mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-04-28 13:17:58 +03:00
Fix migrators for tracker colors to match new menu formats. (#5369)
Add temporary additional clearing to CVarColorPicker's reset functionality to resolve already migrated issues.
This commit is contained in:
parent
c3322c85ae
commit
e98a6c3748
3 changed files with 32 additions and 31 deletions
|
@ -1087,14 +1087,6 @@ void CheckTrackerWindow::DrawElement() {
|
|||
bool doingCollapseOrExpand = optExpandAll || optCollapseAll;
|
||||
bool isThisAreaSpoiled;
|
||||
RandomizerCheckArea lastArea = RCAREA_INVALID;
|
||||
Color_RGBA8 areaCompleteColor =
|
||||
CVarGetColor(CVAR_TRACKER_CHECK("AreaComplete.MainColor.Value"), Color_Main_Default);
|
||||
Color_RGBA8 areaIncompleteColor =
|
||||
CVarGetColor(CVAR_TRACKER_CHECK("AreaIncomplete.MainColor.Value"), Color_Main_Default);
|
||||
Color_RGBA8 extraCompleteColor =
|
||||
CVarGetColor(CVAR_TRACKER_CHECK("AreaComplete.ExtraColor.Value"), Color_Area_Complete_Extra_Default);
|
||||
Color_RGBA8 extraIncompleteColor =
|
||||
CVarGetColor(CVAR_TRACKER_CHECK("AreaIncomplete.ExtraColor.Value"), Color_Area_Incomplete_Extra_Default);
|
||||
Color_RGBA8 mainColor;
|
||||
Color_RGBA8 extraColor;
|
||||
std::string stemp;
|
||||
|
@ -1122,11 +1114,11 @@ void CheckTrackerWindow::DrawElement() {
|
|||
} else {
|
||||
// Get the colour for the area
|
||||
if (thisAreaFullyChecked) {
|
||||
mainColor = areaCompleteColor;
|
||||
extraColor = extraCompleteColor;
|
||||
mainColor = Color_Area_Complete_Main;
|
||||
extraColor = Color_Area_Complete_Extra;
|
||||
} else {
|
||||
mainColor = areaIncompleteColor;
|
||||
extraColor = extraIncompleteColor;
|
||||
mainColor = Color_Area_Incomplete_Main;
|
||||
extraColor = Color_Area_Incomplete_Extra;
|
||||
}
|
||||
|
||||
// Draw the area
|
||||
|
|
|
@ -895,6 +895,12 @@ bool CVarColorPicker(const char* label, const char* cvarName, Color_RGBA8 defaul
|
|||
UIWidgets::ButtonOptions({ { .tooltip = "Resets this color to its default value" } })
|
||||
.Color(themeColor)
|
||||
.Size(UIWidgets::Sizes::Inline))) {
|
||||
// TODO: Remove for next minor or major version, temporary fix for already migrated configs to 3 for 9.0.0
|
||||
CVarClear((std::string(cvarName) + ".R").c_str());
|
||||
CVarClear((std::string(cvarName) + ".G").c_str());
|
||||
CVarClear((std::string(cvarName) + ".B").c_str());
|
||||
CVarClear((std::string(cvarName) + ".A").c_str());
|
||||
CVarClear((std::string(cvarName) + ".Type").c_str());
|
||||
CVarClearBlock(valueCVar.c_str());
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||
}
|
||||
|
|
|
@ -1263,10 +1263,10 @@ std::vector<Migration> version3Migrations = {
|
|||
{ MigrationAction::Rename, "gUnfixGoronSpin", "gCosmetics.UnfixGoronSpin" },
|
||||
{ MigrationAction::Rename, "gNL_Diamond_Env", "gCosmetics.Magic.NayrusSecondary" },
|
||||
{ MigrationAction::Rename, "gUseSpellsCol", "gCosmetics.UseSpellsColors" },
|
||||
{ MigrationAction::Rename, "gItemTrackerBgColorA", "gTrackers.ItemTracker.BgColorA" },
|
||||
{ MigrationAction::Rename, "gItemTrackerBgColorB", "gTrackers.ItemTracker.BgColorB" },
|
||||
{ MigrationAction::Rename, "gItemTrackerBgColorG", "gTrackers.ItemTracker.BgColorG" },
|
||||
{ MigrationAction::Rename, "gItemTrackerBgColorR", "gTrackers.ItemTracker.BgColorR" },
|
||||
{ MigrationAction::Rename, "gItemTrackerBgColorA", "gTrackers.ItemTracker.BgColor.Value.A" },
|
||||
{ MigrationAction::Rename, "gItemTrackerBgColorB", "gTrackers.ItemTracker.BgColor.Value.B" },
|
||||
{ MigrationAction::Rename, "gItemTrackerBgColorG", "gTrackers.ItemTracker.BgColor.Value.G" },
|
||||
{ MigrationAction::Rename, "gItemTrackerBgColorR", "gTrackers.ItemTracker.BgColor.Value.R" },
|
||||
{ MigrationAction::Rename, "gItemTrackerCapacityTrack", "gTrackers.ItemTracker.ItemCountType" },
|
||||
{ MigrationAction::Rename, "gItemTrackerComboButton1", "gTrackers.ItemTracker.ComboButton1" },
|
||||
{ MigrationAction::Rename, "gItemTrackerComboButton2", "gTrackers.ItemTracker.ComboButton2" },
|
||||
|
@ -1310,22 +1310,24 @@ std::vector<Migration> version3Migrations = {
|
|||
{ MigrationAction::Rename, "gEntranceTrackerSortBy", "gTrackers.EntranceTracker.SortBy" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerAreaCompleteHide", "gTrackers.CheckTracker.AreaComplete.Hide" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerAreaExtraCompleteColor",
|
||||
"gTrackers.CheckTracker.AreaComplete.ExtraColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerAreaExtraIncompleteColor",
|
||||
"gTrackers.CheckTracker.AreaIncomplete.ExtraColor" },
|
||||
"gTrackers.CheckTracker.AreaComplete.ExtraColor.Value" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerAreaExtraIncompleteColor.Value",
|
||||
"gTrackers.CheckTracker.AreaIncomplete.ExtraColor.Value" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerAreaIncompleteHide", "gTrackers.CheckTracker.AreaIncomplete.Hide" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerAreaMainCompleteColor", "gTrackers.CheckTracker.AreaComplete.MainColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerAreaMainIncompleteColor",
|
||||
"gTrackers.CheckTracker.AreaIncomplete.MainColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerBgColor", "gTrackers.CheckTracker.BgColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerCollectedExtraColor", "gTrackers.CheckTracker.Collected.ExtraColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerAreaMainCompleteColor",
|
||||
"gTrackers.CheckTracker.AreaComplete.MainColor.Value" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerAreaMainIncompleteColor.Value",
|
||||
"gTrackers.CheckTracker.AreaIncomplete.MainColor.Value" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerBgColor", "gTrackers.CheckTracker.BgColor.Value" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerCollectedExtraColor",
|
||||
"gTrackers.CheckTracker.Collected.ExtraColor.Value" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerCollectedHide", "gTrackers.CheckTracker.Collected.Hide" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerCollectedMainColor", "gTrackers.CheckTracker.Collected.MainColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerCollectedMainColor", "gTrackers.CheckTracker.Collected.MainColor.Value" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerComboButton1", "gTrackers.CheckTracker.ComboButton1" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerComboButton2", "gTrackers.CheckTracker.ComboButton2" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerDisplayType", "gTrackers.CheckTracker.DisplayType" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerHintedExtraColor", "gTrackers.CheckTracker.Hinted.ExtraColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerHintedMainColor", "gTrackers.CheckTracker.Hinted.MainColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerHintedExtraColor", "gTrackers.CheckTracker.Hinted.ExtraColor.Value" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerHintedMainColor", "gTrackers.CheckTracker.Hinted.MainColor.Value" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerHintedHide", "gTrackers.CheckTracker.Hinted.Hide" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerHudEditMode", "gTrackers.CheckTracker.Draggable" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerKnownHide", "gTrackers.CheckTracker.Scummed.Hide" },
|
||||
|
@ -1334,7 +1336,7 @@ std::vector<Migration> version3Migrations = {
|
|||
"gTrackers.CheckTracker.HideUnshuffledShopChecks" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerOptionMQSpoilers", "gTrackers.CheckTracker.MQSpoilers" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerOptionShowHidden", "gTrackers.CheckTracker.ShowHidden" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerSavedExtraColor", "gTrackers.CheckTracker.Saved.ExtraColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerSavedExtraColor", "gTrackers.CheckTracker.Saved.ExtraColor.Value" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerSavedHide", "gTrackers.CheckTracker.Saved.Hide" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerSavedMainColor", "gTrackers.CheckTracker.Saved.MainColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerScummedExtraColor", "gTrackers.CheckTracker.Scummed.ExtraColor" },
|
||||
|
@ -1345,10 +1347,11 @@ std::vector<Migration> version3Migrations = {
|
|||
{ MigrationAction::Rename, "gCheckTrackerShowOnlyPaused", "gTrackers.CheckTracker.ShowOnlyPaused" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerSkippedExtraColor", "gTrackers.CheckTracker.Skipped.ExtraColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerSkippedHide", "gTrackers.CheckTracker.Skipped.Hide" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerSkippedMainColor", "gTrackers.CheckTracker.Skipped.MainColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerUncheckedExtraColor", "gTrackers.CheckTracker.Unchecked.ExtraColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerSkippedMainColor", "gTrackers.CheckTracker.Skipped.MainColor.Value" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerUncheckedExtraColor",
|
||||
"gTrackers.CheckTracker.Unchecked.ExtraColor.Value" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerUncheckedHide", "gTrackers.CheckTracker.Unchecked.Hide" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerUncheckedMainColor", "gTrackers.CheckTracker.Unchecked.MainColor" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerUncheckedMainColor", "gTrackers.CheckTracker.Unchecked.MainColor.Value" },
|
||||
{ MigrationAction::Rename, "gCheckTrackerWindowType", "gTrackers.CheckTracker.WindowType" },
|
||||
{ MigrationAction::Rename, "gRandomize10GSHint", "gRandoSettings.10GSHint" },
|
||||
{ MigrationAction::Rename, "gRandomize20GSHint", "gRandoSettings.20GSHint" },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue