742 lines
31 KiB
INI
742 lines
31 KiB
INI
persistidents 0
|
|
|
|
newmenu editing
|
|
|
|
menuitem "Mapmodels..." [ showmenu Mapmodels ]
|
|
menuitem "Lighting..." [ showmenu Lighting ]
|
|
menuitem "Entities..." [ showmenu Entities ]
|
|
menuitem "Pickups..." [ showmenu Pickups ]
|
|
menuitem "Textures..." [ showmenu textures ]
|
|
menuitem "Skymaps..." [ showmenu skymaps ]
|
|
menuitem "Ambient sounds..." [ showmenu [Ambient sounds] ]
|
|
menuitem "Arches and slopes..." [ showmenu Arches ]
|
|
menuitem "Map operations..." [ showmenu [Map operations] ]
|
|
menuitem "Map config operations..." [ showmenu [Map config operations] ]
|
|
menuitem "Bots..." [ showmenu [Creating bot waypoints] ]
|
|
menuitem "Settings..." [ showmenu [Editing settings] ]
|
|
menuitem "Deleted entities" [ showmenu "deleted entities" ]
|
|
|
|
menuitem "Help?" [ echo "\f2Please read the AssaultCube README which has a detailed guide on mapediting..." ]
|
|
|
|
tempalias tmp_cradius 12
|
|
|
|
//Lighting menu.
|
|
newmenu Lighting
|
|
|
|
menuitem "Add white lights " [ showmenu [White light] ]
|
|
menuitem "Add coloured lights " [ showmenu [Coloured light] ]
|
|
menuitem "" -1
|
|
menuitemcheckbox "Enable fullbright: " "$fullbright" [ fullbright $arg1 ]
|
|
menuitem "" -1
|
|
menuitem "Random coloured light: " -1
|
|
menuitemtextinput "Radius: " [ result $tmp_cradius ] [ if (&& (! (> $arg1 32)) (! (< $arg1 1))) [ tmp_cradius = $arg1 ] [ echo "\f3Error: \f2" $arg1 "\f5is not a valid radius for a light entity." ] ]
|
|
menuitem "Place random light..." [ gencl $tmp_cradius ]
|
|
menuitem "Update random light..." gencl
|
|
|
|
wlight = 1; wlight1 = 1
|
|
|
|
newmenu [White light]
|
|
|
|
menuitemslider "Light radius: " 1 32 "$wlight" 1 [] [ wlight = $arg1 ]
|
|
menuitemslider "Brightness: " 1 255 "$wlight1" 5 [] [ wlight1 = $arg1 ]
|
|
menuitem "" -1
|
|
menuitem "\f2\t [ OK ]\t\t" [ newent light $wlight $wlight1 ]
|
|
|
|
clight = 1; clight1 = 1; clight2 = 1; clight3 = 1
|
|
|
|
newmenu [Coloured light]
|
|
|
|
menuitemslider "Light radius: " 1 32 "$clight" 1 [] [ clight = $arg1 ]
|
|
menuitem "" -1
|
|
menuitemslider "Red light: " 1 255 "$clight1" 5 [] [ clight1 = $arg1 ]
|
|
menuitemslider "Green light: " 1 255 "$clight2" 5 [] [ clight2 = $arg1 ]
|
|
menuitemslider "Blue light: " 1 255 "$clight3" 5 [] [ clight3 = $arg1 ]
|
|
menuitem "" -1
|
|
menuitem "\f2\t\t [ OK ]" [ newent light $clight $clight1 $clight2 $clight3 ]
|
|
|
|
//Entities menu
|
|
newmenu Entities
|
|
|
|
menuitem "RVSF Spawn point" [ newent playerstart 1 ]
|
|
menuitem "CLA Spawn point" [ newent playerstart 0 ]
|
|
menuitem "FFA Spawn point" [ newent playerstart 100 ]
|
|
menuitem "" -1
|
|
menuitem "RVSF CTF Flag" [ newent ctf-flag 1 ]
|
|
menuitem "CLA CTF Flag" [ newent ctf-flag 0 ]
|
|
menuitem "" -1
|
|
menuitem "Ladder entity" "saycommand /newent ladder " [ echo "Ensure that you have placed the ladder mapmodel first (found in the mapmodels menu)..." ]
|
|
menuitem "Clip entity" [ showmenu Clips ] [ echo Clips can be used to block off areas that players shouldn't be able to access... ]
|
|
|
|
tempalias _clip00 clip; tempalias _clip00status 0; tempalias _clip01 0; tempalias _clip02 1; tempalias _clip03 1; tempalias _clip04 1 // Give aliases an initial value.
|
|
|
|
newmenu Clips
|
|
|
|
menuitemslider "Clip type: " 0 1 "$_clip00status" 1 [ Clip "Player Clip" ] [ _clip00 = (at [clip plclip] $arg1); _clip00status = $arg1 ]
|
|
menuitemslider "Elevation from ground: " 0 50 "$_clip01" 1 [] [ _clip01 = $arg1 ]
|
|
menuitemslider "Length of clip\t(X): " 0 50 "$_clip02" 1 [] [ _clip02 = $arg1 ]
|
|
menuitemslider "Width of clip\t(Y): " 0 50 "$_clip03" 1 [] [ _clip03 = $arg1 ]
|
|
menuitemslider "Height of clip\t(Z): " 0 50 "$_clip04" 1 [] [ _clip04 = $arg1 ]
|
|
menuitem "" -1
|
|
menuitem "\f2\t\t [ OK ]" [ newent $_clip00 $_clip01 $_clip02 $_clip03 $_clip04 ]
|
|
|
|
//Pickups menu
|
|
newmenu Pickups
|
|
|
|
menuitem "Health" [ newent health ]
|
|
menuitem "Pistol Magazine" [ newent pistol ]
|
|
menuitem "Box of Ammo" [ newent ammobox ]
|
|
menuitem "Kevlar Vest" [ newent armour ]
|
|
menuitem "Helmet" [ newent helmet ]
|
|
menuitem "Akimbo" [ newent akimbo ]
|
|
menuitem "Grenades" [ newent grenades ]
|
|
|
|
//Arch and slope menu
|
|
newmenu Arches
|
|
|
|
menuitem "Arch with no sideways curves" [ heightfield 2; arch 0 ]
|
|
menuitem "Arch with sideways curves (delta 1)" [ heightfield 2; arch 1 ]
|
|
menuitem "Arch with sideways curves (delta 2)" [ heightfield 2; arch 2 ]
|
|
menuitem "Arch with sideways curves (delta 3)" [ heightfield 2; arch 3 ]
|
|
menuitem "Arch with sideways curves (delta 4)" [ heightfield 2; arch 4 ]
|
|
menuitem "" -1
|
|
menuitem "Slope increase 2 left-right" [ heightfield 0; slope 2 0 ]
|
|
menuitem "Slope decrease 2 left-right" [ heightfield 0; slope -2 0 ]
|
|
menuitem "Slope increase 2 top-bottom" [ heightfield 0; slope 0 2 ]
|
|
menuitem "Slope decrease 2 top-bottom" [ heightfield 0; slope 0 -2 ]
|
|
menuitem "Slope increase 1 left-right" [ heightfield 0; slope 1 0 ]
|
|
menuitem "Slope decrease 1 left-right" [ heightfield 0; slope -1 0 ]
|
|
menuitem "Slope increase 1 top-bottom" [ heightfield 0; slope 0 1 ]
|
|
menuitem "Slope decrease 1 top-bottom" [ heightfield 0; slope 0 -1 ]
|
|
menuitem "" -1
|
|
menuitem "Fix heightfielding" [ solid 0; slope 0 0 ]
|
|
|
|
newmenu skymaps
|
|
menuinit [
|
|
delmenu skymaps
|
|
newmenu skymaps
|
|
if (&& $editing (! (getautomapconfig))) [
|
|
menuitem [Enable automapconfig to make changes permanent] [automapconfig ; closemenu (curmenu)] (concat loadsky (escape $loadsky))
|
|
menuitem "" -1 (concat loadsky (escape $loadsky))
|
|
]
|
|
menuitem (concat "Current skymap:" $loadsky) (concat loadsky (escape $loadsky))
|
|
menuitem "" -1 (concat loadsky (escape $loadsky))
|
|
push offskies ""
|
|
push userskies ""
|
|
push skyname ""
|
|
looplist (gettexturelist skymaps/ "" _ft.jpg) [c1 c2 c3 c4] [
|
|
skyname = (escape (concatword $c3 "/" $c4))
|
|
if (strcmp official (gettextureorigin (concatword $c1 "/" $c2))) [
|
|
offskies = (concat $offskies $skyname)
|
|
] [
|
|
userskies = (concat $userskies $skyname)
|
|
]
|
|
]
|
|
menuitem "Official skymaps:" -1 (concat loadsky (escape $loadsky))
|
|
looplist $offskies skyname [
|
|
menuitem (concat " " $skyname) (concat loadsky $skyname) (concat loadsky $skyname)
|
|
]
|
|
if (strlen $userskies) [
|
|
menuitem "" -1 (concat loadsky (escape $loadsky))
|
|
menuitem "Custom/downloaded skymaps:" -1 (concat loadsky (escape $loadsky))
|
|
looplist $userskies skyname [
|
|
menuitem (concat " " $skyname) (concat loadsky (escape $skyname)) (concat loadsky (escape $skyname))
|
|
]
|
|
]
|
|
pop offskies userskies skyname
|
|
]
|
|
|
|
_closestenttypestatus = 0
|
|
//Map operations
|
|
newmenu [Map operations]
|
|
|
|
menuitem "Newmap (128x128 cubes - recommended)" [ newmap 7 ]
|
|
menuitem "Newmap (256x256 cubes)" [ newmap 8 ]
|
|
menuitem "Increase mapsize (2x)" [ mapenlarge; echo The map size has been increased by 2. However, the new space is solid. To utilize it, you will need to turn it into non-solid space, by selecting it and pressing G. ]
|
|
menuitem "Edit map message" editmapmsg
|
|
menuitem "Change waterlevel" [ saycommand [/waterlevel ] ]
|
|
menuitem "Change watercolour" [ showmenu [Water colour] ]
|
|
menuitem "Generate a random watercolour" genwc
|
|
menuitem "Generate a random fogcolour" [ fogcolour (genhex) ]
|
|
menuitem "Print entity stats" entstats
|
|
menuitem "Select the next closest entity" nextclosestent
|
|
menuitem "Copy the current closest entity" copyent
|
|
menuitem "Paste a previously copied entity" pasteent
|
|
menuitemslider "Select only these entities: " 0 15 "$_closestenttypestatus" 1 [All Light Playerstart Pistol Ammobox Grenades Health Armour Akimbo Mapmodel Ladder CTF-flag Sound Clip Helmet PlayerClip] [ _closestentslider $arg1 ]
|
|
|
|
// Map config operations
|
|
newmenu [Map config operations]
|
|
|
|
menuitem "Edit mapmodel slot..." [ showmenu [Edit mapmodel slots] ]
|
|
menuitem "Delete unused mapmodel slot..." [ showmenu [Delete unused mapmodel slot] ]
|
|
menuitem "" -1
|
|
menuitem "Edit texture slot..." [ showmenu [Edit texture slots] ]
|
|
menuitem "" -1
|
|
menuitem "Edit mapsound slot..." [ showmenu [Edit mapsound slots] ]
|
|
menuitem "" -1
|
|
menuitem "Delete ALL unused mapmodel slots" [loop ii 256 [ push i (- 255 $ii) ; if (&& (strlen (mapmodelslotname $i)) (strcmp "" (mapmodelslotusage $i))) [deletemapmodelslot $i] ; pop i]]
|
|
menuitem "Delete ALL unused texture slots" [loop ii 251 [ push i (- 255 $ii) ; if (&& (strlen (edittextureslot $i)) (strcmp "" (textureslotusage $i))) [deletetextureslot $i] ; pop i]]
|
|
menuitem "Delete ALL unused mapsound slots" [loop ii 256 [ push i (- 255 $ii) ; if (&& (strlen (editmapsoundslot $i)) (strcmp "" (mapsoundslotusage $i))) [deletemapsoundslot $i] ; pop i]]
|
|
menuitem "" -1
|
|
menuitem "Update mapmodel menus" "mapmodelchanged 1"
|
|
|
|
tempalias __lastwatchedmapmodel ""
|
|
tempalias __mmslot ""
|
|
|
|
// Edit mapmodel slots
|
|
newmenu [Edit mapmodel slots]
|
|
menuinit __rebuildmapmodelmenus
|
|
|
|
// Edit mapmodel slot
|
|
newmenu [Edit mapmodel slot]
|
|
menuinit [
|
|
delmenu [Edit mapmodel slot]
|
|
newmenu [Edit mapmodel slot]
|
|
if (strlen $__mmslot) [
|
|
push info (editmapmodelslot $__mmslot)
|
|
menuheader "" (concatword "edit mapmodel slot #" $__mmslot ":\n" (mapmodelslotname $__mmslot))
|
|
menuitemtextinput "Clipping radius" (at $info 0) [editmapmodelslot $__mmslot $arg1]
|
|
menuitemtextinput "Clipping height " (at $info 1) [editmapmodelslot $__mmslot "" $arg1]
|
|
menuitemtextinput "z-Offset " (at $info 2) [editmapmodelslot $__mmslot "" "" $arg1]
|
|
menuitemtextinput "Scale [0.25 - 4.0] " (at $info 3) [editmapmodelslot $__mmslot "" "" "" $arg1]
|
|
push __distribution (getmapmodelattributes (mapmodelslotname $__mmslot) distribution)
|
|
if (! (strlen $__distribution)) [ __distribution = "custom/unsorted" ]
|
|
menuitem (concat "Distribution:" (pop __distribution)) -1
|
|
menuitem "" -1
|
|
menuitemtextinput "Mapmodel path " (concat result (at $info 4)) [editmapmodelslot $__mmslot "" "" "" "" $arg1] "" 250
|
|
if (&& (strlen $__lastwatchedmapmodel) (! (strcmp $__lastwatchedmapmodel (at $info 4)))) [
|
|
menuitem (concat " change to" (escape $__lastwatchedmapmodel)) [editmapmodelslot $__mmslot "" "" "" "" $__lastwatchedmapmodel]
|
|
]
|
|
if (strlen (mapmodelslotusage $__mmslot)) [
|
|
menuitem "" -1 (concat gotoposition (gotoposition))
|
|
looplist (mapmodelslotusage $__mmslot) ii [
|
|
menuitem (concatword "slot used by map entity #" $ii) (concat gotoentity $ii) (concat gotoentity $ii)
|
|
]
|
|
menuitem "" -1 (concat gotoposition (gotoposition))
|
|
][
|
|
menuitem "" -1
|
|
menuitem "\f3Delete unused slot" (concat deletemapmodelslot $__mmslot)
|
|
]
|
|
pop info
|
|
][
|
|
menuitem "no slot selected" -1
|
|
]
|
|
]
|
|
|
|
// Delete unused mapmodel slot
|
|
newmenu [Delete unused mapmodel slot]
|
|
menuinit __rebuildmapmodelmenus
|
|
|
|
tempalias __lastwatchedtexture ""
|
|
tempalias __texslot ""
|
|
|
|
// Edit texture slots
|
|
newmenu [Edit texture slots]
|
|
menuinit [
|
|
delmenu (curmenu)
|
|
newmenu (curmenu)
|
|
menurenderoffset -20 0
|
|
if $editing [
|
|
push ecurmenu (escape (curmenu))
|
|
push i 0
|
|
push info ""
|
|
looplist (textureslotusagelist) cnt [
|
|
info = (edittextureslot $i)
|
|
if (|| $cnt (strlen $info)) [
|
|
if (! (strlen $info)) [ info = " \fs\f3<unassigned>\fr" ]
|
|
menuitem (concatword "edit texture slot #" $i ": " $info " (" $cnt " uses)") (concat alias __texslot $i "; showmenu [Edit texture slot]") (concat chmenutexture $ecurmenu (at $info 1))
|
|
]
|
|
+= i 1
|
|
]
|
|
pop i info ecurmenu
|
|
] [
|
|
menuitem "menu only available in edit mode" -1
|
|
]
|
|
]
|
|
|
|
// Edit texture slot
|
|
newmenu [Edit texture slot]
|
|
menuinit [
|
|
delmenu (curmenu)
|
|
newmenu (curmenu)
|
|
if (strlen $__texslot) [
|
|
push info (edittextureslot $__texslot) // "<scale> <path>"
|
|
chmenutexture (curmenu) (at $info 1)
|
|
menurenderoffset -20 0
|
|
menuheader "" (concatword "edit texture slot #" $__texslot ":\n" (at $info 1))
|
|
menuitemtextinput "Scaling factor [0..4] " (at $info 0) [edittextureslot $__texslot $arg1]
|
|
menuitem "\f4factor 0 means default (1.0)" -1
|
|
menuitem "" -1
|
|
menuitem (concat "Distribution:" (gettextureorigin (at $info 1))) -1
|
|
menuitem "" -1
|
|
menuitemtextinput "Texture path " (concat result (at $info 1)) [edittextureslot $__texslot "" $arg1] "" 250
|
|
if (&& (strlen $__lastwatchedtexture) (! (strcmp $__lastwatchedtexture (at $info 1)))) [
|
|
menuitem (concat " change to" (escape $__lastwatchedtexture)) [edittextureslot $__texslot "" $__lastwatchedtexture]
|
|
]
|
|
menuitem "" -1
|
|
menuitem "use as next (upper-)wall texture" [edittexturestack wall $__texslot]
|
|
menuitem "use as next floor texture" [edittexturestack floor $__texslot]
|
|
menuitem "use as next ceiling texture" [edittexturestack ceiling $__texslot]
|
|
push __usage (textureslotusage $__texslot)
|
|
if (&& $__texslot (listlen $__usage)) [
|
|
menuitem "" -1 (concat gotoposition (gotoposition))
|
|
looplist $__usage ii [
|
|
menuitem (concatword "slot used by map entity #" $ii) (concat gotoentity $ii) (concat gotoentity $ii)
|
|
]
|
|
menuitem "" -1 (concat gotoposition (gotoposition))
|
|
]
|
|
if (strlen (pop __usage)) [
|
|
if (> (listlen (textureslotbyname (at $info 1))) 1) [
|
|
menuitem "" -1
|
|
menuitem "Merge multiple slots using same texture" [showmenu "Texture slot merge"]
|
|
]
|
|
pop slots
|
|
] [
|
|
menuitem "" -1
|
|
menuitem "\f3Delete unused slot" (concat deletetextureslot $__texslot)
|
|
]
|
|
pop info
|
|
][
|
|
menuitem "no slot selected" -1
|
|
]
|
|
]
|
|
|
|
tempalias __tex_joined ""
|
|
tempalias __tex_togo ""
|
|
|
|
newmenu "Texture slot merge"
|
|
menuinit [
|
|
delmenu (curmenu)
|
|
newmenu (curmenu)
|
|
if (strlen $__texslot) [
|
|
push info (edittextureslot $__texslot) // "<scale> <path>"
|
|
chmenutexture (curmenu) (at $info 1)
|
|
menurenderoffset -20 0
|
|
menuheader "" (concatword "merge texture slots using\n" (at $info 1))
|
|
menuitem (concat "Slots using texture" (at $info 1)) -1
|
|
push slots (textureslotbyname (at $info 1))
|
|
push usemap (textureslotusagelist)
|
|
menuitem "" -1
|
|
push last (- (listlen $slots) 1)
|
|
__tex_togo = (at $slots 0)
|
|
__tex_joined = (at $slots $last)
|
|
looplist $slots ii [
|
|
menuitem (concatword " #" $ii ": " (edittextureslot $ii) " (" (at $usemap $ii) " uses)") (concat alias __texslot $ii "; showmenu [Edit texture slot]")
|
|
]
|
|
menuitem "" -1
|
|
menuitem "Merge" -1
|
|
menuitemslider " slot #" 0 $last 0 1 $slots (concat "__tex_togo = (at" (escape $slots) "$arg1)")
|
|
menuitem "into" -1
|
|
menuitemslider " slot #" 0 $last $last 1 $slots (concat "__tex_joined = (at" (escape $slots) "$arg1)")
|
|
menuitem " \f0[OK]" [if (!= $__tex_joined $__tex_togo) [deletetextureslot $__tex_togo purge $__tex_joined]]
|
|
pop info slots usemap last
|
|
][
|
|
menuitem "no slot selected" -1
|
|
]
|
|
]
|
|
|
|
// Texture browsing menus
|
|
newmenu textures
|
|
menuitem "Browse official textures" [ showmenu "Official textures" ]
|
|
menuitem "Browse custom/downloaded textures" [ showmenu "Custom textures" ]
|
|
menuitem "Edit texture slots of current map" [ showmenu "Edit texture slots" ]
|
|
|
|
newmenu "Official textures"
|
|
menuinit __rebuildtexturemenus
|
|
|
|
newmenu "Custom textures"
|
|
menuinit __rebuildtexturemenus
|
|
|
|
newmenu "Pick texture"
|
|
menuinit [
|
|
delmenu (curmenu)
|
|
newmenu (curmenu)
|
|
if (strlen $__lastwatchedtexture) [
|
|
chmenutexture (curmenu) $__lastwatchedtexture
|
|
push usedslots (textureslotbyname $__lastwatchedtexture)
|
|
menuitem (concat "Texture:" $__lastwatchedtexture) -1
|
|
menuitem (concat "Distribution:" (gettextureorigin $__lastwatchedtexture)) -1
|
|
menuitem "" -1
|
|
if (strlen $usedslots) [
|
|
menuitem "Texture is already used in:" -1
|
|
looplist $usedslots i [
|
|
menuitem (concatword " slot #" $i " (scale " (at (edittextureslot $i) 0) ")") (concat "__texslot =" $i "; showmenu [Edit texture slot]")
|
|
]
|
|
menuitem "" -1
|
|
usedslots = "once more"
|
|
]
|
|
if (! (strlen (edittextureslot 255))) [
|
|
menuitem (concat "Add to map config" $usedslots) (concat texture 0 $__lastwatchedtexture)
|
|
menuitem "Add to map config and use as next wall texture" (concat "edittexturestack wall (texture 0" $__lastwatchedtexture ")")
|
|
menuitem "Add to map config and use as next floor texture" (concat "edittexturestack floor (texture 0" $__lastwatchedtexture ")")
|
|
menuitem "Add to map config and use as next ceiling texture" (concat "edittexturestack ceiling (texture 0" $__lastwatchedtexture ")")
|
|
] [
|
|
menuitem "\f4(no free texture slots available)" -1
|
|
]
|
|
pop usedslots
|
|
][
|
|
menuitem "no texture selected" -1
|
|
]
|
|
]
|
|
|
|
// Browse mapsounds
|
|
newmenu [Ambient sounds]
|
|
menuitem "Browse official mapsounds" [ showmenu "Official mapsounds" ]
|
|
menuitem "Browse custom/downloaded mapsounds" [ showmenu "Custom mapsounds" ]
|
|
menuitem "Edit mapsound slots of current map" [ showmenu "Edit mapsound slots" ]
|
|
|
|
newmenu "Official mapsounds"
|
|
menuinit __rebuildmapsoundmenus
|
|
|
|
newmenu "Custom mapsounds"
|
|
menuinit __rebuildmapsoundmenus
|
|
|
|
tempalias __lastwatchedmapsound ""
|
|
tempalias __sndslot ""
|
|
|
|
newmenu "Pick mapsound"
|
|
menuinit [
|
|
delmenu (curmenu)
|
|
newmenu (curmenu)
|
|
if (strlen $__lastwatchedmapsound) [
|
|
push usedslots (mapsoundslotbyname $__lastwatchedmapsound)
|
|
menuitem (concat "Mapsound:" $__lastwatchedmapsound) -1
|
|
menuitem (concat "Distribution:" (getmapsoundorigin $__lastwatchedmapsound)) -1
|
|
menuitem "" -1
|
|
if (strlen $usedslots) [
|
|
menuitem "Mapsound is already used in" -1
|
|
looplist $usedslots i [
|
|
menuitem (concatword " slot #" $i " (maxuses: " (at (editmapsoundslot $i) 1) ")") (concat "__sndslot =" $i "; showmenu [Edit mapsound slot]")
|
|
]
|
|
menuitem "" -1
|
|
usedslots = "once more"
|
|
]
|
|
if (! (strlen (editmapsoundslot 255))) [
|
|
menuitem (concat "\f0Add to map config" $usedslots) (concat mapsound $__lastwatchedmapsound -1)
|
|
] [
|
|
menuitem "\f4(no free mapsound slots available)" -1
|
|
]
|
|
pop usedslots
|
|
][
|
|
menuitem "no mapsound selected" -1
|
|
]
|
|
]
|
|
|
|
// Edit mapsound slots
|
|
newmenu [Edit mapsound slots]
|
|
menuinit [
|
|
delmenu (curmenu)
|
|
newmenu (curmenu)
|
|
if $editing [
|
|
push info ""
|
|
loop i 256 [
|
|
info = (editmapsoundslot $i)
|
|
if (strlen $info) [
|
|
menuitem (concatword "edit mapsound slot #" $i ": " $info) (concat alias __sndslot $i ";" showmenu (escape "Edit mapsound slot"))
|
|
]
|
|
]
|
|
pop info
|
|
] [
|
|
menuitem "menu only available in edit mode" -1
|
|
]
|
|
]
|
|
|
|
tempalias __snd_rad "1"
|
|
tempalias __snd_size "0"
|
|
tempalias __snd_vol "255"
|
|
|
|
newmenu [Edit mapsound slot]
|
|
menuinit [
|
|
delmenu (curmenu)
|
|
newmenu (curmenu)
|
|
if (strlen $__sndslot) [
|
|
push info (editmapsoundslot $__sndslot) // "<path> <maxuses>"
|
|
menuheader "" (concatword "edit mapsound slot #" $__sndslot ":\n" (at $info 0))
|
|
menuitemtextinput "Max simultaneous uses " (at $info 1) [editmapsoundslot $__sndslot "" $arg1]
|
|
menuitem " (\f4-1: unlimited)" -1
|
|
menuitem "" -1
|
|
menuitem (concat "Distribution:" (getmapsoundorigin (at $info 0))) -1
|
|
menuitem "" -1
|
|
menuitemtextinput "Mapsound path " (concat result (at $info 0)) [editmapsoundslot $__sndslot $arg1] "" 250
|
|
if (&& (strlen $__lastwatchedmapsound) (! (strcmp $__lastwatchedmapsound (at $info 0)))) [
|
|
menuitem (concat " change to" (escape $__lastwatchedmapsound)) [editmapsoundslot $__sndslot $__lastwatchedmapsound]
|
|
]
|
|
menuitem "" -1
|
|
menuitem "\f2Create map entity:" -1
|
|
menuitemslider [Sound radius: ] 1 25 "$__snd_rad" 1 [] [ __snd_rad = $arg1 ]
|
|
menuitemslider [Sound size: ] 0 25 "$__snd_size" 1 [] [ __snd_size = $arg1 ]
|
|
menuitemslider [Sound volume: ] 1 255 "$__snd_vol" 5 [] [ __snd_vol = $arg1 ]
|
|
menuitem "\f0 Place new entity now" (concat newent sound $__sndslot $__snd_rad $__snd_size $__snd_vol)
|
|
|
|
if (strlen (mapsoundslotusage $__sndslot)) [
|
|
menuitem "" -1 (concat gotoposition (gotoposition))
|
|
looplist (mapsoundslotusage $__sndslot) ii [
|
|
menuitem (concatword "slot used by map entity #" $ii) (concat gotoentity $ii) (concat gotoentity $ii)
|
|
]
|
|
menuitem "" -1 (concat gotoposition (gotoposition))
|
|
][
|
|
menuitem "" -1
|
|
menuitem "\f3Delete unused slot" (concat deletemapsoundslot $__sndslot)
|
|
]
|
|
pop info
|
|
][
|
|
menuitem "no slot selected" -1
|
|
]
|
|
]
|
|
|
|
// "closestenttype" slider...
|
|
_closestentslider = [ closestenttype (at ["" light playerstart pistol ammobox grenades health armour akimbo mapmodel ladder ctf-flag sound clip helmet plclip] $arg1); _closestenttypestatus = $arg1 ]
|
|
|
|
redw = 1; greenw = 1; bluew = 1
|
|
|
|
newmenu [Water colour]
|
|
|
|
menuitemslider "Red pigment: " 1 255 "$redw" 5 [] [ redw = $arg1 ]
|
|
menuitemslider "Green pigment: " 1 255 "$greenw" 5 [] [ greenw = $arg1 ]
|
|
menuitemslider "Blue pigment: " 1 255 "$bluew" 5 [] [ bluew = $arg1 ]
|
|
menuitem "" -1
|
|
menuitem "\f2\t\t [ OK ]" [ watercolour $redw $greenw $bluew ]
|
|
|
|
showedBAKinfo = 0
|
|
|
|
newmenu [Editing settings]
|
|
menuitemslider "Grid/Selection style: " 0 1 "$oldselstyle" 1 [triangles "squares (default)"] [ oldselstyle $arg1 ]
|
|
menuitemcheckbox "Show mapmodel clippings: " "$showmodelclipping" [ showmodelclipping $arg1 ]
|
|
menuitemcheckbox "Show all playerstarts: " "$showplayerstarts" [ showplayerstarts $arg1 ]
|
|
menuitemslider "Fly speeds multiplier: " 1 5 "$flyspeed" 1 [] [ flyspeed $arg1 ]
|
|
menuitemcheckbox "Enable auto save map: " "$autosavemap" [ autosavemap = $arg1 ]
|
|
menuitemslider "Time between auto saves (in minutes): " 2 60 "(div $timeBetAutoSaves 60000)" 1 [] [ timeBetAutoSaves = (* $arg1 60000) ]
|
|
menuitemtextinput "Make a map backup (.BAK) every: " "$numAutoSaveBackups" [ numAutoSaveBackups = $arg1 ] [ if (! $showedBAKinfo) [ echo This setting effects the number of autosavemaps between making a map backup file. "(.BAK)"; showedBAKinfo = 1 ] ] 4
|
|
|
|
// deleted entities
|
|
newmenu "deleted entities"
|
|
menuinit __rebuilddeletedentitymenu
|
|
|
|
tempalias __rebuilddeletedentitymenu [
|
|
delmenu "deleted entities"
|
|
newmenu "deleted entities"
|
|
if (unlistdeletedentity) [
|
|
push i 0
|
|
looplist (getdeletedentities) [type x y z a1 a2 a3 a4 a5 a6 a7] [
|
|
push desc (concat $type (concatword "[" $x "|" $y "|" $z "]") (concatword "(" $a1 ", " $a2 ", " $a3 ", " $a4 ", " $a5 ", " $a6 ", " $a7 ")"))
|
|
if (strcmp $type mapmodel) [desc = (concat $desc (mapmodelslotname $a2))]
|
|
if (&& $editing (strcmp $type sound)) [desc = (concat $desc (at (editmapsoundslot $a1) 0))]
|
|
if $editing [
|
|
menuitem (pop desc) (concat gotoposition $x $y $z $a1 0 ";" undelent $i)
|
|
][
|
|
menuitem (pop desc) -1
|
|
]
|
|
+= i 1
|
|
]
|
|
pop i
|
|
menuitem "\f3clear this list" "unlistdeletedentity all"
|
|
] [
|
|
menuitem "no deleted entities" -1
|
|
]
|
|
]
|
|
|
|
//Mapmodels
|
|
newmenu Mapmodels
|
|
menuinit __rebuildmapmodelmenus
|
|
|
|
tempalias __mapmodelcategories [
|
|
platforms "Platforms"
|
|
ladders "Ladders+Stairs"
|
|
stairs "Ladders+Stairs"
|
|
fencing "Fencing"
|
|
plants "Plants"
|
|
lamps "Lights+Lamps"
|
|
street "Street"
|
|
pipes "Pipes"
|
|
office "Office"
|
|
computers "Computers"
|
|
home "Home"
|
|
industrial "Industrial"
|
|
military "Military"
|
|
signs "Signs"
|
|
litter "Other/Litter"
|
|
misc "Other/Misc"
|
|
unsoo "Unsorted/Official"
|
|
unsoa "Unsorted/Akimbo"
|
|
unsom "Unsorted/Map-Config"
|
|
unsorted "Unsorted/Custom"
|
|
]
|
|
|
|
looplist $__mapmodelcategories [key menu] [tempalias (concatword __mm_key_ $key) $menu]
|
|
|
|
tempalias __mm_unassigned [echo (yellow) sry: mapmodel (addpunct $arg1) has no slot assigned. Please edit your map config file.]
|
|
tempalias __mm_showmodel [concat alias __lastwatchedmapmodel $arg2 ";" chmenumdl (escape $arg1) (concatword mapmodels/ $arg2) all 40 3]
|
|
|
|
tempalias __rebuildmapmodelmenus [
|
|
if $mapmodelchanged [
|
|
push __mm_menus "" // menus with content
|
|
push __mm_done "" // done map config slots
|
|
push idxs ""
|
|
push mpath ""
|
|
looplist $__mapmodelcategories [key menu] [delmenu $menu]
|
|
looplist (listallmapmodelattributes explodekeywords sortby: keywords sortby: desc usage defaults distribution) [path keyword desc usage dflts dist] [
|
|
mpath = (concatword "mapmodels/" $path)
|
|
dflts = (concat $dflts "0 0 0 0")
|
|
dflts = (concat (at $dflts 0) (at $dflts 1) (at $dflts 2) (at $dflts 3)) // fix missing/incomplete default slot parameters
|
|
idxs = (mapmodelslotbyname $mpath)
|
|
if (|| (! (strlen $keyword)) (< (findlist $__mapmodelcategories $keyword) 0)) [
|
|
keyword = unsorted
|
|
if (strcmp $dist "official") [ keyword = unsoo ] // unless someone writes the missing config files ;)
|
|
if (strcmp $dist "autodownload") [ keyword = unsoa ] // a.k.a "akimbo"
|
|
if (listlen $idxs) [ keyword = unsom ] // has slot in current map config
|
|
]
|
|
keyword = (concatword __mm_key_ $keyword)
|
|
newmenu $$keyword
|
|
menurenderoffset -40 0
|
|
concatuniq __mm_menus $$keyword
|
|
if (strlen $desc) [] [desc = $mpath]
|
|
if (listlen $idxs) [
|
|
__mm_done = (concat $__mm_done $idxs)
|
|
if (> (listlen $idxs) 1) [
|
|
looplist $idxs i [menuitem (concat $desc (concatword "#" $i)) (concat newent mapmodel $i) (__mm_showmodel $$keyword $path) $usage] // several slots for the same mapmodel
|
|
][
|
|
menuitem $desc (concat newent mapmodel $idxs) (__mm_showmodel $$keyword $path) $usage // usual case: one slot per model
|
|
]
|
|
][
|
|
menuitem (concatword "\f4" $desc) (concat newent mapmodel "(mapmodel" $dflts $path ")") (__mm_showmodel $$keyword $path) $usage // mapmodel has no slot assigned: assign one
|
|
]
|
|
]
|
|
delmenu Mapmodels
|
|
newmenu Mapmodels
|
|
push __mm_sorted ""
|
|
looplist $__mapmodelcategories [key menu] [if (>= (findlist $__mm_menus $menu) 0) [concatuniq __mm_sorted $menu]] // create list of non-empty menus in order of list above
|
|
looplist $__mm_sorted m [menuitem $m (concat showmenu $m)] // only create non-empty menus
|
|
delmenu [Delete unused mapmodel slot]
|
|
delmenu [Edit mapmodel slots]
|
|
if $editing [
|
|
newmenu [Delete unused mapmodel slot]
|
|
loop i 256 [
|
|
mpath = (mapmodelslotname $i)
|
|
if (strlen $mpath) [
|
|
if (strcmp "" (mapmodelslotusage $i)) [
|
|
menuitem (concatword "delete slot #" $i ": " (editmapmodelslot $i)) (concat deletemapmodelslot $i) (__mm_showmodel [Delete unused mapmodel slot] $mpath)
|
|
]
|
|
]
|
|
]
|
|
newmenu [Edit mapmodel slots]
|
|
loop i 256 [
|
|
mpath = (mapmodelslotname $i)
|
|
if (strlen $mpath) [
|
|
menuitem (concatword "edit slot #" $i ": " (editmapmodelslot $i)) (concat alias __mmslot $i ";" showmenu (escape "Edit mapmodel slot"))
|
|
]
|
|
]
|
|
mapmodelchanged 0
|
|
] [
|
|
newmenu [Delete unused mapmodel slot]
|
|
menuitem "menu only available in edit mode" -1
|
|
newmenu [Edit mapmodel slots]
|
|
menuitem "menu only available in edit mode" -1
|
|
]
|
|
pop menu __mm_menus __mm_sorted __mm_done __mm_unsorted idxs mpath
|
|
]
|
|
]
|
|
|
|
tempalias __rebuildtexturemenus [
|
|
if $rereadtexturelists [
|
|
delmenu "Official textures"
|
|
delmenu "Custom textures"
|
|
push fullname ""
|
|
looplist (gettexturelist "" "kurt skymaps map_editor" "") [tpath tname] [
|
|
fullname = (concatword $tpath "/" $tname)
|
|
if (strcmp official (gettextureorigin $fullname)) [
|
|
newmenu "Official textures"
|
|
] [
|
|
newmenu "Custom textures"
|
|
]
|
|
menuitem $fullname (concat _texmenu_exec (escape $fullname)) (concat _texmenu_hover (escape $fullname) (escape (curmenu)))
|
|
menurenderoffset -20 0
|
|
]
|
|
]
|
|
]
|
|
|
|
tempalias _texmenu_exec [
|
|
__lastwatchedtexture = $arg1
|
|
if $editing [ showmenu "Pick texture" ]
|
|
]
|
|
|
|
tempalias _texmenu_hover [
|
|
__lastwatchedtexture = $arg1
|
|
chmenutexture $arg2 $arg1
|
|
]
|
|
|
|
tempalias __mapsoundtitles [
|
|
cavedrip.ogg "Cave drip"
|
|
distant_cars.ogg "Cars driving in the distance"
|
|
hum01.ogg "Humm 1"
|
|
hum02.ogg "Humm 2"
|
|
night_crickets.ogg "Crickets at night"
|
|
water.ogg "Water 1"
|
|
wind.ogg "Wind"
|
|
t_aircond.ogg "Air conditioner"
|
|
t_compressor.ogg "Compressor"
|
|
t_crow.ogg "Crow"
|
|
t_dogs01.ogg "Dogs 1"
|
|
t_helicopter.ogg "Helicopter"
|
|
t_hum01.ogg "Humm 3"
|
|
t_hum02.ogg "Humm 4"
|
|
t_hum03.ogg "Humm 5"
|
|
t_hum04.ogg "Humm 6"
|
|
t_night_dog.ogg "Dogs 2"
|
|
t_night01.ogg "Night 1"
|
|
t_night02.ogg "Night 2"
|
|
t_radio_comms.ogg "Radio comms"
|
|
t_radio_static.ogg "Radio static"
|
|
t_satcoms.ogg "Sat-coms"
|
|
t_sludge.ogg "Sludge"
|
|
t_static01.ogg "Static 1"
|
|
t_static02.ogg "Static 2"
|
|
t_vent01.ogg "Vent 1"
|
|
t_vent02.ogg "Vent 2"
|
|
t_water_owl.ogg "Water owl"
|
|
t_water01.ogg "Water 2"
|
|
t_waterdrip.ogg "Water drip"
|
|
t_wind.ogg "Wind 2"
|
|
t_waterpipe01.ogg "Waterpipes 1"
|
|
t_waterpipe02.ogg "Waterpipes 2"
|
|
warningalarm01.ogg "Warning alarm"
|
|
t_gastank.ogg "Gastank"
|
|
t_keyboard.ogg "Keyboard"
|
|
t_factory01.ogg "Factory"
|
|
t_vents.ogg "Vent 3"
|
|
t_waterfront.ogg "Waterfront"
|
|
t_generator.ogg "Generator"
|
|
t_electricbuzz.ogg "Electric buzz"
|
|
t_alarm01.ogg "Alarm"
|
|
flies.ogg "Flies"
|
|
deserthawk.ogg "Desert hawk"
|
|
owl.ogg "Owl"
|
|
citynoisebirds.ogg "City birds"
|
|
]
|
|
|
|
tempalias __rebuildmapsoundmenus [
|
|
if $rereadsoundlists [
|
|
delmenu "Official mapsounds"
|
|
delmenu "Custom mapsounds"
|
|
looplist (getmapsoundlist) [sname] [
|
|
if (strcmp official (getmapsoundorigin $sname)) [
|
|
newmenu "Official mapsounds"
|
|
] [
|
|
newmenu "Custom mapsounds"
|
|
]
|
|
push idx (findlist $__mapsoundtitles $sname)
|
|
if (< $idx 0) [
|
|
menuitem $sname (concat _sndmenu_exec $sname)
|
|
] [
|
|
menuitem (concatword (at $__mapsoundtitles (+ $idx 1)) " (" $sname ")") (concat _sndmenu_exec $sname)
|
|
]
|
|
menurenderoffset -20 0
|
|
]
|
|
]
|
|
]
|
|
|
|
tempalias _sndmenu_exec [
|
|
__lastwatchedmapsound = $arg1
|
|
if $editing [ showmenu "Pick mapsound" ]
|
|
]
|
|
|
|
persistidents 1
|