diff --git a/config/menus_edit.cfg b/config/menus_edit.cfg index 3796a75c..89d9b855 100644 --- a/config/menus_edit.cfg +++ b/config/menus_edit.cfg @@ -112,8 +112,7 @@ menuitem "Fix heightfielding" [ solid 0; slope 0 0 ] newmenu skymaps menuinit [ - delmenu skymaps - newmenu skymaps + resetmenu if (&& $editing (! (getautomapconfig))) [ menuitem [Enable automapconfig to make changes permanent] [automapconfig ; closemenu (curmenu)] (concat loadsky (escape $loadsky)) menuitem "" -1 (concat loadsky (escape $loadsky)) @@ -189,8 +188,7 @@ menuinit __rebuildmapmodelmenus // Edit mapmodel slot newmenu [Edit mapmodel slot] menuinit [ - delmenu [Edit mapmodel slot] - newmenu [Edit mapmodel slot] + resetmenu if (strlen $__mmslot) [ push info (editmapmodelslot $__mmslot) menuheader "" (concatword "edit mapmodel slot #" $__mmslot ":\n" (mapmodelslotname $__mmslot)) @@ -232,8 +230,7 @@ tempalias __texslot "" // Edit texture slots newmenu [Edit texture slots] menuinit [ - delmenu (curmenu) - newmenu (curmenu) + resetmenu menurenderoffset -20 0 if $editing [ push ecurmenu (escape (curmenu)) @@ -256,8 +253,7 @@ menuinit [ // Edit texture slot newmenu [Edit texture slot] menuinit [ - delmenu (curmenu) - newmenu (curmenu) + resetmenu if (strlen $__texslot) [ push info (edittextureslot $__texslot) // " " chmenutexture (curmenu) (at $info 1) @@ -305,8 +301,7 @@ tempalias __tex_togo "" newmenu "Texture slot merge" menuinit [ - delmenu (curmenu) - newmenu (curmenu) + resetmenu if (strlen $__texslot) [ push info (edittextureslot $__texslot) // " " chmenutexture (curmenu) (at $info 1) @@ -348,8 +343,7 @@ menuinit __rebuildtexturemenus newmenu "Pick texture" menuinit [ - delmenu (curmenu) - newmenu (curmenu) + resetmenu if (strlen $__lastwatchedtexture) [ chmenutexture (curmenu) $__lastwatchedtexture push usedslots (textureslotbyname $__lastwatchedtexture) @@ -395,8 +389,7 @@ tempalias __sndslot "" newmenu "Pick mapsound" menuinit [ - delmenu (curmenu) - newmenu (curmenu) + resetmenu if (strlen $__lastwatchedmapsound) [ push usedslots (mapsoundslotbyname $__lastwatchedmapsound) menuitem (concat "Mapsound:" $__lastwatchedmapsound) -1 @@ -424,8 +417,7 @@ menuinit [ // Edit mapsound slots newmenu [Edit mapsound slots] menuinit [ - delmenu (curmenu) - newmenu (curmenu) + resetmenu if $editing [ push info "" loop i 256 [ @@ -446,8 +438,7 @@ tempalias __snd_vol "255" newmenu [Edit mapsound slot] menuinit [ - delmenu (curmenu) - newmenu (curmenu) + resetmenu if (strlen $__sndslot) [ push info (editmapsoundslot $__sndslot) // " " menuheader "" (concatword "edit mapsound slot #" $__sndslot ":\n" (at $info 0)) @@ -509,11 +500,8 @@ menuitemtextinput "Make a map backup (.BAK) every: " "$numAutoSaveBackups" [ num // deleted entities newmenu "deleted entities" -menuinit __rebuilddeletedentitymenu - -tempalias __rebuilddeletedentitymenu [ - delmenu "deleted entities" - newmenu "deleted entities" +menuinit [ + resetmenu if (unlistdeletedentity) [ push i 0 looplist (getdeletedentities) [type x y z a1 a2 a3 a4 a5 a6 a7] [ diff --git a/config/menus_settings.cfg b/config/menus_settings.cfg index abdd4d4c..92af741c 100644 --- a/config/menus_settings.cfg +++ b/config/menus_settings.cfg @@ -706,7 +706,7 @@ tempalias __pckserv "" newmenu "Autodownload config" menuinit [ - delmenu (curmenu) ; newmenu (curmenu) + resetmenu push serverlist (getpckserver) push words (listlen $serverlist) if (! $words) [ @@ -734,7 +734,7 @@ menuinit [ newmenu "Configure package server" menuinit [ - delmenu (curmenu) ; newmenu (curmenu) + resetmenu if (!= (listlen $__pcksrv) 4) [ menuitem "----- no server selected ------" -1 ] [ @@ -760,7 +760,7 @@ tempalias __zip "" newmenu "Mod package" menuinit [ - delmenu (curmenu) ; newmenu (curmenu) + resetmenu menurenderoffset -20 0 push ecurmenu (escape (curmenu)) push activezips (zipmodlist active) @@ -787,7 +787,7 @@ menuinit [ newmenu "Configure mod package" menuinit [ - delmenu (curmenu) ; newmenu (curmenu) + resetmenu menurenderoffset -20 0 push ecurmenu (escape (curmenu)) push activezips (zipmodlist active) @@ -813,7 +813,7 @@ menuinit [ newmenu "Show files in package" menuinit [ - delmenu (curmenu) ; newmenu (curmenu) + resetmenu if (strlen $__zip) [ menuitem (concat "Files in package\f9" $__zip) -1 menuitem "" -1 diff --git a/config/scripts.cfg b/config/scripts.cfg index 0634a9dc..f800a9db 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -64,6 +64,7 @@ const editmapmsg [ editsvar mapmsg ] const return [ result $arg1 ] const run [ exec (concatword config/ $arg1 .cfg) ] const closecurmenu [ closemenu (curmenu) ] +const resetmenu [ delmenu (curmenu) ; newmenu (curmenu) ] // Auto-completions const mapcomplete [complete $arg1 "packages/maps/official packages/maps" cgz]