persistidents 0

newmenu settings

menuitem [Video settings]           [ showmenu video ]
menuitem [Head-Up Display settings] [ showmenu HUD ]
menuitem [Gameplay settings]        [ showmenu gameplay ]
menuitem [Keyboard settings]			  [ showmenu Keyboard ]
menuitem [Mouse settings]			      [ showmenu Mouse ]
menuitem [Sound settings]           [ showmenu sound ]
menuitem [Misc settings]            [ showmenu Misc ]
menuitem [] -1
menuitem [Reset all settings] [ showmenu [Reset settings] ]

const isprimary [ return (|| (|| (|| (= $arg1 $SNIPER) (= $arg1 $SHOTGUN)) (|| (= $arg1 $AR) (= $arg1 $SMG))) (= $arg1 $CARBINE)) ]

const getcustomprimarydirs [
  customprimarydirs = []
  loop gcp $NUM_WEAPONS [
    if (! (isprimary $gcp)) [ add2list customprimarydirs (addpunct [ ]) ] [
      add2list customprimarydirs (at $ALTERNATIVE_WEAPONS (+ (* $gcp 3) 2))
    ]
  ]
  return $customprimarydirs
]

const loadcustomprimary [
  nargs = $numargs
  if (> $nargs 0) [
    li = $arg1
    if (isprimary $li) [
      tmp = (getalias (at $WEAPONS $li))
      customphud = (format modmdlweap%1 $tmp)
      custompwld = (format modmdlvwep%1 $tmp)
      if (> $nargs 1) [ // revert to default primary HUD model if any 2nd argument is given
        delalias $customphud; delalias $custompwld
      ] [ // else try loading the custom primary models
        cdirlist = (getcustomprimarydirs)
        if (listlen $cdirlist) [
          dirtotry = (at $cdirlist $li)
          if (strlen $dirtotry) [
            $customphud = $dirtotry
            $custompwld = $dirtotry
          ]
        ]
      ]
    ]
  ]
]

const DEFAULT_PRIMARIES ["MTP-57 Assault Rifle" "A-ARD/10 Submachine Gun" "Precision Tech AD-81 Sniper Rifle" "V-19 Combat Shotgun" "TMP-M&A Carbine"]
const DEFAULT_PRALIASES [AR SMG SNIPER SHOTGUN CARBINE]
const DEFAULT_PRMDLDIRS [assault subgun sniper shotgun carbine]

const CUSTOM_PRIMARIES ["AR-15 Assault Rifle" "Mac11 Submachine Gun" "Dragunov SVD Sniper Rifle" "Sawed-off Shotgun" "Marlin Guide Carbine 1895"]
const CUSTOM_PRMDLDIRS [assault2 subgun2 sniper2 shotgun2 carbine2]

newmenu Weapons

menumdl weapons/assault/menu mapmodel 75 12
loop gwm (listlen $DEFAULT_PRIMARIES) [
  execute (format [menuitem [%1] [ nextprimary (getalias %2); loadcustomprimary (getalias %2) 0; echo %1 selected ] [ chmenumdl Weapons weapons/%3/menu mapmodel 75 12 ]] (at $DEFAULT_PRIMARIES $gwm) (at $DEFAULT_PRALIASES $gwm) (at $DEFAULT_PRMDLDIRS $gwm))
]
// menuitem [] -1
// menuitem [Alternative weapons...] [ showmenu [Alternative Weapons] ]

// newmenu [Alternative Weapons]

// menumdl weapons/assault2/menu mapmodel 75 12
// loop cwm (listlen $CUSTOM_PRIMARIES) [
//   execute (format [menuitem [%1] [ nextprimary (getalias %2); loadcustomprimary (getalias %2); echo %1 selected ] [ chmenumdl [Alternative Weapons] weapons/%3/menu mapmodel 75 12 ]] (at $CUSTOM_PRIMARIES $cwm) (at $DEFAULT_PRALIASES $cwm) (at $CUSTOM_PRMDLDIRS $cwm))
// ]
// menuitem [] -1
// menuitem [Other alternative weapons...] [ showmenu [Alternative Weapon Models] ]

newmenu CLA

menuinit [ menuselection CLA (player1 skin_cla) ]
menumdl playermodels/CLA/01 all 50 4
menuitem [Comandante] [ skin_cla 0 ] [ chmenumdl CLA playermodels/CLA/01 all 50 4 ]
menuitem [Psycho]     [ skin_cla 1 ] [ chmenumdl CLA playermodels/CLA/02 all 50 4 ]
menuitem [Bomber]     [ skin_cla 2 ] [ chmenumdl CLA playermodels/CLA/03 all 50 4 ]
menuitem [Ripper]     [ skin_cla 3 ] [ chmenumdl CLA playermodels/CLA/04 all 50 4 ]

