menus_edit.cfg 66 KB

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