mirror of https://github.com/AxioDL/metaforce.git
CTweakGame: Add tweak.game.SplashScreensDisabled CVar
This commit is contained in:
parent
7f15390d4f
commit
81c2e5b03c
|
@ -8,10 +8,12 @@ namespace DataSpec::DNAMP1 {
|
||||||
hecl::CVar* tw_fov = nullptr;
|
hecl::CVar* tw_fov = nullptr;
|
||||||
hecl::CVar* tw_hardmodeDMult = nullptr;
|
hecl::CVar* tw_hardmodeDMult = nullptr;
|
||||||
hecl::CVar* tw_hardmodeWMult = nullptr;
|
hecl::CVar* tw_hardmodeWMult = nullptr;
|
||||||
|
hecl::CVar* tw_splashScreensDisabled = nullptr;
|
||||||
namespace {
|
namespace {
|
||||||
constexpr std::string_view skFov = "tweak.game.FieldOfView"sv;
|
constexpr std::string_view skFov = "tweak.game.FieldOfView"sv;
|
||||||
constexpr std::string_view skHardModeDamageMultName = "tweak.game.HardModeDamageMult"sv;
|
constexpr std::string_view skHardModeDamageMultName = "tweak.game.HardModeDamageMult"sv;
|
||||||
constexpr std::string_view skHardModeWeaponMultName = "tweak.game.HardModeWeaponMult"sv;
|
constexpr std::string_view skHardModeWeaponMultName = "tweak.game.HardModeWeaponMult"sv;
|
||||||
|
constexpr std::string_view skSplashScreensDisabled = "tweak.game.SplashScreensDisabled"sv;
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
void CTweakGame::_tweakGameListener(hecl::CVar* cv) {
|
void CTweakGame::_tweakGameListener(hecl::CVar* cv) {
|
||||||
|
@ -21,6 +23,8 @@ void CTweakGame::_tweakGameListener(hecl::CVar* cv) {
|
||||||
x60_hardmodeDamageMult = cv->toReal();
|
x60_hardmodeDamageMult = cv->toReal();
|
||||||
} else if (cv == tw_hardmodeWMult) {
|
} else if (cv == tw_hardmodeWMult) {
|
||||||
x64_hardmodeWeaponMult = cv->toReal();
|
x64_hardmodeWeaponMult = cv->toReal();
|
||||||
|
} else if (cv == tw_splashScreensDisabled) {
|
||||||
|
x2b_splashScreensDisabled = cv->toBoolean();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,14 +37,23 @@ void CTweakGame::initCVars(hecl::CVarManager* mgr) {
|
||||||
cv->addListener([this](hecl::CVar* cv) { _tweakGameListener(cv); });
|
cv->addListener([this](hecl::CVar* cv) { _tweakGameListener(cv); });
|
||||||
return cv;
|
return cv;
|
||||||
};
|
};
|
||||||
|
auto assignBoolValue = [this, mgr](std::string_view name, std::string_view desc, bool& v, hecl::CVar::EFlags flags) {
|
||||||
|
hecl::CVar* cv = mgr->findOrMakeCVar(name, desc, v, flags);
|
||||||
|
// Check if the CVar was deserialized, this avoid an unnecessary conversion
|
||||||
|
if (cv->wasDeserialized())
|
||||||
|
v = cv->toBoolean();
|
||||||
|
cv->addListener([this](hecl::CVar* cv) { _tweakGameListener(cv); });
|
||||||
|
return cv;
|
||||||
|
};
|
||||||
|
|
||||||
tw_fov = assignRealValue(skFov, "", x24_fov,
|
tw_fov = assignRealValue(skFov, "", x24_fov, hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive);
|
||||||
hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive);
|
|
||||||
tw_hardmodeDMult =
|
tw_hardmodeDMult =
|
||||||
assignRealValue(skHardModeDamageMultName, "", x60_hardmodeDamageMult,
|
assignRealValue(skHardModeDamageMultName, "", x60_hardmodeDamageMult,
|
||||||
hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive | hecl::CVar::EFlags::Cheat);
|
hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive | hecl::CVar::EFlags::Cheat);
|
||||||
tw_hardmodeWMult =
|
tw_hardmodeWMult =
|
||||||
assignRealValue(skHardModeWeaponMultName, "", x64_hardmodeWeaponMult,
|
assignRealValue(skHardModeWeaponMultName, "", x64_hardmodeWeaponMult,
|
||||||
hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive | hecl::CVar::EFlags::Cheat);
|
hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive | hecl::CVar::EFlags::Cheat);
|
||||||
|
tw_splashScreensDisabled = assignBoolValue(skSplashScreensDisabled, "", x2b_splashScreensDisabled,
|
||||||
|
hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive);
|
||||||
}
|
}
|
||||||
} // namespace DataSpec::DNAMP1
|
} // namespace DataSpec::DNAMP1
|
||||||
|
|
2
hecl-gui
2
hecl-gui
|
@ -1 +1 @@
|
||||||
Subproject commit db38d19ac3ed624f4e55fb071c177db4feed3ce0
|
Subproject commit c66d33b0b2fca695c39d1c0c829489ba67a52f47
|
Loading…
Reference in New Issue