typeof comboType2 = ObjBox;; typeof Ambient1 = ObjText;; typeof Para1 = ObjText;; typeof Para2 = ObjText;; typeof Omni1 = ObjText;; typeof Omni2 = ObjText;; typeof Omni3 = ObjText;; typeof Spot1 = ObjText;; typeof Spot2 = ObjText;; typeof Spot3 = ObjText;; typeof Description2 = ObjText;; typeof TypeSave2 = S;; typeof T_Ambient = ObjText;; typeof T_Para1 = ObjText;; typeof T_Para2 = ObjText;; typeof T_Para3 = ObjText;; typeof T_Omni1 = ObjText;; typeof T_Omni2 = ObjText;; typeof T_Omni3 = ObjText;; typeof T_Spot1 = ObjText;; typeof T_Spot2 = ObjText;; typeof T_Spot3 = ObjText;; typeof EX1 = ObjText;; fun closeedit() = strbuild ("type"::TypeSave2::nil):: ("Ambient_puissance"::(_GETtext Ambient1)::nil):: ("Para_avant" ::(if !strcmp "LIGHT_PARA" TypeSave2 then itoa ( ((atoi (_GETtext Para1))+(atoi (_GETtext Para2)))/2 ) else nil)::nil):: ("Para_arriere" ::(if !strcmp "LIGHT_PARA" TypeSave2 then itoa ( ((atoi (_GETtext Para1))-(atoi (_GETtext Para2)))/2 ) else nil)::nil):: ("Omni_min" ::(_GETtext Omni1)::nil):: ("Omni_max" ::(if !strcmp "LIGHT_OMNI" TypeSave2 then itoa ((atoi (_GETtext Omni2)) - (atoi (_GETtext Omni1))) else nil)::nil):: ("Omni_distance" ::(_GETtext Omni3)::nil):: ("Spot_min" ::(_GETtext Spot1)::nil):: ("Spot_max" ::(if !strcmp "LIGHT_SPOT" TypeSave2 then itoa ((atoi (_GETtext Spot2)) - (atoi (_GETtext Spot1))) else nil)::nil):: ("Spot_distance" ::(_GETtext Spot3)::nil):: ("init" ::("on")::nil):: ("a"::( if !strcmp "LIGHT_PARA" TypeSave2 then itoa ( ((atoi (_GETtext Para1))+(atoi (_GETtext Para2)))/2 ) else if !strcmp "LIGHT_AMBIENT" TypeSave2 then _GETtext Ambient1 else if !strcmp "LIGHT_OMNI" TypeSave2 then _GETtext Omni1 else if !strcmp "LIGHT_SPOT" TypeSave2 then _GETtext Spot1 else nil)::nil):: ("b"::( if !strcmp "LIGHT_AMBIENT" TypeSave2 then nil else if !strcmp "LIGHT_PARA" TypeSave2 then itoa( ((atoi (_GETtext Para1)) - (atoi (_GETtext Para2)))/2 ) else if !strcmp "LIGHT_OMNI" TypeSave2 then itoa ((atoi (_GETtext Omni2)) - (atoi (_GETtext Omni1))) else if !strcmp "LIGHT_SPOT" TypeSave2 then itoa ((atoi (_GETtext Spot2)) - (atoi (_GETtext Spot1))) else nil)::nil):: ("p1"::( if !strcmp "LIGHT_AMBIENT" TypeSave2 then nil else if !strcmp "LIGHT_PARA" TypeSave2 then nil else if !strcmp "LIGHT_OMNI" TypeSave2 then _GETtext Omni3 else if !strcmp "LIGHT_SPOT" TypeSave2 then _GETtext Spot3 else nil)::nil):: nil ;; fun AddType(s, a) = set comboType2 = _ADDcombo comboType2 10 s ;; fun AddTypes()= apply_on_list "Ambient"::"Para"::"Omni"::"Spot"::nil @AddType nil ;; fun destroyText () = _DStext T_Ambient; _DStext T_Para1; _DStext T_Para2; _DStext T_Para3; _DStext T_Omni1; _DStext T_Omni2; _DStext T_Omni3; _DStext T_Spot1; _DStext T_Spot2; _DStext T_Spot3 ;; fun destroyValue () = _DStext Ambient1; _DStext Para1; _DStext Para2; _DStext Omni1; _DStext Omni2; _DStext Omni3; _DStext Spot1; _DStext Spot2; _DStext Spot3 ;; fun Describe(win, param) = let param -> [Ambient_puissance Para_avant Para_arriere Omni_min Omni_max Omni_distance Spot_min Spot_max Spot_distance type] in let _GETcombo comboType2 -> [_ s] in if 0==strcmpi s "Ambient" then /*Ambient*/ ( destroyValue; set Ambient1 = _SETtext _CReditText _channel win 20+85 30 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Ambient_puissance==nil then "10" else Ambient_puissance; destroyText; set T_Ambient = _CRtext _channel win 5 32 80 20 ET_ALIGN_LEFT _loc this "LIGHTS_PUISSANCE" nil; _SETtext EX1 _loc this "LIGHTS_EXPLICATION_AMBIENT1" nil ; set TypeSave2="LIGHT_AMBIENT"; _loc this "LIGHTS_TYPE1" nil; ) else /*Para*/ if 0==strcmpi s "Para" then ( destroyValue; set Para1 = _SETtext _CReditText _channel win 20+85 30 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Para_avant==nil then "40" else itoa ((atoi Para_avant) + (atoi Para_arriere)); set Para2 = _SETtext _CReditText _channel win 20+85 55 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Para_arriere==nil then "-40" else itoa ((atoi Para_avant) - (atoi Para_arriere)); destroyText; set T_Para2 = _CRtext _channel win 5 32 100 20 ET_ALIGN_LEFT _loc this "LIGHTS_DEVANT" nil; set T_Para3 = _CRtext _channel win 5 57 100 20 ET_ALIGN_LEFT _loc this "LIGHTS_ARRIERE" nil; _SETtext EX1 _loc this "LIGHTS_EXPLICATION_PARA1" nil ; set TypeSave2="LIGHT_PARA"; _loc this "LIGHTS_TYPE2" nil; ) else /*Omni*/ if 0==strcmpi s "Omni" then ( destroyValue; set Omni1 = _SETtext _CReditText _channel win 20+85 30 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Omni_min==nil then "3" else Omni_min; set Omni2 = _SETtext _CReditText _channel win 20+85 55 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Omni_max==nil then "15" else itoa ((atoi Omni_min) + (atoi Omni_max)); set Omni3 = _SETtext _CReditText _channel win 20+85 80 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Omni_distance==nil then "500" else Omni_distance; destroyText; set T_Omni1 = _CRtext _channel win 5 32 80 20 ET_ALIGN_LEFT _loc this "LIGHTS_PUISSANCE_MIN" nil; set T_Omni2 = _CRtext _channel win 5 57 80 20 ET_ALIGN_LEFT _loc this "LIGHTS_PUISSANCE_MAX" nil; set T_Omni3 = _CRtext _channel win 5 82 80 20 ET_ALIGN_LEFT _loc this "LIGHTS_ATTENUATION" nil; _SETtext EX1 _loc this "LIGHTS_EXPLICATION_OMNI1" nil ; set TypeSave2="LIGHT_OMNI"; _loc this "LIGHTS_TYPE3" nil; ) else /*Spot*/ ( destroyValue; set Spot1 = _SETtext _CReditText _channel win 20+85 30 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Spot_min==nil then "3" else Spot_min; set Spot2 = _SETtext _CReditText _channel win 20+85 55 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Spot_max==nil then "25" else itoa ((atoi Spot_min) + (atoi Spot_max)); set Spot3 = _SETtext _CReditText _channel win 20+85 80 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Spot_distance==nil then "1000" else Spot_distance; destroyText; set T_Spot1 = _CRtext _channel win 5 32 80 20 ET_ALIGN_LEFT _loc this "LIGHTS_PUISSANCE_MIN" nil; set T_Spot2 = _CRtext _channel win 5 57 80 20 ET_ALIGN_LEFT _loc this "LIGHTS_PUISSANCE_MAX" nil; set T_Spot3 = _CRtext _channel win 5 82 80 20 ET_ALIGN_LEFT _loc this "LIGHTS_ATTENUATION" nil; _SETtext EX1 _loc this "LIGHTS_EXPLICATION_SPOT1" nil ; set TypeSave2="LIGHT_SPOT"; _loc this "LIGHTS_TYPE4" nil; ) ;; fun comboReflex(a, win, c, d, param) = _SETtext Description2 Describe win param ;; fun toType(s) = if !strcmp s "LIGHT_AMBIENT" then 0 else if !strcmp s "LIGHT_PARA" then 1 else if !strcmp s "LIGHT_OMNI" then 2 else if !strcmp s "LIGHT_SPOT" then 3 else 0 ;; fun dynamicedit(win, obj, mat, param) = let strextr param -> l in let _GETwindowSizePosition win -> [w h x y] in let getInfo l "type" -> type in let getInfo l "Ambient_puissance" -> Ambient_puissance in let getInfo l "Para_avant" -> Para_avant in let getInfo l "Para_arriere" -> Para_arriere in let getInfo l "Omni_min" -> Omni_min in let getInfo l "Omni_max" -> Omni_max in let getInfo l "Omni_distance" -> Omni_distance in let getInfo l "Spot_min" -> Spot_min in let getInfo l "Spot_max" -> Spot_max in let getInfo l "Spot_distance" -> Spot_distance in let _SETtext _CRtext _channel win 5 7 80 20 ET_ALIGN_LEFT "Type:" _loc this "LIGHTS_TYPE" nil -> T1 in ( set comboType2 = _CRcombo _channel win 20+85 7 100 100 CB_NOEDIT "Ambient"; AddTypes; /*ambient*/ set Ambient1 = _SETtext _CReditText _channel win 20+85 30 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Ambient_puissance==nil then "5" else Ambient_puissance; /*para*/ set Para1 = _SETtext _CReditText _channel win 20+85 30 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Para_avant==nil then "20" else itoa ((atoi Para_avant) + (atoi Para_arriere)); set Para2 = _SETtext _CReditText _channel win 20+85 55 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Para_arriere==nil then "-20" else itoa ((atoi Para_avant) - (atoi Para_arriere)); /*Omni*/ set Omni1 = _SETtext _CReditText _channel win 20+85 30 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Omni_min==nil then "3" else Omni_min; set Omni2 = _SETtext _CReditText _channel win 20+85 55 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Omni_max==nil then "15" else itoa ((atoi Omni_min) + (atoi Omni_max)); set Omni3 = _SETtext _CReditText _channel win 20+85 80 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Omni_distance==nil then "500" else Omni_distance; /*Spot*/ set Spot1 = _SETtext _CReditText _channel win 20+85 30 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Spot_min==nil then "3" else Spot_min; set Spot2 = _SETtext _CReditText _channel win 20+85 55 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Spot_max==nil then "15" else itoa ((atoi Spot_min) + (atoi Spot_max)); set Spot3 = _SETtext _CReditText _channel win 20+85 80 35 20 ET_ALIGN_LEFT|ET_DOWN "" if Spot_distance==nil then "500" else Spot_distance; set comboType2 = _SELcombo comboType2 toType type; set Description2 = _SETtext _CRtext _channel win 20+175+20 7 w-185 40 0 "" Describe win [Ambient_puissance Para_avant Para_arriere Omni_min Omni_max Omni_distance Spot_min Spot_max Spot_distance type]; set comboType2 = _CBcombo comboType2 mkfun5 @comboReflex [Ambient_puissance Para_avant Para_arriere Omni_min Omni_max Omni_distance Spot_min Spot_max Spot_distance type] win ; set EX1 = _CRtext _channel win 5 120 800 120 ET_ALIGN_LEFT if !strcmp "LIGHT_AMBIENT" type then _loc this "LIGHTS_EXPLICATION_AMBIENT1" nil else if !strcmp "LIGHT_PARA" type then _loc this "LIGHTS_EXPLICATION_PARA1" nil else if !strcmp "LIGHT_OMNI" type then _loc this "LIGHTS_EXPLICATION_OMNI1" nil else if !strcmp "LIGHT_SPOT" type then _loc this "LIGHTS_EXPLICATION_SPOT1" nil else _loc this "LIGHTS_EXPLICATION" nil ); @closeedit ;;