From c9ddadd525a7361c526786437e51b2bbc473633c Mon Sep 17 00:00:00 2001 From: ac-stef Date: Mon, 5 Jun 2017 15:14:40 +0200 Subject: [PATCH] per-slider option to wrap around menuitemslider text min max val step display action wrap DOCREF menuitemslider --- config/menus_edit.cfg | 30 +++++++++++++++--------------- config/menus_multiplayer.cfg | 16 ++++++++-------- config/menus_settings.cfg | 30 +++++++++++++++--------------- source/src/menus.cpp | 11 ++++++----- 4 files changed, 44 insertions(+), 43 deletions(-) diff --git a/config/menus_edit.cfg b/config/menus_edit.cfg index 2447dcf9..a8bb0fbf 100644 --- a/config/menus_edit.cfg +++ b/config/menus_edit.cfg @@ -197,8 +197,8 @@ menuitemcheckbox "Enable fullbright: " "$fullbright" [ fullbright $arg1 ] newmenu [White light] __wlight = 1; __wlight1 = 1 -menuitemslider "Light radius: " 1 32 "$__wlight" 1 [] [ __wlight = $arg1 ] -menuitemslider "Brightness: " 1 255 "$__wlight1" 5 [] [ __wlight1 = $arg1 ] +menuitemslider "Light radius: " 1 32 "$__wlight" 1 [] [ __wlight = $arg1 ] 1 +menuitemslider "Brightness: " 1 255 "$__wlight1" 5 [] [ __wlight1 = $arg1 ] 1 menuitem "" -1 menuitem "\f2\t [ OK ]\t\t" [ newent light $__wlight $__wlight1 ] @@ -206,11 +206,11 @@ menuitem "\f2\t [ OK ]\t\t" [ newent light $__wlight $__wlight1 ] newmenu [Coloured light] __clight = 1; __clight1 = 1; __clight2 = 1; __clight3 = 1 -menuitemslider "Light radius: " 1 32 "$__clight" 1 [] [ __clight = $arg1 ] +menuitemslider "Light radius: " 1 32 "$__clight" 1 [] [ __clight = $arg1 ] 1 menuitem "" -1 -menuitemslider "Red light: " 1 255 "$__clight1" 5 [] [ __clight1 = $arg1 ] -menuitemslider "Green light: " 1 255 "$__clight2" 5 [] [ __clight2 = $arg1 ] -menuitemslider "Blue light: " 1 255 "$__clight3" 5 [] [ __clight3 = $arg1 ] +menuitemslider "Red light: " 1 255 "$__clight1" 5 [] [ __clight1 = $arg1 ] 1 +menuitemslider "Green light: " 1 255 "$__clight2" 5 [] [ __clight2 = $arg1 ] 1 +menuitemslider "Blue light: " 1 255 "$__clight3" 5 [] [ __clight3 = $arg1 ] 1 menuitem "" -1 menuitem "\f2\t\t [ OK ]" [ newent light $__clight $__clight1 $__clight2 $__clight3 ] @@ -245,7 +245,7 @@ menuinit [ menuitemslider "Width (Y):\t" 0 50 "$_clip03" 1 [] [ _clip03 = $arg1 ] menuitemslider "Height (Z):\t" 0 50 "$_clip04" 1 [] [ _clip04 = $arg1 ] menuitemslider "Slope:\t" -4 4 "$_clip06" 1 [] [ _clip06 = $arg1 ] - menuitemslider "Shape:\t" 0 3 "$_clip07" 1 "regular sloped-x sloped-y rotated" [ _clip07 = $arg1 ] + menuitemslider "Shape:\t" 0 3 "$_clip07" 1 "regular sloped-x sloped-y rotated" [ _clip07 = $arg1 ] 1 menuitem "" -1 menuitem "\f2\t [ Place clip entity ]" [ newent clip $_clip01 $_clip02 $_clip03 $_clip04 _clip05 $_clip06 $_clip07 ] menuitem "\f2\t [ Place player clip entity]" [ newent plclip $_clip01 $_clip02 $_clip03 $_clip04 _clip05 $_clip06 $_clip07 ] @@ -669,7 +669,7 @@ menuitem "Print entity stats" entstats menuitem "Copy the current closest entity" copyent menuitem "Paste a previously copied entity" pasteent menuitem "Cycle through multiple closest entities" nextclosestent -menuitemslider "Select only entities of this type: " 0 (listlen (listoptions ents)) "(closestenttype -)" 1 (concat all (listoptions ents)) [ if $arg1 [ closestenttype $arg1 ] [ closestenttype ] ] +menuitemslider "Select only entities of this type: " 0 (listlen (listoptions ents)) "(closestenttype -)" 1 (concat all (listoptions ents)) [ if $arg1 [ closestenttype $arg1 ] [ closestenttype ] ] 1 menuitem "Hide entity sparklies\i\3" [ showmenu [Hide entity sparklies] ] menuitem "Multiple map buffers (xmaps)\i\3" [ showmenu xmaps ] @@ -807,14 +807,14 @@ menuinit [ newmenu [Water colour] looplisti [red green blue alpha] n [ - menuitemslider (concatword "Water colour (" $n "): ") 0 255 (concat "(at (getwatercolour)" $i ")") 5 [] (concat setwatercolour $i "$arg1") + menuitemslider (concatword "Water colour (" $n "): ") 0 255 (concat "(at (getwatercolour)" $i ")") 5 [] (concat setwatercolour $i "$arg1") 1 ] //// Main > Editing > Map settings > Fog colour //// newmenu [Fog colour] looplist [red 0xff0000 0x10000 green 0xff00 0x100 blue 0xff 1] [n m f] [ - 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 "))") + 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 ] //// Main > Editing > Map settings > Fog colour > Vantage point //// @@ -1116,7 +1116,7 @@ looplist [__mmsort __mmmerge __texsort __texmerge __sndsort __sndmerge] i [tempa newmenu [Sort mapmodel slots] menuitemcheckbox "Sort slots alphabetically" "$__mmsort" [ __mmsort = $arg1 ] -menuitemslider "Merge " 0 2 "$__mmmerge" 1 ["no slots" "unused identical slots" "all identical slots"] [ __mmmerge = $arg1 ] +menuitemslider "Merge " 0 2 "$__mmmerge" 1 ["no slots" "unused identical slots" "all identical slots"] [ __mmmerge = $arg1 ] 1 menuitem "" -1 menuitem "\t\t\f0[Start]" [sortmapmodelslots (at [nosort ""] $__mmsort) (at [nomerge "" mergeused] $__mmmerge)] @@ -1124,7 +1124,7 @@ menuitem "\t\t\f0[Start]" [sortmapmodelslots (at [nosort ""] $__mmsort) (at [nom newmenu [Sort texture slots] menuitemcheckbox "Sort slots alphabetically" "$__texsort" [ __texsort = $arg1 ] -menuitemslider "Merge " 0 2 "$__texmerge" 1 ["no slots" "unused identical slots" "all identical slots"] [ __texmerge = $arg1 ] +menuitemslider "Merge " 0 2 "$__texmerge" 1 ["no slots" "unused identical slots" "all identical slots"] [ __texmerge = $arg1 ] 1 menuitem "" -1 menuitem "\t\t\f0[Start]" [sorttextureslots (at [nosort ""] $__texsort) (at [nomerge "" mergeused] $__texmerge)] @@ -1132,7 +1132,7 @@ menuitem "\t\t\f0[Start]" [sorttextureslots (at [nosort ""] $__texsort) (at [nom newmenu [Sort mapsound slots] menuitemcheckbox "Sort slots alphabetically" "$__sndsort" [ __sndsort = $arg1 ] -menuitemslider "Merge " 0 2 "$__sndmerge" 1 ["no slots" "unused identical slots" "all identical slots"] [ __sndmerge = $arg1 ] +menuitemslider "Merge " 0 2 "$__sndmerge" 1 ["no slots" "unused identical slots" "all identical slots"] [ __sndmerge = $arg1 ] 1 menuitem "" -1 menuitem "\t\t\f0[Start]" [sortmapsoundslots (at [nosort ""] $__sndsort) (at [nomerge "" mergeused] $__sndmerge)] @@ -1259,11 +1259,11 @@ menuinit [ //// Main > Editing > Editing settings //// newmenu [Editing settings] -menuitemslider "Grid/Selection style: " 0 1 "$oldselstyle" 1 [triangles "squares (default)"] [ oldselstyle $arg1 ] +menuitemslider "Grid/Selection style: " 0 1 "$oldselstyle" 1 [triangles "squares (default)"] [ oldselstyle $arg1 ] 1 menuitemcheckbox "Show mapmodel clippings: " "$showmodelclipping" [ showmodelclipping $arg1 ] menuitemcheckbox "Show ladder entities: " "$showladderentities" [ showladderentities $arg1 ] menuitemcheckbox "Show all playerstarts (spawn points): " "$showplayerstarts" [ showplayerstarts $arg1 ] -menuitemslider "Show closest ent slot info: " 0 2 "$hideeditslotinfo" 1 [ always "if unassigned" never ][ hideeditslotinfo $arg1 ] +menuitemslider "Show closest ent slot info: " 0 2 "$hideeditslotinfo" 1 [ always "if unassigned" never ][ hideeditslotinfo $arg1 ] 1 menuitemcheckbox "Show edit info panel: " "(! $hideeditinfopanel)" [ hideeditinfopanel (! $arg1) ] menuitemslider "Fly speeds multiplier: " 1 5 "$flyspeed" 1 [] [ flyspeed $arg1 ] menuitemcheckbox "Write xmaps to disk on quit: " "$persistentxmaps" [ persistentxmaps $arg1 ] diff --git a/config/menus_multiplayer.cfg b/config/menus_multiplayer.cfg index 39f2de74..5851cc0f 100644 --- a/config/menus_multiplayer.cfg +++ b/config/menus_multiplayer.cfg @@ -196,9 +196,9 @@ menuitemcheckbox "F8: Show minutes remaining:" "$showminremain" [ showm menuitemcheckbox "Sort official maps ontop:" "$serversortpreferofficial" [ serversortpreferofficial $arg1 ] menuitemcheckbox "Use gamemode acronyms:" "$modeacronyms" [ modeacronyms $arg1 ] menuitemcheckbox "Show number of all players on the servers:" "$showallplayersnumber" [ showallplayersnumber $arg1 ] -menuitemslider "Favourites tag column:\t" 0 2 "$serverbrowserhidefavtag" 1 ["Show always" "Show when used" "Hide always"] [ serverbrowserhidefavtag $arg1 ] -menuitemslider "Server IP & port:\t\t" 0 2 "$serverbrowserhideip" 1 [Show "Show in grey" Hide] [ serverbrowserhideip $arg1 ] -menuitemslider "Sort servers by:\t\t" 0 7 "$serversort" 1 [Ping "Number of players" "Max players" "Minutes remaining" "Map name" Gamemode "IP address" "Server description"] [ serversort $arg1 ] +menuitemslider "Favourites tag column:\t" 0 2 "$serverbrowserhidefavtag" 1 ["Show always" "Show when used" "Hide always"] [ serverbrowserhidefavtag $arg1 ] 1 +menuitemslider "Server IP & port:\t\t" 0 2 "$serverbrowserhideip" 1 [Show "Show in grey" Hide] [ serverbrowserhideip $arg1 ] 1 +menuitemslider "Sort servers by:\t\t" 0 7 "$serversort" 1 [Ping "Number of players" "Max players" "Minutes remaining" "Map name" Gamemode "IP address" "Server description"] [ serversort $arg1 ] 1 menuinitselection 1 tempalias addallfavcatmenus [ @@ -224,16 +224,16 @@ const addfavcatmenu [ menuitemtextinput "Tag: " (concatword "result $" sbfavourite_ $arg1 _tag) (concatword sbfavourite_ $arg1 _tag " = $arg1") [] 15 menuitemtextinput "Description: " (concatword "result $" sbfavourite_ $arg1 _desc) (concatword sbfavourite_ $arg1 _desc " = $arg1") [] 45 menuitem "" -1 - menuitemslider "Background red:\t" 0 100 (concatword "$" sbfavourite_ $arg1 _red) 10 [] (concatword sbfavourite_ $arg1 _red " = $arg1") - menuitemslider "Background green:\t" 0 100 (concatword "$" sbfavourite_ $arg1 _green) 10 [] (concatword sbfavourite_ $arg1 _green " = $arg1") - menuitemslider "Background blue:\t" 0 100 (concatword "$" sbfavourite_ $arg1 _blue) 10 [] (concatword sbfavourite_ $arg1 _blue " = $arg1") - menuitemslider "Background alpha:\t" 0 100 (concatword "$" sbfavourite_ $arg1 _alpha) 10 [] (concatword sbfavourite_ $arg1 _alpha " = $arg1") + menuitemslider "Background red:\t" 0 100 (concatword "$" sbfavourite_ $arg1 _red) 10 [] (concatword sbfavourite_ $arg1 _red " = $arg1") 1 + menuitemslider "Background green:\t" 0 100 (concatword "$" sbfavourite_ $arg1 _green) 10 [] (concatword sbfavourite_ $arg1 _green " = $arg1") 1 + menuitemslider "Background blue:\t" 0 100 (concatword "$" sbfavourite_ $arg1 _blue) 10 [] (concatword sbfavourite_ $arg1 _blue " = $arg1") 1 + menuitemslider "Background alpha:\t" 0 100 (concatword "$" sbfavourite_ $arg1 _alpha) 10 [] (concatword sbfavourite_ $arg1 _alpha " = $arg1") 1 menuitem "" -1 menuitemtextinput "Keyword list: " (concatword "result $" sbfavourite_ $arg1 _keys) (concatword sbfavourite_ $arg1 _keys " = $arg1") [] 255 menuitem "" -1 menuitemtextinput "Weight: " (concatword "result $" sbfavourite_ $arg1 _weight) (concatword sbfavourite_ $arg1 _weight " = $arg1") [] 10 menuitem "" -1 - menuitemslider "" 0 1 (concatword "result $" sbfavourite_ $arg1 _ignore) 1 ["Enable this category" "Ignore this category"] (concatword sbfavourite_ $arg1 _ignore " = $arg1") + menuitemslider "" 0 1 (concatword "result $" sbfavourite_ $arg1 _ignore) 1 ["Enable this category" "Ignore this category"] (concatword sbfavourite_ $arg1 _ignore " = $arg1") 1 menuitem "" -1 menuitem "Show servers of this category\i\3" (concat showonlyfavourites $i ";showmenu server") [ showonlyfavourites 0 ] ] diff --git a/config/menus_settings.cfg b/config/menus_settings.cfg index c0083726..83f6cbb0 100644 --- a/config/menus_settings.cfg +++ b/config/menus_settings.cfg @@ -28,7 +28,7 @@ menuitem "Choose resolution from list\i\3" [ showmenu [Display resolutions] ] menuitem "" -1 menuitemslider "Graphics detail: " 1 6 "$gfxqualityalias" 1 [Horrible Low Medium Good High "INSANE! (May perform slowly on older gfx)"] [ new_gfx_quality $arg1 ] menuitem "" -1 -menuitemslider "Field of view: " 75 120 "$fov" 2 [] [ fov $arg1 ] +menuitemslider "Field of view: " 75 120 "$fov" 2 [] [ fov $arg1 ] 1 menuitemcheckbox "Fullscreen: " "$fullscreen" [ fullscreen $arg1 ] menuitemslider "Vsync: " -1 1 "$vsync" 1 [Default Disabled Enabled] [ vsync $arg1 ] menuitem "" -1 @@ -90,13 +90,13 @@ const __fsaa_valuemap [-1 0 2 4 8 16] const __aniso_valuemap [0 2 4 8 16] const __minlod_valuemap [60 100 200 250] const __watersubdiv_valuemap [16 8 4 2 1] -menuitemslider [Scope FOV: ] 5 60 "$scopefov" 5 [] [ scopefov $arg1 ] +menuitemslider [Scope FOV: ] 5 60 "$scopefov" 5 [] [ scopefov $arg1 ] 1 menuitemslider [Antialiasing (FSAA): ] 0 5 "(findlist $__fsaa_valuemap $fsaa)" 1 [Default Off 2 4 8 16] [ fsaa (at $__fsaa_valuemap $arg1) ] menuitemslider [Anisotropic filtering: ] 0 4 "(findlist $__aniso_valuemap $aniso)" 1 [Off 2 4 8 16] [ aniso (at $__aniso_valuemap $arg1) ] menuitemslider [Minimal level of detail: ] 0 3 "(findlist $__minlod_valuemap $minlod)" 1 [Low Decent Good Best] [ minlod (at $__minlod_valuemap $arg1) ] menuitemslider [Light error: ] 1 100 "$lighterror" 5 [] [ lighterror $arg1 ] menuitemslider [Water subdivision: ] 0 4 "(findlist $__watersubdiv_valuemap $watersubdiv)" 1 ["Lowest quality" "Low quality" "Medium quality" "High quality" "Highest quality"] [ watersubdiv (at $__watersubdiv_valuemap $arg1) ] -menuitemslider [Dynamic shadows: ] 0 2 __getshadowq 1 [Off Blob Stencil] [ (concatword __setshadowq_ $arg1) ] +menuitemslider [Dynamic shadows: ] 0 2 __getshadowq 1 [Off Blob Stencil] [ (concatword __setshadowq_ $arg1) ] 1 menuitemslider [Tex-reduce: ] -1 3 "$texreduce" 1 [] [ texreduce $arg1 ] menuitemcheckbox [Water reflection: ] "$waterreflect" [ waterreflect $arg1 ] menuitemcheckbox [Dynamic lights: ] "$dynlight" [ dynlight $arg1 ] @@ -139,13 +139,13 @@ menuitemslider [ Damage maxroll: ] 0 (getvarrange max maxrolleffect) "$maxro menuitemcheckbox [ Team score counters ] "(= $hideteamscorehud 0)" [ hideteamscorehud (= $arg1 0) ] menuitemcheckbox [ KTF flag direction indicator ] "(! $hidektfindicator)" [ hidektfindicator (! $arg1) ] menuitemcheckbox [ Radar ] "(= $hideradar 0)" [ hideradar (= $arg1 0) ] -menuitemslider [ Radar zoom: ] 5 500 [ $radarheight ] 5 [][ radarheight $arg1 ] -menuitemslider [ Votes: ] 0 2 "$hidevote" 1 ["Always show" "Show until you vote" "Never show"] [ hidevote $arg1 ] -menuitemslider [ Graphics statistics: ] 0 2 "$showstats" 1 [None "FPS Only" All] [ showstats $arg1 ] -menuitemslider [ Game time: ] 0 2 "$gametimedisplay" 1 [None "Count backward" "Count forward"] [ gametimedisplay $arg1 ] -menuitemslider [ Wall clock: ] 0 6 [findlist $wallclockformatlist $wallclockformat] 1 [None "HH:MM (local, 24h)" "HH:MM:SS (local, 24h)" "HH:MM (local, 12h)" "HH:MM:SS (local, 12h)" "HH:MM (UTC/GMT)" "HH:MM:SS (UTC/GMT)"] [ alias wallclockformat (at $wallclockformatlist $arg1)] +menuitemslider [ Radar zoom: ] 5 500 [ $radarheight ] 5 [][ radarheight $arg1 ] 1 +menuitemslider [ Votes: ] 0 2 "$hidevote" 1 ["Always show" "Show until you vote" "Never show"] [ hidevote $arg1 ] 1 +menuitemslider [ Graphics statistics: ] 0 2 "$showstats" 1 [None "FPS Only" All] [ showstats $arg1 ] 1 +menuitemslider [ Game time: ] 0 2 "$gametimedisplay" 1 [None "Count backward" "Count forward"] [ gametimedisplay $arg1 ] 1 +menuitemslider [ Wall clock: ] 0 6 [findlist $wallclockformatlist $wallclockformat] 1 [None "HH:MM (local, 24h)" "HH:MM:SS (local, 24h)" "HH:MM (local, 12h)" "HH:MM:SS (local, 12h)" "HH:MM (UTC/GMT)" "HH:MM:SS (UTC/GMT)"] [ alias wallclockformat (at $wallclockformatlist $arg1)] 1 menuitemslider [ Extra messages: ] 0 3 "$hudextras" 1 ["No extra messages" "Show extra messages in console" "Pop up extra messages!" "SPAM EXTRA MESSAGES!"] [ hudextras $arg1 ] -menuitemslider [ Hand alignment: ] 0 1 "$righthanded" 1 [Left-handed Right-handed] [ righthanded $arg1 ] +menuitemslider [ Hand alignment: ] 0 1 "$righthanded" 1 [Left-handed Right-handed] [ righthanded $arg1 ] 1 menuitemslider [ Max-roll: ] 0 (getvarrange max maxroll) "$maxroll" 1 [] [ maxroll $arg1 ] menuitemslider [ Spectator max-roll: ] 0 (getvarrange max maxrollremote) "$maxrollremote" 2 [] [ maxrollremote $arg1 ] @@ -167,8 +167,8 @@ menuitemkeyinput "Forward console key: " key_console_forward menuitemkeyinput "End of console key: " key_console_end menuitemkeyinput "Scroll console key (+ mousewheel): " key_console_scroll menuitem "\f4Inlined console graphics settings:" -1 -menuitemslider (concatword "Igraph size (" (getigraph ")") "): ") 80 300 "$igraphsize" 5 [] [ igraphsize $arg1 ] -menuitemslider "Igraph size for menu icons (\i\1): " 80 160 "$igraphsizehardcoded" 5 [] [ igraphsizehardcoded $arg1 ] +menuitemslider (concatword "Igraph size (" (getigraph ")") "): ") 80 300 "$igraphsize" 5 [] [ igraphsize $arg1 ] 1 +menuitemslider "Igraph size for menu icons (\i\1): " 80 160 "$igraphsizehardcoded" 5 [] [ igraphsizehardcoded $arg1 ] 1 menuitemcheckbox "Stop igraph animation: " "! $igraphanimate" [ igraphanimate (! $arg1) ] menuitemcheckbox "Disable igraphs: " "$hideigraphs" [ hideigraphs $arg1 ] @@ -179,8 +179,8 @@ newmenu "\fsGameplay" alias nickhighlight 0 alias __gibsgore 1 menuitemtextinput "Nickname: " "result $curname" [ name $arg1 ] -menuitemslider "Player skins: " 0 2 "$teamdisplaymode" 1 [Normal "Colored vests" "Full color"] [ teamdisplaymode $arg1 ] -menuitemslider "Custom player skins: " 0 2 "$hidecustomskins" 1 ["Always show" "Show in non-team modes" "Never show"] [ hidecustomskins $arg1 ] +menuitemslider "Player skins: " 0 2 "$teamdisplaymode" 1 [Normal "Colored vests" "Full color"] [ teamdisplaymode $arg1 ] 1 +menuitemslider "Custom player skins: " 0 2 "$hidecustomskins" 1 ["Always show" "Show in non-team modes" "Never show"] [ hidecustomskins $arg1 ] 1 menuitem "" -1 menuitemcheckbox "Reduced violence mode: " "$poniesmodeon" [ reducedviolencemode $arg1 ] menuitemslider "Gib gore: " 0 4 "$__gibsgore" 1 [Off Normal Good Messy Unrealistic] [ gibsgore $arg1 ] @@ -237,7 +237,7 @@ looplist [ subgun 3 assault 2 akimbo 2 ] [ g n ] [ alias (concatword __burstshot menuitemslider [Play hit sounds: ] 0 2 "$hitsound" 1 [Off "When server detects hits" "When client detects hits"] [ hitsound $arg1 ] menuitemcheckbox [Auto weapon reload: ] "$autoreload" [ autoreload $arg1 ] menuitemcheckbox [Auto switch to akimbo upon pickup: ] "$akimboautoswitch" [ akimboautoswitch $arg1 ] -menuitemslider [Akimbo end action: ] 0 3 "$akimboendaction" 1 ["Switch to knife" "Stay with pistol" "Switch to grenades" "Switch to primary"] [ akimboendaction $arg1 ] +menuitemslider [Akimbo end action: ] 0 3 "$akimboendaction" 1 ["Switch to knife" "Stay with pistol" "Switch to grenades" "Switch to primary"] [ akimboendaction $arg1 ] 1 menuitemcheckbox [SMG - Full Auto?] "(= (burstshots SUBGUN -1) 0)" [ if (= $arg1 0) [ burstshots SUBGUN $__burstshots_subgun ] [ burstshots SUBGUN 0 ]; refreshcurmenu ] menuitemcheckbox [AR - Full Auto?] "(= (burstshots ASSAULT -1) 0)" [ if (= $arg1 0) [ burstshots ASSAULT $__burstshots_assault ] [ burstshots ASSAULT 0 ]; refreshcurmenu ] menuitemcheckbox [Akimbo - Full Auto?] "(= (burstshots AKIMBO -1) 0)" [ if (= $arg1 0) [ burstshots AKIMBO $__burstshots_akimbo ] [ burstshots AKIMBO 0 ]; refreshcurmenu ] @@ -696,7 +696,7 @@ menuitemtextinput "Mouse sensitivity: " "$sensitivity" [ sensitivity $arg1 menuitemcheckbox "Reduced violence mode: " "$poniesmodeon" [ reducedviolencemode $arg1 ] menuitemslider "Graphics detail: " 1 6 "$gfxqualityalias" 1 [Horrible Low Medium Good High "INSANE! (May perform slowly on older gfx)"] [ new_gfx_quality $arg1 ] menuitemslider "Sound detail: " 1 3 "$__soundquality" 1 [Low Medium High] [ __set_sound_quality $arg1 ] -menuitemslider "Field of view: " 75 120 "$fov" 2 [] [ fov $arg1 ] +menuitemslider "Field of view: " 75 120 "$fov" 2 [] [ fov $arg1 ] 1 menuitem "" -1 menuitem "\f0\t\t\t [ OK; View FAQ ]" [ closecurmenu; resetgl; load_faq ; showmenu faq ] menuitem "\f2\t\t\t [ OK ]" [ closecurmenu; resetgl ] diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 2f5b7b33..7c20d034 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -581,8 +581,9 @@ struct mitemslider : mitem int min_, max_, step, value, maxvaluewidth; char *text, *valueexp, *display, *action; string curval; + bool wrap; - mitemslider(gmenu *parent, char *text, int min_, int max_, int step, char *value, char *display, char *action, color *bgcolor) : mitem(parent, bgcolor, mitem::TYPE_SLIDER), min_(min_), max_(max_), step(step), value(min_), maxvaluewidth(0), text(text), valueexp(value), display(display), action(action) { } + mitemslider(gmenu *parent, char *text, int min_, int max_, int step, char *value, char *display, char *action, color *bgcolor, bool wrap) : mitem(parent, bgcolor, mitem::TYPE_SLIDER), min_(min_), max_(max_), step(step), value(min_), maxvaluewidth(0), text(text), valueexp(value), display(display), action(action), wrap(wrap) { } virtual ~mitemslider() { @@ -636,7 +637,7 @@ struct mitemslider : mitem void slide(bool right) { value += right ? step : -step; - if (wrapslider) + if (wrapslider || wrap) { if (value > max_) value = min_; if (value < min_) value = max_; @@ -1043,12 +1044,12 @@ void menuitemtextinput(char *text, char *value, char *action, char *hoveraction, } COMMAND(menuitemtextinput, "ssssii"); -void menuitemslider(char *text, int *min_, int *max_, char *value, int *step, char *display, char *action) +void menuitemslider(char *text, int *min_, int *max_, char *value, int *step, char *display, char *action, int *wrap) { if(!lastmenu) return; - lastmenu->items.add(new mitemslider(lastmenu, newstring(text), *min_, *max_, *step, newstring(value), display[0] ? newstring(display) : NULL, action[0] ? newstring(action) : NULL, NULL)); + lastmenu->items.add(new mitemslider(lastmenu, newstring(text), *min_, *max_, *step, newstring(value), display[0] ? newstring(display) : NULL, action[0] ? newstring(action) : NULL, NULL, *wrap != 0)); } -COMMAND(menuitemslider, "siisiss"); +COMMAND(menuitemslider, "siisissi"); void menuitemkeyinput(char *text, char *bindcmd) {