/*
This is example menu definition file for Q2PRO.

File format is line based, whitespace is ignored.  C and C++ style comments are
supported.  Long lines can be broken into multiple ones by escaping linefeed
characters with backslashes.

Lines are macro expanded at script load time just as usual console commands.
Any cvars and macros can be referenced.

Maximum line length after expansion is limited to 1024 chars (this is Q2
command line parser limitation). Menu items of spin control type (‘values’ and
‘strings’) support special hack that avoids 1024 chars limit by performing
expansion after command line is parsed: prefix cvar name to be expanded with
"$$" instead of "$".

Duplicate menu entries override previous ones.  Built-in menus (‘demos’,
‘servers’ and ‘players’) can not be overridden.  When user presses ESC while
disconnected, ‘main’ menu is pushed.  When user presses ESC while spawned in
game, ‘game’ menu is pushed if it is found, otherwise ‘main’ menu is pushed.

Supported keywords and their syntax:

include <filename>

background <color|image>
font <image>
cursor <image>
weapon <model>

color <state> <color>

begin <menuname>
   title <menutitle>
   banner <image>
   background <color|image>
   plaque <plaque> [logo]

   range <name> <cvar> <min> <max> [step]

   pairs <name> <cvar> <string1> <value1> [...]
   values <name> <cvar> <string1> [...]
   strings <name> <cvar> <value1> [...]
   toggle <name> <cvar> [~][bit]

   bind <name> <command>
   action <name> <command>
   bitmap <image> <command>
   savegame <slot>
   loadgame <slot>
   blank

   field [options] <name> <cvar>
end
*/

background black
font conchars
cursor ch1
weapon w_railgun.md2

color normal #0f90eb64
color active #0f90ff64
color selection #0f90eb64
color disabled #7f7f7f

begin video
    //title "Video Setup"
    banner m_banner_video
    values "video mode" vid_fullscreen windowed $$vid_modelist
    toggle "vertical sync" gl_swapinterval
    range "texture gamma" vid_gamma 1.3 0.3
    toggle "hardware gamma" vid_hwgamma
    range "texture quality" gl_picmip 3 0 -1
    pairs "texture filter" gl_texturemode \
        nearest GL_NEAREST \
        linear GL_LINEAR \
        bilinear GL_LINEAR_MIPMAP_NEAREST \
        trilinear GL_LINEAR_MIPMAP_LINEAR
    pairs "anisotropic filter" gl_anisotropy no 1 2x 2 4x 4 8x 8 16x 16
    range "texture saturation" gl_saturation 0 1
    pairs "texture intensity" intensity 1x 1 2x 2 3x 3
    range "lightmap saturation" gl_coloredlightmaps 0 1
    range "lightmap brightness" gl_brightness 0 0.3
end

begin options
    //title "Options"
    banner m_banner_options
    action "player setup" pushmenu players
    action "input setup" pushmenu input
    action "key bindings" pushmenu keys
    action "weapon bindings" pushmenu weapons
    action "video setup" pushmenu video
    action "sound setup" pushmenu sound
    action "effects setup" pushmenu effects
    action "screen setup" pushmenu screen
    action "download options" pushmenu downloads
end

begin sound
    title "Sound Setup"
    values "sound engine" s_enable "no sound" "software" "OpenAL"
    values "hardware access" s_direct "max compatibility" "max performance"
    range "effects volume" s_volume 0 1
    values "ambient sounds" s_ambient "no" "yes" "only player's own"
    values "chat beep" cl_chat_sound "disabled" "default" "alternative"
end

begin railtrail
    title "Railgun Trail Setup"
    values "rail trail type" cl_railtrail_type \
        "default" "core only" "core and spiral"
    range "rail trail duration" cl_railtrail_time 0.1 3.0 0.1
    range "core width" cl_railcore_width 1 6 1
    range "spiral radius" cl_railspiral_radius 1 6 1
    strings "core color" cl_railcore_color \
        black red green yellow blue cyan magenta white
    strings "spiral color" cl_railspiral_color \
        black red green yellow blue cyan magenta white
end

begin effects
    title "Effects Setup"
    values "dynamic lighting" gl_dynamic "no" "yes" "only switchable"
    values "entity cel-shading" gl_celshading no 1x 2x 3x
    toggle "entity glowing" cl_noglow ~
    toggle "ground shadows" gl_shadows
    toggle "screen blending" gl_polyblend
    toggle "grenade explosions" cl_disable_explosions ~0
    toggle "rocket explosions" cl_disable_explosions ~1
    blank
    action --align "railgun trail setup..." pushmenu railtrail
end

begin crosshair
    title "Crosshair Setup"
    values "crosshair type" crosshair none cross dot angle
    pairs "crosshair scale" ch_scale 1x 1 2x 2 4x 4
    toggle "color by health" ch_health
    range "red channel" ch_red 0 1
    range "green channel" ch_green 0 1
    range "blue channel" ch_blue 0 1
    range "alpha channel" ch_alpha 0 1
end

begin screen
    title "Screen Setup"
    range "screen size" viewsize 40 100 10
    toggle "ping graph" scr_lag_draw
    values "demo bar" scr_demobar no yes verbose
    range "HUD opacity" scr_alpha 0 1
    range "console opacity" con_alpha 0 1
    pairs "HUD scale" scr_scale auto 0 1x 1 2x 2 4x 4
    pairs "console scale" con_scale auto 0 1x 1 2x 2 4x 4
    pairs "menu scale" ui_scale auto 0 1x 1 2x 2 4x 4
    blank
    action --align "crosshair setup..." pushmenu crosshair
end