newmenu RVSF

menuinit [menuselection RVSF (player1 skin_rvsf)]
menumdl playermodels/RVSF/01 all 50 4
menuitem [Alpha]  [ skin_rvsf 0 ] [ chmenumdl RVSF playermodels/RVSF/01 all 50 4 ]
menuitem [Tango]  [ skin_rvsf 1 ] [ chmenumdl RVSF playermodels/RVSF/02 all 50 4 ]
menuitem [Cobra]  [ skin_rvsf 2 ] [ chmenumdl RVSF playermodels/RVSF/03 all 50 4 ]
menuitem [Viper]  [ skin_rvsf 3 ] [ chmenumdl RVSF playermodels/RVSF/04 all 50 4 ]
menuitem [Swat]   [ skin_rvsf 4 ] [ chmenumdl RVSF playermodels/RVSF/05 all 50 4 ]
menuitem [Police] [ skin_rvsf 5 ] [ chmenumdl RVSF playermodels/RVSF/06 all 50 4 ]

newmenu [QUICK setup]

menuitemtextinput [Nickname:] [] [ name $arg1 ]
menuitemtextinput [Resolution (Width): ] "$scr_w"           [ scr_w $arg1 ]
menuitemtextinput [Resolution (Height): ] "$scr_h"          [ scr_h $arg1 ]
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 "$soundqualityalias" 1 [Low Medium High] [ new_sound_quality $arg1 ]
menuitemslider [Field of view: ] 75 120 "$fov" 2 [] [ fov $arg1 ]
menuitem [] -1
menuitem "0			        [ OK; View FAQ ]" [ closemenu [QUICK setup]; resetgl; showmenu faq ]
menuitem "2			        [ OK ]" [ closemenu [QUICK setup]; resetgl ]

const new_gfx_quality [
  if (= $arg1 6) [ // "INSANE!" gfx quality
    fsaa 8
    minlod 250
    gfxqualityalias = 6
    fpsrange 100 1000
    watersubdiv 1
    dynlight 1
    waterreflect 1
    stencilbits 8
    stencilshadow 40
    dynshadow 40
    lighterror 1
    scorch 1
    bullethole 1
    blood 1
    gib 1
    gibnum 16
    shotline 1
    echo Be mighty careful! This setting puts any & every graphics setting as high as absolutely possible!
    trilinear 1
    waterrefract 1
    texreduce 0
    hidebigmenuimages 0
  ] [
    if (= $arg1 5) [ // High gfx quality
      fsaa 4
      minlod 200
      gfxqualityalias = 5
      fpsrange 100 1000
      watersubdiv 2
      dynlight 1
      waterreflect 1
      stencilbits 8
      stencilshadow 40
      dynshadow 40
      lighterror 1
      scorch 1
      bullethole 1
      blood 1
      gib 1
      gibnum 12
      shotline 1
      trilinear 1
      waterrefract 0
      texreduce 0
      hidebigmenuimages 0
    ] [
      if (= $arg1 4) [ // Good gfx quality
        fsaa 0
        minlod 100
        gfxqualityalias = 4
        fpsrange 60 60
        watersubdiv 2
        dynlight 1
        waterreflect 1
        stencilbits 8
        stencilshadow 40
        dynshadow 40
        lighterror 4
        scorch 1
        bullethole 1
        blood 1
        gib 1
        gibnum 8
        shotline 1
        trilinear 1
        waterrefract 0
        texreduce 0
        hidebigmenuimages 0
      ] [
        if (= $arg1 3) [ // Medium gfx quality (DEFAULT)
          fsaa 0
          minlod 60
          gfxqualityalias = 3
          fpsrange 30 40
          watersubdiv 4
          dynlight 1
          // Makes sure the 3D card is powerful enough for water reflection/shadow stencils...
          if (glext "GL_ARB_fragment_program") [ waterreflect 1 ] [ waterreflect 0 ]
          if (|| (glext "GL_EXT_stencil_two_side") (glext "GL_ATI_separate_stencil")) [
            stencilbits 8
            stencilshadow 40
          ] [
            stencilbits 0
            stencilshadow 0 ]
            dynshadow 40
            lighterror 4
            scorch 1
            bullethole 1
            blood 1
            gib 1
            gibnum 6
            shotline 1
            trilinear 1
            waterrefract 0
            texreduce 0
            hidebigmenuimages 0
        ] [
          if (= $arg1 2) [ // Low gfx quality
            fsaa 0
            minlod 60
            gfxqualityalias = 2
            fpsrange 20 25
            watersubdiv 16
            dynlight 0
            waterreflect 0
            stencilshadow 0
            stencilbits 0
            dynshadow 0
            lighterror 10
            scorch 0
            bullethole 0
            blood 0
            gib 0
            shotline 0
            trilinear 1
            waterrefract 0
            texreduce 1
            hidebigmenuimages 1
          ] [ // Horrible gfx quality
            fsaa 0
            minlod 60
            gfxqualityalias = 1
            fpsrange 20 25
            watersubdiv 64
            dynlight 0
            waterreflect 0
            stencilshadow 0
            stencilbits 0
            dynshadow 0
            lighterror 16
            scorch 0
            bullethole 0
            blood 0
            gib 0
            shotline 0
            trilinear 0
            waterrefract 0
            texreduce -1
            hidebigmenuimages 1
          ]
        ]
      ]
    ]
  ]
]

