menus_edit.cfg 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532
  1. //// Main > Editing ////
  2. newmenu editing
  3. menuinit [ if (! $editing) [menuheader "" "\f3You are not in edit mode"] [menuheader] ]
  4. menuitem "Mapmodels\i\3" [ showmenu Mapmodels ]
  5. menuitem "Lighting\i\3" [ showmenu Lighting ]
  6. menuitem "Entities\i\3" [ showmenu Entities ]
  7. menuitem "Pickups\i\3" [ showmenu Pickups ]
  8. menuitem "Textures\i\3" [ showmenu Textures ]
  9. menuitem "Skymaps\i\3" [ showmenu Skymaps ]
  10. menuitem "Ambient sounds\i\3" [ showmenu [Ambient sounds] ]
  11. menuitem "Arches, slopes and stairs\i\3" [ showmenu Arches ]
  12. menuitem "Map operations\i\3" [ showmenu [Map operations] ]
  13. menuitem "Map settings\i\3" [ showmenu [Map settings] ]
  14. menuitem "Map config operations\i\3" [ showmenu [Map config operations] ]
  15. menuitem "Map checks and statistics\i\3" [ showmenu [Map checks and statistics] ]
  16. menuitem "Bots\i\3" [ showmenu [Creating bot waypoints] ]
  17. menuitem "Settings\i\3" [ showmenu [Editing settings] ]
  18. menuitem "Misc\i\3" [ showmenu [Editing misc] ]
  19. menuitem "Keys\i\3" [ showmenu [Editing keys] ]
  20. menuitem "Deleted entities" [ showmenu "Deleted entities" ]
  21. menuitem "Help?" [ echo "\f2Please read the AssaultCube README which has a detailed guide on mapediting..." ]
  22. //// Main > Editing > Mapmodels ////
  23. newmenu Mapmodels
  24. menuinit __rebuildmapmodelmenus
  25. tempalias __mapmodelcategories [
  26. platforms "Platforms"
  27. ladders "Ladders+Stairs"
  28. stairs "Ladders+Stairs"
  29. fencing "Fencing"
  30. plants "Plants"
  31. lamps "Lights+Lamps"
  32. street "Street"
  33. pipes "Pipes"
  34. office "Office"
  35. computers "Computers"
  36. home "Home"
  37. industrial "Industrial"
  38. military "Military"
  39. signs "Signs"
  40. litter "Other/Litter"
  41. misc "Other/Misc"
  42. unsoo "Unsorted/Official"
  43. unsoa "Unsorted/Akimbo"
  44. unsom "Unsorted/Map-Config"
  45. unsorted "Unsorted/Custom"
  46. ]
  47. looplist $__mapmodelcategories [key menu] [tempalias (concatword __mm_key_ $key) $menu]
  48. tempalias __menuitem_offlineeditonly [ menuitem "menu only available in offline edit mode" -1 ]
  49. tempalias __mm_showmodel [concat alias __lastwatchedmapmodel $arg2 ";" menumdl (escape $arg1) (concatword mapmodels/ $arg2) all 40 3]
  50. tempalias __mm_showmodel2 [concat menumdl (escape $arg1) (concatword mapmodels/ $arg2) all 40 3]
  51. tempalias __mm_tempmenus ""
  52. tempalias __rebuildmapmodelmenus [
  53. if $mapmodelchanged [
  54. push __mm_menus "" // menus with content
  55. push __mm_done "" // done map config slots
  56. push idxs ""
  57. push mpath ""
  58. looplist $__mapmodelcategories [key menu] [delmenu $menu]
  59. looplist (listallmapmodelattributes explodekeywords sortby: keywords sortby: desc usage defaults distribution) [path keyword desc usage dflts dist] [
  60. mpath = (concatword "mapmodels/" $path)
  61. dflts = (concat $dflts "0 0 0 0")
  62. dflts = (concat (at $dflts 0) (at $dflts 1) (at $dflts 2) (at $dflts 3)) // fix missing/incomplete default slot parameters
  63. idxs = (mapmodelslotbyname $mpath)
  64. if (|| (! (strlen $keyword)) (< (findlist $__mapmodelcategories $keyword) 0)) [
  65. keyword = unsorted
  66. if (strcmp $dist "official") [ keyword = unsoo ] // unless someone writes the missing config files ;)
  67. if (strcmp $dist "autodownload") [ keyword = unsoa ] // a.k.a "akimbo"
  68. if (strcmp $dist "akimbo") [ keyword = unsoa ]
  69. if (listlen $idxs) [ keyword = unsom ] // has slot in current map config
  70. ]
  71. keyword = (concatword __mm_key_ $keyword)
  72. newmenu $$keyword
  73. menurenderoffset -40 0
  74. concatuniq __mm_menus $$keyword
  75. if (strlen $desc) [] [desc = $mpath]
  76. if (listlen $idxs) [
  77. __mm_done = (concat $__mm_done $idxs)
  78. if (> (listlen $idxs) 1) [
  79. looplist $idxs i [menuitem (concat $desc (concatword "#" $i)) (concat newent mapmodel $i) (__mm_showmodel $$keyword $path) $usage] // several slots for the same mapmodel
  80. ][
  81. menuitem $desc (concat newent mapmodel $idxs) (__mm_showmodel $$keyword $path) $usage // usual case: one slot per model
  82. ]
  83. ][
  84. menuitem (concatword "\f4" $desc) (concat newent mapmodel "(mapmodel" $dflts $path ") ; __enableautomapconfig") (__mm_showmodel $$keyword $path) $usage // mapmodel has no slot assigned: assign one
  85. ]
  86. ]
  87. // add menus sorted by author and distribution
  88. push amenu ""
  89. push distmenus ""
  90. looplist $__mm_tempmenus menu [delmenu $menu]
  91. __mm_tempmenus = ""
  92. looplist (listallmapmodelattributes sortby: author desc usage defaults distribution) [path author desc usage dflts dist] [
  93. mpath = (concatword "mapmodels/" $path)
  94. dflts = (concat $dflts "0 0 0 0")
  95. dflts = (concat (at $dflts 0) (at $dflts 1) (at $dflts 2) (at $dflts 3)) // fix missing/incomplete default slot parameters
  96. if (strlen $author) [] [author = "*unknown*"]
  97. idxs = (mapmodelslotbyname $mpath)
  98. amenu = (concat "Map models by" $author)
  99. newmenu $amenu // menu sorted by author
  100. concatuniq __mm_tempmenus $amenu
  101. menurenderoffset -40 0
  102. if (listlen $idxs) [
  103. if (> (listlen $idxs) 1) [
  104. looplist $idxs i [menuitem (concat $path (concatword "#" $i)) (concat newent mapmodel $i) (__mm_showmodel $amenu $path) $desc] // several slots for the same mapmodel
  105. ][
  106. menuitem $path (concat newent mapmodel $idxs) (__mm_showmodel $amenu $path) $desc // usual case: one slot per model
  107. ]
  108. ][
  109. menuitem (concatword "\f4" $path) (concat newent mapmodel "(mapmodel" $dflts $path ")") (__mm_showmodel $amenu $path) $desc // mapmodel has no slot assigned: assign one
  110. ]
  111. if (strlen $dist) [] [dist = "*unknown*"]
  112. amenu = (concat "Map models of origin:" $dist)
  113. newmenu $amenu // menu sorted by distribution
  114. concatuniq distmenus $amenu
  115. menurenderoffset -40 0
  116. if (listlen $idxs) [
  117. if (> (listlen $idxs) 1) [
  118. looplist $idxs i [menuitem (concat $path (concatword "#" $i)) (concat newent mapmodel $i) (__mm_showmodel $amenu $path) $desc] // several slots for the same mapmodel
  119. ][
  120. menuitem $path (concat newent mapmodel $idxs) (__mm_showmodel $amenu $path) $desc // usual case: one slot per model
  121. ]
  122. ][
  123. menuitem (concatword "\f4" $path) (concat newent mapmodel "(mapmodel" $dflts $path ")") (__mm_showmodel $amenu $path) $desc // mapmodel has no slot assigned: assign one
  124. ]
  125. ]
  126. amenu = "Browse all map models"
  127. delmenu $amenu
  128. newmenu $amenu
  129. looplist $__mm_tempmenus m [menuitem $m (concat showmenu (escape $m))]
  130. menuitem "" -1
  131. looplist $distmenus m [menuitem $m (concat showmenu (escape $m))]
  132. __mm_tempmenus = (concat $__mm_tempmenus $distmenus)
  133. delmenu Mapmodels
  134. newmenu Mapmodels
  135. push __mm_sorted ""
  136. 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
  137. looplist $__mm_sorted m [menuitem $m (concat showmenu $m)] // only create non-empty menus
  138. if (strlen $__mm_tempmenus) [menuitem "" -1 ; menuitem $amenu (concat showmenu (escape $amenu))]
  139. delmenu [Delete unused mapmodel slot]
  140. delmenu [Edit mapmodel slots]
  141. if $editing_sp [
  142. newmenu [Delete unused mapmodel slot]
  143. menurenderoffset -40 0
  144. loop i 256 [
  145. mpath = (mapmodelslotname $i)
  146. if (strlen $mpath) [
  147. if (strcmp "" (mapmodelslotusage $i)) [
  148. menuitem (concatword "delete slot #" $i ": " (editmapmodelslot $i)) (concat deletemapmodelslot $i) (__mm_showmodel [Delete unused mapmodel slot] $mpath)
  149. ]
  150. ]
  151. ]
  152. newmenu [Edit mapmodel slots]
  153. menurenderoffset -40 0
  154. push origin ""
  155. loop i 256 [
  156. mpath = (mapmodelslotname $i)
  157. if (strlen $mpath) [
  158. if $__showorigin [
  159. origin = (getmapmodelattributes $mpath distribution)
  160. if (! (strlen $origin)) [ origin = "custom/unsorted" ]
  161. origin = (__colororigin $origin)
  162. ]
  163. menuitem (concatword "edit slot #" $i ": " (editmapmodelslot $i) $origin) (concat alias __mmslot $i ";" showmenu (escape "Edit mapmodel slot")) (__mm_showmodel2 [Edit mapmodel slots] $mpath)
  164. ] [
  165. if (strlen (mapmodelslotusage $i)) [
  166. menuitem (concatword "unassigned slot #" $i) (concat alias __mmslot $i ";" showmenu (escape "Edit mapmodel slot")) [menumdl [Edit mapmodel slots] ""]
  167. ]
  168. ]
  169. ]
  170. pop origin
  171. mapmodelchanged 0
  172. ] [
  173. newmenu [Delete unused mapmodel slot]
  174. __menuitem_offlineeditonly // "menu only available in offline edit mode"
  175. newmenu [Edit mapmodel slots]
  176. __menuitem_offlineeditonly // "menu only available in offline edit mode"
  177. ]
  178. pop __mm_menus __mm_sorted __mm_done idxs mpath amenu distmenus
  179. ]
  180. ]
  181. //// Main > Editing > Lighting ////
  182. newmenu Lighting
  183. menuitem "Add white lights " [ showmenu [White light] ]
  184. menuitem "Add coloured lights " [ showmenu [Coloured light] ]
  185. menuitem "" -1
  186. menuitemcheckbox "Enable fullbright: " "$fullbright" [ fullbright $arg1 ]
  187. //// Main > Editing > Lighting > White light ////
  188. newmenu [White light]
  189. __wlight = 1; __wlight1 = 1
  190. menuitemslider "Light radius: " 1 32 "$__wlight" 1 [ __wlight = $arg1 ] 1
  191. menuitemslider "Brightness: " 1 255 "$__wlight1" 5 [ __wlight1 = $arg1 ] 1
  192. menuitem "" -1
  193. menuitem "\f2\t [ OK ]\t\t" [ newent light $__wlight $__wlight1 ]
  194. //// Main > Editing > Lighting > Coloured light ////
  195. newmenu [Coloured light]
  196. __clight = 1; __clight1 = 1; __clight2 = 1; __clight3 = 1
  197. menuitemslider "Light radius: " 1 32 "$__clight" 1 [ __clight = $arg1 ] 1
  198. menuitem "" -1
  199. menuitemslider "Red light: " 1 255 "$__clight1" 5 [ __clight1 = $arg1 ] 1
  200. menuitemslider "Green light: " 1 255 "$__clight2" 5 [ __clight2 = $arg1 ] 1
  201. menuitemslider "Blue light: " 1 255 "$__clight3" 5 [ __clight3 = $arg1 ] 1
  202. menuitem "" -1
  203. menuitem "\f2\t\t [ OK ]" [ newent light $__clight $__clight1 $__clight2 $__clight3 ]
  204. //// Main > Editing > Entities ////
  205. newmenu Entities
  206. menuinit [
  207. resetcurmenu
  208. if $editing [
  209. menuitem "Place Entities" [ showmenu "Place Entities" ]
  210. menuitem "Entity Configuration" [ showmenu "Entity Configuration" ]
  211. menuitem "Show list of TODO entities\i\3" [ showmenu "TODO entities" ]
  212. menuitem "Show list of deleted entities\i\3" [ showmenu "Deleted entities" ]
  213. ][
  214. menuitem "menu only available in edit mode" -1
  215. ]
  216. ]
  217. tempalias __resetpickedents [ delmenu [Paste entity]; newmenu [Paste entity]; menuitem "\f7[Clear the list of copied entities from this menu]" __resetpickedents ; menuitem "" -1 ]
  218. __resetpickedents
  219. //// Main > Editing > Entities > Place Entities ////
  220. newmenu [Place Entities]
  221. menuinit [
  222. resetcurmenu
  223. if $editing [
  224. menuitem "Place RVSF spawn point" [ newent playerstart 1 ]
  225. menuitem "Place CLA spawn point" [ newent playerstart 0 ]
  226. menuitem "Place FFA spawn point" [ newent playerstart 100 ]
  227. menuitemcheckbox "Show all spawn points: " "$showplayerstarts" [ showplayerstarts $arg1 ]
  228. menuitem "" -1
  229. menuitem "Place RVSF CTF Flag" [ newent ctf-flag 1 ]
  230. menuitem "Place CLA CTF Flag" [ newent ctf-flag 0 ]
  231. menuitem "" -1
  232. menuitem "Place ladder entity" "saycommand /newent ladder " [] "\f4The ladder entity lets players climb.\nPlease also place a ladder mapmodel.\n(found in the mapmodels menu)\i\3"
  233. menuitem "Place clip entity\i\3" [ showmenu Clips ]
  234. menuitem "" -1
  235. push n (format2 "%1 %5 %6 %7 %8 %9 %010 %011" (editentity (getclosestent)))
  236. push d (switch (findlist "mapmodel sound" (at $n 0)) [mapmodelslotname (at $n 2)] [at (editmapsoundslot (at $n 1)) 0])
  237. menuitem "Copy closest entity" copyent [] (format "\fs\f4current closest entity:\n\fr%1\f4\n%2" (pop n) (pop d))
  238. menuitem "Paste entity\i\3" [ showmenu [Paste entity] ]
  239. menuitem "Paste last copied entity" pasteent
  240. ][
  241. menuitem "menu only available in edit mode" -1
  242. ]
  243. ]
  244. //// Main > Editing > Entities > Entity Configuration ////
  245. tempalias __edset_durations [750 1000 1500 2000 2500 5000 7500 10000 15000 30000 60000 75000]
  246. tempalias __rebuild_esvt_slider_value [
  247. _LE_ESVT = 0
  248. loop presetidx (listlen $__edset_durations) [
  249. if (<= (at $__edset_durations $presetidx) $editingsettingsvisibletime) [
  250. _LE_ESVT = $presetidx;
  251. ]
  252. ]
  253. result $_LE_ESVT
  254. ]
  255. newmenu [Entity Configuration]
  256. menuinit [
  257. resetcurmenu
  258. if $editing [
  259. menuitem "Print entity stats" entstats
  260. menuitem "Cycle through multiple closest entities" nextclosestent
  261. menuitemslider "Select only entities of this type: " 0 -1 "(closestenttype -)" (concat all (listoptions ents)) [ if $arg1 [ closestenttype $arg1 ] [ closestenttype ] ] 1
  262. menuitemslider "GUI for hidemask setting: " 0 3 "$showeditingsettings" ["almost entirely off" "all off after duration" "text off after duration" "permanent"] [ showeditingsettings $arg1 ] 1
  263. menuitemslider "GUI for hidemask duration (presets): " 0 (- (listlen $__edset_durations) 1) "(__rebuild_esvt_slider_value)" 1 [ editingsettingsvisibletime (at $__edset_durations $arg1); echo "\f9will show \f1editinsettings\f9 for" (concatword "\f8" $editingsettingsvisibletime "\f9") "milliseconds"; ] 1
  264. menuitem "Hide entity sparklies\i\3" [ showmenu [Hide entity sparklies] ]
  265. ][
  266. menuitem "menu only available in edit mode" -1
  267. ]
  268. ]
  269. //// Main > Editing > Entities > Entity Configuration > Hide entity sparklies ////
  270. newmenu [Hide entity sparklies]
  271. looplisti (listoptions ents) e [
  272. menuitemcheckbox (concat Hide $e sparklies:) (concat "(&b $edithideentmask" (+ 0 (powf 2 $i)) ")") (concat "edithideentmask (^b $edithideentmask" (+ 0 (powf 2 $i)) ")")
  273. ]
  274. //// Main > Editing > Entities > Clips ////
  275. // attr5/clip05 always 0 // entscale: 10, 5, 5, 5, 1, 10, 1 but _clipscale maps factor 1 or 10 for human benefit
  276. newmenu Clips
  277. alias _clip01 0 ; alias _clip02 1 ; alias _clip03 1 ; alias _clip04 1 ; alias _clip05 0 ; alias _clip06 0 ; alias _clip07 0; alias _clipscale [10 10 10 10 1 10 1]
  278. menuinit [
  279. resetcurmenu
  280. menusynctabstops 1
  281. if (! $editing) [ menuheader "" "\f3not in edit mode" ]
  282. menuitem "\f4values marked \fX>\f4 are scaled \f5x\f410" -1
  283. menuitemslider "\fX> \f5Elevation \t\f4E\f5: " -500 500 "$_clip01" 1 [ _clip01 = $arg1 ]
  284. menuitemslider "\fX> \f5Length \t\f4X\f5: " 0 500 "$_clip02" 2 [ _clip02 = $arg1 ]
  285. menuitemslider "\fX> \f5Width \t\f4Y\f5: " 0 500 "$_clip03" 2 [ _clip03 = $arg1 ]
  286. menuitemslider "\fX> \f5Height \t\f4Z\f5: " 0 500 "$_clip04" 2 [ _clip04 = $arg1 ]
  287. menuitemslider "\fX> \f5Slope \t\f4S\f5: " -40 40 "$_clip06" 1 [ _clip06 = $arg1 ]
  288. menuitemslider "> Shape \t" 0 3 "$_clip07" "regular sloped-x sloped-y rotated" [ _clip07 = $arg1 ] 1
  289. menuitem "" -1
  290. menuitem "\f2\t [ Place clip entity ]" [ newent clip (divf $_clip01 10) (divf $_clip02 10) (divf $_clip03 10) (divf $_clip04 10) 0 (divf $_clip06 10) $_clip07 ]
  291. menuitem "\f2\t [ Place player clip entity ]" [ newent plclip (divf $_clip01 10) (divf $_clip02 10) (divf $_clip03 10) (divf $_clip04 10) 0 (divf $_clip06 10) $_clip07 ]
  292. if $editing [
  293. push x (editentity (getclosestent))
  294. if (|| (strcmp (at $x 0) clip) (strcmp (at $x 0) plclip)) [
  295. push n ""
  296. loop i 7 [ n = [ @n ; _clip0@(+ $i 1) = @(floor (*f (at $x (+ $i 4)) (at $_clipscale $i))) ] ]
  297. n = [ @n ; _clip05 = 0 ] // attr5 always 0
  298. menuitem "" -1
  299. menuitem (concat "Pick clip size from closest entity:" (at $x 4) (at $x 5) (at $x 6) (at $x 7) (at $x 9) (at $x 10)) [ @(pop n) ; refreshcurmenudelayed ]
  300. ]
  301. pop x
  302. ]
  303. ]
  304. //// Main > Editing > Entities > TODO entities ////
  305. newmenu "TODO entities"
  306. menuinit [
  307. resetcurmenu
  308. push h 1
  309. looplisti (enumtodoentities) [n desc] [
  310. if $editing [
  311. menuitem (concatword "Entity #" $n ": \fs\f4" (editentity $n) "\fr " $desc) (concat gotoentity $n "; echo" (escape $desc))
  312. ][
  313. menuitem (concatword "Entity #" $n ": " $desc) -1
  314. ]
  315. h = 0
  316. ]
  317. if (pop h) [
  318. menuitem "no TODO entities" -1
  319. ][
  320. menuitem "" -1
  321. menuitem "\f3Clear list of TODO entities" cleartodoentities
  322. ]
  323. ]
  324. //// Main > Editing > Pickups ////
  325. newmenu Pickups
  326. menuheader "" "\f4place pickup entities"
  327. menuitem "Health" [ newent health ]
  328. menuitem "Pistol Magazine" [ newent pistol ]
  329. menuitem "Box of Ammo" [ newent ammobox ]
  330. menuitem "Kevlar Vest" [ newent armour ]
  331. menuitem "Helmet" [ newent helmet ]
  332. menuitem "Akimbo" [ newent akimbo ]
  333. menuitem "Grenades" [ newent grenades ]
  334. //// Main > Editing > Textures ////
  335. newmenu Textures
  336. menuitem "Browse official textures" [ showmenu "Official textures" ]
  337. menuitem "Browse custom/downloaded textures" [ showmenu "Custom textures" ]
  338. menuitem "Edit texture slots of current map" [ showmenu "Edit texture slots" ]
  339. menuitem "Set notexture" [ showmenu "Set notexture" ]
  340. tempalias __lastwatchedtexture "" ; tempalias __texslot ""
  341. tempalias __rebuildtexturemenus [
  342. if $rereadtexturelists [
  343. delmenu "Official textures"
  344. delmenu "Custom textures"
  345. push fullname ""
  346. looplist (gettexturelist "" "kurt skymaps map_editor" "") [tpath tname] [
  347. fullname = (concatword $tpath "/" $tname)
  348. if (strcmp official (gettextureorigin $fullname)) [
  349. newmenu "Official textures"
  350. ] [
  351. newmenu "Custom textures"
  352. ]
  353. menuitem $fullname (concat _texmenu_exec (escape $fullname)) (concat _texmenu_hover (escape $fullname) (escape (curmenu)))
  354. menurenderoffset -20 0
  355. ]
  356. pop fullname
  357. ]
  358. ]
  359. tempalias _texmenu_exec [
  360. __lastwatchedtexture = $arg1
  361. if $editing [ showmenu "Pick texture" ]
  362. ]
  363. tempalias _texmenu_hover [
  364. __lastwatchedtexture = $arg1
  365. chmenutexture $arg2 $arg1
  366. ]
  367. //// Main > Editing > Textures > Official textures ////
  368. newmenu "Official textures"
  369. menuinit __rebuildtexturemenus
  370. //// Main > Editing > Textures > Custom textures ////
  371. newmenu "Custom textures"
  372. menuinit __rebuildtexturemenus
  373. //// Main > Editing > Textures > Official|Custom textures > Pick texture ////
  374. newmenu "Pick texture"
  375. menuinit [
  376. resetcurmenu
  377. if (strlen $__lastwatchedtexture) [
  378. chmenutexture (curmenu) $__lastwatchedtexture
  379. push usedslots (textureslotbyname $__lastwatchedtexture)
  380. menuitem (concat "Texture:" $__lastwatchedtexture) -1
  381. menuitem (concat "Distribution:" (gettextureorigin $__lastwatchedtexture)) -1
  382. menuitem "" -1
  383. if (strlen $usedslots) [
  384. menuitem "Texture is already used in:" -1
  385. looplist $usedslots i [
  386. menuitem (concatword " slot #" $i " (scale " (at (edittextureslot $i) 0) ")") (concat "__texslot =" $i "; showmenu [Edit texture slot]")
  387. ]
  388. menuitem "" -1
  389. usedslots = "once more"
  390. ]
  391. if (! (strlen (edittextureslot 255))) [
  392. menuitem (concat "Add to map config" $usedslots) (concat texture 0 $__lastwatchedtexture "; __enableautomapconfig")
  393. menuitem "Add to map config and use as next wall texture" (concat "edittexturestack wall (texture 0" $__lastwatchedtexture ") ; __enableautomapconfig")
  394. menuitem "Add to map config and use as next floor texture" (concat "edittexturestack floor (texture 0" $__lastwatchedtexture ") ; __enableautomapconfig")
  395. menuitem "Add to map config and use as next ceiling texture" (concat "edittexturestack ceiling (texture 0" $__lastwatchedtexture ") ; __enableautomapconfig")
  396. ] [
  397. menuitem "\f4(no free texture slots available)" -1
  398. ]
  399. pop usedslots
  400. ][
  401. menuitem "no texture selected" -1
  402. ]
  403. ]
  404. //// Main > Editing > Textures > Set notexture ////
  405. newmenu "Set notexture"
  406. menuinit [
  407. resetcurmenu
  408. menurenderoffset -20 0
  409. push m (escape (curmenu))
  410. push t (concat chmenutexture $m "[]")
  411. if (strlen (getnotexture)) [
  412. menuitem (concat Current notexture: (getnotexture)) (concat loadnotexture (getnotexture)) (concat chmenutexture $m (getnotexture))
  413. ]
  414. menuitem "Reset notexture" loadnotexture $t // no preview possible
  415. menuitem "" -1 $t
  416. menuitem "\f1Pick a notexture to highlight the areas" -1 $t
  417. looplist (gettexturelist "map_editor/marker" "" ".png") [tpath tname td] [
  418. fullname = (concatword $tpath "/" $tname)
  419. menuitem (concat Set notexture to $tname) (concat loadnotexture (escape $fullname)) (concat chmenutexture $m (escape $fullname))
  420. ]
  421. menuitem "" -1 $t
  422. menuitem "\f1Pick a notexture for actual use" -1 $t
  423. menuitem "\f4(as default texture, if custom texture downloads fail)" -1 $t
  424. looplist (concat makke/rock.jpg makke/concrete.jpg (at (edittextureslot 2) 1) (at (edittextureslot 3) 1) (at (edittextureslot 4) 1) $__lastwatchedtexture) fn [
  425. menuitem (concat Set notexture to $fn) (concat loadnotexture (escape $fn)) (concat chmenutexture $m (escape $fn))
  426. ]
  427. pop m t
  428. ]
  429. //// Main > Editing > Skymaps ////
  430. newmenu Skymaps
  431. menuinit [
  432. resetcurmenu
  433. if (&& $editing (! (getautomapconfig))) [
  434. menuitem [Enable automapconfig to make changes permanent] [automapconfig ; closemenu (curmenu)] (concat loadsky (escape $loadsky))
  435. menuitem "" -1 (concat loadsky (escape $loadsky))
  436. ]
  437. menuitem (concat "Current skymap:" $loadsky) (concat loadsky (escape $loadsky))
  438. menuitem "" -1 (concat loadsky (escape $loadsky))
  439. push offskies ""
  440. push userskies ""
  441. push skyname ""
  442. looplist (gettexturelist skymaps/ "" _ft.jpg) [c1 c2 c3 c4] [
  443. skyname = (escape (concatword $c3 "/" $c4))
  444. if (strcmp official (gettextureorigin (concatword $c1 "/" $c2))) [
  445. offskies = (concat $offskies $skyname)
  446. ] [
  447. userskies = (concat $userskies $skyname)
  448. ]
  449. ]
  450. menuitem "Official skymaps:" -1 (concat loadsky (escape $loadsky))
  451. looplist $offskies skyname [
  452. menuitem (concat " " $skyname) (concat loadsky $skyname) (concat loadsky $skyname)
  453. ]
  454. if (strlen $userskies) [
  455. menuitem "" -1 (concat loadsky (escape $loadsky))
  456. menuitem "Custom/downloaded skymaps:" -1 (concat loadsky (escape $loadsky))
  457. looplist $userskies skyname [
  458. menuitem (concat " " $skyname) (concat loadsky (escape $skyname)) (concat loadsky (escape $skyname))
  459. ]
  460. ]
  461. pop offskies userskies skyname
  462. ]
  463. //// Main > Editing > Ambient sounds ////
  464. newmenu [Ambient sounds]
  465. menuitem "Browse official mapsounds" [ showmenu "Official mapsounds" ]
  466. menuitem "Browse custom/downloaded mapsounds" [ showmenu "Custom mapsounds" ]
  467. menuitem "Edit mapsound slots of current map" [ showmenu "Edit mapsound slots" ]
  468. tempalias __mapsoundtitles [
  469. cavedrip.ogg "Cave drip"
  470. distant_cars.ogg "Cars driving in the distance"
  471. hum01.ogg "Humm 1"
  472. hum02.ogg "Humm 2"
  473. night_crickets.ogg "Crickets at night"
  474. water.ogg "Water 1"
  475. wind.ogg "Wind"
  476. t_aircond.ogg "Air conditioner"
  477. t_compressor.ogg "Compressor"
  478. t_crow.ogg "Crow"
  479. t_dogs01.ogg "Dogs 1"
  480. t_helicopter.ogg "Helicopter"
  481. t_hum01.ogg "Humm 3"
  482. t_hum02.ogg "Humm 4"
  483. t_hum03.ogg "Humm 5"
  484. t_hum04.ogg "Humm 6"
  485. t_night_dog.ogg "Dogs 2"
  486. t_night01.ogg "Night 1"
  487. t_night02.ogg "Night 2"
  488. t_radio_comms.ogg "Radio comms"
  489. t_radio_static.ogg "Radio static"
  490. t_satcoms.ogg "Sat-coms"
  491. t_sludge.ogg "Sludge"
  492. t_static01.ogg "Static 1"
  493. t_static02.ogg "Static 2"
  494. t_vent01.ogg "Vent 1"
  495. t_vent02.ogg "Vent 2"
  496. t_water_owl.ogg "Water owl"
  497. t_water01.ogg "Water 2"
  498. t_waterdrip.ogg "Water drip"
  499. t_wind.ogg "Wind 2"
  500. t_waterpipe01.ogg "Waterpipes 1"
  501. t_waterpipe02.ogg "Waterpipes 2"
  502. warningalarm01.ogg "Warning alarm"
  503. t_gastank.ogg "Gastank"
  504. t_keyboard.ogg "Keyboard"
  505. t_factory01.ogg "Factory"
  506. t_vents.ogg "Vent 3"
  507. t_waterfront.ogg "Waterfront"
  508. t_generator.ogg "Generator"
  509. t_electricbuzz.ogg "Electric buzz"
  510. t_alarm01.ogg "Alarm"
  511. flies.ogg "Flies"
  512. deserthawk.ogg "Desert hawk"
  513. owl.ogg "Owl"
  514. citynoisebirds.ogg "City birds"
  515. ]
  516. tempalias __rebuildmapsoundmenus [
  517. if $rereadsoundlists [
  518. delmenu "Official mapsounds"
  519. delmenu "Custom mapsounds"
  520. looplist (getmapsoundlist) [sname] [
  521. if (strcmp official (getmapsoundorigin $sname)) [
  522. newmenu "Official mapsounds"
  523. ] [
  524. newmenu "Custom mapsounds"
  525. ]
  526. push idx (findlist $__mapsoundtitles $sname)
  527. if (< $idx 0) [
  528. menuitem $sname (concat _sndmenu_exec $sname)
  529. ] [
  530. menuitem (concatword (at $__mapsoundtitles (+ $idx 1)) " (" $sname ")") (concat _sndmenu_exec $sname)
  531. ]
  532. pop idx
  533. menurenderoffset -20 0
  534. ]
  535. ]
  536. ]
  537. tempalias _sndmenu_exec [
  538. __lastwatchedmapsound = $arg1
  539. if $editing [ showmenu "Pick mapsound" ]
  540. ]
  541. //// Main > Editing > Ambient sounds > Official mapsounds ////
  542. newmenu "Official mapsounds"
  543. menuinit __rebuildmapsoundmenus
  544. //// Main > Editing > Ambient sounds > Custom mapsounds ////
  545. newmenu "Custom mapsounds"
  546. menuinit __rebuildmapsoundmenus
  547. //// Main > Editing > Ambient sounds > Official|Custom mapsounds > Pick mapsound ////
  548. newmenu "Pick mapsound"
  549. tempalias __lastwatchedmapsound "" ; tempalias __sndslot ""
  550. menuinit [
  551. resetcurmenu
  552. if (strlen $__lastwatchedmapsound) [
  553. push usedslots (mapsoundslotbyname $__lastwatchedmapsound)
  554. menuitem (concat "Mapsound:" $__lastwatchedmapsound) -1
  555. menuitem (concat "Distribution:" (getmapsoundorigin $__lastwatchedmapsound)) -1
  556. menuitem "" -1
  557. if (strlen $usedslots) [
  558. menuitem "Mapsound is already used in" -1
  559. looplist $usedslots i [
  560. menuitem (concatword " slot #" $i " (maxuses: " (at (editmapsoundslot $i) 1) ")") (concat "__sndslot =" $i "; showmenu [Edit mapsound slot]")
  561. ]
  562. menuitem "" -1
  563. usedslots = "once more"
  564. ]
  565. if (! (strlen (editmapsoundslot 255))) [
  566. menuitem (concat "\f0Add to map config" $usedslots) (concat mapsound $__lastwatchedmapsound -1 "; __enableautomapconfig")
  567. ] [
  568. menuitem "\f4(no free mapsound slots available)" -1
  569. ]
  570. pop usedslots
  571. ][
  572. menuitem "no mapsound selected" -1
  573. ]
  574. ]
  575. //// Main > Editing > Arches ////
  576. looplist [__slopeaxis 0 __slopeinc 4 __stairaxis 0 __stairwidth 1 __undoarch "" __archside 1] [n v] [tempalias $n $v]
  577. tempalias __setundoarch [ __undoarch = (concat select (at (selx) 0) (at (sely) 0) (at (selxs) 0) (at (selys) 0) "; if (= (undolevel)" (+ (undolevel) 2) ") [ undolevel" (undolevel) "]") ]
  578. newmenu Arches
  579. menuinit [ chmenutexture (curmenu) map_editor/axes.png " " ]
  580. menuitemslider "Arch sideways curve delta: " 0 5 "$__archside" 1 [ __archside = $arg1 ]
  581. menuitem "\t[ Place arch ]" [ if $editing_sp __setundoarch ; heightfield 2; arch $__archside ]
  582. menuitem "Edit arches\i\3" [ showmenu "Edit arches" ]
  583. menuitem "" -1
  584. menuitemradio "Slope axis: " 0 1 "$__slopeaxis" ["West to East (X)" "North to South (Y)"] [ __slopeaxis = $arg1 ]
  585. menuitemslider "Slope increment: " 0 5 "$__slopeinc" ["downwards 3" "downwards 2" "downwards 1" "upwards 1" "upwards 2" "upwards 3"] [ __slopeinc = $arg1 ]
  586. menuitem "\t[ Place slope ]" [ if $editing_sp __setundoarch ; heightfield 0; push i (at "3 2 1 -1 -2 -3" $__slopeinc) ; slope (if $__slopeaxis 0 $i) (if $__slopeaxis $i 0) ; pop i ; 0]
  587. menuitem "" -1
  588. menuitem "Clear heightfielding" [ solid 0; slope 0 0 ]
  589. menuitem "Undo last placed arch or slope" [ __undoarch ; -1 ]
  590. menuitemcheckbox "Automatically enlarge selections after placing arches and slopes" "$enlargearchslopeselections" [ enlargearchslopeselections $arg1 ]
  591. menuitem "Enlarge selections now" enlargevdeltaselections
  592. menuitem "" -1
  593. menuitemradio "Stairs axis: " 0 1 "$__stairaxis" ["West to East (X)" "North to South (Y)"] [ __stairaxis = $arg1 ]
  594. menuitemslider "Step width: " 0 5 "$__stairwidth" ["downwards 3" "downwards 2" "downwards 1" "upwards 1" "upwards 2" "upwards 3"] [ __stairwidth = $arg1 ]
  595. menuitem "\t[ Place stairs ]" [ push i (at "-3 -2 -1 1 2 3" $__stairwidth) ; stairs (if $__stairaxis 0 $i) (if $__stairaxis $i 0) ; pop i ; 0]
  596. //// Main > Editing > Arches > Edit arches ////
  597. tempalias __pickarch 2
  598. tempalias __listarch [ push ii "" ; loop i $arg1 [ if $i [ ii = (concat $ii (archvertex $arg1 $i)) ] ] ; result (pop ii) ]
  599. newmenu "Edit arches"
  600. menuinit [
  601. resetcurmenu
  602. loop i 50 [
  603. if (> $i 1) [
  604. menuitem (concatword "arch width " $i ": " (__listarch $i)) (concat __pickarch = $i "; showmenu [Edit arch]")
  605. ]
  606. ]
  607. ]
  608. //// Main > Editing > Arches > Edit arches > Edit arch ////
  609. newmenu "Edit arch"
  610. menuinit [
  611. resetcurmenu
  612. menuheader "" (concat "edit arch width" $__pickarch "(symmetrical)")
  613. push ii ""
  614. loop i (div $__pickarch 2) [
  615. ii = (+ $i 1)
  616. menuitemslider (concat vertex $ii "\t") 0 31 (archvertex $__pickarch $ii) 1 (concat archvertex $__pickarch $ii "$arg1 ; archvertex" $__pickarch (- $__pickarch $ii) "$arg1")
  617. ]
  618. pop ii
  619. menuitem "" -1
  620. menuitem (concat Measure selection for width $__pickarch arch) (concat av (- $__pickarch 1) "(av_measure)")
  621. menuitem "Edit full arch (non-symmetrical)\i\3" [ showmenu "Edit full arch" ]
  622. menuitem "Restore arch of different size (ymmv)\i\3" [ showmenu "Pick custom arch" ]
  623. menuitem "Delete saved custom arch\i\3" [ showmenu "Delete custom arch" ]
  624. menuitem "" -1
  625. tempalias __archname custom
  626. looplist (enumalias (concatword _arch_ $__pickarch _)) [fn sn] [
  627. if (= (+ (listlen $$fn) 1) $__pickarch) [
  628. __archname = $sn
  629. menuitem (concat Restore $sn " " $$fn) (concat av (- $__pickarch 1) (escape $$fn))
  630. ]
  631. ]
  632. menuitemtextinput "Save arch as " "result $__archname" (concat __archname "= $arg1 ; (concatword _arch_"$__pickarch "_ $arg1) = (__listarch" $__pickarch ")" ) "" 250
  633. ]
  634. //// Main > Editing > Arches > Edit arches > Edit arch > Edit full arch ////
  635. newmenu "Edit full arch"
  636. menuinit [
  637. resetcurmenu
  638. menuheader "" (concat "edit arch width" $__pickarch "(non-symmetrical)")
  639. loop i $__pickarch [
  640. if $i [ menuitemslider (concat vertex $i "\t") 0 31 (archvertex $__pickarch $i) 1 (concat archvertex $__pickarch $i "$arg1") ]
  641. ]
  642. ]
  643. //// Main > Editing > Arches > Edit arches > Edit arch > Pick custom arch ////
  644. newmenu "Pick custom arch"
  645. menuinit [
  646. resetcurmenu
  647. menuheader "" (concat "pick custom arch for width" $__pickarch)
  648. looplist (enumalias _arch_) [fn sn] [ menuitem (concat Use "\fs\f2" $sn $$fn "\fr " as width $__pickarch arch) (concat av (- $__pickarch 1) (escape $$fn)) ]
  649. ]
  650. //// Main > Editing > Arches > Edit arches > Edit arch > Delete custom arch ////
  651. newmenu "Delete custom arch"
  652. menuinit [
  653. resetcurmenu
  654. looplist (enumalias _arch_) [fn sn] [ menuitem (concat Delete custom arch "\fs\f2" $sn "\fr" $$fn) (concat delalias (escape $fn)) ]
  655. ]
  656. //// Main > Editing > Map operations ////
  657. newmenu [Map operations]
  658. menuitem "Newmap (128x128 cubes - recommended)" [ newmap 7 ]
  659. menuitem "Newmap (256x256 cubes)" [ newmap 8 ]
  660. 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. ]
  661. menuitem "Multiple map buffers (xmaps)\i\3" [ showmenu xmaps ]
  662. //// Main > Editing > Map operations > xmaps ////
  663. newmenu xmaps
  664. tempalias __curxmap ""
  665. menuinit [
  666. resetcurmenu
  667. if $editing [
  668. push la (getxmaplist)
  669. push lb (getxmaplist bak)
  670. if (strlen $la) [
  671. menuitem "\f2Currently available xmaps:" -1
  672. looplist $la [n d] [
  673. menuitem $d (concat "__curxmap =" $n "; showmenu xmap")
  674. ]
  675. menuitem "" -1
  676. ]
  677. if (strlen $lb) [
  678. menuitem "\f2Currently stored backup xmap:" -1
  679. menuitem (at $lb 1) -1
  680. menuitem "Transfer backup xmap to new regular xmap" (concat inputcommand (at $lb 0) "[xmap_keep_backup $cmdbuf]" "\"\fs\f0[xmap_keep_backup]\f2 enter new nickname for backup xmap:\fr\"" 1)
  681. menuitem "Delete backup xmap" [ saycommand "/xmap_delete_backup" ]
  682. if $editing_sp [
  683. if $unsavededits [
  684. menuitem (concat "Restore backup xmap \f3(and lose" $unsavededits "currently unsaved edits)") xmap_restore
  685. ] [
  686. menuitem "Restore backup xmap" xmap_restore
  687. ]
  688. ]
  689. menuitem "" -1
  690. ]
  691. menuitem "Store current map and edit state as xmap" [ inputcommand "" [xmap_store $cmdbuf] "\"\fs\f0[xmap_store]\f2 enter nickname for new xmap:\fr\"" ]
  692. menuitem "List all xmaps in console" [ saycommand "/xmap_list" ]
  693. pop la lb
  694. ] [
  695. menuitem "menu only available in edit mode" -1
  696. ]
  697. ]
  698. //// Main > Editing > Map operations > xmaps > xmap ////
  699. newmenu xmap
  700. menuinit [
  701. resetcurmenu
  702. if $editing [
  703. push desc ""
  704. looplist (getxmaplist) [n d] [ if (strcmp $n $__curxmap) [ desc = $d ] ]
  705. if (strlen $desc) [
  706. menuitem (concatword "\f2xmap " $__curxmap ":") -1
  707. menuitem $desc -1
  708. menuitem "" -1
  709. if $editing_sp [
  710. if (strlen (getxmaplist bak)) [
  711. menuitem (concatword "Restore xmap \fs\f1" $__curxmap "\fr (store current state as new backup xmap \fs\f3and lose backup xmap \f1" (at (getxmaplist bak) 0) "\fr)") (concat xmap_restore $__curxmap)
  712. ] [
  713. menuitem (concat "Restore xmap\fs\f1" $__curxmap "\fr(store current state as new backup xmap)") (concat xmap_restore $__curxmap)
  714. ]
  715. ]
  716. menuitem "" -1
  717. menuitem "Rename xmap" (concat inputcommand $__curxmap "[xmap_rename" $__curxmap "$cmdbuf]" "\"\fs\f0[xmap_rename]\f2 enter new nickname for xmap" $__curxmap ":\fr\"" 1)
  718. menuitem "Delete xmap" (concat saycommand "/xmap_delete" $__curxmap)
  719. ]
  720. menuselection (curmenu) 3
  721. pop desc
  722. ] [
  723. menuitem "menu only available in edit mode" -1
  724. ]
  725. ]
  726. //// Main > Editing > Map settings ////
  727. newmenu [Map settings]
  728. tempalias __enableautomapconfig [ if (&& $editing (! (getautomapconfig))) automapconfig ]
  729. menuinit [
  730. resetcurmenu
  731. if $editing [
  732. menuheader "" (concat " Settings for map" (curmap))
  733. menuitemtextinput (concatword "Water level (" (getvarrange min waterlevel) ".." (getvarrange max waterlevel) ", default " (getvarrange default waterlevel) "):\t") $waterlevel [waterlevel $arg1]
  734. looplisti "red 20 green 25 blue 20 alpha 178" [n v] [
  735. menuitemtextinput (concatword "Water colour (" $n ", default " $v "):\t") (at (getwatercolour) $i) (concat setwatercolour $n "$arg1")
  736. ]
  737. menuitem "Water colour sliders\i\3" [ showmenu [Water colour] ]
  738. menuitem "" -1
  739. menuitemtextinput (concatword "Shadow yaw (0..360, default " (getvarrange default shadowyaw) "):\t") $shadowyaw [__enableautomapconfig ; shadowyaw $arg1]
  740. menuitem "" -1
  741. menuitemtextinput (concatword "Fog distance (" (getvarrange min fog) ".." (getvarrange max fog) ", default " (getvarrange default fog) "):\t") $fog [__enableautomapconfig ; fog $arg1]
  742. menuitemtextinput (concatword "Fog colour (0xrrggbb, default 0x" (h0 6 (getvarrange default fogcolour)) "):\t") (concatword "0x" (h0 6 $fogcolour)) [__enableautomapconfig ; fogcolour $arg1]
  743. menuitem "Fog colour sliders\i\3" [ showmenu [Fog colour] ]
  744. menuitem "" -1
  745. menuitemtextinput (concatword "Ambient light (0..255 or 0xrrggbb, default 0):\t") (if (< $ambient 256) $ambient (concatword "0x" (h0 6 $ambient))) [ambient $arg1]
  746. menuitem "" -1
  747. menuitemcheckbox "Map override: Disable water reflection" "$mapoverride_nowaterreflect" [ mapoverride_nowaterreflect $arg1 ]
  748. menuitemcheckbox "Map override: Limit water waveheight" "$mapoverride_limitwaveheight" [ mapoverride_limitwaveheight $arg1 ]
  749. menuitemcheckbox "Map override: Disable stencil shadows" "$mapoverride_nostencilshadows" [ mapoverride_nostencilshadows $arg1 ]
  750. menuitem "" -1
  751. if (strlen (getvantagepoint)) [
  752. menuitem (format2 "Map vantage point is at x=%1, y=%2, z=%3, yaw=%4, pitch=%5" (getvantagepoint)) [ showmenu [Vantage point] ]
  753. ] [
  754. menuitem "Set map vantage point\i\3" [ showmenu [Vantage point] ]
  755. ]
  756. menuitem "" -1
  757. push n (getnotexture)
  758. if (! (strlen $n)) [n = <default>]
  759. menuitem (concatword "Notexture:\n" (pop n)) [showmenu "Set notexture"]
  760. menuitem (concatword "Skymap:\n" $loadsky) [showmenu Skymaps]
  761. menuitem "" -1
  762. if (strlen $mapmsg) [
  763. menuitem (concat "Map message:" $mapmsg) editmapmsg
  764. ] [
  765. menuitem "Edit map message..." editmapmsg
  766. ]
  767. if (strlen $mapinfo_license) [
  768. menuitem (concatword "Map license tag: \"" $mapinfo_license "\"") [ showmenu "Select map license" ]
  769. if (strlen $mapinfo_comment) [
  770. menuitem (concat "Map license comment:" $mapinfo_comment) [ editsvar mapinfo_comment ]
  771. ] [
  772. menuitem "Edit map license comment..." [ editsvar mapinfo_comment ]
  773. ]
  774. ] [
  775. menuitem "Select map license\i\3" [ showmenu "Select map license" ]
  776. ]
  777. ] [
  778. menuitem "menu only available in edit mode" -1
  779. ]
  780. menuitem "" -1
  781. menuitem "Show map info\i\3" [ showmenu "Show map info" ]
  782. ]
  783. //// Main > Editing > Map settings > Water colour ////
  784. newmenu [Water colour]
  785. looplisti [red green blue alpha] n [
  786. menuitemslider (concatword "Water colour (" $n "): ") 0 255 (concat "(at (getwatercolour)" $i ")") 5 (concat setwatercolour $i "$arg1") 1
  787. ]
  788. //// Main > Editing > Map settings > Fog colour ////
  789. newmenu [Fog colour]
  790. looplist [red 0xff0000 0x10000 green 0xff00 0x100 blue 0xff 1] [n m f] [
  791. menuitemslider (concatword "Fog colour (" $n "): ") 0 255 (concat "(div (&b $fogcolour " $m ")" $f ")") 5 (concat "__enableautomapconfig ; fogcolour (|b (&b $fogcolour" (^b 0xffffff $m) ") (* $arg1" $f "))") 1
  792. ]
  793. //// Main > Editing > Map settings > Fog colour > Vantage point ////
  794. newmenu [Vantage point]
  795. menuinit [
  796. resetcurmenu
  797. if (strlen (getvantagepoint)) [
  798. menuitem (format2 "Goto current map vantage point at x=%1, y=%2, z=%3, yaw=%4, pitch=%5" (getvantagepoint)) [ gotovantagepoint ]
  799. menuitem "" -1
  800. if $editing_sp [
  801. menuitem "\f3[ Delete vantage point ]" clearvantagepoint
  802. menuitem "" -1
  803. ]
  804. ]
  805. if (! $connected) [
  806. menuitem "\f0[ Set current position and viewing angle as map vantage point ]" setvantagepoint
  807. ]
  808. ]
  809. //// Main > Editing > Map settings > Select map license ////
  810. //// Main > Editing > Map settings > Show map info ////
  811. // see menus_licenses.cfg
  812. //// Main > Editing > Map config operations ////
  813. newmenu [Map config operations]
  814. tempalias __showorigin 0 ; tempalias __colororigin [ result (concatword " \fs\f" (if (strcmp $arg1 official) 4 2) "<" $arg1 ">\fr") ]
  815. menuinit [
  816. resetcurmenu
  817. if $editing_sp [
  818. menuitem "Edit mapmodel slot\i\3" [ showmenu [Edit mapmodel slots] ]
  819. menuitem "Delete unused mapmodel slot\i\3" [ showmenu [Delete unused mapmodel slot] ]
  820. menuitem "" -1
  821. menuitem "Edit texture slot\i\3" [ showmenu [Edit texture slots] ]
  822. menuitem "" -1
  823. menuitem "Edit mapsound slot\i\3" [ showmenu [Edit mapsound slots] ]
  824. menuitem "" -1
  825. menuitem "Delete ALL unused mapmodel slots" [loop ii 256 [ push i (- 255 $ii) ; if (&& (strlen (mapmodelslotname $i)) (strcmp "" (mapmodelslotusage $i))) [deletemapmodelslot $i] ; pop i]]
  826. menuitem "Delete ALL unused texture slots" [loop ii 251 [ push i (- 255 $ii) ; if (&& (strlen (edittextureslot $i)) (strcmp "" (textureslotusage $i))) [deletetextureslot $i] ; pop i]]
  827. menuitem "Delete ALL unused mapsound slots" [loop ii 256 [ push i (- 255 $ii) ; if (&& (strlen (editmapsoundslot $i)) (strcmp "" (mapsoundslotusage $i))) [deletemapsoundslot $i] ; pop i]]
  828. menuitem "" -1
  829. menuitem "Sort mapmodel slots\i\3" [ showmenu [Sort mapmodel slots] ]
  830. menuitem "Sort texture slots\i\3" [ showmenu [Sort texture slots] ]
  831. menuitem "Sort mapsound slots\i\3" [ showmenu [Sort mapsound slots] ]
  832. menuitem "" -1
  833. menuitem "Update mapmodel menus" "mapmodelchanged 1"
  834. ][
  835. menuitem "List mapmodel slots" [ showmenu [List mapmodel slots] ]
  836. menuitem "List texture slots" [ showmenu [List texture slots] ]
  837. menuitem "List mapsound slots" [ showmenu [List mapsound slots] ]
  838. menuitem "\f4(offline edit mode required to make changes)" -1
  839. menuitem "" -1
  840. ]
  841. menuitemcheckbox "Show media file origin/distribution" "$__showorigin" [ __showorigin = $arg1 ; mapmodelchanged 1 ]
  842. ]
  843. //// Main > Editing > Map config operations > Edit mapmodel slots ////
  844. newmenu [Edit mapmodel slots]
  845. menuinit __rebuildmapmodelmenus
  846. //// Main > Editing > Map config operations > Edit mapmodel slots > Edit mapmodel slot ////
  847. newmenu [Edit mapmodel slot]
  848. tempalias __lastwatchedmapmodel "" ; tempalias __mmslot ""
  849. menuinit [
  850. resetcurmenu
  851. if (strlen $__mmslot) [
  852. push info (editmapmodelslot $__mmslot)
  853. menuheader "" (concatword "edit mapmodel slot #" $__mmslot ":\n" (mapmodelslotname $__mmslot))
  854. if (strlen $info) [
  855. menuitemtextinput "Clipping radius" (at $info 0) [editmapmodelslot $__mmslot $arg1]
  856. menuitemtextinput "Clipping height " (at $info 1) [editmapmodelslot $__mmslot "" $arg1]
  857. menuitemtextinput "z-Offset " (at $info 2) [editmapmodelslot $__mmslot "" "" $arg1]
  858. menuitemtextinput "Scale [0.25 - 4.0] " (at $info 3) [editmapmodelslot $__mmslot "" "" "" $arg1]
  859. push __distribution (getmapmodelattributes (mapmodelslotname $__mmslot) distribution)
  860. if (! (strlen $__distribution)) [ __distribution = "custom/unsorted" ]
  861. menuitem (concat "Distribution:" (pop __distribution)) -1
  862. looplist [defaults "Defaults:" usage "Usage:" license "License:" version "Version:" requires "Requires:"] [attr hd] [ // also possible: desc "Desc:" author "Author:"
  863. attr = (getmapmodelattributes (mapmodelslotname $__mmslot) $attr)
  864. if (strlen $attr) [
  865. menuitem (concat $hd $attr) -1
  866. ]
  867. ]
  868. menuitem "" -1
  869. menuitemtextinput "Mapmodel path " (concat result (at $info 4)) [editmapmodelslot $__mmslot "" "" "" "" $arg1] "" 250
  870. if (&& (strlen $__lastwatchedmapmodel) (! (strcmp $__lastwatchedmapmodel (at $info 4)))) [
  871. menuitem (concat " change to" (escape $__lastwatchedmapmodel)) [editmapmodelslot $__mmslot "" "" "" "" $__lastwatchedmapmodel]
  872. ]
  873. menuitem "" -1
  874. menuitem "Duplicate slot" (concat mapmodel $info)
  875. ] [
  876. menuitem "\f3Unassigned slot" -1
  877. ]
  878. if (strlen (mapmodelslotusage $__mmslot)) [
  879. menuitem "" -1 (concat gotoposition (gotoposition))
  880. looplist (mapmodelslotusage $__mmslot) ii [
  881. menuitem (concatword "slot used by map entity #" $ii) (concat gotoentity $ii) (concat gotoentity $ii)
  882. ]
  883. if (strcmp " " (mapmodelslotusage $__mmslot)) [
  884. menuitem "(this model is required by another model)" -1
  885. ]
  886. menuitem "" -1 (concat gotoposition (gotoposition))
  887. ][
  888. menuitem "" -1
  889. menuitem "\f3Delete unused slot" (concat deletemapmodelslot $__mmslot)
  890. ]
  891. pop info
  892. ][
  893. menuitem "no slot selected" -1
  894. ]
  895. ]
  896. //// Main > Editing > Map config operations > Delete unused mapmodel slot ////
  897. newmenu [Delete unused mapmodel slot]
  898. menuinit __rebuildmapmodelmenus
  899. //// Main > Editing > Map config operations > Edit texture slots ////
  900. newmenu [Edit texture slots]
  901. menuinit [
  902. resetcurmenu
  903. menurenderoffset -20 0
  904. if $editing_sp [
  905. push ecurmenu (escape (curmenu))
  906. push info ""
  907. push origin ""
  908. looplisti (textureslotusagelist) [cnt used] [
  909. info = (edittextureslot $i)
  910. if $__showorigin [ origin = (__colororigin (gettextureorigin (at $info 1))) ]
  911. if (|| $cnt (strlen $info)) [
  912. if (! (strlen $info)) [ info = " \fs\f3<unassigned>\fr" ; origin = "" ]
  913. menuitem (concatword "edit texture slot #" $i ": " $info " (" $cnt " uses, " $used " visible)" $origin) (concat __texslot = $i "; showmenu [Edit texture slot]") (concat chmenutexture $ecurmenu (at $info 1))
  914. ]
  915. ]
  916. pop info ecurmenu origin
  917. ] [
  918. __menuitem_offlineeditonly // "menu only available in offline edit mode"
  919. ]
  920. ]
  921. //// Main > Editing > Map config operations > Edit texture slots > Edit texture slot ////
  922. newmenu [Edit texture slot]
  923. tempalias __defaultskymapdummy kurt/klite1.jpg
  924. menuinit [
  925. resetcurmenu
  926. if (strlen $__texslot) [
  927. push info (edittextureslot $__texslot) // "<scale> <path>"
  928. chmenutexture (curmenu) (at $info 1)
  929. menurenderoffset -20 0
  930. menuheader "" (concatword "edit texture slot #" $__texslot ":\n" (at $info 1))
  931. menuitemtextinput "Scaling factor [0..4] " (at $info 0) [edittextureslot $__texslot $arg1]
  932. menuitem "\f4factor 0 means default (1.0)" -1
  933. menuitem "" -1
  934. menuitem (concat "Distribution:" (gettextureorigin (at $info 1))) -1
  935. menuitem "" -1
  936. menuitemtextinput "Texture path " (concat result (at $info 1)) [edittextureslot $__texslot "" $arg1] "" 250
  937. if (&& (strlen $__lastwatchedtexture) (! (strcmp $__lastwatchedtexture (at $info 1)))) [
  938. menuitem (concat " change to" (escape $__lastwatchedtexture)) [edittextureslot $__texslot "" $__lastwatchedtexture]
  939. ]
  940. if (&& (! $__texslot) (! (strcmp $__defaultskymapdummy (at $info 1)))) [
  941. menuitem (concat " change to skymap default" (escape $__defaultskymapdummy)) [edittextureslot $__texslot 0 $__defaultskymapdummy]
  942. ]
  943. menuitem "" -1
  944. menuitem "use as next (upper-)wall texture" [edittexturestack wall $__texslot]
  945. menuitem "use as next floor texture" [edittexturestack floor $__texslot]
  946. menuitem "use as next ceiling texture" [edittexturestack ceiling $__texslot]
  947. push __usage (textureslotusage $__texslot)
  948. if (&& $__texslot (listlen $__usage)) [
  949. menuitem "" -1 (concat gotoposition (gotoposition))
  950. looplist $__usage ii [
  951. menuitem (concatword "slot used by map entity #" $ii) (concat gotoentity $ii) (concat gotoentity $ii)
  952. ]
  953. menuitem "" -1 (concat gotoposition (gotoposition))
  954. ]
  955. if (strlen (pop __usage)) [
  956. if (> (listlen (textureslotbyname (at $info 1))) 1) [
  957. menuitem "" -1
  958. menuitem "Merge multiple slots using same texture" [showmenu "Texture slot merge"]
  959. ]
  960. ] [
  961. menuitem "" -1
  962. menuitem "\f3Delete unused slot" (concat deletetextureslot $__texslot)
  963. ]
  964. if (! (strcmp $__lastwatchedtexture (at $info 1))) [
  965. menuitem "" -1
  966. menuitem (concat "Pick texture name" (at $info 1)) (concat __lastwatchedtexture = (escape (at $info 1)))
  967. ]
  968. if (! $__texslot) [
  969. menuitem "" -1
  970. menuitem (concat "Slot #0 is hardcoded as skymap, please use" $__defaultskymapdummy) -1
  971. ] [
  972. if (< $__texslot 5) [
  973. menuitem "" -1
  974. menuitem (concatword "Slot #" $__texslot " is the default " (at ["" "cube 1 water" "wall" "floor" "ceiling"] $__texslot) " texture") -1
  975. ]
  976. ]
  977. pop info
  978. ][
  979. menuitem "no slot selected" -1
  980. ]
  981. ]
  982. //// Main > Editing > Map config operations > Edit texture slots > Edit texture slot > Texture slot merge ////
  983. newmenu "Texture slot merge"
  984. tempalias __tex_joined "" ; tempalias __tex_togo ""
  985. menuinit [
  986. resetcurmenu
  987. if (strlen $__texslot) [
  988. push info (edittextureslot $__texslot) // "<scale> <path>"
  989. chmenutexture (curmenu) (at $info 1)
  990. menurenderoffset -20 0
  991. menuheader "" (concatword "merge texture slots using\n" (at $info 1))
  992. menuitem (concat "Slots using texture" (at $info 1)) -1
  993. push slots (textureslotbyname (at $info 1))
  994. push usemap (textureslotusagelist)
  995. menuitem "" -1
  996. push last (- (listlen $slots) 1)
  997. __tex_togo = (at $slots 0)
  998. __tex_joined = (at $slots $last)
  999. looplist $slots ii [
  1000. menuitem (concatword " #" $ii ": " (edittextureslot $ii) " (" (at $usemap (* $ii 2)) " uses, " (at $usemap (+ (* $ii 2) 1)) " visible)") (concat alias __texslot $ii "; showmenu [Edit texture slot]")
  1001. ]
  1002. menuitem "" -1
  1003. menuitem "Merge" -1
  1004. menuitemslider " slot #" 0 $last 0 $slots (concat "__tex_togo = (at" (escape $slots) "$arg1)")
  1005. menuitem "into" -1
  1006. menuitemslider " slot #" 0 $last $last $slots (concat "__tex_joined = (at" (escape $slots) "$arg1)")
  1007. menuitem " \f0[OK]" [if (!= $__tex_joined $__tex_togo) [deletetextureslot $__tex_togo purge $__tex_joined]]
  1008. pop info slots usemap last
  1009. ][
  1010. menuitem "no slot selected" -1
  1011. ]
  1012. ]
  1013. //// Main > Editing > Map config operations > Edit mapsound slots ////
  1014. // Edit mapsound slots
  1015. newmenu [Edit mapsound slots]
  1016. menuinit [
  1017. resetcurmenu
  1018. if $editing_sp [
  1019. push info ""
  1020. push origin ""
  1021. loop i 256 [
  1022. info = (editmapsoundslot $i)
  1023. if (strlen $info) [
  1024. if $__showorigin [ origin = (__colororigin (getmapsoundorigin (at $info 0))) ]
  1025. menuitem (concatword "edit mapsound slot #" $i ": " $info $origin) (concat alias __sndslot $i ";" showmenu (escape "Edit mapsound slot"))
  1026. ] [
  1027. if (strlen (mapsoundslotusage $i)) [
  1028. menuitem (concatword "unassigned mapsound slot #" $i) (concat alias __sndslot $i ";" showmenu (escape "Edit mapsound slot"))
  1029. ]
  1030. ]
  1031. ]
  1032. pop info origin
  1033. ] [
  1034. __menuitem_offlineeditonly // "menu only available in offline edit mode"
  1035. ]
  1036. ]
  1037. //// Main > Editing > Map config operations > Edit mapsound slots > Edit mapsound slot ////
  1038. newmenu [Edit mapsound slot]
  1039. tempalias __snd_rad "1" ; tempalias __snd_size "0" ; tempalias __snd_vol "255"
  1040. menuinit [
  1041. resetcurmenu
  1042. if (strlen $__sndslot) [
  1043. push info (editmapsoundslot $__sndslot) // "<path> <maxuses>"
  1044. menuheader "" (concatword "edit mapsound slot #" $__sndslot ":\n" (at $info 0))
  1045. if (strlen $info) [
  1046. menuitemtextinput "Max simultaneous uses " (at $info 1) [editmapsoundslot $__sndslot "" $arg1]
  1047. menuitem " (\f4-1: unlimited)" -1
  1048. menuitem "" -1
  1049. menuitem (concat "Distribution:" (getmapsoundorigin (at $info 0))) -1
  1050. menuitem "" -1
  1051. menuitemtextinput "Mapsound path " (concat result (at $info 0)) [editmapsoundslot $__sndslot $arg1] "" 250
  1052. if (&& (strlen $__lastwatchedmapsound) (! (strcmp $__lastwatchedmapsound (at $info 0)))) [
  1053. menuitem (concat " change to" (escape $__lastwatchedmapsound)) [editmapsoundslot $__sndslot $__lastwatchedmapsound]
  1054. ]
  1055. menuitem "" -1
  1056. menuitem "\f2Create map entity:" -1
  1057. menuitemslider [Sound radius: ] 1 25 "$__snd_rad" 1 [ __snd_rad = $arg1 ]
  1058. menuitemslider [Sound size: ] 0 25 "$__snd_size" 1 [ __snd_size = $arg1 ]
  1059. menuitemslider [Sound volume: ] 1 255 "$__snd_vol" 5 [ __snd_vol = $arg1 ]
  1060. menuitem "\f0 Place new entity now" (concat newent sound $__sndslot $__snd_rad $__snd_size $__snd_vol)
  1061. ] [
  1062. menuitem "\f3Unassigned slot" -1
  1063. ]
  1064. if (strlen (mapsoundslotusage $__sndslot)) [
  1065. menuitem "" -1 (concat gotoposition (gotoposition))
  1066. looplist (mapsoundslotusage $__sndslot) ii [
  1067. menuitem (concatword "slot used by map entity #" $ii) (concat gotoentity $ii) (concat gotoentity $ii)
  1068. ]
  1069. menuitem "" -1 (concat gotoposition (gotoposition))
  1070. ][
  1071. menuitem "" -1
  1072. menuitem "\f3Delete unused slot" (concat deletemapsoundslot $__sndslot)
  1073. ]
  1074. pop info
  1075. ][
  1076. menuitem "no slot selected" -1
  1077. ]
  1078. ]
  1079. //// Main > Editing > Map config operations > Sort mapmodel slots ////
  1080. looplist [__mmsort __mmmerge __texsort __texmerge __sndsort __sndmerge] i [tempalias $i 1]
  1081. newmenu [Sort mapmodel slots]
  1082. menuitemcheckbox "Sort slots alphabetically" "$__mmsort" [ __mmsort = $arg1 ]
  1083. menuitemslider "Merge " 0 2 "$__mmmerge" ["no slots" "unused identical slots" "all identical slots"] [ __mmmerge = $arg1 ] 1
  1084. menuitem "" -1
  1085. menuitem "\t\t\f0[Start]" [sortmapmodelslots (at [nosort ""] $__mmsort) (at [nomerge "" mergeused] $__mmmerge)]
  1086. //// Main > Editing > Map config operations > Sort texture slots ////
  1087. newmenu [Sort texture slots]
  1088. menuitemcheckbox "Sort slots alphabetically" "$__texsort" [ __texsort = $arg1 ]
  1089. menuitemslider "Merge " 0 2 "$__texmerge" ["no slots" "unused identical slots" "all identical slots"] [ __texmerge = $arg1 ]
  1090. menuitem "" -1
  1091. menuitem "\t\t\f0[Start]" [sorttextureslots (at [nosort ""] $__texsort) (at [nomerge "" mergeused] $__texmerge)]
  1092. //// Main > Editing > Map config operations > Sort mapsound slots ////
  1093. newmenu [Sort mapsound slots]
  1094. menuitemcheckbox "Sort slots alphabetically" "$__sndsort" [ __sndsort = $arg1 ]
  1095. menuitemslider "Merge " 0 2 "$__sndmerge" ["no slots" "unused identical slots" "all identical slots"] [ __sndmerge = $arg1 ] 1
  1096. menuitem "" -1
  1097. menuitem "\t\t\f0[Start]" [sortmapsoundslots (at [nosort ""] $__sndsort) (at [nomerge "" mergeused] $__sndmerge)]
  1098. //// Main > Editing > Map config operations > List mapmodel slots ////
  1099. newmenu [List mapmodel slots]
  1100. menuinit [
  1101. resetcurmenu
  1102. menurenderoffset -40 0
  1103. push mpath ""
  1104. push origin ""
  1105. loop i 256 [
  1106. mpath = (mapmodelslotname $i)
  1107. if (strlen $mpath) [
  1108. if $__showorigin [
  1109. origin = (getmapmodelattributes $mpath distribution)
  1110. if (! (strlen $origin)) [ origin = "custom/unsorted" ]
  1111. origin = (__colororigin $origin)
  1112. ]
  1113. menuitem [slot #@[i]: @(editmapmodelslot $i)@origin] -1 (__mm_showmodel2 [List mapmodel slots] $mpath)
  1114. ]
  1115. ]
  1116. pop origin mpath
  1117. ]
  1118. //// Main > Editing > Map config operations > List texture slots ////
  1119. newmenu [List texture slots]
  1120. menuinit [
  1121. resetcurmenu
  1122. menurenderoffset -20 0
  1123. push info ""
  1124. push origin ""
  1125. looplisti (textureslotusagelist) [cnt used] [
  1126. info = (edittextureslot $i)
  1127. if $__showorigin [ origin = (__colororigin (gettextureorigin (at $info 1))) ]
  1128. if (strlen $info) [
  1129. menuitem [texture slot #@[i]: @info @"("@cnt uses, @used visible@")"@origin] -1 [chmenutexture [List texture slots] @(at $info 1)]
  1130. ]
  1131. ]
  1132. pop info origin
  1133. ]
  1134. //// Main > Editing > Map config operations > List mapsound slots ////
  1135. newmenu [List mapsound slots]
  1136. menuinit [
  1137. resetcurmenu
  1138. push info ""
  1139. push origin ""
  1140. loop i 256 [
  1141. info = (editmapsoundslot $i)
  1142. if (strlen $info) [
  1143. if $__showorigin [ origin = (__colororigin (getmapsoundorigin (at $info 0))) ]
  1144. menuitem (concatword "mapsound slot #" $i ": " $info $origin) -1
  1145. ]
  1146. ]
  1147. pop info origin
  1148. ]
  1149. //// Main > Editing > Map checks and statistics ////
  1150. newmenu [Map checks and statistics]
  1151. menuinit [
  1152. resetcurmenu
  1153. if $editing [
  1154. menuitem "Map area checks\i\3" [ showmenu [Map area checks] ]
  1155. menuitem "Entity statistics" [ showmenu [Entity statistics] ]
  1156. menuitem "Check mapmodels with unconfigured custom textures" [ showmenu [Walk mapmodel entities with unconfigured custom textures] ]
  1157. menuitem "Show most visible textures" [ showmenu [Most visible textures] ]
  1158. menuitem "Cycle through spawn points" [ gotonextplayerstart ]
  1159. ] [
  1160. menuitem "menu only available in edit mode" -1
  1161. ]
  1162. ]
  1163. tempalias __showslopes [
  1164. push i 0
  1165. looplist (mapareacheck vdelta) n [
  1166. if $n [ echo $n cubes with slopes $i .. (+ $i 2) ]
  1167. i = (+ $i 2)
  1168. ]
  1169. pop i
  1170. ]
  1171. tempalias __clearprobepointdummies [ clearents dummy ]
  1172. tempalias __placeprobepointdummies [
  1173. __clearprobepointdummies
  1174. looplist (mapareacheck pp) [x y z area vol avgh] [
  1175. if (> $vol 32767) [ vol = 32767 ]
  1176. editentity (addentity dummy) $x $y (+ $z 5) $area "" "" "" $vol "" $avgh
  1177. ]
  1178. ]
  1179. //// Main > Editing > Map checks and statistics > Map area checks ////
  1180. newmenu [Map area checks]
  1181. menuinit [
  1182. resetcurmenu
  1183. menuitem "Heightfield slope stats" __showslopes
  1184. menuitem "Goto steepest heightfield position" [ push p (mapareacheck steepest) ; gotoposition (at $p 0) (at $p 1) (at (pop p) 2)]
  1185. if $editing_sp [
  1186. menuitem "Place probe point dummies" __placeprobepointdummies
  1187. menuitem "Walk probe point dummies\i\3" [ showmenu [Walk probe point dummies] ]
  1188. menuitem "Clear probe point dummies" __clearprobepointdummies
  1189. ]
  1190. ]
  1191. //// Main > Editing > Map checks and statistics > Map area checks > Walk probe point dummies ////
  1192. newmenu [Walk probe point dummies]
  1193. menuinit [
  1194. resetcurmenu
  1195. __placeprobepointdummies
  1196. menuitem "\f4(return to previous position)" (concat gotoposition (gotoposition)) (concat gotoposition (gotoposition))
  1197. push ents (enumentities dummy)
  1198. looplisti (mapareacheck pp) [x y z area vol avgh] [
  1199. menuitem (concatword "#" $i " area: " $area " volume: " $vol " avg height: " $avgh " (" $x "|" $y ")") (concat gotoentity (at $ents $i)) (concat gotoentity (at $ents $i))
  1200. ]
  1201. pop ents
  1202. ]
  1203. //// Main > Editing > Map checks and statistics > Entity statistics ////
  1204. newmenu [Entity statistics]
  1205. menuinit [
  1206. resetcurmenu
  1207. push s 1
  1208. looplist (listoptions ents) e [
  1209. push n (listlen (enumentities $e))
  1210. if $n [
  1211. menuitem (concatword $n " entities of type " $e) (concat showmenu "[Walk" $e "entities]")
  1212. s = 0
  1213. ]
  1214. pop n
  1215. ]
  1216. if (pop s) [
  1217. menuitem "No entities" -1
  1218. ]
  1219. ]
  1220. //// Main > Editing > Map checks and statistics > Entity statistics > Walk ... entities ////
  1221. push __a "resetcurmenu ; menuitem [\f4(return to previous position)] (concat gotoposition (gotoposition)) (concat gotoposition (gotoposition)) ;"
  1222. push __b "looplist $ents i [ menuitem (concatword # $i [ ] (editentity $i)) (concat gotoentity $i) (concat gotoentity $i) ] ; pop ents"
  1223. looplist (listoptions ents) e [
  1224. newmenu (concat Walk $e entities)
  1225. menuinit (concat $__a "push ents (enumentities" $e ") ;" $__b)
  1226. ]
  1227. //// Main > Editing > Map checks and statistics > Walk mapmodel entities with unconfigured custom textures ////
  1228. newmenu [Walk mapmodel entities with unconfigured custom textures]
  1229. menuinit (concat $__a "looplist (enumentities mapmodel) i [if (! (strlen (edittextureslot (at (editentity $i) 7)))) [menuitem (concatword # $i [ ] (editentity $i)) (concat gotoentity $i) (concat gotoentity $i)]]")
  1230. pop __a __b
  1231. //// Main > Editing > Map checks and statistics > Most visible textures ////
  1232. newmenu [Most visible textures]
  1233. menuinit [
  1234. resetcurmenu
  1235. menurenderoffset -20 0
  1236. if $editing [
  1237. push ec (escape (curmenu))
  1238. push mvis (textureslotusagelist onlymostvisible)
  1239. push info ""
  1240. looplist $mvis [d i] [
  1241. info = (edittextureslot $i)
  1242. menuitem (concatword "most visible " $d " texture: " (if $i (escape $info) [result <skymap>]) " (slot #" $i ")") (concat __texslot = $i "; showmenu [Edit texture slot]") (concat chmenutexture $ec (at $info 1))
  1243. ]
  1244. if $editing_sp [
  1245. menuitem "" -1 (concat chmenutexture $ec [])
  1246. menuitem "Sort the most visible textures to the default slot positions" (concat sorttextureslots nomerge nosort 1 (at $mvis 1) (at $mvis 3) (at $mvis 5) (at $mvis 7)) (concat chmenutexture $ec [])
  1247. ]
  1248. pop mvis ec info
  1249. ] [
  1250. menuitem "menu only available in edit mode" -1
  1251. ]
  1252. ]
  1253. //// Main > Editing > Creating bot waypoints ////
  1254. // see menus_bot.cfg
  1255. //// Main > Editing > Editing settings ////
  1256. newmenu [Editing settings]
  1257. menuitemslider "Grid/Selection style: " 0 1 "$oldselstyle" [triangles "squares (default)"] [ oldselstyle $arg1 ] 1
  1258. menuitemcheckbox "Show mapmodel clippings: " "$showmodelclipping" [ showmodelclipping $arg1 ]
  1259. menuitemcheckbox "Show ladder entities: " "$showladderentities" [ showladderentities $arg1 ]
  1260. menuitemcheckbox "Show all playerstarts (spawn points): " "$showplayerstarts" [ showplayerstarts $arg1 ]
  1261. menuitemslider "Show closest ent slot info: " 0 2 "$hideeditslotinfo" [ always "if unassigned" never ][ hideeditslotinfo $arg1 ] 1
  1262. menuitemcheckbox "Show edit info panel: " "(! $hideeditinfopanel)" [ hideeditinfopanel (! $arg1) ]
  1263. menuitemradio "Entity selection: " 0 1 "$pointatent" ["Closest entity" "Point at entity"] [ pointatent $arg1 ] 0
  1264. menuitemslider "Fly speeds multiplier: " 1 5 "$flyspeed" 1 [ flyspeed $arg1 ]
  1265. menuitemcheckbox "Write xmaps to disk on quit: " "$persistentxmaps" [ persistentxmaps $arg1 ]
  1266. // opt/autosave.cfg may add some entries
  1267. //// Main > Editing > Editing misc ////
  1268. newmenu [Editing misc]
  1269. menuitem "Load batch map conversion tools" load_convmap [] "\f4(checking and editing of entire map collections)"
  1270. menuitem "Load extra map editing scripts" load_mapeditscripts [] "\f4(expert tools for hardcore map optimisations)"
  1271. menuitem "Rebuild list of mapmodels" [ echo "\f1This will take a few seconds..." ; sleep 99 [ mapmodelregistryclear ; loadallmapmodels ; echo "\f1Done." ] ] [] "\f2Use this after manually adding or removing mapmodels\nfrom your profile directory. May throw some errors."
  1272. //// Main > Editing > Editing keys ////
  1273. newmenu [Editing keys]
  1274. menuitem "Select an action and press ENTER to bind a new key:" -1
  1275. menuitem "" -1
  1276. menuitem "\f2Mousewheel editing:" -1
  1277. menuitemeditkeyinput [Move entity: ] editkey_scroll_moveent
  1278. menuitemeditkeyinput [Change vdelta: ] editkey_scroll_vdelta
  1279. menuitemeditkeyinput [Change wall/upper wall texture: ] editkey_scroll_walluppertex
  1280. menuitemeditkeyinput [Change floor/ceiling texture: ] editkey_scroll_floorceiltex
  1281. menuitem "\f4(Keys '1' thru '7' edit entity attributes)" -1
  1282. menuitem "" -1
  1283. menuitem "\f2Edit all selected cubes:" -1
  1284. menuitemeditkeyinput [Make cubes 'solid': ] editkey_cubes_solid
  1285. menuitemeditkeyinput [Make cubes 'space': ] editkey_cubes_space
  1286. menuitemeditkeyinput [Make cubes 'floor heightfield': ] editkey_cubes_hf_floor
  1287. menuitemeditkeyinput [Make cubes 'ceiling heightfield': ] editkey_cubes_hf_ceiling
  1288. menuitemeditkeyinput [Make cubes 'corner': ] corner
  1289. menuitem "" -1
  1290. menuitemeditkeyinput [Move floor down: ] editkey_move_floor_down
  1291. menuitemeditkeyinput [Move floor up: ] editkey_move_floor_up
  1292. menuitemeditkeyinput [Move ceiling down: ] editkey_move_ceiling_down
  1293. menuitemeditkeyinput [Move ceiling up: ] editkey_move_ceiling_up
  1294. menuitemeditkeyinput [Decrease vdelta: ] editkey_vdelta_down
  1295. menuitemeditkeyinput [Increase vdelta: ] editkey_vdelta_up
  1296. menuitemeditkeyinput [Equalize floor: ] editkey_equalize_floor
  1297. menuitemeditkeyinput [Equalize ceiling: ] editkey_equalize_ceiling
  1298. menuitem "" -1
  1299. menuitemeditkeyinput [Texture on floor forward: ] editkey_floortex_up
  1300. menuitemeditkeyinput [Texture on floor previous: ] editkey_floortex_dn
  1301. menuitemeditkeyinput [Texture on wall forward: ] editkey_walltex_up
  1302. menuitemeditkeyinput [Texture on wall previous: ] editkey_walltex_dn
  1303. menuitemeditkeyinput [Texture on ceiling forward: ] editkey_ceiltex_up
  1304. menuitemeditkeyinput [Texture on ceiling previous: ] editkey_ceiltex_dn
  1305. menuitemeditkeyinput [Texture on upper wall forward: ] editkey_uppertex_up
  1306. menuitemeditkeyinput [Texture on upper wall previous: ] editkey_uppertex_dn
  1307. menuitem "" -1
  1308. menuitem "\f2Misc editing keys:" -1
  1309. menuitemkeyinput [Enter edit mode: ] edittoggle
  1310. menuitemeditkeyinput [Exit edit mode: ] edittoggle
  1311. menuitemeditkeyinput [Show editing menu: ] editkey_show_menu
  1312. menuitemeditkeyinput [Show lighting menu: ] editkey_show_menu_light
  1313. menuitem "" -1
  1314. menuitemeditkeyinput [1st meta key: ] editmeta
  1315. menuitemeditkeyinput [2nd meta key: ] editkey_editmeta2
  1316. menuitem "" -1
  1317. menuitemeditkeyinput [Occlusion culling on/off: ] toggleocull
  1318. menuitemeditkeyinput [Mip display on/off: ] showmip
  1319. menuitemeditkeyinput [Fullbright on/off: ] editkey_fullbright
  1320. menuitemeditkeyinput [Show cube details on/off: ] showfocuscubedetails
  1321. menuitem "" -1
  1322. menuitemeditkeyinput [Copy selected cubes: ] copy
  1323. menuitemeditkeyinput [Paste cubes: ] paste
  1324. menuitemeditkeyinput [Undo geometry changes: ] undo
  1325. menuitemeditkeyinput [Redo: ] redo
  1326. menuitem "" -1
  1327. menuitemeditkeyinput [Pin/unpin closest entity: ] toggleclosestentpin
  1328. menuitemeditkeyinput [Point to select entity: ] editkey_pointatents
  1329. menuitemeditkeyinput [Cycle through closest entities: ] nextclosestent
  1330. menuitemeditkeyinput [Delete entity: ] editkey_delete_entity
  1331. menuitemeditkeyinput [Copy entity: ] copyent
  1332. menuitemeditkeyinput [Paste entity: ] pasteent
  1333. menuitemeditkeyinput [Edit entity: ] editent
  1334. menuitemeditkeyinput [Cycle through TODO entities: ] editkey_scroll_todoents
  1335. menuitemeditkeyinput [Cycle through spawns: ] editkey_scroll_spawns
  1336. menuitem "" -1
  1337. menuitem "\f2Tag clips:" -1
  1338. menuitemeditkeyinput [Show tag clip volume: ] showtagclipfocus
  1339. menuitemeditkeyinput [Remove tag clip: ] editkey_tagclip_none
  1340. menuitemeditkeyinput [Create tag 'playerclip': ] editkey_tagclip_plclip
  1341. menuitemeditkeyinput [Create tag 'clip': ] editkey_tagclip_clip
  1342. menuitem "" -1
  1343. menuitemtextinput [Lookup a keyeditbind: ] [] [
  1344. if (strlen $arg1) [
  1345. echo (concatword "\f9Contents of keyeditbind " (addpunct $arg1) :)
  1346. if (strcmp (result (keyeditbind $arg1)) "") [
  1347. echo (addpunct $arg1) is not bound
  1348. ][
  1349. echo (keyeditbind $arg1)
  1350. ]
  1351. ]
  1352. ] [] 256
  1353. menuitem [] -1
  1354. menuitem "Alternate edit binds\i\3" [ showmenu [Alternate edit binds] ]
  1355. //// Main > Editing > Editing keys > Alternate edit binds ////
  1356. newmenu [Alternate edit binds]
  1357. menuitem "Are you sure you want to use alternate edit binds?" -1
  1358. menuitem [No] [ closecurmenu ]
  1359. menuitem [Yes] [ exec config/opt/alternateeditbinds.cfg; closecurmenu ] [ echo "\f3See config/opt/alternateeditbinds.cfg first" ]
  1360. //// Main > Editing > Deleted entities ////
  1361. newmenu "Deleted entities"
  1362. menuinit [
  1363. resetcurmenu
  1364. if (unlistdeletedentity) [
  1365. menuitemgreyedout (! $editing)
  1366. looplisti (getdeletedentities) [type x y z a1 a2 a3 a4 a5 a6 a7] [
  1367. push desc (concat $type (concatword "[" $x "|" $y "|" $z "]") (concatword "(" $a1 ", " $a2 ", " $a3 ", " $a4 ", " $a5 ", " $a6 ", " $a7 ")"))
  1368. if (strcmp $type mapmodel) [desc = (concat $desc (mapmodelslotname $a2))]
  1369. if (&& $editing (strcmp $type sound)) [desc = (concat $desc (at (editmapsoundslot $a1) 0))]
  1370. menuitem (pop desc) (concat gotoposition $x $y $z $a1 0 ";" undelent $i)
  1371. ]
  1372. menuitemgreyedout 0
  1373. menuitem "\f3clear this list" "unlistdeletedentity all"
  1374. ] [
  1375. menuitem "no deleted entities" -1
  1376. ]
  1377. ]