Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add temporary loadout #1567

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
39 changes: 36 additions & 3 deletions config/ui/game/player.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ gameui_player_reset = [
append gameui_player_vanities_ids (gameui_player_find_vanity (at $gameui_player_vanities $i))
]

// Get loadout
gameui_player_loadout_slots = $playerloadweap
// Get saved loadout
gameui_player_loadout_slots = $playersavedloadweap

// Get loadout random filter
gameui_player_loadout_filter = 0
Expand All @@ -187,6 +187,21 @@ gameui_player_set = [
playervanity $gameui_player_vanities

// Don't attempt to set loadout if it's invalid
if (gameui_player_loadout_validate) [
playerloadweap $gameui_player_loadout_slots
defsvarp playersavedloadweap $gameui_player_loadout_slots

// Set loadout random filter
local _tmp
_tmp = []
loop i 32 [
append _tmp (& $gameui_player_loadout_filter (<< 1 $i))
]
playerrandweap $_tmp
]
]

gameui_player_temporary_loadout_set = [
if (gameui_player_loadout_validate) [
playerloadweap $gameui_player_loadout_slots

Expand Down Expand Up @@ -653,6 +668,24 @@ gameui_player_loadout_open_overlay = [
]
]
]

uifill 0 0.03

uihlist 0.05 [
uivlist 0.01 [
ui_gameui_button [
p_label = "Save for Match"
p_label_size = 1.5
p_width = 0.144
p_height = 0.05
p_on_click = [
gameui_player_temporary_loadout_set
]
p_border_scale = 0.5
p_id = #(gameui_get_id button)
]
]
]
]

# ui_gameui_player_loadout = [
Expand Down Expand Up @@ -1576,7 +1609,7 @@ ui_gameui_player_dims = 1.2

uihlist 0 [
ui_gameui_button [
p_label = "Reset"
p_label = "Undo Changes"
p_label_size = 1.5
p_width = 0.144
p_height = 0.05
Expand Down
2 changes: 1 addition & 1 deletion src/game/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4203,4 +4203,4 @@ namespace client
CLCOMMAND(sprinttime, intret(d->sprinttime));
CLCOMMAND(rotvelx, floatret(d->rotvel.x));
CLCOMMAND(rotvely, floatret(d->rotvel.y));
}
}