/* ----------------------------------------------------------------------------- This source file is part of OpenSpace3D For the latest info, see https://www.openspace3d.com Copyright (c) 2012 I-maginer This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to https://www.gnu.org/copyleft/lesser.txt ----------------------------------------------------------------------------- */ fun getAnimations(l, type)= let sizelist l -> size in let nil -> ndata in let 0 -> i in ( while i < size do ( let nth_list l i -> [elem [lp _]] in let strcatn type::"animation_"::(itoa i)::nil -> elemname in let strcatn type::"aweight_"::(itoa i)::nil -> weightname in set ndata = [elemname elem]::[weightname (hd lp)]::ndata; set i = i + 1; ); ndata; );; fun getMaterials(l)= let sizelist l -> size in let nil -> ndata in let 0 -> i in ( while i < size do ( let nth_list l i -> elem in let strcat "material_" (itoa i) -> elemname in set ndata = [elemname elem]::ndata; set i = i + 1; ); ndata; );; fun cbCloseEdit(p)= let p -> [ctrlsourceobject ctrlnum ctrldirection ctrlradius ctrlheight ctrlwspeed ctrlrspeed ctrlrandompos ctrlrandomminspeed ctrlrandommaxspeed ctrlrandomstop ctrlstoponhit ctrlchasetarget ctrltargetobject ctrlchasedist ctrlmaterials ctrlselectmindex ctrlwanimations ctrlranimations ctrlianimations ctrljanimations ctrlhanimations ctrlganimations ctrlinit] in let getEdCtrlTextLineValue ctrlsourceobject -> sourceobject in let ftoi getEdCtrlFloatValue ctrlnum -> num in let getSelectedEdCtrlSelectPos ctrldirection -> direction in let getEdCtrlFloatValue ctrlradius -> radius in let getEdCtrlFloatValue ctrlheight -> height in let getEdCtrlFloatValue ctrlwspeed -> wspeed in let getEdCtrlFloatValue ctrlrspeed -> rspeed in let getEdCtrlCheckState ctrlrandompos -> randompos in let getEdCtrlFloatValue ctrlrandomminspeed -> randomminspeed in let getEdCtrlFloatValue ctrlrandommaxspeed -> randommaxspeed in let getEdCtrlListElems ctrlmaterials -> lmaterials in let getSelectedEdCtrlSelectPos ctrlselectmindex -> mindex in let getEdCtrlListElemsEx ctrlwanimations -> lwanimations in let getEdCtrlListElemsEx ctrlranimations -> lranimations in let getEdCtrlListElemsEx ctrlianimations -> lianimations in let getEdCtrlListElemsEx ctrljanimations -> ljanimations in let getEdCtrlListElemsEx ctrlhanimations -> lhanimations in let getEdCtrlListElemsEx ctrlganimations -> lganimations in let getEdCtrlCheckState ctrlrandomstop -> randomstop in let getEdCtrlCheckState ctrlstoponhit -> stoponhit in let getEdCtrlCheckState ctrlchasetarget -> chasetarget in let getEdCtrlFloatValue ctrlchasedist -> chasedist in let getEdCtrlTextLineValue ctrltargetobject -> targetobject in let getEdCtrlCheckState ctrlinit -> init in ["sourceobject" sourceobject]:: ["num" itoa num]:: ["direction" itoa direction]:: ["radius" ftoa radius]:: ["height" ftoa height]:: ["wspeed" ftoa wspeed]:: ["rspeed" ftoa rspeed]:: ["randompos" itoa randompos]:: ["randomminspeed" ftoa randomminspeed]:: ["randommaxspeed" ftoa randommaxspeed]:: ["randomstop" itoa randomstop]:: ["stoponhit" itoa stoponhit]:: ["chasetarget" itoa chasetarget]:: ["targetobject" targetobject]:: ["chasedist" ftoa chasedist]:: ["mindex" itoa mindex]:: ["init" itoa init]:: lcat getMaterials lmaterials lcat getAnimations lwanimations "w" lcat getAnimations lranimations "r" lcat getAnimations lianimations "i" lcat getAnimations ljanimations "j" lcat getAnimations lhanimations "h" getAnimations lganimations "g";; fun cbCloseRes(ctrlbtn)= setEdCtrlButtonEnable ctrlbtn 1; 0;; fun cbAddList(ctrlstr, p)= let p -> [ctrllist ctrlselect] in let getEdCtrlTextLineValue ctrlselect -> value in if (value == nil) || (!strcmp "" strtrim value) then nil else let getEdCtrlListElems ctrllist -> lelem in ( if (isStringInListi lelem value) then nil else ( addEdCtrlList ctrllist value "1.0"::nil nil; selectEdCtrlList ctrllist value; ); ); 0;; fun cbAddMaterialList(ctrlstr, p)= let p -> [ctrllist ctrlselect] in let getSelectedEdCtrlSelect ctrlselect -> value in if (value == nil) || (!strcmp "" strtrim value) then nil else let getEdCtrlListElems ctrllist -> lelem in ( if (isStringInListi lelem value) then nil else ( addEdCtrlList ctrllist value nil nil; selectEdCtrlList ctrllist value; ); ); 0;; fun cbDelList(ctrlstr, p)= let p -> [ctrllist ctrlselect] in let getSelectedEdCtrlList ctrllist -> [name _ _] in ( delEdCtrlList ctrllist name; let getSelectedEdCtrlList ctrllist -> [sname _ _] in setEdCtrlTextLineValue ctrlselect sname; ); 0;; fun fillMaterialSelector(inst, ctrlselect)= let getGroupName currentProject inst.INST_groupstr.GRP_xmlMark -> grpname in let SO3SceneParseMaterialsFromGroup (V3DgetSession c3dXsession) grpname -> l in let sizelist l -> size in let nil -> lmats in let 0 -> i in ( while i < size do ( let nth_list l i -> mat in let SO3MaterialGetName mat -> name in set lmats = name::lmats; set i = i + 1; ); fillEdCtrlSelect ctrlselect quicksort lmats @suppDoublon; ); 0;; fun cbSelectAnimation(val, type, p)= let p -> [inst winstr viewstr ctrlanimations ctrlanimname] in let V3DgetDefaultSession viewstr -> sessionstr in let V3DgetAnimationByName sessionstr val -> anim in if anim == nil then nil else ( setEdCtrlTextLineValue ctrlanimname val; cbAddList ctrlanimations [ctrlanimations ctrlanimname]; ); 0;; fun cbBtnPickAnim(ctrlbtn, p)= let p -> [inst winstr viewstr ctrlanimations ctrlanimname animname] in ( setEdCtrlButtonEnable ctrlbtn 0; dlgSelectPluginInstanceResource inst winstr iTypeAnim animname mkfun3 @cbSelectAnimation [inst winstr viewstr ctrlanimations ctrlanimname] mkfun1 @cbCloseRes ctrlbtn 0; ); 0;; fun cbSelectAnim(ctrlstr, pos, elem, lval, type, p)= let p -> [ctrlselectanimation ctrlweight] in ( setEdCtrlFloatValue ctrlweight atof (hd lval); setEdCtrlTextLineValue ctrlselectanimation elem; ); 0;; fun cbAnimWeight(ctrlstr, val, ctrllist)= let getSelectedEdCtrlList ctrllist -> [name _ _] in setEdCtrlListElementParam ctrllist name (ftoa val)::nil; 0;; fun cbSelectObj(val, type, p)= let p -> [inst winstr viewstr ctrldestname] in let V3DgetDefaultSession viewstr -> sessionstr in let SO3SceneGetObject (V3DgetSession sessionstr) val -> obj in if (obj != nil) || (!strcmpi "Current camera" val) || (!strcmpi "Current camera shell" val) then ( setEdCtrlTextLineValue ctrldestname val; ) else nil; 0;; fun cbBtnPickObj(ctrlbtn, p)= let p -> [inst winstr viewstr ctrldestname objname] in ( setEdCtrlButtonEnable ctrlbtn 0; dlgSelectPluginInstanceResource inst winstr iTypeGroup|iTypeEntity|iTypeNode|iTypeLight|iTypeCamera|iTypeParticle|iTypeCubeMap objname mkfun3 @cbSelectObj [inst winstr viewstr ctrldestname] mkfun1 @cbCloseRes ctrlbtn 0; ); 0;; fun cbCheckRamdomPos(ctrl, state, p)= let p -> [minctrl maxctrl randomstopctrl] in ( setEdCtrlFloatEnable minctrl state; setEdCtrlFloatEnable maxctrl state; setEdCtrlCheckEnable randomstopctrl state; ); 0;; fun cbCheckChaseTarget(ctrl, state, p)= let p -> [ctrlchasedist pickbtn3 refreshtargetobject] in ( setEdCtrlFloatEnable ctrlchasedist state; setEdCtrlButtonEnable pickbtn3 state; setEdCtrlButtonEnable refreshtargetobject state; ); 0;; fun cbRefreshBtn(pickbtn, p)= let p -> [ctrlobjname] in setEdCtrlTextLineValue ctrlobjname ""; 0;; fun loadAnimations(inst, type)= let nil -> ndata in let 0 -> i in ( let getPluginInstanceParam inst (strcatn type::"animation_"::(itoa i)::nil) -> elem in while (elem != nil) do ( let getPluginInstanceParam inst (strcatn type::"aweight_"::(itoa i)::nil) -> val in let if (val == nil) then "1.0" else val -> val in set ndata = if (i == 0) then [elem [val::nil 0]]::nil else lcat ndata [elem [val::nil 0]]::nil; set i = i + 1; set elem = getPluginInstanceParam inst (strcatn type::"animation_"::(itoa i)::nil); ); ndata; );; fun loadMaterials(inst)= let nil -> ndata in let 0 -> i in ( let getPluginInstanceParam inst (strcat "material_" (itoa i)) -> elem in while (elem != nil) do ( set ndata = if (i == 0) then elem::nil else lcat ndata elem::nil; set i = i + 1; set elem = getPluginInstanceParam inst (strcat "material_" (itoa i)); ); ndata; );; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [420 1500] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let (getPluginInstanceParam inst "sourceobject") -> sourceobject in let atoi (getPluginInstanceParam inst "direction") -> direction in let if direction == nil then 0 else direction -> direction in let atof (getPluginInstanceParam inst "radius") -> radius in let if radius == nil then 0.25 else radius -> radius in let atof (getPluginInstanceParam inst "height") -> height in let if height == nil then 1.75 else height -> height in let atof (getPluginInstanceParam inst "wspeed") -> wspeed in let if wspeed == nil then 1.0 else wspeed -> wspeed in let atof (getPluginInstanceParam inst "rspeed") -> rspeed in let if rspeed == nil then 1.5 else rspeed -> rspeed in let atoi (getPluginInstanceParam inst "randompos") -> randompos in let if randompos == nil then 0 else randompos -> randompos in let atof (getPluginInstanceParam inst "randomminspeed") -> randomminspeed in let if randomminspeed == nil then 0.5 else randomminspeed -> randomminspeed in let atof (getPluginInstanceParam inst "randommaxspeed") -> randommaxspeed in let if randommaxspeed == nil then 1.5 else randommaxspeed -> randommaxspeed in let atoi (getPluginInstanceParam inst "randomstop") -> randomstop in let if randomstop == nil then 0 else randomstop -> randomstop in let atoi (getPluginInstanceParam inst "stoponhit") -> stoponhit in let if stoponhit == nil then 0 else stoponhit -> stoponhit in let (getPluginInstanceParam inst "targetobject") -> targetobject in let atoi (getPluginInstanceParam inst "chasetarget") -> chasetarget in let if chasetarget == nil then 0 else chasetarget -> chasetarget in let atof (getPluginInstanceParam inst "chasedist") -> chasedist in let if chasedist == nil then 1.0 else chasedist -> chasedist in let atof (getPluginInstanceParam inst "num") -> num in let if num == nil then 10.0 else num -> num in let atoi (getPluginInstanceParam inst "mindex") -> mindex in let if mindex == nil then 0 else mindex -> mindex in let atoi (getPluginInstanceParam inst "init") -> init in let if init == nil then 1 else init -> init in let crEdFrameWindow _channel ewinstr 0 0 iw 85 EDWIN_RESIZE_MW nil (loc "OS3DCROWD_0002") (loc "OS3DCROWD_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 65 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 135 20 (loc "OS3DCROWD_0003") nil -> labelobj in let crEdCtrlTextLine winstr 180 ypos 140 20 sourceobject nil EDWIN_RESIZE_MW -> ctrlsourceobject in let crEdCtrlButton winstr 325 ypos 55 20 "..." nil -> pickbtn2 in let crEdCtrlButton winstr 385 ypos 35 20 "X" nil -> refreshsourceobject in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DCROWD_0028") nil -> label in let crEdCtrlFloat winstr 180 ypos 100 20 num 1.0 200.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlnum in let crEdFrameWindow _channel ewinstr 0 0 iw 285 EDWIN_RESIZE_MW nil (loc "OS3DCROWD_0007") (loc "OS3DCROWD_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 265 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DCROWD_0009") nil -> label in let crEdCtrlSelect winstr 180 ypos 200 120 EDWIN_RESIZE_MW -> ctrldirection in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DCROWD_0010") nil -> label in let crEdCtrlFloat winstr 180 ypos 100 20 radius 0.1 100.0 0.01 2 nil EDWIN_RESIZE_MW -> ctrlradius in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DCROWD_0011") nil -> label in let crEdCtrlFloat winstr 180 ypos 100 20 height 0.1 100.0 0.01 2 nil EDWIN_RESIZE_MW -> ctrlheight in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DCROWD_0012") nil -> label in let crEdCtrlFloat winstr 180 ypos 100 20 wspeed 0.1 100.0 0.01 2 nil EDWIN_RESIZE_MW -> ctrlwspeed in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DCROWD_0013") nil -> label in let crEdCtrlFloat winstr 180 ypos 100 20 rspeed 0.1 100.0 0.01 2 nil EDWIN_RESIZE_MW -> ctrlrspeed in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DCROWD_0014") EDWIN_RESIZE_MW -> ctrlrandompos in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DCROWD_0015") nil -> label in let crEdCtrlFloat winstr 180 ypos 100 20 randomminspeed 0.1 100.0 0.01 2 nil EDWIN_RESIZE_MW -> ctrlrandomminspeed in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DCROWD_0016") nil -> label in let crEdCtrlFloat winstr 180 ypos 100 20 randommaxspeed 0.1 100.0 0.01 2 nil EDWIN_RESIZE_MW -> ctrlrandommaxspeed in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DCROWD_0018") EDWIN_RESIZE_MW -> ctrlrandomstop in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DCROWD_0019") EDWIN_RESIZE_MW -> ctrlstoponhit in let crEdFrameWindow _channel ewinstr 0 0 iw 105 EDWIN_RESIZE_MW nil (loc "OS3DCROWD_0020") (loc "OS3DCROWD_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 85 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlCheck winstr 10 (set ypos = 10) (iw - 20) 20 (loc "OS3DCROWD_0021") EDWIN_RESIZE_MW -> ctrlchasetarget in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 135 20 (loc "OS3DCROWD_0022") nil -> labelobj in let crEdCtrlTextLine winstr 180 ypos 140 20 targetobject nil EDWIN_RESIZE_MW -> ctrltargetobject in let crEdCtrlButton winstr 325 ypos 55 20 "..." nil -> pickbtn3 in let crEdCtrlButton winstr 385 ypos 35 20 "X" nil -> refreshtargetobject in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DCROWD_0023") nil -> label in let crEdCtrlFloat winstr 180 ypos 100 20 chasedist 0.1 10000.0 0.01 2 nil EDWIN_RESIZE_MW -> ctrlchasedist in let crEdFrameWindow _channel ewinstr 0 0 iw 150 EDWIN_RESIZE_MW nil (loc "OS3DCROWD_0029") (loc "OS3DCROWD_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 130 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlList winstr 10 (set ypos = 10) (iw - 20) 60 LB_BORDER|LB_VSCROLL|ET_TABFOCUS EDWIN_RESIZE_MW|EDWIN_RESIZE_MH -> ctrlmaterials in let crEdCtrlSelect winstr 10 (set ypos = ypos + 65) (iw - 230) 120 EDWIN_RESIZE_MW -> ctrlselectm in let crEdCtrlButton winstr (iw - 215) ypos 55 20 "+" EDWIN_RESIZE_MW -> ctrlbtnaddm in let crEdCtrlButton winstr (iw - 155) ypos 55 20 "-" EDWIN_RESIZE_MW -> ctrlbtndelm in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) (iw - 230) 20 (loc "OS3DCROWD_0031") nil -> label in let crEdCtrlSelect winstr (iw - 215) ypos 100 120 EDWIN_RESIZE_MW -> ctrlselectmindex in let crEdFrameWindow _channel ewinstr 0 0 iw 125 EDWIN_RESIZE_MW nil (loc "OS3DCROWD_0004") (loc "OS3DCROWD_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 105 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlList winstr 10 (set ypos = 10) (iw - 20) 60 LB_BORDER|LB_VSCROLL|ET_TABFOCUS EDWIN_RESIZE_MW|EDWIN_RESIZE_MH -> ctrlianimations in let crEdCtrlTextLine winstr 10 (set ypos = ypos + 65) (iw - 230) 20 nil nil EDWIN_RESIZE_MW -> ctrlselectanimi in let crEdCtrlButton winstr (iw - 215) ypos 55 20 "..." nil -> pickbtnai in let crEdCtrlButton winstr (iw - 155) ypos 65 20 (loc "OS3DCROWD_0008") EDWIN_RESIZE_MW -> ctrlbtndeli in let crEdFrameWindow _channel ewinstr 0 0 iw 150 EDWIN_RESIZE_MW nil (loc "OS3DCROWD_0005") (loc "OS3DCROWD_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 130 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlList winstr 10 (set ypos = 10) (iw - 20) 60 LB_BORDER|LB_VSCROLL|ET_TABFOCUS EDWIN_RESIZE_MW|EDWIN_RESIZE_MH -> ctrlwanimations in let crEdCtrlTextLine winstr 10 (set ypos = ypos + 65) (iw - 230) 20 nil nil EDWIN_RESIZE_MW -> ctrlselectanimw in let crEdCtrlButton winstr (iw - 215) ypos 55 20 "..." nil -> pickbtnaw in let crEdCtrlButton winstr (iw - 155) ypos 65 20 (loc "OS3DCROWD_0008") EDWIN_RESIZE_MW -> ctrlbtndelw in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) (iw - 230) 20 (loc "OS3DCROWD_0017") nil -> label in let crEdCtrlFloat winstr (iw - 215) ypos 100 20 1.0 0.01 100.0 0.01 2 nil EDWIN_RESIZE_MW -> ctrlaweightw in let crEdFrameWindow _channel ewinstr 0 0 iw 150 EDWIN_RESIZE_MW nil (loc "OS3DCROWD_0006") (loc "OS3DCROWD_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 130 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlList winstr 10 (set ypos = 10) (iw - 20) 60 LB_BORDER|LB_VSCROLL|ET_TABFOCUS EDWIN_RESIZE_MW|EDWIN_RESIZE_MH -> ctrlranimations in let crEdCtrlTextLine winstr 10 (set ypos = ypos + 65) (iw - 230) 20 nil nil EDWIN_RESIZE_MW -> ctrlselectanimr in let crEdCtrlButton winstr (iw - 215) ypos 55 20 "..." nil -> pickbtnar in let crEdCtrlButton winstr (iw - 155) ypos 65 20 (loc "OS3DCROWD_0008") EDWIN_RESIZE_MW -> ctrlbtndelr in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) (iw - 230) 20 (loc "OS3DCROWD_0017") nil -> label in let crEdCtrlFloat winstr (iw - 215) ypos 100 20 1.0 0.01 100.0 0.01 2 nil EDWIN_RESIZE_MW -> ctrlaweightr in let crEdFrameWindow _channel ewinstr 0 0 iw 125 EDWIN_RESIZE_MW nil (loc "OS3DCROWD_0027") (loc "OS3DCROWD_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 105 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlList winstr 10 (set ypos = 10) (iw - 20) 60 LB_BORDER|LB_VSCROLL|ET_TABFOCUS EDWIN_RESIZE_MW|EDWIN_RESIZE_MH -> ctrljanimations in let crEdCtrlTextLine winstr 10 (set ypos = ypos + 65) (iw - 230) 20 nil nil EDWIN_RESIZE_MW -> ctrlselectanimj in let crEdCtrlButton winstr (iw - 215) ypos 55 20 "..." nil -> pickbtnaj in let crEdCtrlButton winstr (iw - 155) ypos 65 20 (loc "OS3DCROWD_0008") EDWIN_RESIZE_MW -> ctrlbtndelj in let crEdFrameWindow _channel ewinstr 0 0 iw 125 EDWIN_RESIZE_MW nil (loc "OS3DCROWD_0024") (loc "OS3DCROWD_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 105 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlList winstr 10 (set ypos = 10) (iw - 20) 60 LB_BORDER|LB_VSCROLL|ET_TABFOCUS EDWIN_RESIZE_MW|EDWIN_RESIZE_MH -> ctrlhanimations in let crEdCtrlTextLine winstr 10 (set ypos = ypos + 65) (iw - 230) 20 nil nil EDWIN_RESIZE_MW -> ctrlselectanimh in let crEdCtrlButton winstr (iw - 215) ypos 55 20 "..." nil -> pickbtnah in let crEdCtrlButton winstr (iw - 155) ypos 65 20 (loc "OS3DCROWD_0008") EDWIN_RESIZE_MW -> ctrlbtndelh in let crEdFrameWindow _channel ewinstr 0 0 iw 125 EDWIN_RESIZE_MW nil (loc "OS3DCROWD_0032") (loc "OS3DCROWD_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 105 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlList winstr 10 (set ypos = 10) (iw - 20) 60 LB_BORDER|LB_VSCROLL|ET_TABFOCUS EDWIN_RESIZE_MW|EDWIN_RESIZE_MH -> ctrlganimations in let crEdCtrlTextLine winstr 10 (set ypos = ypos + 65) (iw - 230) 20 nil nil EDWIN_RESIZE_MW -> ctrlselectanimg in let crEdCtrlButton winstr (iw - 215) ypos 55 20 "..." nil -> pickbtnag in let crEdCtrlButton winstr (iw - 155) ypos 65 20 (loc "OS3DCROWD_0008") EDWIN_RESIZE_MW -> ctrlbtndelg in let crEdFrameWindow _channel ewinstr 0 0 iw 60 EDWIN_RESIZE_MW nil (loc "OS3DCROWD_0025") (loc "OS3DCROWD_0001") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 40 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlCheck winstr 10 (set ypos = 10) (iw - 20) 20 (loc "OS3DCROWD_0026") EDWIN_RESIZE_MW -> ctrlinit in ( fillMaterialSelector inst ctrlselectm; setEdCtrlButtonCb ctrlbtnaddm mkfun2 @cbAddMaterialList [ctrlmaterials ctrlselectm]; setEdCtrlButtonCb ctrlbtndelm mkfun2 @cbDelList [ctrlmaterials nil]; fillEdCtrlList ctrlmaterials (loadMaterials inst); fillEdCtrlSelect ctrlselectmindex "All"::"0"::"1"::"2"::"3"::"4"::"5"::"6"::"7"::"8"::"9"::"10"::nil; selectEdCtrlSelectByPos ctrlselectmindex mindex; setEdCtrlTextLineEnable ctrlselectanimi 0; setEdCtrlButtonCb pickbtnai mkfun2 @cbBtnPickAnim [inst winstr viewstr ctrlianimations ctrlselectanimi ""]; setEdCtrlButtonCb ctrlbtndeli mkfun2 @cbDelList [ctrlianimations ctrlselectanimi]; fillEdCtrlListEx ctrlianimations (loadAnimations inst "i"); setEdCtrlListCbClick ctrlianimations mkfun6 @cbSelectAnim [ctrlselectanimi nil]; setEdCtrlTextLineEnable ctrlselectanimw 0; setEdCtrlButtonCb pickbtnaw mkfun2 @cbBtnPickAnim [inst winstr viewstr ctrlwanimations ctrlselectanimw ""]; setEdCtrlButtonCb ctrlbtndelw mkfun2 @cbDelList [ctrlwanimations ctrlselectanimw]; fillEdCtrlListEx ctrlwanimations (loadAnimations inst "w"); setEdCtrlListCbClick ctrlwanimations mkfun6 @cbSelectAnim [ctrlselectanimw ctrlaweightw]; setEdCtrlFloatCbChange ctrlaweightw mkfun3 @cbAnimWeight ctrlwanimations; setEdCtrlTextLineEnable ctrlselectanimr 0; setEdCtrlButtonCb pickbtnar mkfun2 @cbBtnPickAnim [inst winstr viewstr ctrlranimations ctrlselectanimr ""]; setEdCtrlButtonCb ctrlbtndelr mkfun2 @cbDelList [ctrlranimations ctrlselectanimr]; fillEdCtrlListEx ctrlranimations (loadAnimations inst "r"); setEdCtrlListCbClick ctrlranimations mkfun6 @cbSelectAnim [ctrlselectanimr ctrlaweightr]; setEdCtrlFloatCbChange ctrlaweightr mkfun3 @cbAnimWeight ctrlranimations; setEdCtrlTextLineEnable ctrlselectanimj 0; setEdCtrlButtonCb pickbtnaj mkfun2 @cbBtnPickAnim [inst winstr viewstr ctrljanimations ctrlselectanimj ""]; setEdCtrlButtonCb ctrlbtndelj mkfun2 @cbDelList [ctrljanimations ctrlselectanimj]; fillEdCtrlListEx ctrljanimations (loadAnimations inst "j"); setEdCtrlListCbClick ctrljanimations mkfun6 @cbSelectAnim [ctrlselectanimj nil]; setEdCtrlTextLineEnable ctrlselectanimh 0; setEdCtrlButtonCb pickbtnah mkfun2 @cbBtnPickAnim [inst winstr viewstr ctrlhanimations ctrlselectanimh ""]; setEdCtrlButtonCb ctrlbtndelh mkfun2 @cbDelList [ctrlhanimations ctrlselectanimh]; fillEdCtrlListEx ctrlhanimations (loadAnimations inst "h"); setEdCtrlListCbClick ctrlhanimations mkfun6 @cbSelectAnim [ctrlselectanimh nil]; setEdCtrlTextLineEnable ctrlselectanimg 0; setEdCtrlButtonCb pickbtnag mkfun2 @cbBtnPickAnim [inst winstr viewstr ctrlganimations ctrlselectanimg ""]; setEdCtrlButtonCb ctrlbtndelg mkfun2 @cbDelList [ctrlganimations ctrlselectanimg]; fillEdCtrlListEx ctrlganimations (loadAnimations inst "g"); setEdCtrlListCbClick ctrlganimations mkfun6 @cbSelectAnim [ctrlselectanimg nil]; setEdCtrlButtonCb pickbtn2 mkfun2 @cbBtnPickObj [inst winstr viewstr ctrlsourceobject sourceobject]; setEdCtrlButtonCb refreshsourceobject mkfun2 @cbRefreshBtn [ctrlsourceobject]; setEdCtrlTextLineEnable ctrlsourceobject 0; setEdCtrlButtonCb pickbtn3 mkfun2 @cbBtnPickObj [inst winstr viewstr ctrltargetobject targetobject]; setEdCtrlButtonCb refreshtargetobject mkfun2 @cbRefreshBtn [ctrltargetobject]; setEdCtrlTextLineEnable ctrltargetobject 0; fillEdCtrlSelect ctrldirection "X"::"Negative X"::"Y"::"Negative Y"::"Z"::"Negative Z"::nil; selectEdCtrlSelectByPos ctrldirection direction; setEdCtrlCheckState ctrlrandompos randompos; setEdCtrlCheckCbState ctrlrandompos mkfun3 @cbCheckRamdomPos [ctrlrandomminspeed ctrlrandommaxspeed ctrlrandomstop]; if (randompos) then nil else ( setEdCtrlFloatEnable ctrlrandomminspeed 0; setEdCtrlFloatEnable ctrlrandommaxspeed 0; setEdCtrlCheckEnable ctrlrandomstop 0; ); setEdCtrlCheckState ctrlchasetarget chasetarget; setEdCtrlCheckCbState ctrlchasetarget mkfun3 @cbCheckChaseTarget [ctrlchasedist pickbtn3 refreshtargetobject]; if (chasetarget) then nil else ( setEdCtrlFloatEnable ctrlchasedist 0; setEdCtrlButtonEnable pickbtn3 0; setEdCtrlButtonEnable refreshtargetobject 0; ); setEdCtrlCheckState ctrlrandomstop randomstop; setEdCtrlCheckState ctrlstoponhit stoponhit; setEdCtrlCheckState ctrlinit init; [mkfun1 @cbCloseEdit [ctrlsourceobject ctrlnum ctrldirection ctrlradius ctrlheight ctrlwspeed ctrlrspeed ctrlrandompos ctrlrandomminspeed ctrlrandommaxspeed ctrlrandomstop ctrlstoponhit ctrlchasetarget ctrltargetobject ctrlchasedist ctrlmaterials ctrlselectmindex ctrlwanimations ctrlranimations ctrlianimations ctrljanimations ctrlhanimations ctrlganimations ctrlinit] nil]; ); );;