More tweak CVars

parent b68acb06
This diff is collapsed.
......@@ -9,9 +9,9 @@ hecl::CVar* tw_fov = nullptr;
hecl::CVar* tw_hardmodeDMult = nullptr;
hecl::CVar* tw_hardmodeWMult = nullptr;
namespace {
constexpr std::string_view skFov = "tweaks.game.FieldOfView"sv;
constexpr std::string_view skHardModeDamageMultName = "tweaks.game.HardModeDamageMult"sv;
constexpr std::string_view skHardModeWeaponMultName = "tweaks.game.HardModeWeaponMult"sv;
constexpr std::string_view skFov = "tweak.game.FieldOfView"sv;
constexpr std::string_view skHardModeDamageMultName = "tweak.game.HardModeDamageMult"sv;
constexpr std::string_view skHardModeWeaponMultName = "tweak.game.HardModeWeaponMult"sv;
} // anonymous namespace
void CTweakGame::_tweakGameListener(hecl::CVar* cv) {
......@@ -29,7 +29,7 @@ void CTweakGame::initCVars(hecl::CVarManager* mgr) {
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->toReal();
v = static_cast<float>(cv->toReal());
cv->addListener([this](hecl::CVar* cv) { _tweakGameListener(cv); });
return cv;
};
......
......@@ -7,7 +7,7 @@ CPakFile::CPakFile(std::string_view filename, bool buildDepList, bool worldPak)
if (!CDvdFile::operator bool())
Log.report(logvisor::Fatal, fmt("{}: Unable to open"), GetPath());
x28_24_buildDepList = buildDepList;
x28_24_buildDepList = true; // Always do this so URDE can rapidly pre-warm shaders
//x28_24_buildDepList = true; // Always do this so URDE can rapidly pre-warm shaders
x28_26_worldPak = worldPak;
x28_27_stashedInARAM = false;
}
......
......@@ -82,7 +82,7 @@ void CTweaks::RegisterTweaks(hecl::CVarManager* cvarMgr) {
strm.emplace(g_ResFactory->LoadResourceSync(*tag).release(), g_ResFactory->ResourceSize(*tag), true);
g_tweakAutoMapper = new DataSpec::DNAMP1::CTweakAutoMapper(*strm);
CMappableObject::ReadAutoMapperTweaks(*g_tweakAutoMapper);
g_tweakPlayerGun->initCVars(cvarMgr);
g_tweakAutoMapper->initCVars(cvarMgr);
/* Gui */
tag = g_ResFactory->GetResourceIdByName("Gui");
......
......@@ -387,7 +387,8 @@ bool CMain::LoadAudio() {
void CMain::EnsureWorldPaksReady() {}
void CMain::EnsureWorldPakReady(CAssetId mlvl) { /* TODO: Schedule resource list load for World Pak containing mlvl */ }
void CMain::EnsureWorldPakReady(CAssetId mlvl) { /* TODO: Schedule resource list load for World Pak containing mlvl */
}
void CMain::Give(hecl::Console* console, const std::vector<std::string>& args) {
if (args.size() < 1 || (!g_GameState || !g_GameState->GetPlayerState()))
......@@ -404,6 +405,8 @@ void CMain::Give(hecl::Console* console, const std::vector<std::string>& args) {
CPlayerState::GetPowerUpMaxValue(CPlayerState::EItemType(item)));
}
pState->IncrPickup(CPlayerState::EItemType::HealthRefill, 99999);
} else if (type == "map") {
g_GameState->CurrentWorldState().MapWorldInfo()->SetMapStationUsed(true);
} else {
CPlayerState::EItemType eType = CPlayerState::ItemNameToType(type);
if (eType == CPlayerState::EItemType::Invalid) {
......@@ -444,7 +447,7 @@ void CMain::Give(hecl::Console* console, const std::vector<std::string>& args) {
if (g_StateManager)
g_StateManager->Player()->AsyncLoadSuit(*g_StateManager);
console->report(hecl::Console::Level::Info, fmt("Cheater....., Greatly increasing Metroid encounters, have fun!"));
}
} // namespace MP1
void CMain::Remove(hecl::Console*, const std::vector<std::string>& args) {
if (args.size() < 1 || (!g_GameState || !g_GameState->GetPlayerState()))
......@@ -453,11 +456,17 @@ void CMain::Remove(hecl::Console*, const std::vector<std::string>& args) {
std::string type = args[0];
athena::utility::tolower(type);
std::shared_ptr<CPlayerState> pState = g_GameState->GetPlayerState();
CPlayerState::EItemType eType = CPlayerState::ItemNameToType(type);
if (eType != CPlayerState::EItemType::Invalid) {
pState->ReInitalizePowerUp(eType, 0);
if (g_StateManager)
g_StateManager->Player()->AsyncLoadSuit(*g_StateManager);
if (type == "all") {
} else if (type == "map") {
g_GameState->CurrentWorldState().MapWorldInfo()->SetMapStationUsed(false);
} else {
CPlayerState::EItemType eType = CPlayerState::ItemNameToType(type);
if (eType != CPlayerState::EItemType::Invalid) {
pState->ReInitalizePowerUp(eType, 0);
if (g_StateManager)
g_StateManager->Player()->AsyncLoadSuit(*g_StateManager);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment