Files
assaultcube-/config/menus_edit.cfg
T
ac-stef 95680b699c add undelete for entities
BACKSPACE in combination with editmeta (LCTRL) now undeletes the last
deleted entity. BACKSPACE in combination with editmeta2 (LSHIFT) brings
up the menu "deleted entities".

The edit menu now has a submenu "deleted entities" which lists all
deleted entities and undeletes the selected one.

undelent [<index>]
  If no index is specified, the last deleted entity is restored. If an
  index is given, the specified entity from the list of deleted entities
  is restored.

getdeletedentities
  Returns a list of deleted entities. Each line contains the entity type,
  the position and all seven attributes.

unlistdeletedentity [<which>]
  If <which> is a number, the specified entry from the list of deleted
  entities gets removed. If <which> is "all", the whole list of deleted
  entities gets deleted. If <which> is "last" the last deleted entity is
  removed from the list of deleted entities.
  Returns the number of entities on the list of deleted entities (even if
  the parameter <which> was unknown or not specified).

DOCREF undelent getdeletedentities unlistdeletedentity
2015-05-27 15:47:05 +02:00

415 lines
22 KiB
INI

persistidents 0
newmenu editing
menuitem (_ [Mapmodels...]) [ showmenu Mapmodels ]
menuitem (_ [Lighting...]) [ showmenu Lighting ]
menuitem (_ [Entities...]) [ showmenu Entities ]
menuitem (_ [Pickups...]) [ showmenu Pickups ]
menuitem (_ [Test a skymap...]) [ 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 (yellow) (_ [Please 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 (red)Error: (yellow) $arg1 (white)is 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 (concatword (c 2) [ ] "[ OK ]" [ ]) [ 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 (concatword (c 2) [ ] "[ 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... ]
_clip00 = clip; _clip00status = 0; _clip01 = 0; _clip02 = 1; _clip03 = 1; _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 (X): ") 0 50 "$_clip02" 1 [] [ _clip02 = $arg1 ]
menuitemslider (_ "Width of clip (Y): ") 0 50 "$_clip03" 1 [] [ _clip03 = $arg1 ]
menuitemslider (_ "Height of clip (Z): ") 0 50 "$_clip04" 1 [] [ _clip04 = $arg1 ]
menuitem [] -1
menuitem (concatword (c 2) [ ] "[ 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 [ echo Please read: (red)/docs/mapediting5.html to find out how to PERMANENTLY add a custom skymap to your map... ]
menuitem (_ [At sea skymap]) [ loadsky "kothic/atsea" ]
menuitem (_ [Canyons1 skymap]) [ loadsky "ladynighthawk/inhcanyons1" ]
menuitem (_ [Graveyard skymap]) [ loadsky "socksky/grave" ]
menuitem (_ [Ice Station skymap]) [ loadsky "iceflow/iceflow" ]
menuitem (_ [Mountain skymap]) [ loadsky "makke/mountain" ]
menuitem (_ [Nightball skymap]) [ loadsky "socksky/nightball" ]
menuitem (_ [Powerlines skymap]) [ loadsky "humus/powerlines" ]
menuitem (_ [Rocky skymap]) [ loadsky "makke/rocky" ]
menuitem (_ [Sand skymap]) [ loadsky "makke/sand" ]
menuitem (_ [Steini2 skymap]) [ loadsky "steini/steini2" ]
menuitem (_ [Steini3 skymap]) [ loadsky "steini/steini3" ]
menuitem (_ [Steini4 skymap]) [ loadsky "steini/steini4" ]
_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]) [ showmenu [Edit map message] ]
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 [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) [
menuheader "" (concatword "edit mapmodel slot #" $__mmslot ":\n" (mapmodelslotname $__mmslot))
menuitemtextinput "Clipping radius" (at (editmapmodelslot $__mmslot) 0) [editmapmodelslot $__mmslot $arg1]
menuitemtextinput "Clipping height " (at (editmapmodelslot $__mmslot) 1) [editmapmodelslot $__mmslot "" $arg1]
menuitemtextinput "z-Offset " (at (editmapmodelslot $__mmslot) 2) [editmapmodelslot $__mmslot "" "" $arg1]
menuitem "" -1
menuitemtextinput "Mapmodel path " (concat result (at (editmapmodelslot $__mmslot) 4)) [editmapmodelslot $__mmslot "" "" "" "" $arg1] "" 250
if (&& (strlen $__lastwatchedmapmodel) (! (strcmp $__lastwatchedmapmodel (editmapmodelslot $__mmslot) 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)
]
][
menuitem "no slot selected" -1
]
]
// Delete unused mapmodel slot
newmenu [Delete unused mapmodel slot]
menuinit __rebuildmapmodelmenus
// "closestenttype" slider...
_closestentslider = [ closestenttype (at ["" light playerstart pistol ammobox grenades health armour akimbo mapmodel ladder ctf-flag sound clip helmet plclip] $arg1); _closestenttypestatus = $arg1 ]
// FIXME: menu can be removed, if editmapmsg is used
newmenu [Edit map message]
menuinit [ menumapmsgtext = [] ]
menuitemtextinput (_ [Edit your map message: ]) "result $mapmsg" [ menumapmsgtext = $arg1 ] [] 256
menuitem (concatword (c 2) [ ] "[ OK ]") [ mapmsg $menumapmsgtext ]
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 (concatword (c 2) [ ] "[ OK ]") [ watercolour $redw $greenw $bluew ]
newmenu [Ambient sounds]
menuinit [ ambientsoundmenu = [] ]
menuitem (_ [Cave drip]) [ ambientsoundmenu = 0; showmenu "Ambient sound settings" ]
menuitem (_ [Cars driving in the distance]) [ ambientsoundmenu = 1; showmenu "Ambient sound settings" ]
menuitem (_ [Humm (01)]) [ ambientsoundmenu = 2; showmenu "Ambient sound settings" ]
menuitem (_ [Humm (02)]) [ ambientsoundmenu = 3; showmenu "Ambient sound settings" ]
menuitem (_ [Crickets at night]) [ ambientsoundmenu = 4; showmenu "Ambient sound settings" ]
menuitem (_ [Water (01)]) [ ambientsoundmenu = 5; showmenu "Ambient sound settings" ]
menuitem (_ Wind) [ ambientsoundmenu = 6; showmenu "Ambient sound settings" ]
menuitem (_ [Air conditioner]) [ ambientsoundmenu = 7; showmenu "Ambient sound settings" ]
menuitem (_ Compressor) [ ambientsoundmenu = 8; showmenu "Ambient sound settings" ]
menuitem (_ Crow) [ ambientsoundmenu = 9; showmenu "Ambient sound settings" ]
menuitem (_ [Dogs (01)]) [ ambientsoundmenu = 10; showmenu "Ambient sound settings" ]
menuitem (_ Helicopter) [ ambientsoundmenu = 11; showmenu "Ambient sound settings" ]
menuitem (_ [Humm (03)]) [ ambientsoundmenu = 12; showmenu "Ambient sound settings" ]
menuitem (_ [Humm (04)]) [ ambientsoundmenu = 13; showmenu "Ambient sound settings" ]
menuitem (_ [Humm (05)]) [ ambientsoundmenu = 14; showmenu "Ambient sound settings" ]
menuitem (_ [Humm (06)]) [ ambientsoundmenu = 15; showmenu "Ambient sound settings" ]
menuitem (_ [Dogs (02)]) [ ambientsoundmenu = 16; showmenu "Ambient sound settings" ]
menuitem (_ [Night (01)]) [ ambientsoundmenu = 17; showmenu "Ambient sound settings" ]
menuitem (_ [Night (02)]) [ ambientsoundmenu = 18; showmenu "Ambient sound settings" ]
menuitem (_ [Radio comms]) [ ambientsoundmenu = 19; showmenu "Ambient sound settings" ]
menuitem (_ [Radio static]) [ ambientsoundmenu = 20; showmenu "Ambient sound settings" ]
menuitem (_ [Sat-coms]) [ ambientsoundmenu = 21; showmenu "Ambient sound settings" ]
menuitem (_ [Sludge]) [ ambientsoundmenu = 22; showmenu "Ambient sound settings" ]
menuitem (_ [Static (01)]) [ ambientsoundmenu = 23; showmenu "Ambient sound settings" ]
menuitem (_ [Static (02)]) [ ambientsoundmenu = 24; showmenu "Ambient sound settings" ]
menuitem (_ [Vent (01)]) [ ambientsoundmenu = 25; showmenu "Ambient sound settings" ]
menuitem (_ [Vent (02)]) [ ambientsoundmenu = 26; showmenu "Ambient sound settings" ]
menuitem (_ [Water owl]) [ ambientsoundmenu = 27; showmenu "Ambient sound settings" ]
menuitem (_ [Water (02)]) [ ambientsoundmenu = 28; showmenu "Ambient sound settings" ]
menuitem (_ [Water drip]) [ ambientsoundmenu = 29; showmenu "Ambient sound settings" ]
menuitem (_ [Wind (02)]) [ ambientsoundmenu = 30; showmenu "Ambient sound settings" ]
menuitem (_ [Waterpipes (01)]) [ ambientsoundmenu = 31; showmenu "Ambient sound settings" ]
menuitem (_ [Waterpipes (02)]) [ ambientsoundmenu = 32; showmenu "Ambient sound settings" ]
menuitem (_ [Warning alarm]) [ ambientsoundmenu = 33; showmenu "Ambient sound settings" ]
menuitem (_ Gastank) [ ambientsoundmenu = 34; showmenu "Ambient sound settings" ]
menuitem (_ Keyboard) [ ambientsoundmenu = 35; showmenu "Ambient sound settings" ]
menuitem (_ Factory) [ ambientsoundmenu = 36; showmenu "Ambient sound settings" ]
menuitem (_ [Vent (03)]) [ ambientsoundmenu = 37; showmenu "Ambient sound settings" ]
menuitem (_ Waterfront) [ ambientsoundmenu = 38; showmenu "Ambient sound settings" ]
menuitem (_ Generator) [ ambientsoundmenu = 39; showmenu "Ambient sound settings" ]
menuitem (_ [Electric buzz]) [ ambientsoundmenu = 40; showmenu "Ambient sound settings" ]
menuitem (_ Alarm) [ ambientsoundmenu = 41; showmenu "Ambient sound settings" ]
menuitem (_ Flies) [ ambientsoundmenu = 42; showmenu "Ambient sound settings" ]
menuitem (_ [Desert hawk]) [ ambientsoundmenu = 43; showmenu "Ambient sound settings" ]
menuitem (_ Owl) [ ambientsoundmenu = 44; showmenu "Ambient sound settings" ]
menuitem (_ [City birds]) [ ambientsoundmenu = 45; showmenu "Ambient sound settings" ]
soundrad = 1; soundsize = 0; ambientsoundvol = 255
newmenu [Ambient sound settings]
menuinit [ soundrad = 1; soundsize = 0; ambientsoundvol = 255 ]
menuitemslider (_ [Sound radius: ]) 1 25 "$soundrad" 1 [] [ soundrad = $arg1 ]
menuitemslider (_ [Sound size: ]) 0 25 "$soundsize" 1 [] [ soundsize = $arg1 ]
menuitemslider (_ [Sound volume: ]) 1 255 "$ambientsoundvol" 5 [] [ ambientsoundvol = $arg1 ]
menuitem (concatword (c 2) [ ] "[ OK ]") [ newent sound $ambientsoundmenu $soundrad $soundsize $ambientsoundvol ]
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 (getmapmodelattributes 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
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
if $editing [
delmenu [Delete unused mapmodel slot]
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)
]
]
]
delmenu [Edit mapmodel slots]
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
]
pop menu __mm_menus __mm_sorted __mm_done __mm_unsorted idxs mpath
]
]
persistidents 1