[General] Name the last two remaining used dvar flags

This commit is contained in:
Diavolo 2022-06-18 19:42:56 +02:00
parent e8aadc2382
commit abacd1c284
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5
9 changed files with 18 additions and 18 deletions

View File

@ -75,7 +75,7 @@ namespace Components
[[maybe_unused]] float y, float min, float max, [[maybe_unused]] int flags, const char* description) [[maybe_unused]] float y, float min, float max, [[maybe_unused]] int flags, const char* description)
{ {
return Game::Dvar_RegisterVec2(dvarName, -60.0f, return Game::Dvar_RegisterVec2(dvarName, -60.0f,
474.0f, min, max, Game::dvar_flag::DVAR_READONLY, description); 474.0f, min, max, Game::dvar_flag::DVAR_ROM, description);
} }
void Branding::RegisterBrandingDvars() void Branding::RegisterBrandingDvars()

View File

@ -328,7 +328,7 @@ namespace Components
Utils::Hook::Xor<BYTE>(0x4F9992, Game::dvar_flag::DVAR_ARCHIVE); Utils::Hook::Xor<BYTE>(0x4F9992, Game::dvar_flag::DVAR_ARCHIVE);
// remove write protection from fs_game // remove write protection from fs_game
Utils::Hook::Xor<DWORD>(0x6431EA, Game::dvar_flag::DVAR_WRITEPROTECTED); Utils::Hook::Xor<DWORD>(0x6431EA, Game::dvar_flag::DVAR_INIT);
// set cg_fov max to 160.0 // set cg_fov max to 160.0
// because that's the max on SP // because that's the max on SP
@ -349,8 +349,8 @@ namespace Components
Utils::Hook(0x40531C, Dvar::Dvar_RegisterName, HOOK_CALL).install()->quick(); Utils::Hook(0x40531C, Dvar::Dvar_RegisterName, HOOK_CALL).install()->quick();
// un-cheat safeArea_* and add archive flags // un-cheat safeArea_* and add archive flags
Utils::Hook::Xor<INT>(0x42E3F5, Game::dvar_flag::DVAR_READONLY | Game::dvar_flag::DVAR_ARCHIVE); //safeArea_adjusted_horizontal Utils::Hook::Xor<INT>(0x42E3F5, Game::dvar_flag::DVAR_ROM | Game::dvar_flag::DVAR_ARCHIVE); //safeArea_adjusted_horizontal
Utils::Hook::Xor<INT>(0x42E423, Game::dvar_flag::DVAR_READONLY | Game::dvar_flag::DVAR_ARCHIVE); //safeArea_adjusted_vertical Utils::Hook::Xor<INT>(0x42E423, Game::dvar_flag::DVAR_ROM | Game::dvar_flag::DVAR_ARCHIVE); //safeArea_adjusted_vertical
Utils::Hook::Xor<BYTE>(0x42E398, Game::dvar_flag::DVAR_CHEAT | Game::dvar_flag::DVAR_ARCHIVE); //safeArea_horizontal Utils::Hook::Xor<BYTE>(0x42E398, Game::dvar_flag::DVAR_CHEAT | Game::dvar_flag::DVAR_ARCHIVE); //safeArea_horizontal
Utils::Hook::Xor<BYTE>(0x42E3C4, Game::dvar_flag::DVAR_CHEAT | Game::dvar_flag::DVAR_ARCHIVE); //safeArea_vertical Utils::Hook::Xor<BYTE>(0x42E3C4, Game::dvar_flag::DVAR_CHEAT | Game::dvar_flag::DVAR_ARCHIVE); //safeArea_vertical

View File

@ -1711,8 +1711,8 @@ namespace Components
{ {
gpad_enabled = Dvar::Register<bool>("gpad_enabled", false, Game::DVAR_ARCHIVE, "Game pad enabled"); gpad_enabled = Dvar::Register<bool>("gpad_enabled", false, Game::DVAR_ARCHIVE, "Game pad enabled");
gpad_debug = Dvar::Register<bool>("gpad_debug", false, Game::DVAR_NONE, "Game pad debugging"); gpad_debug = Dvar::Register<bool>("gpad_debug", false, Game::DVAR_NONE, "Game pad debugging");
gpad_present = Dvar::Register<bool>("gpad_present", false, Game::DVAR_READONLY, "Game pad present"); gpad_present = Dvar::Register<bool>("gpad_present", false, Game::DVAR_ROM, "Game pad present");
gpad_in_use = Dvar::Register<bool>("gpad_in_use", false, Game::DVAR_READONLY, "A game pad is in use"); gpad_in_use = Dvar::Register<bool>("gpad_in_use", false, Game::DVAR_ROM, "A game pad is in use");
gpad_style = Dvar::Register<bool>("gpad_style", false, Game::DVAR_ARCHIVE, "Switch between Xbox and PS HUD"); gpad_style = Dvar::Register<bool>("gpad_style", false, Game::DVAR_ARCHIVE, "Switch between Xbox and PS HUD");
gpad_sticksConfig = Dvar::Register<const char*>("gpad_sticksConfig", "", Game::DVAR_ARCHIVE, "Game pad stick configuration"); gpad_sticksConfig = Dvar::Register<const char*>("gpad_sticksConfig", "", Game::DVAR_ARCHIVE, "Game pad stick configuration");
gpad_buttonConfig = Dvar::Register<const char*>("gpad_buttonConfig", "", Game::DVAR_ARCHIVE, "Game pad button configuration"); gpad_buttonConfig = Dvar::Register<const char*>("gpad_buttonConfig", "", Game::DVAR_ARCHIVE, "Game pad button configuration");

View File

@ -546,7 +546,7 @@ namespace Components
} }
} }
Dvar::Register<bool>(Utils::String::VA("isDlcInstalled_%d", dlc.index), false, Game::DVAR_EXTERNAL | Game::DVAR_WRITEPROTECTED, ""); Dvar::Register<bool>(Utils::String::VA("isDlcInstalled_%d", dlc.index), false, Game::DVAR_EXTERNAL | Game::DVAR_INIT, "");
Maps::DlcPacks.push_back(dlc); Maps::DlcPacks.push_back(dlc);
Maps::UpdateDlcStatus(); Maps::UpdateDlcStatus();
@ -776,7 +776,7 @@ namespace Components
{ {
Scheduler::Once([] Scheduler::Once([]
{ {
Dvar::Register<bool>("isDlcInstalled_All", false, Game::DVAR_EXTERNAL | Game::DVAR_WRITEPROTECTED, ""); Dvar::Register<bool>("isDlcInstalled_All", false, Game::DVAR_EXTERNAL | Game::DVAR_INIT, "");
Maps::RListSModels = Dvar::Register<bool>("r_listSModels", false, Game::DVAR_NONE, "Display a list of visible SModels"); Maps::RListSModels = Dvar::Register<bool>("r_listSModels", false, Game::DVAR_NONE, "Display a list of visible SModels");
Maps::AddDlc({ 1, "Stimulus Pack", {"mp_complex", "mp_compact", "mp_storm", "mp_overgrown", "mp_crash"} }); Maps::AddDlc({ 1, "Stimulus Pack", {"mp_complex", "mp_compact", "mp_storm", "mp_overgrown", "mp_crash"} });

View File

@ -41,7 +41,7 @@ namespace Components
Dvar::Register<bool>("g_firstLaunch", true, Game::DVAR_ARCHIVE, ""); Dvar::Register<bool>("g_firstLaunch", true, Game::DVAR_ARCHIVE, "");
Dvar::Register<int>("cl_updateoldversion", REVISION, REVISION, REVISION, Game::DVAR_WRITEPROTECTED, "Current version number."); Dvar::Register<int>("cl_updateoldversion", REVISION, REVISION, REVISION, Game::DVAR_INIT, "Current version number.");
UIScript::Add("checkFirstLaunch", [](UIScript::Token) UIScript::Add("checkFirstLaunch", [](UIScript::Token)
{ {

View File

@ -78,7 +78,7 @@ namespace Components
Game::dvar_t* Party::RegisterMinPlayers(const char* name, int /*value*/, int /*min*/, int max, Game::dvar_flag flag, const char* description) Game::dvar_t* Party::RegisterMinPlayers(const char* name, int /*value*/, int /*min*/, int max, Game::dvar_flag flag, const char* description)
{ {
return Dvar::Register<int>(name, 1, 1, max, Game::dvar_flag::DVAR_WRITEPROTECTED | flag, description).get<Game::dvar_t*>(); return Dvar::Register<int>(name, 1, 1, max, Game::dvar_flag::DVAR_INIT | flag, description).get<Game::dvar_t*>();
} }
bool Party::PlaylistAwaiting() bool Party::PlaylistAwaiting()
@ -155,7 +155,7 @@ namespace Components
Party::Party() Party::Party()
{ {
Party::PartyEnable = Dvar::Register<bool>("party_enable", Dedicated::IsEnabled(), Game::dvar_flag::DVAR_NONE, "Enable party system"); Party::PartyEnable = Dvar::Register<bool>("party_enable", Dedicated::IsEnabled(), Game::dvar_flag::DVAR_NONE, "Enable party system");
Dvar::Register<bool>("xblive_privatematch", true, Game::dvar_flag::DVAR_WRITEPROTECTED, ""); Dvar::Register<bool>("xblive_privatematch", true, Game::dvar_flag::DVAR_INIT, "");
// various changes to SV_DirectConnect-y stuff to allow non-party joinees // various changes to SV_DirectConnect-y stuff to allow non-party joinees
Utils::Hook::Set<WORD>(0x460D96, 0x90E9); Utils::Hook::Set<WORD>(0x460D96, 0x90E9);

View File

@ -61,8 +61,8 @@ namespace Components
return; return;
} }
constexpr auto disallowedFlags = (Game::DVAR_CHEAT | Game::DVAR_WRITEPROTECTED constexpr auto disallowedFlags = (Game::DVAR_CHEAT | Game::DVAR_INIT
| Game::DVAR_READONLY | Game::DVAR_EXTERNAL | Game::DVAR_LATCH); | Game::DVAR_ROM | Game::DVAR_EXTERNAL | Game::DVAR_LATCH);
// If it's a dvar check that it does not have disallowed flags // If it's a dvar check that it does not have disallowed flags
if ((dvar->flags & disallowedFlags) != 0) if ((dvar->flags & disallowedFlags) != 0)

View File

@ -9,9 +9,9 @@ namespace Components
{ {
Scheduler::Once([] Scheduler::Once([]
{ {
Dvar::Register<const char*>("ui_startupMessage", "", Game::DVAR_EXTERNAL | Game::DVAR_WRITEPROTECTED, ""); Dvar::Register<const char*>("ui_startupMessage", "", Game::DVAR_EXTERNAL | Game::DVAR_INIT, "");
Dvar::Register<const char*>("ui_startupMessageTitle", "", Game::DVAR_EXTERNAL | Game::DVAR_WRITEPROTECTED, ""); Dvar::Register<const char*>("ui_startupMessageTitle", "", Game::DVAR_EXTERNAL | Game::DVAR_INIT, "");
Dvar::Register<const char*>("ui_startupNextButtonText", "", Game::DVAR_EXTERNAL | Game::DVAR_WRITEPROTECTED, ""); Dvar::Register<const char*>("ui_startupNextButtonText", "", Game::DVAR_EXTERNAL | Game::DVAR_INIT, "");
}, Scheduler::Pipeline::MAIN); }, Scheduler::Pipeline::MAIN);
UIScript::Add("nextStartupMessage", [](UIScript::Token) UIScript::Add("nextStartupMessage", [](UIScript::Token)

View File

@ -148,9 +148,9 @@ namespace Game
DVAR_EXTERNAL = 1 << 8, // Created by a set command DVAR_EXTERNAL = 1 << 8, // Created by a set command
DVAR_USERINFO = 1 << 9, // Sent to server on connect or change DVAR_USERINFO = 1 << 9, // Sent to server on connect or change
DVAR_SERVERINFO = 1 << 10, // Sent in response to front end requests DVAR_SERVERINFO = 1 << 10, // Sent in response to front end requests
DVAR_WRITEPROTECTED = 1 << 11, DVAR_INIT = 1 << 11, // Don't allow change from console at all
DVAR_SYSTEMINFO = 1 << 12, // Will be duplicated on all clients DVAR_SYSTEMINFO = 1 << 12, // Will be duplicated on all clients
DVAR_READONLY = 1 << 13, // Read only (same as DVAR_WRITEPROTECTED?) DVAR_ROM = 1 << 13, // Display only, cannot be set by user at all
DVAR_SAVED = 1 << 14, DVAR_SAVED = 1 << 14,
DVAR_AUTOEXEC = 1 << 15, // isLoadingAutoExecGlobalFlag is always false so it should be never set by the game DVAR_AUTOEXEC = 1 << 15, // isLoadingAutoExecGlobalFlag is always false so it should be never set by the game
}; };