Merge fe08935be5
into 08ad16e750
This commit is contained in:
commit
7fb84da30d
|
@ -1 +1 @@
|
|||
Subproject commit 0da318c0f4e431313565cad546fc469b8e850388
|
||||
Subproject commit d39fce8187ad1eca5252a1f38c071c87b80d5dce
|
|
@ -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
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,4 +12,10 @@ namespace SOH {
|
|||
ConfigVersion2Updater();
|
||||
void Update(Ship::Config* conf);
|
||||
};
|
||||
}
|
||||
|
||||
class ConfigVersion3Updater : public Ship::ConfigVersionUpdater {
|
||||
public:
|
||||
ConfigVersion3Updater();
|
||||
void Update(Ship::Config* conf);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue