revert: reinclude branding, preserve only localized menu str, remove dvar

This commit is contained in:
Rim 2025-03-21 19:04:31 -04:00
parent be65046ec7
commit 9f7e9738ac
4 changed files with 18 additions and 18 deletions

View File

@ -308,7 +308,7 @@ pchsource "src/client/std_include.cpp"
linkoptions {"/IGNORE:4254", "/DYNAMICBASE:NO", "/SAFESEH:NO", "/LARGEADDRESSAWARE", "/LAST:.main", "/PDBCompress"} linkoptions {"/IGNORE:4254", "/DYNAMICBASE:NO", "/SAFESEH:NO", "/LARGEADDRESSAWARE", "/LAST:.main", "/PDBCompress"}
files {"./src/client/**.rc", "./src/client/**.hpp", "./src/client/**.cpp", "./src/client/resources/**.*"} files {"./src/client/**.rc", "./src/client/**.hpp", "./src/client/**.cpp", "./src/client/resources/**.*"}
removefiles {"src/client/component/updater.cpp", "src/client/component/updater.hpp", "src/client/component/branding.cpp", "src/client/component/branding.cpp"} removefiles {"src/client/component/updater.cpp", "src/client/component/updater.hpp"}
-- filter { "configurations:Release", "files:src/client/component/updater.cpp" } -- filter { "configurations:Release", "files:src/client/component/updater.cpp" }
-- flags { "ExcludeFromBuild" } -- flags { "ExcludeFromBuild" }
@ -365,9 +365,9 @@ group "Dependencies"
dependencies.projects() dependencies.projects()
-- filter "projects:client" -- filter "projects:client"
-- removefiles {"src/client/component/updater.cpp", "src/client/component/updater.hpp", "src/client/component/branding.cpp", "src/client/component/branding.cpp"} -- removefiles {"src/client/component/updater.cpp", "src/client/component/updater.hpp"}
-- filter {} -- filter {}
-- filter {"projects:client", "configurations:Release", "files:src/client/component/updater.cpp", "src/client/component/branding.cpp"} -- filter {"projects:client", "configurations:Release", "files:src/client/component/updater.cpp"}
-- flags {"ExcludeFromBuild"} -- flags {"ExcludeFromBuild"}
-- filter {} -- filter {}

View File

@ -2,17 +2,17 @@
#include "loader/component_loader.hpp" #include "loader/component_loader.hpp"
#include "localized_strings.hpp" #include "localized_strings.hpp"
#include "scheduler.hpp" // #include "scheduler.hpp"
#include "version.hpp" // #include "version.hpp"
#include "game/game.hpp" #include "game/game.hpp"
#include "game/dvars.hpp" // #include "game/dvars.hpp"
#include "utils/hook.hpp" // #include "utils/hook.hpp"
#include <utils/string.hpp> // #include <utils/string.hpp>
namespace branding namespace branding
{ {
namespace /* namespace
{ {
utils::hook::detour ui_get_formatted_build_number_hook; utils::hook::detour ui_get_formatted_build_number_hook;
const char* ui_get_formatted_build_number_stub() const char* ui_get_formatted_build_number_stub()
@ -20,7 +20,7 @@ namespace branding
const auto build_num = ui_get_formatted_build_number_hook.invoke<const char*>(); const auto build_num = ui_get_formatted_build_number_hook.invoke<const char*>();
return utils::string::va("%s (%s)", VERSION, build_num); return utils::string::va("%s (%s)", VERSION, build_num);
} }
} } */
class component final : public component_interface class component final : public component_interface
{ {
@ -34,11 +34,11 @@ namespace branding
localized_strings::override("LUA_MENU_LEGAL_COPYRIGHT", "IW7-MOD"); localized_strings::override("LUA_MENU_LEGAL_COPYRIGHT", "IW7-MOD");
//localized_strings::override("MENU_SP_CAMPAIGN", "IW7-MOD: CAMPAIGN"); // localized_strings::override("MENU_SP_CAMPAIGN", "IW7-MOD: CAMPAIGN");
//localized_strings::override("LUA_MENU_MULTIPLAYER_CAPS", "IW7-MOD: MULTIPLAYER"); // localized_strings::override("LUA_MENU_MULTIPLAYER_CAPS", "IW7-MOD: MULTIPLAYER");
//localized_strings::override("LUA_MENU_ALIENS_CAPS", "IW7-MOD: ZOMBIES"); // localized_strings::override("LUA_MENU_ALIENS_CAPS", "IW7-MOD: ZOMBIES");
scheduler::once([]() /* scheduler::once([]()
{ {
dvars::branding = game::Dvar_RegisterBool("branding", false, game::DvarFlags::DVAR_FLAG_SAVED, "Show branding"); dvars::branding = game::Dvar_RegisterBool("branding", false, game::DvarFlags::DVAR_FLAG_SAVED, "Show branding");
}, scheduler::pipeline::renderer); }, scheduler::pipeline::renderer);
@ -59,7 +59,7 @@ namespace branding
static const auto offset_from_corner = 75.0f; static const auto offset_from_corner = 75.0f;
static float text_color[4] = { 0.4f, 0.69f, 1.0f, 0.69f }; static float text_color[4] = { 0.4f, 0.69f, 1.0f, 0.69f };
const auto x = (placement->realViewportSize[0] - offset_from_corner) - (game::R_TextWidth(version_buffer, std::numeric_limits<int>::max(), font)); const auto x = (placement->realViewportSize[0] - offset_from_corner) - (game::R_TextWidth(version_buffer, std::numeric_limits<int>::max(), font));
const auto height = (placement->realViewportSize[1] - offset_from_corner) + 5.0f; // remove some off the offset const auto height = (placement->realViewportSize[1] - offset_from_corner) + 5.0f; // remove some off the offset
@ -77,7 +77,7 @@ namespace branding
} }
}, scheduler::pipeline::renderer); }, scheduler::pipeline::renderer);
ui_get_formatted_build_number_hook.create(0x140CD1170, ui_get_formatted_build_number_stub); ui_get_formatted_build_number_hook.create(0x140CD1170, ui_get_formatted_build_number_stub); */
} }
}; };
} }

View File

@ -18,7 +18,7 @@ namespace dvars
game::dvar_t* con_inputDvarInactiveValueColor = nullptr; game::dvar_t* con_inputDvarInactiveValueColor = nullptr;
game::dvar_t* con_inputCmdMatchColor = nullptr; game::dvar_t* con_inputCmdMatchColor = nullptr;
game::dvar_t* branding = nullptr; // game::dvar_t* branding = nullptr;
game::dvar_t* lui_debug = nullptr; game::dvar_t* lui_debug = nullptr;

View File

@ -15,7 +15,7 @@ namespace dvars
extern game::dvar_t* con_inputDvarInactiveValueColor; extern game::dvar_t* con_inputDvarInactiveValueColor;
extern game::dvar_t* con_inputCmdMatchColor; extern game::dvar_t* con_inputCmdMatchColor;
extern game::dvar_t* branding; // extern game::dvar_t* branding;
extern game::dvar_t* lui_debug; extern game::dvar_t* lui_debug;