Skip to content

Commit

Permalink
new ConVars: redm_mode_title_hud_x, redm_mode_title_hud_y (#126)
Browse files Browse the repository at this point in the history
Mode title HUD position.
  • Loading branch information
SergeyShorokhov authored Jun 23, 2024
1 parent 712ba01 commit 527ddbc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cstrike/addons/amxmodx/configs/redm/gamemode_deathmatch.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@
// How many times can the game mode be extended.
"redm_mode_vote_extend_times": "1",

// Mode title HUD X position.
"redm_mode_title_hud_x": "-1.0",

// Mode title HUD Y position.
"redm_mode_title_hud_y": "0.85",

// ReGameDLL Settings
"mp_freeforall": "1",
"bot_deathmatch": "1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ static g_currentRoundModeIdx = RoundMode_NotSet
static g_forcedModeIdx = RoundMode_NotSet

static redm_modes_switch[32]
static Float: redm_mode_title_hud_x
static Float: redm_mode_title_hud_y

RoundModes_Init() {
register_dictionary("redm/modes.txt")
Expand All @@ -27,6 +29,26 @@ RoundModes_Init() {
redm_modes_switch,
charsmax(redm_modes_switch)
)
bind_pcvar_float(
create_cvar(
"redm_mode_title_hud_x", "-1.0",
.has_min = true, .min_val = -1.0,
.has_max = true, .max_val = 1.0,
.flags = _FCVAR_FLOAT,
.description = "Mode title HUD X position."
),
redm_mode_title_hud_x
)
bind_pcvar_float(
create_cvar(
"redm_mode_title_hud_y", "0.85",
.has_min = true, .min_val = -1.0,
.has_max = true, .max_val = 1.0,
.flags = _FCVAR_FLOAT,
.description = "Mode title HUD Y position."
),
redm_mode_title_hud_y
)

ModesMenus_Init()
ModeVote_Init()
Expand Down Expand Up @@ -121,7 +143,8 @@ public RoundInfoMessage(const player) {
.red = 200,
.green = 200,
.blue = 200,
.y = 0.85,
.x = redm_mode_title_hud_x,
.y = redm_mode_title_hud_y,
.holdtime = 4.0
)

Expand Down

0 comments on commit 527ddbc

Please sign in to comment.