This commit is contained in:
Malkierian 2024-05-13 03:46:22 +00:00 committed by GitHub
commit 7fb84da30d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 1488 additions and 2 deletions

@ -1 +1 @@
Subproject commit 0da318c0f4e431313565cad546fc469b8e850388
Subproject commit d39fce8187ad1eca5252a1f38c071c87b80d5dce

View File

@ -1186,6 +1186,7 @@ extern "C" void InitOTR() {
std::shared_ptr<Ship::Config> conf = OTRGlobals::Instance->context->GetConfig();
conf->RegisterConfigVersionUpdater(std::make_shared<SOH::ConfigVersion1Updater>());
conf->RegisterConfigVersionUpdater(std::make_shared<SOH::ConfigVersion2Updater>());
conf->RegisterConfigVersionUpdater(std::make_shared<SOH::ConfigVersion3Updater>());
conf->RunVersionUpdates();
}

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,11 @@
#include "ConfigUpdaters.h"
#include "ConfigMigrators.h"
#include "soh/Enhancements/audio/AudioCollection.h"
namespace SOH {
ConfigVersion1Updater::ConfigVersion1Updater() : ConfigVersionUpdater(1) {}
ConfigVersion2Updater::ConfigVersion2Updater() : ConfigVersionUpdater(2) {}
ConfigVersion3Updater::ConfigVersion3Updater() : ConfigVersionUpdater(3) {}
void ConfigVersion1Updater::Update(Ship::Config* conf) {
if (conf->GetInt("Window.Width", 640) == 640) {
@ -68,4 +70,14 @@ namespace SOH {
CVarClear(std::string("gAudioEditor.ReplacedSequences." + seq.second.sfxKey).c_str());
}
}
void ConfigVersion3Updater::Update(Ship::Config* conf) {
conf->EraseBlock("Controllers");
for (Migration migration : version3Migrations) {
if (migration.action == MigrationAction::Rename) {
CVarCopy(migration.from.c_str(), migration.to.value().c_str());
}
CVarClear(migration.from.c_str());
}
}
}

View File

@ -12,4 +12,10 @@ namespace SOH {
ConfigVersion2Updater();
void Update(Ship::Config* conf);
};
}
class ConfigVersion3Updater : public Ship::ConfigVersionUpdater {
public:
ConfigVersion3Updater();
void Update(Ship::Config* conf);
};
}