/* ----------------------------------------------------------------------------- This source file is part of OpenSpace3D For the latest info, see http://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 http://www.gnu.org/copyleft/lesser.txt ----------------------------------------------------------------------------- */ fun getWheels(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 strToListSep elem "," -> pwheel in ( set ndata = [(strcat "wheel_" (itoa i)) (hd pwheel)]::ndata; set ndata = [(strcat "dampinglength_" (itoa i)) (nth_list pwheel 1)]::ndata; set ndata = [(strcat "damping_" (itoa i)) (nth_list pwheel 2)]::ndata; set ndata = [(strcat "driving_" (itoa i)) (nth_list pwheel 3)]::ndata; set ndata = [(strcat "directional_" (itoa i)) (nth_list pwheel 4)]::ndata; ); set i = i + 1; ); ndata; );; fun cbCloseEdit(p)= let p -> [ctrlobjname ctrlmass ctrlpower ctrlnbgears ctrlautogear ctrlwfriction ctrlwheels ctrlsndstart ctrlsndloop ctrlsndscreech ctrlsndshock ctrlobjmatname ctrlmatname ctrlmattech ctrlmatpass ctrlfov ctrlnclip ctrlfclip ctrlmindist ctrlmaxdist ctrlcamangle ctrlcamenable ctrldriftpart ctrlstartengine] in let getEdCtrlTextLineValue ctrlobjname -> objname in let getEdCtrlFloatValue ctrlmass -> mass in let getEdCtrlFloatValue ctrlpower -> enginepower in let ftoi getEdCtrlFloatValue ctrlnbgears -> nbgears in let getEdCtrlCheckState ctrlautogear -> autogear in let getEdCtrlFloatValue ctrlwfriction -> wfriction in let getEdCtrlCheckState ctrlstartengine -> startengine in let getEdCtrlListElems ctrlwheels -> lwheel in let getEdCtrlTextLineValue ctrlsndstart -> sndstart in let getEdCtrlTextLineValue ctrlsndloop -> sndloop in let getEdCtrlTextLineValue ctrlsndscreech -> sndscreech in let getEdCtrlTextLineValue ctrlsndshock -> sndshock in let getEdCtrlTextLineValue ctrlobjmatname -> objmatname in let getSelectedEdCtrlSelect ctrlmatname -> matname in let getSelectedEdCtrlSelectPos ctrlmattech -> technique in let getSelectedEdCtrlSelectPos ctrlmatpass -> pass in let getEdCtrlFloatValue ctrlfov -> fovy in let getEdCtrlFloatValue ctrlnclip -> nclip in let getEdCtrlFloatValue ctrlfclip -> fclip in let getEdCtrlFloatValue ctrlmindist -> mindist in let getEdCtrlFloatValue ctrlmaxdist -> maxdist in let getEdCtrlFloatValue ctrlcamangle -> camangle in let getEdCtrlCheckState ctrlcamenable -> enablecam in let getEdCtrlCheckState ctrldriftpart -> driftpart in ["object" objname]:: ["mass" ftoa mass]:: ["enginepower" ftoa enginepower]:: ["nbgears" itoa nbgears]:: ["autogear" itoa autogear]:: ["wfriction" ftoa wfriction]:: ["startengine" itoa startengine]:: ["sndstart" sndstart]:: ["sndloop" sndloop]:: ["sndscreech" sndscreech]:: ["sndshock" sndshock]:: ["objectmat" objmatname]:: ["material" matname]:: ["technique" itoa technique]:: ["pass" itoa pass]:: ["fovy" ftoa fovy]:: ["nclip" ftoa nclip]:: ["fclip" ftoa fclip]:: ["mindist" ftoa mindist]:: ["maxdist" ftoa maxdist]:: ["camangle" ftoa camangle]:: ["enablecam" itoa enablecam]:: ["driftpart" itoa driftpart]:: getWheels lwheel;; fun cbSelectObj(val, type, p)= let p -> [inst winstr viewstr ctrlobjname] 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 ctrlobjname val; ) else nil; 0;; fun cbCloseRes(ctrlbtn)= setEdCtrlButtonEnable ctrlbtn 1; 0;; fun cbBtnPickObj(ctrlbtn, p)= let p -> [inst winstr viewstr ctrlobjname objname] in ( setEdCtrlButtonEnable ctrlbtn 0; dlgSelectPluginInstanceResource inst winstr iTypeEntity objname mkfun3 @cbSelectObj [inst winstr viewstr ctrlobjname] mkfun1 @cbCloseRes ctrlbtn 0; ); 0;; fun cbDlgGetSound(dlg, p, pfile)= let p -> [inst ctrlbtn winstr ctrlsndname psnd] in ( if pfile == nil then nil else let _PtoScol pfile -> file in if file == nil then ( _DLGMessageBox _channel winstr.EDW_win "Error" "Your file have to be in a scol partition." 0; 0; ) else ( setEdCtrlTextLineValue ctrlsndname file; /* let psnd -> [tbstr chkplaypause sndpreview] in if (sndpreview == nil) then nil else ( _DSAudio sndpreview; mutate psnd <- [_ _ nil]; setEdToolBarCheckState tbstr chkplaypause 0; );*/ 0; ); setEdCtrlButtonEnable ctrlbtn 1; ); 0;; fun cbBtnPickSound(ctrlbtn, p)= let p -> [inst winstr ctrlsndname psnd] in let getEdCtrlTextLineValue ctrlsndname -> sndpath in let getPathFile sndpath "" -> [fpath fname] in ( setEdCtrlButtonEnable ctrlbtn 0; _DLGrflopen _DLGOpenFile _channel winstr.EDW_win fpath fname "Sounds\0*.mp3;*.wav;*.ogg;\0Mp3\0*.mp3\0Ogg\0*.ogg\0Wave\0*.wav\0All\0*.*\0\0" @cbDlgGetSound [inst ctrlbtn winstr ctrlsndname psnd]; ); 0;; fun cbRefreshBtn(pickbtn, p)= let p -> [ctrlobjname] in setEdCtrlTextLineValue ctrlobjname ""; 0;; fun loadWheels(inst)= let nil -> ndata in let 0 -> i in ( let getPluginInstanceParam inst (strcat "wheel_" (itoa i)) -> wheel in let getPluginInstanceParam inst (strcat "dampinglength_" (itoa i)) -> dampinglength in let getPluginInstanceParam inst (strcat "damping_" (itoa i)) -> damping in let getPluginInstanceParam inst (strcat "driving_" (itoa i)) -> driving in let getPluginInstanceParam inst (strcat "directional_" (itoa i)) -> directional in while (wheel != nil) do ( let strcatnSep wheel::dampinglength::damping::driving::directional::nil "," -> elem in set ndata = if i == 0 then elem::nil else lcat ndata elem::nil; set i = i + 1; set wheel = getPluginInstanceParam inst (strcat "wheel_" (itoa i)); set dampinglength = getPluginInstanceParam inst (strcat "dampinglength_" (itoa i)); set damping = getPluginInstanceParam inst (strcat "damping_" (itoa i)); set driving = getPluginInstanceParam inst (strcat "driving_" (itoa i)); set directional = getPluginInstanceParam inst (strcat "directional_" (itoa i)); ); ndata; );; fun cbSetList(ctrlstr, p)= let p -> [ctrllist ctrlselectwheel ctrldampinglength ctrldamping ctrldriving ctrldirectional] in let getEdCtrlTextLineValue ctrlselectwheel -> value in if (value == nil) || (!strcmp "" strtrim value) then nil else let getSelectedEdCtrlList ctrllist -> [name _ _] in ( let ftoa getEdCtrlFloatValue ctrldampinglength -> dampinglength in let ftoa getEdCtrlFloatValue ctrldamping -> damping in let itoa getEdCtrlCheckState ctrldriving -> driving in let itoa getEdCtrlCheckState ctrldirectional -> directional in let strcatnSep value::dampinglength::damping::driving::directional::nil "," -> nvalue in ( renameEdCtrlListElement ctrllist name nvalue; ); ); 0;; fun cbAddList(ctrlstr, p)= let p -> [ctrllist ctrlselectwheel ctrldampinglength ctrldamping ctrldriving ctrldirectional] in let getEdCtrlTextLineValue ctrlselectwheel -> value in if (value == nil) || (!strcmp "" strtrim value) then nil else let getEdCtrlListElems ctrllist -> lelem in ( if (isStringInListiPos lelem value 0 (strlen value)) then nil else let ftoa getEdCtrlFloatValue ctrldampinglength -> dampinglength in let ftoa getEdCtrlFloatValue ctrldamping -> damping in let itoa getEdCtrlCheckState ctrldriving -> driving in let itoa getEdCtrlCheckState ctrldirectional -> directional in let strcatnSep value::dampinglength::damping::driving::directional::nil "," -> nvalue in ( addEdCtrlList ctrllist nvalue nil nil; //selectEdCtrlList ctrllist nvalue; setEdCtrlTextLineValue ctrlselectwheel ""; setEdCtrlFloatValue ctrldampinglength 0.1; setEdCtrlFloatValue ctrldamping 10.0; setEdCtrlCheckState ctrldriving 1; setEdCtrlCheckState ctrldirectional 0; ); ); 0;; fun fillWheelCtrls(value, p)= let p -> [ctrlselectwheel ctrldampinglength ctrldamping ctrldriving ctrldirectional] in let strToListSep value "," -> pwheel in ( setEdCtrlTextLineValue ctrlselectwheel (hd pwheel); setEdCtrlFloatValue ctrldampinglength (atof (nth_list pwheel 1)); setEdCtrlFloatValue ctrldamping (atof (nth_list pwheel 2)); setEdCtrlCheckState ctrldriving (atoi (nth_list pwheel 3)); setEdCtrlCheckState ctrldirectional (atoi (nth_list pwheel 4)); ); 0;; fun cbSelectWheel(ctrlstr, pos, elem, lval, type, p)= fillWheelCtrls elem p; 0;; fun cbDelList(ctrlstr, p)= let p -> [ctrllist ctrlselectwheel ctrldampinglength ctrldamping ctrldriving ctrldirectional] in let getSelectedEdCtrlList ctrllist -> [name _ _] in ( delEdCtrlList ctrllist name; let getSelectedEdCtrlList ctrllist -> [sname _ _] in fillWheelCtrls sname [ctrlselectwheel ctrldampinglength ctrldamping ctrldriving ctrldirectional]; ); 0;; fun fillMaterialPassSelector(viewstr, p, mat, tech)= let p -> [ctrlselect ctrlmatname ctrlmattech] in if mat == nil then nil else let V3DgetDefaultSession viewstr -> sessionstr in let SO3MaterialNumberOfPassesByTechnique mat tech -> size in let 0 -> i in let nil -> lmatname in ( while i < size do ( let SO3MaterialPassGetNameByIndex mat tech i -> matname in let if (!strcmp matname "") then (itoa i) else matname -> matname in set lmatname = lcat lmatname matname::nil; set i = i + 1; ); fillEdCtrlSelect ctrlselect lmatname; ); 0;; fun cbMatTechniqueName(ctrlstr, pos, elem, p)= let p -> [inst viewstr group ctrlmatname ctrlmatpass] in let getSelectedEdCtrlSelect ctrlmatname -> matname in let V3DgetDefaultSession viewstr -> sessionstr in let if matname != nil then SO3SceneGetMaterial (V3DgetSession sessionstr) group matname else nil -> mat in fillMaterialPassSelector viewstr [ctrlmatpass ctrlmatname ctrlstr] mat pos; 0;; fun fillMaterialTechSelector(viewstr, p, mat)= let p -> [ctrlselect ctrlmatname ctrlmatpass] in if mat == nil then nil else let V3DgetDefaultSession viewstr -> sessionstr in let SO3MaterialNumberOfTechniques mat -> size in let 0 -> i in let nil -> lmatname in ( while i < size do ( let SO3MaterialTechniqueGetNameByIndex mat i -> matname in set lmatname = lcat lmatname matname::nil; set i = i + 1; ); fillEdCtrlSelect ctrlselect lmatname; fillMaterialPassSelector viewstr [ctrlmatpass ctrlmatname ctrlselect] mat 0; ); 0;; fun cbMatName(ctrlstr, pos, elem, p)= let p -> [inst viewstr group ctrlmattech ctrlmatpass] in let V3DgetDefaultSession viewstr -> sessionstr in let if elem != nil then SO3SceneGetMaterial (V3DgetSession sessionstr) group elem else nil -> mat in fillMaterialTechSelector viewstr [ctrlmattech ctrlstr ctrlmatpass] mat; 0;; fun fillMaterialSelector(viewstr, p, objname)= let p -> [inst ctrlselect ctrlmattech ctrlmatpass] in if objname == nil then nil else let V3DgetDefaultSession viewstr -> sessionstr in let SO3SceneGetObject (V3DgetSession sessionstr) objname -> obj in let SO3EntityGetResourceGroup obj -> group in let SO3EntityMaterialList obj -> lmat in let nil -> lmatname in ( setEdCtrlSelectCb ctrlselect mkfun4 @cbMatName [inst viewstr group ctrlmattech ctrlmatpass]; setEdCtrlSelectCb ctrlmattech mkfun4 @cbMatTechniqueName [inst viewstr group ctrlselect ctrlmatpass]; let sizelist lmat -> size in let 0 -> i in while i < size do ( let nth_list lmat i -> mat in let SO3MaterialGetName mat -> matname in set lmatname = lcat lmatname matname::nil; set i = i + 1; ); fillEdCtrlSelect ctrlselect lmatname; fillMaterialTechSelector viewstr [ctrlmattech ctrlselect ctrlmatpass] (SO3SceneGetMaterial (V3DgetSession sessionstr) group (hd lmatname)); ); 0;; fun cbSelectObjMat(val, type, p)= let p -> [inst winstr viewstr ctrlobjname ctrlmatname ctrlmattech ctrlmatpass] in let V3DgetDefaultSession viewstr -> sessionstr in let SO3SceneGetObject (V3DgetSession sessionstr) val -> obj in if obj == nil then nil else ( setEdCtrlTextLineValue ctrlobjname val; fillMaterialSelector viewstr [inst ctrlmatname ctrlmattech ctrlmatpass] val; ); 0;; fun cbCloseResMat(ctrlbtn)= setEdCtrlButtonEnable ctrlbtn 1; 0;; fun cbBtnPickObjMat(ctrlbtn, p)= let p -> [inst winstr viewstr ctrlobjname ctrlmatname ctrlmattech ctrlmatpass objname] in ( setEdCtrlButtonEnable ctrlbtn 0; dlgSelectPluginInstanceResource inst winstr iTypeEntity objname mkfun3 @cbSelectObjMat [inst winstr viewstr ctrlobjname ctrlmatname ctrlmattech ctrlmatpass] mkfun1 @cbCloseResMat ctrlbtn 0; ); 0;; fun cbRefreshBtnSpec(pickbtn, p)= let p -> [ctrlobjname ctrlmatname ctrlmattech ctrlmatpass] in ( setEdCtrlTextLineValue ctrlobjname ""; fillEdCtrlSelect ctrlmatname nil; fillEdCtrlSelect ctrlmattech nil; fillEdCtrlSelect ctrlmatpass nil; ); 0;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [420 600] -> [iw ih] in let 10 -> ypos in ( setEdWindowSize ewinstr iw ih; let (getPluginInstanceParam inst "object") -> objname in let atof (getPluginInstanceParam inst "mass") -> mass in let if mass == nil then 800.0 else mass -> mass in let atof (getPluginInstanceParam inst "enginepower") -> enginepower in let if enginepower == nil then 450.0 else enginepower -> enginepower in let atof (getPluginInstanceParam inst "nbgears") -> nbgears in let if nbgears == nil then 5.0 else nbgears -> nbgears in let atoi (getPluginInstanceParam inst "autogear") -> autogear in let if autogear == nil then 1 else autogear -> autogear in let atof (getPluginInstanceParam inst "wfriction") -> wfriction in let if wfriction == nil then 1.5 else wfriction -> wfriction in let atoi (getPluginInstanceParam inst "driftpart") -> driftpart in let if driftpart == nil then 1 else driftpart -> driftpart in let atoi (getPluginInstanceParam inst "startengine") -> startengine in let if startengine == nil then 1 else startengine -> startengine in let (getPluginInstanceParam inst "sndstart") -> sndstart in let if sndstart == nil then strcatn (getPluginDirectory (getInstancePlugin inst))::"/medias/engine_start.wav"::nil else sndstart -> sndstart in let (getPluginInstanceParam inst "sndloop") -> sndloop in let if sndloop == nil then strcatn (getPluginDirectory (getInstancePlugin inst))::"/medias/engine_loop.wav"::nil else sndloop -> sndloop in let (getPluginInstanceParam inst "sndscreech") -> sndscreech in let if sndscreech == nil then strcatn (getPluginDirectory (getInstancePlugin inst))::"/medias/tires_squal_loop.wav"::nil else sndscreech -> sndscreech in let (getPluginInstanceParam inst "sndshock") -> sndshock in let if sndshock == nil then strcatn (getPluginDirectory (getInstancePlugin inst))::"/medias/small_shock.wav"::nil else sndshock -> sndshock in let (getPluginInstanceParam inst "objectmat") -> objmatname in let (getPluginInstanceParam inst "material") -> matname in let atoi (getPluginInstanceParam inst "technique") -> technique in let if technique == nil then 0 else technique -> technique in let atoi (getPluginInstanceParam inst "pass") -> pass in let if pass == nil then 0 else pass -> pass in let atof (getPluginInstanceParam inst "nclip") -> nclip in let if nclip == nil then 0.1 else nclip -> nclip in let atof (getPluginInstanceParam inst "fclip") -> fclip in let if fclip == nil then 10000.0 else fclip -> fclip in let atof (getPluginInstanceParam inst "fovy") -> fovy in let if fovy == nil then 45.0 else fovy -> fovy in let atof (getPluginInstanceParam inst "mindist") -> mindist in let if mindist == nil then 3.0 else mindist -> mindist in let atof (getPluginInstanceParam inst "maxdist") -> maxdist in let if maxdist == nil then 5.0 else maxdist -> maxdist in let atof (getPluginInstanceParam inst "camangle") -> camangle in let if camangle == nil then (-.20.0) else camangle -> camangle in let atoi (getPluginInstanceParam inst "enablecam") -> enablecam in let if enablecam == nil then 1 else enablecam -> enablecam in let if (objmatname == nil || (strcmpi objmatname "") == 0) then 0 else 1 -> useBrake in ( if !useBrake then nil else set ih = ih + 110; if !enablecam then nil else set ih = ih + 185; setEdWindowSize ewinstr iw ih; let crEdFrameWindow _channel ewinstr 0 0 iw 155 EDWIN_RESIZE_MW nil (loc "OS3DPHYSICVEHICLE_0030") (loc "OS3DPHYSICVEHICLE_0026") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 135 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0038") nil -> labelobj in let crEdCtrlTextLine winstr 180 ypos 140 20 objname nil EDWIN_RESIZE_MW -> ctrlobjname in let crEdCtrlButton winstr 325 ypos 55 20 "..." nil -> pickbtn in let crEdCtrlButton winstr 385 ypos 35 20 "X" nil -> refreshobjname in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0037") nil -> labelmass in let crEdCtrlFloat winstr 180 ypos 100 20 mass 0.0 1000000.0 0.1 4 nil EDWIN_RESIZE_MW -> ctrlmass in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0017") nil -> labelpower in let crEdCtrlFloat winstr 180 ypos 100 20 enginepower 0.0 10000.0 0.1 4 nil EDWIN_RESIZE_MW -> ctrlpower in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0028") nil -> labelnbgears in let crEdCtrlFloat winstr 180 ypos 100 20 nbgears 1.0 6.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlnbgears in let crEdCtrlCheck winstr 285 ypos (iw - 295) 20 (loc "OS3DPHYSICVEHICLE_0002") EDWIN_RESIZE_MW -> ctrlautogear in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0020") nil -> labelwfriction in let crEdCtrlFloat winstr 180 ypos 100 20 wfriction 0.0 10000.0 0.1 4 nil EDWIN_RESIZE_MW -> ctrlwfriction in let crEdFrameWindow _channel ewinstr 0 0 iw 305 EDWIN_RESIZE_MW nil (loc "OS3DPHYSICVEHICLE_0041") (loc "OS3DPHYSICVEHICLE_0026") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 285 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlList winstr 10 (set ypos = 10) (iw - 15) 120 LB_BORDER|LB_VSCROLL|ET_TABFOCUS EDWIN_RESIZE_MW|EDWIN_RESIZE_MH -> ctrlwheels in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 125) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0039") nil -> labelwheelobj in let crEdCtrlTextLine winstr 180 ypos 140 20 nil nil EDWIN_RESIZE_MW -> ctrlselectwheel in let crEdCtrlButton winstr 325 ypos 55 20 "..." nil -> pickwheelbtn in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0011") nil -> labeldampingl in let crEdCtrlFloat winstr 180 ypos 100 20 0.1 0.0 1000000.0 0.1 4 nil EDWIN_RESIZE_MW -> ctrldampinglength in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0012") nil -> labeldamping in let crEdCtrlFloat winstr 180 ypos 100 20 10.0 0.0 1000000.0 0.1 4 nil EDWIN_RESIZE_MW -> ctrldamping in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DPHYSICVEHICLE_0014") EDWIN_RESIZE_MW -> ctrldriving in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DPHYSICVEHICLE_0013") EDWIN_RESIZE_MW -> ctrldirectional in let crEdCtrlButton winstr (iw - 225) (set ypos = ypos + 25) 70 20 (loc "OS3DPHYSICVEHICLE_0001") EDWIN_RESIZE_MW -> ctrlbtnadd in let crEdCtrlButton winstr (iw - 150) ypos 70 20 (loc "OS3DPHYSICVEHICLE_0032") EDWIN_RESIZE_MW -> ctrlbtnset in let crEdCtrlButton winstr (iw - 75) ypos 70 20 (loc "OS3DPHYSICVEHICLE_0031") EDWIN_RESIZE_MW -> ctrlbtndel in let crEdFrameWindowEx _channel ewinstr 0 0 iw 130 EDWIN_RESIZE_MW nil (loc "OS3DPHYSICVEHICLE_0034") (loc "OS3DPHYSICVEHICLE_0026") 1 -> winfrm in let crEdWindow _channel winfrm 0 18 iw 110 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 120 20 (loc "OS3DPHYSICVEHICLE_0018") nil -> labelsndstart in let crEdCtrlTextLine winstr 140 ypos 180 20 sndstart nil EDWIN_RESIZE_MW -> ctrlsndstart in let crEdCtrlButton winstr 325 ypos 55 20 "..." nil -> picksndstart in let crEdCtrlButton winstr 385 ypos 35 20 "X" nil -> refreshsndstart in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 120 20 (loc "OS3DPHYSICVEHICLE_0016") nil -> labelsndloop in let crEdCtrlTextLine winstr 140 ypos 180 20 sndloop nil EDWIN_RESIZE_MW -> ctrlsndloop in let crEdCtrlButton winstr 325 ypos 55 20 "..." nil -> picksndloop in let crEdCtrlButton winstr 385 ypos 35 20 "X" nil -> refreshsndloop in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 120 20 (loc "OS3DPHYSICVEHICLE_0040") nil -> labelsndscreech in let crEdCtrlTextLine winstr 140 ypos 180 20 sndscreech nil EDWIN_RESIZE_MW -> ctrlsndscreech in let crEdCtrlButton winstr 325 ypos 55 20 "..." nil -> picksndscreech in let crEdCtrlButton winstr 385 ypos 35 20 "X" nil -> refreshsndscreech in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 120 20 (loc "OS3DPHYSICVEHICLE_0033") nil -> labelsndshock in let crEdCtrlTextLine winstr 140 ypos 180 20 sndshock nil EDWIN_RESIZE_MW -> ctrlsndshock in let crEdCtrlButton winstr 325 ypos 55 20 "..." nil -> picksndshock in let crEdCtrlButton winstr 385 ypos 35 20 "X" nil -> refreshsndshock in let crEdFrameWindowEx _channel ewinstr 0 0 iw 130 EDWIN_RESIZE_MW nil (loc "OS3DPHYSICVEHICLE_0003") (loc "OS3DPHYSICVEHICLE_0026") !useBrake -> winfrm in let crEdWindow _channel winfrm 0 18 iw 110 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 170 20 (loc "OS3DPHYSICVEHICLE_0029") nil -> labelobjmat in let crEdCtrlTextLine winstr 140 ypos 180 20 objmatname nil EDWIN_RESIZE_MW -> ctrlobjmatname in let crEdCtrlButton winstr 325 ypos 55 20 "..." nil -> pickbtnmat in let crEdCtrlButton winstr 385 ypos 35 20 "X" nil -> refreshobjmatname in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 120 20 (loc "OS3DPHYSICVEHICLE_0022") nil -> labelmat in let crEdCtrlSelect winstr 140 ypos (iw - 140) 120 EDWIN_RESIZE_MW -> ctrlmatname in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 120 20 (loc "OS3DPHYSICVEHICLE_0023") nil -> labeltech in let crEdCtrlSelect winstr 140 ypos (iw - 140) 120 EDWIN_RESIZE_MW -> ctrlmattech in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 120 20 (loc "OS3DPHYSICVEHICLE_0036") nil -> labelpass in let crEdCtrlSelect winstr 140 ypos (iw - 140) 120 EDWIN_RESIZE_MW -> ctrlmatpass in let crEdFrameWindowEx _channel ewinstr 0 0 iw 205 EDWIN_RESIZE_MW nil (loc "OS3DPHYSICVEHICLE_0008") (loc "OS3DPHYSICVEHICLE_0026") !enablecam -> winfrm in let crEdWindow _channel winfrm 0 18 iw 185 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0004") nil -> labelfov in let crEdCtrlFloat winstr 180 ypos 100 20 fovy 0.0 90.0 1.0 2 nil EDWIN_RESIZE_MW -> ctrlfov in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0007") nil -> labelnclip in let crEdCtrlFloat winstr 180 ypos 100 20 nclip 0.0 100000.0 0.001 5 nil EDWIN_RESIZE_MW -> ctrlnclip in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0006") nil -> labelfclip in let crEdCtrlFloat winstr 180 ypos 100 20 fclip 0.0 100000.0 0.001 5 nil EDWIN_RESIZE_MW -> ctrlfclip in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0025") nil -> labelmindist in let crEdCtrlFloat winstr 180 ypos 100 20 mindist 0.0 100000.0 0.01 4 nil EDWIN_RESIZE_MW -> ctrlmindist in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0024") nil -> labelmaxdist in let crEdCtrlFloat winstr 180 ypos 100 20 maxdist 0.0 100000.0 0.01 4 nil EDWIN_RESIZE_MW -> ctrlmaxdist in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DPHYSICVEHICLE_0005") nil -> labelcamangle in let crEdCtrlFloat winstr 180 ypos 100 20 camangle (-.180.0) 180.0 0.01 4 nil EDWIN_RESIZE_MW -> ctrlcamangle in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DPHYSICVEHICLE_0015") EDWIN_RESIZE_MW -> ctrlcamenable in let crEdFrameWindow _channel ewinstr 0 0 iw 80 EDWIN_RESIZE_MW nil (loc "OS3DPHYSICVEHICLE_0027") (loc "OS3DPHYSICVEHICLE_0026") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 60 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlCheck winstr 10 (set ypos = 10) 280 20 (loc "OS3DPHYSICVEHICLE_0021") EDWIN_RESIZE_MW -> ctrldriftpart in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) 280 20 (loc "OS3DPHYSICVEHICLE_0035") EDWIN_RESIZE_MW -> ctrlstartengine in let V3DgetDefaultSession viewstr -> sessionstr in let SO3SceneGetObject (V3DgetSession sessionstr) objname -> obj in let SO3EntityGetResourceGroup obj -> group in ( setEdCtrlButtonCb pickbtn mkfun2 @cbBtnPickObj [inst winstr viewstr ctrlobjname objname]; setEdCtrlButtonCb refreshobjname mkfun2 @cbRefreshBtn [ctrlobjname]; setEdCtrlTextLineEnable ctrlobjname 0; setEdCtrlButtonCb picksndstart mkfun2 @cbBtnPickSound [inst winstr ctrlsndstart sndstart]; setEdCtrlButtonCb refreshsndstart mkfun2 @cbRefreshBtn [ctrlsndstart]; setEdCtrlTextLineEnable ctrlsndstart 0; setEdCtrlButtonCb picksndloop mkfun2 @cbBtnPickSound [inst winstr ctrlsndloop sndloop]; setEdCtrlButtonCb refreshsndloop mkfun2 @cbRefreshBtn [ctrlsndloop]; setEdCtrlTextLineEnable ctrlsndloop 0; setEdCtrlButtonCb picksndscreech mkfun2 @cbBtnPickSound [inst winstr ctrlsndscreech sndscreech]; setEdCtrlButtonCb refreshsndscreech mkfun2 @cbRefreshBtn [ctrlsndscreech]; setEdCtrlTextLineEnable ctrlsndscreech 0; setEdCtrlButtonCb picksndshock mkfun2 @cbBtnPickSound [inst winstr ctrlsndshock sndshock]; setEdCtrlButtonCb refreshsndshock mkfun2 @cbRefreshBtn [ctrlsndshock]; setEdCtrlTextLineEnable ctrlsndshock 0; setEdCtrlCheckState ctrlautogear autogear; setEdCtrlCheckState ctrlcamenable enablecam; setEdCtrlCheckState ctrldriftpart driftpart; setEdCtrlCheckState ctrlstartengine startengine; fillEdCtrlList ctrlwheels (loadWheels inst); setEdCtrlListCbClick ctrlwheels mkfun6 @cbSelectWheel [ctrlselectwheel ctrldampinglength ctrldamping ctrldriving ctrldirectional]; setEdCtrlCheckState ctrldriving 1; setEdCtrlButtonCb pickbtnmat mkfun2 @cbBtnPickObjMat [inst winstr viewstr ctrlobjmatname ctrlmatname ctrlmattech ctrlmatpass objmatname]; setEdCtrlTextLineEnable ctrlobjmatname 0; setEdCtrlButtonCb refreshobjmatname mkfun2 @cbRefreshBtnSpec [ctrlobjmatname ctrlmatname ctrlmattech ctrlmatpass]; fillMaterialSelector viewstr [inst ctrlmatname ctrlmattech ctrlmatpass] objmatname; selectEdCtrlSelect ctrlmatname matname; let SO3SceneGetMaterial (V3DgetSession sessionstr) group matname -> mat in if mat == nil then nil else ( fillMaterialTechSelector viewstr [ctrlmattech ctrlmatname ctrlmatpass] mat; selectEdCtrlSelectByPos ctrlmattech technique; fillMaterialPassSelector viewstr [ctrlmatpass ctrlmatname ctrlmattech] mat technique; selectEdCtrlSelectByPos ctrlmatpass pass; ); setEdCtrlButtonCb ctrlbtnadd mkfun2 @cbAddList [ctrlwheels ctrlselectwheel ctrldampinglength ctrldamping ctrldriving ctrldirectional]; setEdCtrlButtonCb ctrlbtnset mkfun2 @cbSetList [ctrlwheels ctrlselectwheel ctrldampinglength ctrldamping ctrldriving ctrldirectional]; setEdCtrlButtonCb ctrlbtndel mkfun2 @cbDelList [ctrlwheels ctrlselectwheel ctrldampinglength ctrldamping ctrldriving ctrldirectional]; setEdCtrlButtonCb pickwheelbtn mkfun2 @cbBtnPickObj [inst winstr viewstr ctrlselectwheel nil]; setEdCtrlTextLineEnable ctrlselectwheel 0; [mkfun1 @cbCloseEdit [ctrlobjname ctrlmass ctrlpower ctrlnbgears ctrlautogear ctrlwfriction ctrlwheels ctrlsndstart ctrlsndloop ctrlsndscreech ctrlsndshock ctrlobjmatname ctrlmatname ctrlmattech ctrlmatpass ctrlfov ctrlnclip ctrlfclip ctrlmindist ctrlmaxdist ctrlcamangle ctrlcamenable ctrldriftpart ctrlstartengine] nil]; ); ); );;