begin downloads
    title "Download Options"
    toggle "allow downloading" allow_download
    toggle "maps" allow_download_maps
    toggle "player models/skins" allow_download_players
    toggle "models" allow_download_models
    toggle "sounds" allow_download_sounds
    toggle "textures" allow_download_textures
    toggle "pics" allow_download_pics
    blank
    toggle "HTTP downloads" cl_http_downloads
end

begin gameflags
    title "Deathmatch Flags"
    toggle "falling damage" dmflags ~3
    toggle "weapons stay" dmflags 2
    toggle "instant powerups" dmflags 4
    toggle "allow powerups" dmflags ~1
    toggle "allow health" dmflags ~0
    toggle "allow armor" dmflags ~11
    toggle "spawn farthest" dmflags 9
    toggle "same map" dmflags 5
    toggle "force respawn" dmflags 10
    toggle "infinite ammo" dmflags 13
    toggle "fixed FOV" dmflags 15
    toggle "quad drop" dmflags 14
end

begin startserver
    //title "Start Server"
    banner m_banner_start_server
    strings "initial map" _ui_nextserver $$com_maplist
    field --integer --status "0 - no time limit" --width 3 "time limit" timelimit
    field --integer --status "0 - no frag limit" --width 3 "frag limit" fraglimit
    field --integer --width 3 "max players" maxclients
    field --width 16 "host name" hostname
    blank
    action --align "deathmatch flags..." pushmenu gameflags
    action --align "begin game!" "forcemenuoff; map $_ui_nextserver force"
end

begin multiplayer
    banner m_banner_multiplayer
    action "browse q2servers.com" pushmenu servers "+http://q2servers.com/?raw=2"
    action "browse address book" pushmenu servers "favorites://" "file:///servers.lst" "broadcast://"
    action "browse demos" pushmenu demos
    action "start server" pushmenu startserver
end

begin singleplayer
    banner m_banner_game
    action easy "skill 0; deathmatch 0; coop 0; maxclients 1; newgame"
    action medium "skill 1; deathmatch 0; coop 0; maxclients 1; newgame"
    action hard "skill 2; deathmatch 0; coop 0; maxclients 1; newgame"
    action nightmare "skill 3; deathmatch 0; coop 0; maxclients 1; newgame"
    blank
    action "load game..." pushmenu loadgame
    action "save game..." pushmenu savegame
end

begin loadgame
    banner m_banner_load_game
    loadgame save0
    blank
    loadgame save1
    loadgame save2
    loadgame save3
    loadgame save4
    loadgame save5
    loadgame save6
    loadgame save7
    loadgame save8
    loadgame save9
    loadgame save10
    loadgame save11
    loadgame save12
    loadgame save13
    loadgame save14
    loadgame save15
end

begin savegame
    banner m_banner_save_game
    savegame save1
    savegame save2
    savegame save3
    savegame save4
    savegame save5
    savegame save6
    savegame save7
    savegame save8
    savegame save10
    savegame save11
    savegame save12
    savegame save13
    savegame save14
    savegame save15
end

begin main
    title "Welcome to QuakeTown! Select 'Game' to Join"
    plaque m_main_plaque m_main_logo
    bitmap m_main_game connect play.quaketown.net
    bitmap m_main_options pushmenu options
    bitmap m_main_video pushmenu video
    bitmap m_main_quit quit
end

begin game
    background #0000ff20
    style --compact
    action "options" pushmenu options
    action "disconnect" disconnect
    action "quit" quit
end

begin addressbook
    //title "Address Book"
    banner m_banner_addressbook
    field --width 32 --center adr0
    field --width 32 --center adr1
    field --width 32 --center adr2
    field --width 32 --center adr3
    field --width 32 --center adr4
    field --width 32 --center adr5
    field --width 32 --center adr6
    field --width 32 --center adr7
    field --width 32 --center adr8
    field --width 32 --center adr9
    field --width 32 --center adr10
    field --width 32 --center adr11
    field --width 32 --center adr12
    field --width 32 --center adr13
    field --width 32 --center adr14
    field --width 32 --center adr15
end

begin input
    title "Input Setup"
    field --numeric --width 8 "mouse sens" sensitivity
    toggle "auto sens" m_autosens
    toggle "mouse filter" m_filter
    toggle "free look" freelook
    toggle "always run" cl_run
end

begin keys
    title "Key Bindings"
    bind "attack" +attack
    bind "next weapon" weapnext
    bind "previous weapon" weapprev
    bind "walk forward" +forward
    bind "backpedal" +back
    bind "turn left" +left
    bind "turn right" +right
    bind "run" +speed
    bind "step left" +moveleft
    bind "step right" +moveright
    bind "sidestep" +strafe
    bind "look up" +lookup
    bind "look down" +lookdown
    bind "center view" centerview
    bind "mouse look" +mlook
    bind "keyboard look" +klook
    bind "up / jump" +moveup
    bind "down / crouch" +movedown
    bind "inventory" inven
    bind "use item" invuse
    bind "drop item" invdrop
    bind "prev item" invprev
    bind "next item" invnext
    bind "help computer" help
    bind "pause game" pause
end

begin weapons
    title "Weapon Bindings"
    bind "blaster" "use Blaster"
    bind "shotgun" "use Shotgun"
    bind "super shotgun" "use Super Shotgun"
    bind "machinegun" "use Machinegun"
    bind "chaingun" "use Chaingun"
    bind "grenade launcher" "use Grenade Launcher"
    bind "rocket launcher" "use Rocket Launcher"
    bind "hyperblaster" "use HyperBlaster"
    bind "railgun" "use Railgun"
    bind "bfg10k" "use BFG10K"
end
