Skip to content

Commit

Permalink
add trailcolors GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
sauerbraten committed Jan 21, 2022
1 parent 407f8fe commit afdf684
Show file tree
Hide file tree
Showing 4 changed files with 1,067 additions and 869 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ Client-side demos record the game as you experience it, and work independently o
- adds the `trailcolor[shotgun|chaingun|rocketlauncher|rifle|grenadelauncher|pistol]` vars that change the respective weapon's projectile/particle trail
- adds the `settrailcolor <SG|CG|RL|RI|GL|PI> <color>` command (for convenience: changing the variables directly also works)

You can also adjust the trail colors in the options menu.

### [crosshairreloadfade.patch](./patches/crosshairreloadfade.patch)

- adds `crosshairreloadfade` variable: set to 0 to disable the "crosshair-goes-dark-while-weapon-reloads" effect
Expand All @@ -245,11 +247,13 @@ Client-side demos record the game as you experience it, and work independently o
- allows using <kbd>Ctrl</kbd>-<kbd>Left</kbd>/<kbd>Right</kbd> (<kbd>Option</kbd> on Mac) to jump over words in the console input
- allows using <kbd>Ctrl</kbd>-<kbd>Backspace</kbd>/<kbd>Delete</kbd> (<kbd>Option</kbd> on Mac) to delete entire words in the console input

With these changes, you can put the following into your autoexec.cfg for cleaner command prompts (replace the keys to your liking):
Also, you can put the following into your autoexec.cfg for cleaner command prompts (replace the keys to your liking):
```
bind "SLASH" [inputcommand "" [$commandbuf] "/" "cx"]
bind "BACKQUOTE" [inputcommand "" [$commandbuf] "/" "cx"]
bind "CARET" [inputcommand "" [$commandbuf] "/" "cx"] // BACKQUOTE on German keyboards
bind "BACKSLASH" [inputcommand "" [servcmd $commandbuf] "#"] // works for #commands on zeromod & spaghetti, hopefully soon on remod
bind "HASH" [inputcommand "" [servcmd $commandbuf] "#"] // only works with German keyboard layout
```

## Server Patches
Expand Down
143 changes: 142 additions & 1 deletion data/p1xbraten/menus.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,11 @@ newgui options [ ///////////////////////////////////////////////////////////////
]
guicheckbox "hit sound" hitsound
guicheckbox "blood" blood
guicheckbox "outline capture meters" outlinemeters
guilist [
guicheckbox "outline capture meters" outlinemeters
guistrut 1
guistayopen [ guibutton "adjust weapon trail colors" [showgui trailcolors] ]
]

guistrut 1