const new_sound_quality [
  if (= $arg1 3) [ // high sound (DEFAULT)
    soundqualityalias = 3
    maxsoundsatonce 10
    footsteps 1
    bulletairsound 1
    bulletbouncesound 1
  ] [
    if (= $arg1 2) [ // medium
      soundqualityalias = 2
      maxsoundsatonce 8
      footsteps 1
      bulletairsound 0
      bulletbouncesound 1
    ] [ // low
      soundqualityalias = 1
      maxsoundsatonce 5
      footsteps 0
      bulletairsound 0
      bulletbouncesound 0
    ]
  ]
]

newmenu [Reset settings]
menuinit [ resetyes = 0 ] // Ensures this menu works correctly.
menuitemcheckbox [Yes, reset all settings: ] [ resetyes = 1 ] [ resetyes = $arg1 ]
menuitem "2         [ Apply! ]        " [ if $resetyes [ resetcfg 1; quit ] [ showmenu [] ] ] [ echo (c 3)If the above option is ticked, AssaultCube will now quit and your settings will be reset. ] // If checkbox is ticked, reset settings and quit, otherwise, close menus.

newmenu Keyboard

menuitem [Select an action and press ENTER to bind a new key:] -1
menuitem [] -1
menuitemkeyinput [Forwards: ]        forward
menuitemkeyinput [Left: ]            left
menuitemkeyinput [Backwards: ]       backward
menuitemkeyinput [Right: ]           right
menuitemkeyinput [Attack: ]          attack
menuitemkeyinput [Special action: ]  altaction
menuitemkeyinput [Jump: ]            jump
menuitemkeyinput [Crouch: ]          crouch
menuitemkeyinput [Reload: ]          reload
menuitemkeyinput [Weapon menu: ]     "showmenu Weapons"
menuitemkeyinput [Next weapon: ]     "universaldelta 1"
menuitemkeyinput [Previous weapon: ] "universaldelta -1"
menuitemkeyinput [Show scores: ]     showscores
menuitemkeyinput [Chat: ]            saycommand
menuitemkeyinput [Team chat: ]       "saycommand %"
menuitemkeyinput [Commandline: ]     "saycommand /"
menuitemkeyinput [Console output: ]  toggleconsole
menuitemkeyinput [Screenshot: ]      screenshot
menuitemkeyinput [Map overview: ]    toggleshowmap
menuitemkeyinput [Drop CTF flag: ]   dropflag
menuitemkeyinput [Fullscreen: ]      fullscreenscript
menuitem [] -1
menuitemtextinput [Lookup a keybind: ] [] [ echo []; echo (concatword (c 9) [Contents of keybind ] $arg1 :); echo (keybind $arg1) ] [] 256
menuitemcheckbox [Use old editing binds?] [ $old_editbinds ] [ old_editbinds = $arg1 ]
menuitem [] -1
menuitem [Reset keybinds to default settings...] [ showmenu [Reset Binds] ]

newmenu Mouse
menuitemcheckbox [Invert mouse: ] "$invmouse" [ invmouse $arg1 ]
menuitemcheckbox [Automatic Sniper-scope sensitivity: ] "$autoscopesens"  [ autoscopesens $arg1 ]
menuitemtextinput [Mouse Sensitivity:                    ] "$sensitivity" [ sensitivity $arg1 ]
menuitemtextinput [Mouse Acceleration:                    ] "$mouseaccel" [ mouseaccel $arg1 ]
menuitemtextinput [Filter mouse (for bad ones):  ] "$mfilter"             [ mfilter $arg1 ]
menuitemtextinput [Sniper-scope sensitivity scale:  ] "$scopesensscale"   [ scopesensscale $arg1 ]
menuitem [] -1
menuitemslider [Crosshair size: ] 0 50 "$crosshairsize" 5 [] [ crosshairsize $arg1 ]
menuitem [Change crosshair...                ]               [ showmenu Crosshairs ]
menuitem [Change scope crosshair...            ]             [ showmenu [Scope crosshairs] ]

