Log PC patch menu function filtering

This commit is contained in:
2026-06-07 11:49:46 -04:00
parent 943bb20cec
commit eb7457a436
+31 -2
View File
@@ -455,15 +455,44 @@ std::shared_ptr<const Menu> ClientFunctionIndex::patch_switches_menu(
auto map_it = this->functions_by_specific_version.find(specific_version);
if (map_it != this->functions_by_specific_version.end()) {
client_functions_log.warning_f(
"Patch menu debug: building menu for specific_version={} with {} function entries",
str_for_specific_version(specific_version),
map_it->second.size());
for (auto [name, fn] : map_it->second) {
if (fn->appears_in_patches_menu() && !server_auto_patches_enabled.count(fn->short_name)) {
bool appears = fn->appears_in_patches_menu();
bool server_auto = server_auto_patches_enabled.count(fn->short_name);
bool client_enabled = client_auto_patches_enabled.count(fn->short_name);
bool dragon_debug =
(fn->short_name.find("Dragon") != std::string::npos) ||
(fn->long_name.find("Dragon") != std::string::npos);
if (dragon_debug || appears) {
client_functions_log.warning_f(
"Patch menu debug: key={} short={} long={} visibility={} appears={} server_auto={} client_enabled={} menu_item_id={:08X}",
name,
fn->short_name,
fn->long_name,
phosg::name_for_enum(fn->visibility),
appears,
server_auto,
client_enabled,
static_cast<uint32_t>(fn->menu_item_id));
}
if (appears && !server_auto) {
std::string item_text;
item_text.push_back(client_auto_patches_enabled.count(fn->short_name) ? '*' : '-');
item_text.push_back(client_enabled ? '*' : '-');
item_text += fn->long_name.empty() ? fn->short_name : fn->long_name;
ret->items.emplace_back(
fn->menu_item_id, item_text, fn->description, MenuItem::Flag::REQUIRES_SEND_FUNCTION_CALL_RUNS_CODE);
}
}
} else {
client_functions_log.warning_f(
"Patch menu debug: no functions for specific_version={}",
str_for_specific_version(specific_version));
}
return ret;
}