mapmodel menu fixes

Adds "distribution" info and editing of model scale.
This commit is contained in:
ac-stef
2015-06-05 16:00:02 +02:00
parent 1629e3bf54
commit 6379e625be
+20 -8
View File
@@ -160,7 +160,7 @@ menuitem "" -1
menuitem "Update mapmodel menus" "mapmodelchanged 1"
tempalias __lastwatchedmapmodel ""
tempalias __mmslot
tempalias __mmslot ""
// Edit mapmodel slots
newmenu [Edit mapmodel slots]
@@ -172,13 +172,18 @@ menuinit [
delmenu [Edit mapmodel slot]
newmenu [Edit mapmodel slot]
if (strlen $__mmslot) [
push info (editmapmodelslot $__mmslot)
menuheader "" (concatword "edit mapmodel slot #" $__mmslot ":\n" (mapmodelslotname $__mmslot))
menuitemtextinput "Clipping radius" (at (editmapmodelslot $__mmslot) 0) [editmapmodelslot $__mmslot $arg1]
menuitemtextinput "Clipping height " (at (editmapmodelslot $__mmslot) 1) [editmapmodelslot $__mmslot "" $arg1]
menuitemtextinput "z-Offset " (at (editmapmodelslot $__mmslot) 2) [editmapmodelslot $__mmslot "" "" $arg1]
menuitemtextinput "Clipping radius" (at $info 0) [editmapmodelslot $__mmslot $arg1]
menuitemtextinput "Clipping height " (at $info 1) [editmapmodelslot $__mmslot "" $arg1]
menuitemtextinput "z-Offset " (at $info 2) [editmapmodelslot $__mmslot "" "" $arg1]
menuitemtextinput "Scale [0.25 - 4.0] " (at $info 3) [editmapmodelslot $__mmslot "" "" "" $arg1]
push __distribution (getmapmodelattributes (mapmodelslotname $__mmslot) distribution)
if (! (strlen $__distribution)) [ __distribution = "custom/unsorted" ]
menuitem (concat "Distribution:" (pop __distribution)) -1
menuitem "" -1
menuitemtextinput "Mapmodel path " (concat result (at (editmapmodelslot $__mmslot) 4)) [editmapmodelslot $__mmslot "" "" "" "" $arg1] "" 250
if (&& (strlen $__lastwatchedmapmodel) (! (strcmp $__lastwatchedmapmodel (editmapmodelslot $__mmslot) 4))) [
menuitemtextinput "Mapmodel path " (concat result (at $info 4)) [editmapmodelslot $__mmslot "" "" "" "" $arg1] "" 250
if (&& (strlen $__lastwatchedmapmodel) (! (strcmp $__lastwatchedmapmodel (at $info 4)))) [
menuitem (concat " change to" (escape $__lastwatchedmapmodel)) [editmapmodelslot $__mmslot "" "" "" "" $__lastwatchedmapmodel]
]
if (strlen (mapmodelslotusage $__mmslot)) [
@@ -191,6 +196,7 @@ menuinit [
menuitem "" -1
menuitem "\f3Delete unused slot" (concat deletemapmodelslot $__mmslot)
]
pop info
][
menuitem "no slot selected" -1
]
@@ -368,6 +374,7 @@ tempalias __rebuildmapmodelmenus [
]
keyword = (concatword __mm_key_ $keyword)
newmenu $$keyword
menurenderoffset -40 0
concatuniq __mm_menus $$keyword
if (strlen $desc) [] [desc = $mpath]
if (listlen $idxs) [
@@ -386,8 +393,9 @@ tempalias __rebuildmapmodelmenus [
push __mm_sorted ""
looplist $__mapmodelcategories [key menu] [if (>= (findlist $__mm_menus $menu) 0) [concatuniq __mm_sorted $menu]] // create list of non-empty menus in order of list above
looplist $__mm_sorted m [menuitem $m (concat showmenu $m)] // only create non-empty menus
delmenu [Delete unused mapmodel slot]
delmenu [Edit mapmodel slots]
if $editing [
delmenu [Delete unused mapmodel slot]
newmenu [Delete unused mapmodel slot]
loop i 256 [
mpath = (mapmodelslotname $i)
@@ -397,7 +405,6 @@ tempalias __rebuildmapmodelmenus [
]
]
]
delmenu [Edit mapmodel slots]
newmenu [Edit mapmodel slots]
loop i 256 [
mpath = (mapmodelslotname $i)
@@ -406,6 +413,11 @@ tempalias __rebuildmapmodelmenus [
]
]
mapmodelchanged 0
] [
newmenu [Delete unused mapmodel slot]
menuitem "menu only available in edit mode" -1
newmenu [Edit mapmodel slots]
menuitem "menu only available in edit mode" -1
]
pop menu __mm_menus __mm_sorted __mm_done __mm_unsorted idxs mpath
]