Expand Down Expand Up @@ -1460,6 +1464,8 @@ newgui options [ ///////////////////////////////////////////////////////////////
guicheckbox "teammates" teamcrosshair
guistrut 1
guicheckbox "hits" hitcrosshair 425
guistrut 1
guicheckbox "reload" crosshairreloadfade
]
] [
guistrut 1
Expand Down Expand Up @@ -2177,6 +2183,7 @@ newgui hudfragmessages [
] "hud frag messages"

newgui p1xbratenusage [
local players
players = (listclients 0 0 0)
guilist [
guilist [
Expand All @@ -2193,6 +2200,140 @@ newgui p1xbratenusage [
]
] "p1xbraten usage"

newgui trailcolors [

local _shotgun_red _shotgun_green _shotgun_blue
_shotgun_red = (& (>> $trailcolorshotgun 16) 0xFF)
_shotgun_green = (& (>> $trailcolorshotgun 8) 0xFF)
_shotgun_blue = (& $trailcolorshotgun 0xFF)

guilist [
guispring
guicolor $trailcolorshotgun
guispring
]
guistrut 1
guitext "^f3red" 0
guislider _shotgun_red 0 255 [ trailcolorshotgun $_shotgun_red $_shotgun_green $_shotgun_blue ]
guistrut 1
guitext "^f0green" 0
guislider _shotgun_green 0 255 [ trailcolorshotgun $_shotgun_red $_shotgun_green $_shotgun_blue ]
guistrut 1
guitext "^f1blue" 0
guislider _shotgun_blue 0 255 [ trailcolorshotgun $_shotgun_red $_shotgun_green $_shotgun_blue ]

guitab chaingun /////////////////

local _chaingun_red _chaingun_green _chaingun_blue
_chaingun_red = (& (>> $trailcolorchaingun 16) 0xFF)
_chaingun_green = (& (>> $trailcolorchaingun 8) 0xFF)
_chaingun_blue = (& $trailcolorchaingun 0xFF)

guilist [
guispring
guicolor $trailcolorchaingun
guispring
]
guistrut 1
guitext "^f3red" 0
guislider _chaingun_red 0 255 [ trailcolorchaingun $_chaingun_red $_chaingun_green $_chaingun_blue ]
guistrut 1
guitext "^f0green" 0
guislider _chaingun_green 0 255 [ trailcolorchaingun $_chaingun_red $_chaingun_green $_chaingun_blue ]
guistrut 1
guitext "^f1blue" 0
guislider _chaingun_blue 0 255 [ trailcolorchaingun $_chaingun_red $_chaingun_green $_chaingun_blue ]

guitab rocketlauncher /////////////////

local _rocketlauncher_red _rocketlauncher_green _rocketlauncher_blue
_rocketlauncher_red = (& (>> $trailcolorrocketlauncher 16) 0xFF)
_rocketlauncher_green = (& (>> $trailcolorrocketlauncher 8) 0xFF)
_rocketlauncher_blue = (& $trailcolorrocketlauncher 0xFF)

guilist [
guispring
guicolor $trailcolorrocketlauncher
guispring
]
guistrut 1
guitext "^f3red" 0
guislider _rocketlauncher_red 0 255 [ trailcolorrocketlauncher $_rocketlauncher_red $_rocketlauncher_green $_rocketlauncher_blue ]
guistrut 1
guitext "^f0green" 0
guislider _rocketlauncher_green 0 255 [ trailcolorrocketlauncher $_rocketlauncher_red $_rocketlauncher_green $_rocketlauncher_blue ]
guistrut 1
guitext "^f1blue" 0
guislider _rocketlauncher_blue 0 255 [ trailcolorrocketlauncher $_rocketlauncher_red $_rocketlauncher_green $_rocketlauncher_blue ]

guitab rifle /////////////////

local _rifle_red _rifle_green _rifle_blue
_rifle_red = (& (>> $trailcolorrifle 16) 0xFF)
_rifle_green = (& (>> $trailcolorrifle 8) 0xFF)
_rifle_blue = (& $trailcolorrifle 0xFF)

guilist [
guispring
guicolor $trailcolorrifle
guispring
]
guistrut 1
guitext "^f3red" 0
guislider _rifle_red 0 255 [ trailcolorrifle $_rifle_red $_rifle_green $_rifle_blue ]
guistrut 1
guitext "^f0green" 0
guislider _rifle_green 0 255 [ trailcolorrifle $_rifle_red $_rifle_green $_rifle_blue ]
guistrut 1
guitext "^f1blue" 0
guislider _rifle_blue 0 255 [ trailcolorrifle $_rifle_red $_rifle_green $_rifle_blue ]

guitab grenadelauncher /////////////////

local _grenadelauncher_red _grenadelauncher_green _grenadelauncher_blue
_grenadelauncher_red = (& (>> $trailcolorgrenadelauncher 16) 0xFF)
_grenadelauncher_green = (& (>> $trailcolorgrenadelauncher 8) 0xFF)
_grenadelauncher_blue = (& $trailcolorgrenadelauncher 0xFF)

guilist [
guispring
guicolor $trailcolorgrenadelauncher
guispring
]
guistrut 1
guitext "^f3red" 0
guislider _grenadelauncher_red 0 255 [ trailcolorgrenadelauncher $_grenadelauncher_red $_grenadelauncher_green $_grenadelauncher_blue ]
guistrut 1
guitext "^f0green" 0
guislider _grenadelauncher_green 0 255 [ trailcolorgrenadelauncher $_grenadelauncher_red $_grenadelauncher_green $_grenadelauncher_blue ]
guistrut 1
guitext "^f1blue" 0
guislider _grenadelauncher_blue 0 255 [ trailcolorgrenadelauncher $_grenadelauncher_red $_grenadelauncher_green $_grenadelauncher_blue ]

guitab pistol /////////////////

local _pistol_red _pistol_green _pistol_blue
_pistol_red = (& (>> $trailcolorpistol 16) 0xFF)
_pistol_green = (& (>> $trailcolorpistol 8) 0xFF)
_pistol_blue = (& $trailcolorpistol 0xFF)

guilist [
guispring
guicolor $trailcolorpistol
guispring
]
guistrut 1
guitext "^f3red" 0
guislider _pistol_red 0 255 [ trailcolorpistol $_pistol_red $_pistol_green $_pistol_blue ]
guistrut 1
guitext "^f0green" 0
guislider _pistol_green 0 255 [ trailcolorpistol $_pistol_red $_pistol_green $_pistol_blue ]
guistrut 1
guitext "^f1blue" 0
guislider _pistol_blue 0 255 [ trailcolorpistol $_pistol_red $_pistol_green $_pistol_blue ]

] "shotgun"

bindactions = [forward backward left right jump attack togglezoom saycommand sayteamcommand showscores toggleconsole screenshot edittoggle "setweapon FI" "setweapon SG" "setweapon CG" "setweapon RL" "setweapon RI" "setweapon GL" "setweapon PI" "weapon" "universaldelta 1" "universaldelta -1" dropflag addbot delbot]

entupdate = [ entset $entguitype $entguiattr0 $entguiattr1 $entguiattr2 $entguiattr3 $entguiattr4 ]
Expand Down
Loading

0 comments on commit afdf684

Please sign in to comment.