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 @@ -15,6 +15,9 @@ Version 1.5.0 (TBD): Not yet released
[@GooberRF](https://github.com/GooberRF)
- Fix phantom visual flag mesh being visible after Salvage flag is picked up on rare occasions

[@is-this-c](https://github.com/is-this-c)
- Let `Caps Lock` capitalize

Version 1.4.0 (Lupin): Released Aug-25-2026
--------------------------------
### Major features
Expand Down
2 changes: 1 addition & 1 deletion game_patch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file(GLOB EXPERIMENTAL_SRCS experimental/*.cpp experimental/*.h)
file(GLOB_RECURSE EXPERIMENTAL_SRCS experimental/*.cpp experimental/*.h)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It allows code in sub-directories so it is useful. I have used it before but I do not use it at the moment. It is easier for me to have it upstream.


set(SRCS
main/main.cpp
Expand Down
2 changes: 1 addition & 1 deletion game_patch/graphics/gr_font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ int gr_fit_string(
return text_w;
}

while (text_w + suffix_w > max_width && !text.empty()) {
while (!text.empty() && (text_w + suffix_w > max_width || text.back() == ' ')) {
const auto [last_w, last_h] = rf::gr::get_char_size(text.back(), font_id);
text_w -= last_w;
text.pop_back();
Expand Down
2 changes: 2 additions & 0 deletions game_patch/input/key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ FunHook<int(int16_t)> key_to_ascii_hook{
if (key & rf::KEY_CTRLED) {
key_state[VK_CONTROL] = 0x80;
}
// HACKFIX. Must be set for `ToUnicode` to produce capitalized letters.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually a hackfix? Seems no? Isn't this the proper way to do this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a hackfix due to subtle timing issues. The key has been captured at an earlier time. But it is good enough imo.

key_state[VK_CAPITAL] = GetKeyState(VK_CAPITAL) & 1;
int scan_code = key & 0x7F;
auto vk = MapVirtualKeyA(scan_code, MAPVK_VSC_TO_VK);
WCHAR unicode_chars[3];
Expand Down
15 changes: 9 additions & 6 deletions game_patch/multi/dedi_cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2137,12 +2137,15 @@ void print_alpine_dedicated_server_config_info(std::string& output, bool verbose
std::format_to(iter, " Max players: {}\n", netgame.max_players);
std::format_to(iter, " Levels in rotation: {}\n", cfg.levels.size());
std::format_to(iter, " Dynamic rotation: {}\n", cfg.dynamic_rotation);
std::format_to(iter, " Demo auto record: {}\n", cfg.demo_auto_record);
std::format_to(iter, " Demo chat record: {}\n", cfg.demo_chat_record);
std::format_to(iter, " FactionFiles demo upload: {}\n", cfg.fflink_demo_upload);
std::format_to(iter, " FactionFiles demo max MB: {}\n", cfg.fflink_demo_max_mb);
std::format_to(iter, " FactionFiles demo queue max: {}\n", cfg.fflink_demo_queue_max);
std::format_to(iter, " FactionFiles demo delete after send: {}\n", cfg.fflink_demo_delete_after_send);
std::format_to(iter, " Demos:\n");
std::format_to(iter, " Include chat: {}\n", cfg.demo_chat_record);
std::format_to(iter, " Auto-record: {}\n", cfg.demo_auto_record);
std::format_to(iter, " Upload to FactionFiles: {}\n", cfg.fflink_demo_upload);
if (cfg.fflink_demo_upload) {
std::format_to(iter, " Max size: {} MiB\n", cfg.fflink_demo_max_mb);
std::format_to(iter, " Max queue: {}\n", cfg.fflink_demo_queue_max);
std::format_to(iter, " Delete after send: {}\n", cfg.fflink_demo_delete_after_send);
}

if (rf::mod_param.found()) {
std::format_to(iter, " TC mod loaded: {}\n", rf::mod_param.get_arg());
Expand Down
4 changes: 2 additions & 2 deletions game_patch/os/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ ConsoleCommand2 dot_cmd{
if (string_icontains(cmd->name, pattern)
|| (cmd->help && string_icontains(cmd->help, pattern))) {
if (cmd->help) {
rf::console::print("{} - {}", cmd->name, cmd->help);
rf::console::print(" {} - {}", cmd->name, cmd->help);
} else {
rf::console::print("{}", cmd->name);
rf::console::print(" {}", cmd->name);
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions game_patch/rf/os/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ namespace rf::console
output(s.c_str(), nullptr);
}

template <typename... Args>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended for future use? doesnt seem to be used currently?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be useful or I may use it later in a PR. I already do use it internally.

inline void print(
const rf::gr::Color& color,
const std::format_string<Args...> fmt,
Args&&... args
) {
const std::string s = std::format(fmt, std::forward<Args>(args)...);
output(s.c_str(), &color);
}

//static auto& commands = addr_as_ref<ConsoleCommand*[30]>(0x01775530);
static auto& num_commands = addr_as_ref<int>(0x0177567C);

Expand Down
Loading