Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Version 1.5.0 (Trillium): Not yet released
- Load levels with very large face counts or many level sounds much faster

[@is-this-c](https://github.com/is-this-c)
- Add `bighud_health` and `bighud_ammo` console variables to disable `bighud` for health and ammo, which is useful for mods incompatible with `bighud`
- Render `LOADING...` upon level changes in multi
- Support TrueType fonts in 3D text rendering
- Render world HUD text (player labels, damage numbers, ping labels, countdowns) in 3D for smooth sub-pixel motion
Expand Down
48 changes: 46 additions & 2 deletions game_patch/hud/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static bool is_screen_resolution_too_low_for_big_hud()

void set_big_hud(bool is_big)
{
hud_status_set_big(is_big);
hud_status_set_big(is_big && g_alpine_game_config.big_hud_health);
multi_hud_chat_set_big(is_big);
hud_personas_set_big(is_big);
weapon_select_set_big(is_big);
Expand All @@ -167,7 +167,7 @@ void set_big_hud(bool is_big)
g_target_player_name_font = hud_get_default_font();

hud_setup_positions(rf::gr::screen_width());
hud_weapons_set_big(is_big);
hud_weapons_set_big(is_big && g_alpine_game_config.big_hud_ammo);
set_big_countdown_counter(is_big);

// TODO: Message Log - Note: it remembers text height in save files so method of recalculation is needed
Expand All @@ -189,6 +189,48 @@ ConsoleCommand2 bighud_cmd{
"bighud",
};

ConsoleCommand2 bighud_health_cmd{
"bighud_health",
[] (const std::optional<bool> enabled) {
g_alpine_game_config.big_hud_health =
enabled.value_or(!g_alpine_game_config.big_hud_health);
set_big_hud(g_alpine_game_config.big_hud);
if (!g_alpine_game_config.big_hud && g_alpine_game_config.big_hud_health) {
rf::console::print(
"Big HUD health is enabled but ignored, because big HUD is disabled"
);
} else {
rf::console::print(
"Big HUD health is {}",
g_alpine_game_config.big_hud_health ? "enabled" : "disabled"
);
}
},
"Toggle big HUD for health",
"bighud_health",
};

ConsoleCommand2 bighud_ammo_cmd{
"bighud_ammo",
[] (const std::optional<bool> enabled) {
g_alpine_game_config.big_hud_ammo =
enabled.value_or(!g_alpine_game_config.big_hud_ammo);
set_big_hud(g_alpine_game_config.big_hud);
if (!g_alpine_game_config.big_hud && g_alpine_game_config.big_hud_ammo) {
rf::console::print(
"Big HUD ammo is enabled but ignored, because big HUD is disabled"
);
} else {
rf::console::print(
"Big HUD ammo is {}",
g_alpine_game_config.big_hud_ammo ? "enabled" : "disabled"
);
}
},
"Toggle big HUD for ammo",
"bighud_ammo",
};

ConsoleCommand2 ui_realarmor_cmd{
"ui_realarmor",
[]() {
Expand Down Expand Up @@ -462,6 +504,8 @@ void hud_apply_patches()

// Other commands
bighud_cmd.register_cmd();
bighud_health_cmd.register_cmd();
bighud_ammo_cmd.register_cmd();
ui_realarmor_cmd.register_cmd();
#ifndef NDEBUG
hud_coords_cmd.register_cmd();
Expand Down
10 changes: 10 additions & 0 deletions game_patch/misc/alpine_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,14 @@ bool alpine_player_settings_load(rf::Player* player)
}

// Load UI settings
if (settings.count("BigHUDHealth")) {
g_alpine_game_config.big_hud_health = std::stoi(settings["BigHUDHealth"]);
processed_keys.insert("BigHUDHealth");
}
if (settings.count("BigHUDAmmo")) {
g_alpine_game_config.big_hud_ammo = std::stoi(settings["BigHUDAmmo"]);
processed_keys.insert("BigHUDAmmo");
}
if (settings.count("BigHUD")) {
g_alpine_game_config.big_hud = std::stoi(settings["BigHUD"]);
set_big_hud(g_alpine_game_config.big_hud);
Expand Down Expand Up @@ -1648,6 +1656,8 @@ void alpine_player_settings_save(rf::Player* player)
// UI
file << "\n[UISettings]\n";
file << "BigHUD=" << g_alpine_game_config.big_hud << "\n";
file << "BigHUDHealth=" << g_alpine_game_config.big_hud_health << "\n";
file << "BigHUDAmmo=" << g_alpine_game_config.big_hud_ammo << "\n";
if (g_alpine_game_config.sniper_scope_color_override) {
file << "SniperScopeColor=" << format_hex_color_string(*g_alpine_game_config.sniper_scope_color_override) << "\n";
}
Expand Down
2 changes: 2 additions & 0 deletions game_patch/misc/alpine_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ struct AlpineGameSettings
bool mouse_linear_pitch = true;
int mouse_scale = 0; // 0=Classic (RF native), 1=Raw (pure degrees), 2=Modern (id Tech/Source 0.022 deg/pixel)
bool big_hud = false;
bool big_hud_health = true;
bool big_hud_ammo = true;
int skip_cutscene_bind_alias = -1;
bool try_disable_weapon_shake = false;
bool try_fullbright_characters = false;
Expand Down
Loading