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
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Version 1.5.0 (TBD): Not yet released
[@GooberRF](https://github.com/GooberRF)
- Restore cut first person weapon aim sway, toggleable with `cl_weaponsway`

[@nickalreadyinuse](https://github.com/nickalreadyinuse)
- Add `ui_color_console` console command to set the console background color

### Bug fixes

Version 1.4.0 (Lupin): Released Aug-25-2026
Expand Down
12 changes: 12 additions & 0 deletions game_patch/hud/hud_colors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,17 @@ ConsoleCommand2 r_outlines_color_team_cmd{
"r_outlines_color_team <RRGGBB|RRGGBBAA|clear>",
};

ConsoleCommand2 console_color_cmd{
"ui_color_console",
[](std::optional<std::string> color_opt) {
handle_required_color_command(color_opt, "Console background color", g_alpine_game_config.console_color,
AlpineGameSettings::default_console_color);
apply_console_color_setting();
},
"Set the console background color",
"ui_color_console <RRGGBB|RRGGBBAA|clear>",
};

void hud_colors_apply_patch()
{
sniper_scope_color_cmd.register_cmd();
Expand All @@ -357,4 +368,5 @@ void hud_colors_apply_patch()
r_outlines_color_team_b_cmd.register_cmd();
r_outlines_color_enemy_cmd.register_cmd();
r_outlines_color_team_cmd.register_cmd();
console_color_cmd.register_cmd();
}
9 changes: 9 additions & 0 deletions game_patch/misc/alpine_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,14 @@ bool alpine_player_settings_load(rf::Player* player)
apply_console_history_setting();
processed_keys.insert("SaveConsoleHistory");
}
if (settings.count("ConsoleColor")) {
auto c = parse_hex_color_string(settings["ConsoleColor"]);
if (c) {
g_alpine_game_config.console_color = *c;
apply_console_color_setting();
}
processed_keys.insert("ConsoleColor");
}
if (settings.count("AlpineBranding")) {
g_alpine_game_config.af_branding = std::stoi(settings["AlpineBranding"]);
processed_keys.insert("AlpineBranding");
Expand Down Expand Up @@ -1417,6 +1425,7 @@ void alpine_player_settings_save(rf::Player* player)
file << "ShowSpeed=" << g_alpine_game_config.speed_display << "\n";
file << "FPSCounterAverageMs=" << g_alpine_game_config.fps_counter_average_ms << "\n";
file << "SaveConsoleHistory=" << g_alpine_game_config.save_console_history << "\n";
file << "ConsoleColor=" << format_hex_color_string(g_alpine_game_config.console_color) << "\n";
file << "AlpineBranding=" << g_alpine_game_config.af_branding << "\n";
file << "SeasonalEffect=" << g_alpine_game_config.seasonal_effect << "\n";
file << "RealArmorValues=" << g_alpine_game_config.real_armor_values << "\n";
Expand Down
3 changes: 3 additions & 0 deletions game_patch/misc/alpine_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ struct AlpineGameSettings
bool spectate_show_camera_meshes = true; // draw camera meshes in free look
bool spectate_povcomp = true; // delay other players to match what the spectated player saw
bool save_console_history = false; // checked before config loaded, must be false here
static constexpr uint32_t default_console_color = 0x274E69C0; // RRGGBBAA
uint32_t console_color = default_console_color;
bool screen_shake_force_off = false;
bool display_target_player_names = true;
bool verbose_time_left_display = true;
Expand Down Expand Up @@ -457,6 +459,7 @@ void update_scanner_sensitivity();
void recalc_mesh_static_lighting();
void apply_show_enemy_bullets();
void apply_console_history_setting();
void apply_console_color_setting();
void build_time_left_string_format();
void gr_update_texture_filtering();
void set_play_sound_events_volume_scale();
Expand Down
15 changes: 10 additions & 5 deletions game_patch/os/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,15 @@ void apply_console_history_setting() {
rf::console::console_keep_history = g_alpine_game_config.save_console_history;
}

void apply_console_color_setting() {
auto [r, g, b, a] = extract_color_components(g_alpine_game_config.console_color);
write_mem<u32>(0x005098D1, a);
write_mem<u8>(0x005098D6, b);
write_mem<u8>(0x005098D8, g);
write_mem<u8>(0x005098DA, r);
rf::console::background_color.set(r, g, b, a);
}

extern void console_commands_apply_patches();
extern void console_auto_complete_apply_patches();
extern void console_commands_init();
Expand All @@ -342,11 +351,7 @@ void console_apply_patches()
write_mem_ptr(0x004B2534, "-- " PRODUCT_NAME " Initializing --\n");

// Console background color
constexpr rf::Color console_color{0x27, 0x4E, 0x69, 0xC0};
write_mem<u32>(0x005098D1, console_color.alpha);
write_mem<u8>(0x005098D6, console_color.blue);
write_mem<u8>(0x005098D8, console_color.green);
write_mem<u8>(0x005098DA, console_color.red);
apply_console_color_setting();

// Support unsigned hexadecimal arguments.
AsmWriter{0x0050B0B0}.call(std::strtoul);
Expand Down
1 change: 1 addition & 0 deletions game_patch/rf/os/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ namespace rf::console
static auto& history_max_index = addr_as_ref<int>(0x005A4030);
static auto& console_is_visible = addr_as_ref<bool()>(0x0050B520);
static auto& console_keep_history = addr_as_ref<bool>(0x005A402C);
static auto& background_color = addr_as_ref<Color>(0x017751DC);
}
Loading