newmenu Crosshairs
menudirlist "packages/crosshairs" png [ loadcrosshair (concatword $arg1 .png) ] 1

newmenu [Scope crosshairs]
menudirlist "packages/crosshairs" png [ loadcrosshair (concatword $arg1 .png) scope ] 1

newmenu [Reset Binds]
menuinit [ resetbindsyes = 0 ] // Ensures this menu works correctly.
menuitemcheckbox [Yes, reset all binds: ] [ resetbindsyes = 1 ] [ resetbindsyes = $arg1 ]
menuitem "2         [ Apply! ]        " [ if $resetbindsyes resetbinds [ showmenu [] ] ]

newmenu video

menuitemtextinput [Screen width:                 ] "$scr_w" [ scr_w $arg1 ] [] 11
menuitemtextinput [Screen height:                ] "$scr_h" [ scr_h $arg1 ] [] 11
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 [Gamma: ] 30 300 "$gamma" 5 []                       [ gamma $arg1 ]
menuitemcheckbox [Fullscreen: ] "$fullscreen"                       [ fullscreen $arg1 ]
menuitemslider [Vsync: ] -1 1 "$vsync" 1 [Default Disabled Enabled] [ vsync $arg1 ]
menuitem [] -1
menuitem [Advanced video settings...] [ showmenu [Advanced video settings] ]
menuitem [] -1
menuitem "2			  [ Apply now! ]"   [ resetgl ]

const fsaa_valuemap [-1 2 4 8 16]
const minlod_valuemap [60 100 200 250]
const watersubdiv_valuemap [16 8 4 2 1]

newmenu [Advanced video settings]

menuitemslider [Scope FOV: ] 5 60 "$scopefov" 5 [] [ scopefov $arg1 ]
menuitemslider [Antialiasing (FSAA): ] 0 4 "(findlist $fsaa_valuemap $fsaa)" 1 [Off 2 4 8 16] [ fsaa (at $fsaa_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] [ setshadowq $arg1 ]
menuitemslider [Tex-reduce: ] -1 3 "$texreduce" 1 []  [ texreduce $arg1 ]
menuitemcheckbox [Water reflection: ] "$waterreflect" [ waterreflect $arg1 ]

const getshadowq [
  if (&& $stencilshadow (>= $stencilbits 8)) [result 2] [
    if $dynshadow [result 1] [result 0]
  ]
]

const setshadowq [
  if (= $arg1 2) [
    stencilshadow 40
    stencilbits 8
    dynshadow 40
  ] [
    if (= $arg1 1) [
      stencilshadow 0
      stencilbits 0
      dynshadow 40
    ] [
      stencilshadow 0
      stencilbits 0
      dynshadow 0
    ]
  ]
]

menuitemcheckbox [Dynamic lights: ] "$dynlight" [ dynlight $arg1 ]
menuitemcheckbox [Bulletholes: ] "$bullethole"  [ bullethole $arg1 ]
menuitemcheckbox [Scorch: ] "$scorch"           [ scorch $arg1 ]
menuitem [Enable 0.93 FOV compatiblity...]      [ fovcompat; sleep 100 fovcompatmenu ]
menuitem [] -1
menuitem [FPS Range...] [ showmenu [FPS Range] ]
menuitem [] -1
menuitem "2		        [ Apply now! ]" [ resetgl ]

const fovcompatmenu [ showmenu settings; showmenu video; showmenu [Advanced video settings] ]

newmenu [FPS Range]

menuitem [My 486 0wnz y00       (8-10 FPS)]   [ closemenu [FPS Range]; fpsrange 8 10 ]
menuitem [Slow machine           (20-25 FPS)] [ closemenu [FPS Range]; fpsrange 20 25 ]
menuitem [Sensible default       (30-40 FPS)] [ closemenu [FPS Range]; fpsrange 30 40 ]
menuitem [FPS whore           (60-60 FPS)]    [ closemenu [FPS Range]; fpsrange 60 60 ]
menuitem [I don't understand LOD (100+ FPS)]  [ closemenu [FPS Range]; fpsrange 100 1000 ]


const default_bursts [3 2 2]
const refreshWSM [ closemenu [Weapon Settings]; showmenu [Weapon Settings] ]

newmenu [Weapon Settings]
menuitemcheckbox [Auto weapon reload: ] "$autoreload" [ autoreload $arg1 ]
menuitemcheckbox [Hit sound: ] "$hitsound"            [ hitsound $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 ]
menuitemcheckbox [SMG - Full Auto?] "(= (burstshots $SMG -1) 0)" [ if (= $arg1 0) [ burstshots $SMG (at $default_bursts 0) ] [ burstshots $SMG 0 ]; refreshWSM ]
menuitemcheckbox [AR - Full Auto?] "(= (burstshots $AR -1) 0)" [ if (= $arg1 0) [ burstshots $AR (at $default_bursts 1) ] [ burstshots $AR 0 ]; refreshWSM ]
menuitemcheckbox [Akimbo - Full Auto?] "(= (burstshots $AKIMBO -1) 0)" [ if (= $arg1 0) [ burstshots $AKIMBO (at $default_bursts 2) ] [ burstshots $AKIMBO 0 ]; refreshWSM ]
menuitemslider [SMG - Shots per burst: ] 0 29 "(burstshots $SMG -1)" 1 [] [ burstshots $SMG $arg1; refreshWSM ]
menuitemslider [AR - Shots per burst: ] 0 19 "(burstshots $AR -1)" 1 [] [ burstshots $AR $arg1; refreshWSM ]
menuitemslider [Akimbo - Shots per burst: ] 0 19 "(burstshots $AKIMBO -1)" 1 [] [ burstshots $AKIMBO $arg1; refreshWSM ]

if (! (checkalias nickhighlight)) [ nickhighlight = 0 ]

newmenu gameplay
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 ]
menuitem [] -1
menuitemcheckbox [Reduced violence mode: ] "$poniesmodeon" [ reducedviolencemode $arg1 ]
menuitemslider [Gib gore: ] 0 4 "$__gibsgore" 1 [Off Normal Good Messy Unrealistic] [ gibsgore $arg1 ]
menuitemslider [Name highlight color: ] 0 9 "$nickhighlight" 1 [ "0green 5(default)" "1blue" "2yellow" "3red" "4gray" "white" "6dark brown" "7dark red" "8purple" "9orange" ] [ nickhighlight = $arg1; HIGHLIGHT = (c $nickhighlight) ]
menuitemcheckbox [Show scores on death: ] "$showscoresondeath" [ showscoresondeath $arg1 ]
menuitem [Change to the enemy team]                            changeteam
menuitem [Change weapon...]                                    [ showmenu Weapons ]
menuitem [Change player skin...]                               [ showmenu (at [CLA RVSF] (player1 team)) ]
menuitem [Weapon settings...]                                  [ showmenu [Weapon Settings] ]
menuitem [Edit kill messages...]                               [ showmenu [Kill Messages] ]
menuitem [Bot settings...]                                     [ showmenu [Bot settings] ]

__screenshottype = 0 // Initial setting for status of screenshots so AC doesn't give errors.

newmenu Misc
menuitemcheckbox [Auto map download: ] "$autogetmap"                 [ autogetmap $arg1 ]
menuitemcheckbox [Show gamemodes as acronyms: ] "$modeacronyms"      [ modeacronyms $arg1 ]
menuitemcheckbox [Show quit dialog when quitting: ] "$askquit"       [ askquit = $arg1 ]
menuitemcheckbox [Auto-screenshot: ] "$autoscreenshot"               [ autoscreenshot $arg1 ]
menuitemcheckbox [Allow HUD echos: ] "$allowhudechos"                [ allowhudechos $arg1 ]
menuitemslider [Servers to ping at once: ] 0 50 "$maxservpings" 5 [] [ maxservpings $arg1 ]
menuitemslider [Milliseconds between pinging servers: ] 1000 60000 "$servpingrate" 1000 [] [ servpingrate $arg1 ]
menuitemslider [Screenshot type: ] -1 4 "$__screenshottype" 1 ["JPEG (Terrible Quality)" "JPEG (Bad Quality)" "JPEG (Good Quality)" "JPEG (Best Quality)" "PNG (Lossless)" "BMP (Lossless)"] [ if (= $arg1 -1) [ screenshottype 1; jpegquality 50; __screenshottype = -1 ] [ if (= $arg1 0) [ screenshottype 1; jpegquality 70; __screenshottype = 0 ] [ if (= $arg1 1) [ screenshottype 1; jpegquality 85; __screenshottype = 1 ] [ if (= $arg1 2) [ screenshottype 1; jpegquality 100; __screenshottype = 2 ] [ if (= $arg1 3) [ screenshottype 2; __screenshottype = 3 ] [ if (= $arg1 4) [ screenshottype 0; __screenshottype = 4 ] ] ] ] ] ] ]
menuitemslider [Console size: ] 0 20 "$consize" 1 [] [ consize $arg1 ]
menuitemslider [Font type: ] 0 2 "$__fontsetting" 1 [Default Serif Monospace] [ if (= $arg1 1) [ setfont serif ] [ if (= $arg1 2) [ setfont mono ] [ setfont default ] ] ]
menuitemslider [Mini-map background style: ] 0 2 "$showmapbackdrop" 1 ["Fully Transparent" Black White/Transparent] [ showmapbackdrop $arg1 ]
menuitemcheckbox [Enable compatibility with older cubescripts: ] "$compatibilitymode" [ compatibilitymode $arg1; echo (c 3) This setting requires a restart to take effect. ]
menuitemcheckbox [Enable per-official map dynamic gamma: ] "$dyngamma" [ dyngamma = $arg1 ]
menuitemtextinput [Set default gamma for this map: ] "(at $ofc_gamma_list (findlist $defaultmaps (curmap 1)))" [ setgamma $arg1 ]

// Reduced game violence mode...
const reducedviolencemode [
  if (= $arg1 1) [
    poniesmodeon = 1
    blood 0
    gib 0
    mutesound 48 0; loop i 8 [ mutesound (+ $i 26) 0 ] // Mute pain sounds: 26 to 33 and 48
    echo (c 2)OMG! (concatword (c 8) PW (c 1) NI (c 3) ES (c 5) !) mode enabled - Violent game content has now been reduced.
  ] [ // Violent
    poniesmodeon = 0
    blood 1
    gib 1
    mutesound 48 1; loop i 8 [ mutesound (+ $i 26) 1 ] // Un-mute pain sounds
    echo (c 2)OMG! (concatword (c 8) PW (c 1) NI (c 3) ES (c 5) !) mode has been disabled.
  ]
]

const DEFAULT_SCOREBOARD_NAMES [Flags Frags Deaths Ratio Score Lag "Client number" Name]
const DEFAULT_SCOREBOARD_ORDER [sc_flags sc_frags sc_deaths sc_ratio sc_score sc_lag sc_clientnum sc_name]
const DEFAULT_SCOREBOARD_POSITIONS [0 1 2 -1 4 5 6 7]
const SCOREBOARD_DISABLE_ITEMS [sc_deaths sc_ratio sc_score sc_lag]

const refreshScoreboardMenu [ closemenu [Customize your scoreboard]; sleep 0 [ showmenu [Customize your scoreboard] ] ]

newmenu [Customize your scoreboard]
menuitem [0 has the highest priority...] -1
menuitem [-1 disables the item entirely...] -1
menuitem [] -1
loop tsl (listlen $DEFAULT_SCOREBOARD_ORDER) [
  ccn = (at $DEFAULT_SCOREBOARD_ORDER $tsl)
  cfn = (at $DEFAULT_SCOREBOARD_NAMES (findlist $DEFAULT_SCOREBOARD_ORDER $ccn))
  if (!= (findlist $SCOREBOARD_DISABLE_ITEMS $ccn) -1) [
    execute (format [menuitemslider [%1: ] -1 7 "(getalias %2)" 1 [] [ %2 $arg1 ]] $cfn $ccn)
  ] [
    execute (format [menuitemslider [%1: ] 0 7 "(getalias %2)" 1 [] [ %2 $arg1 ]] $cfn $ccn)
  ]
]
menuitem [] -1
menuitem [Reset to default scoreboard...] [ loop rsl (listlen $DEFAULT_SCOREBOARD_ORDER) [ (at $DEFAULT_SCOREBOARD_ORDER $rsl) (at $DEFAULT_SCOREBOARD_POSITIONS $rsl) ]; refreshScoreboardMenu ]
menuitem [Close] [ closemenu [Customize your scoreboard] ]

newmenu HUD

menuitem [Show:] -1
menuitemcheckbox [   Gun ] "$hudgun"                                           [ hudgun $arg1 ]
menuitemcheckbox [   Team icon ] "(= $hideteam 0)"                             [ hideteam (= $arg1 0) ]
menuitemcheckbox [   Icons ] "(= $hidehudequipment 0)"                         [ hidehudequipment (= $arg1 0) ]
menuitemcheckbox [   Console ] "(= $hideconsole 0)"                            [ hideconsole (= $arg1 0) ]
menuitemcheckbox [   Player names ] "$showtargetname"                          [ showtargetname $arg1 ]
menuitemcheckbox [   Spectator info ] "(= $hidespecthud 0)"                    [ hidespecthud (= $arg1 0) ]
menuitemcheckbox [   Quick messages ] "(= $hidehudmsgs 0)"                     [ hidehudmsgs (= $arg1 0) ]
menuitemcheckbox [   Damage direction indicator ] "(= $hidedamageindicator 0)" [ hidedamageindicator (= $arg1 0) ]
menuitemcheckbox [   Damage screen flash    ] "$damagescreen"                  [ damagescreen $arg1 ]
menuitemcheckbox [   Crosshair team-sign ] "$crosshairteamsign"                [ crosshairteamsign $arg1 ]
menuitemcheckbox [   CTF icons ]    "(= $hidectfhud 0)"                        [ hidectfhud (= $arg1 0) ]
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   [   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   [   Max-roll: ] 0 20 "$maxroll" 1 [] [ maxroll $arg1 ]
menuitemslider   [   Spectator max-roll: ] 0 1 "$maxrollremote" 1 [Off On] [ maxrollremote $arg1 ]
menuitem [] -1
menuitem [Customize your scoreboard...] [ showmenu [Customize your scoreboard] ]

newmenu sound

menuitemslider [Sound volume: ] 0 255 "$soundvol" 16 [] [ soundvol $arg1 ]
menuitemslider [Music volume: ] 0 255 "$musicvol" 16 [] [ musicvol $arg1 ]
menuitemslider [Sound detail: ] 1 3 "($soundqualityalias)" 1 [Low Medium High] [ new_sound_quality $arg1 ]
menuitem [] -1
menuitem [Mute/Un-mute specific sounds...] [ showmenu [Mute specific sounds] ]
menuitem [] -1
menuitem [Advanced settings:] -1
menuitemcheckbox [   Footsteps: ] "$footsteps"                                [ footsteps $arg1 ]
menuitemcheckbox [   Disable own footsteps: ] "(= $localfootsteps)"           [ localfootsteps (! $arg1) ]
menuitemslider [   Sounds at once: ] 0 100 "$maxsoundsatonce" 2 []            [ maxsoundsatonce $arg1 ]
menuitemslider [   Voice-coms: ] 0 2 "$voicecomsounds" 1 [Off On "Team only"] [ voicecomsounds $arg1 ]
menuitemslider [   Heartbeat: ] 0 99 "$heartbeat" 1 [] [ heartbeat $arg1 ]


const muteitem [ menuitemcheckbox (concatword $arg1 [: ]) (concat ! "(soundmuted" $arg2 ")") (concat mutesound $arg2 "$arg1") ]

newmenu [Mute specific sounds]

menuitem [Weapon sounds]           [ showmenu [Mute weapon sounds] ]
menuitem [Bullet/explosion sounds] [ showmenu [Mute bullet/explosion sounds] ]
menuitem [Pain/death sounds]       [ showmenu [Mute pain/death sounds] ]
menuitem [Pickup sounds]           [ showmenu [Mute pickup sounds] ]
menuitem [Movement sounds]         [ showmenu [Mute movement sounds] ]
menuitem [Voice-com sounds]        [ showmenu [Mute voice-coms] ]
menuitem [Other sounds]            [ showmenu [Mute other sounds] ]
menuitem [] -1
menuitem [Un-mute all sounds...] [ unmuteallsounds; heartbeat $oldheartbeat ]

newmenu  [Mute weapon sounds]

muteitem [Knife] 7
muteitem [Pistol] 8
muteitem [Pistol reloading] 9
muteitem [Carbine] 10
muteitem [Carbine reloading] 11
muteitem [Shotgun] 12
muteitem [Shotgun reloading] 13
muteitem [Submachine gun] 14
muteitem [Submachine gun reloading] 15
muteitem [Sniper] 16
muteitem [Sniper reloading] 17
muteitem [Assault Rifle] 18
muteitem [Assault Rifle reloading] 19
muteitem [Grenade pull] 41
muteitem [Grenade throw] 42
muteitem [Grenade bounce 1] 43
muteitem [Grenade bounce 2] 44
muteitem [Akimbo reload] 45
muteitem [Change weapon] 46
muteitem [Empty clip] 24

newmenu [Mute pickup sounds]

muteitem [Ammo pickup] 20
muteitem [Health pickup] 21
muteitem [Armour pickup] 22
muteitem [Akimbo pickup] 23
muteitem [Akimbo finished] 25
muteitem [Helmet pickup] 99

oldheartbeat = 0

newmenu [Mute pain/death sounds]

muteitem [Pain 1] 26
muteitem [Pain 2] 27
muteitem [Pain 3] 28
muteitem [Pain 4] 29
muteitem [Pain 5] 30
muteitem [Pain 6] 31
muteitem [Die 1] 32
muteitem [Die 2] 33
muteitem [Gib sounds] 48
muteitem [Tinnitus] 62
menuitemcheckbox [Heartbeat] "$heartbeat" [ if (! $arg1) [ oldheartbeat = $heartbeat; heartbeat 0 ] [ heartbeat $oldheartbeat ] ]

newmenu [Mute movement sounds]

menuitemcheckbox [Footsteps: ] "$footsteps" [ footsteps $arg1 ]
muteitem [Crouch] 54
muteitem [Water footsteps] 55
muteitem [Water crouching] 56
muteitem [Crouch-in] 57
muteitem [Crouch-out] 58
muteitem [Jump] 0
muteitem [Soft landing] 1
muteitem [Hard landing] 2
muteitem [Splash 1] 35
muteitem [Splash 2] 36
muteitem [Underwater] 61

newmenu [Mute bullet/explosion sounds]

muteitem [Ricochet air 1] 3
muteitem [Ricochet air 2] 4
muteitem [Ricochet hit] 5
muteitem [Bullet (water impact)] 6
muteitem [Grenade explosion] 34
menuitemcheckbox [Bullet hit: ] "$bulletbouncesound" [ bulletbouncesound $arg1 ]
menuitemcheckbox [Bullet near-miss: ] "$bulletairsound" [ bulletairsound $arg1 ]
muteitem [HitSound: ] "(! $hitsound)" [ hitsound (! $hitsound) ]

newmenu [Mute other sounds]

muteitem [Flag drop] 37
muteitem [Flag pickup] 38
muteitem [Flag return] 39
muteitem [Flag score] 40
muteitem [Headshot] 49
muteitem [Call vote] 50
muteitem [Pass vote] 51
muteitem [Fail vote] 52
muteitem [Menu select] 59
muteitem [Menu enter] 60

newmenu [Mute voice-coms]

muteitem [Affirmative] 63
muteitem [All-right sir] 64
muteitem [Come on, move] 65
muteitem [Coming in with the flag] 66
muteitem [Cover me] 67
muteitem [Defend the flag] 68
muteitem [Enemy down] 69
muteitem [Go get 'em boys!] 70
muteitem [Good job team] 71
muteitem [I got one!] 72
muteitem [I made contact] 73
muteitem [I'm attacking] 74
muteitem [I'm on defense] 75
muteitem [I'm on your team] 76
muteitem [Negative] 77
muteitem [No can do] 78
muteitem [Recover the flag] 79
muteitem [Sorry] 80
muteitem [Spread out] 81
muteitem [Stay here] 82
muteitem [Stay together] 83
muteitem [There's no way sir] 84
muteitem [We did it!] 85
muteitem [Yes] 86
muteitem [Under way] 87
muteitem [On the move] 88
muteitem [Got your back] 89
muteitem [Got you covered] 90
muteitem [In position] 91
muteitem [In position now] 92
muteitem [Report In!] 93
muteitem [Nice shot] 94
muteitem [Thanks] 95
muteitem [Thanks, man] 96
muteitem [Awesome (1)] 97
muteitem [Awesome (2)] 98

newmenu [Kill Messages]
menuitemvar [concat (orange)Frag messages: ] [] []
menuitemtextinput [Pistol: ]  [fragmessage 1] [ fragmessage 1 $arg1 ] [] 15
menuitemtextinput [Carbine: ] [fragmessage 2] [ fragmessage 2 $arg1 ] [] 15
menuitemtextinput [Shotgun: ] [fragmessage 3] [ fragmessage 3 $arg1 ] [] 15
menuitemtextinput [SMG: ]     [fragmessage 4] [ fragmessage 4 $arg1 ] [] 15
menuitemtextinput [Sniper: ]  [fragmessage 5] [ fragmessage 5 $arg1 ] [] 15
menuitemtextinput [AR: ]      [fragmessage 6] [ fragmessage 6 $arg1 ] [] 15
menuitemtextinput [CPistol: ] [fragmessage 7] [ fragmessage 7 $arg1 ] [] 15
menuitemtextinput [Akimbo: ]  [fragmessage 9] [ fragmessage 9 $arg1 ] [] 15
menuitem [] -1
menuitemvar [concat (orange)Gib messages: ] [] []
menuitemtextinput [Knife: ]    [gibmessage 0] [ gibmessage 0 $arg1 ] [] 15
menuitemtextinput [Shotgun: ]  [gibmessage 3] [ gibmessage 3 $arg1 ] [] 15
menuitemtextinput [Sniper: ]   [gibmessage 5] [ gibmessage 5 $arg1 ] [] 15
menuitemtextinput [Grenades: ] [gibmessage 8] [ gibmessage 8 $arg1 ] [] 15

persistidents 1
