mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 06:13:45 -07:00
Check Tracker - Adds a performance mode option
This commit is contained in:
parent
fd88829aa6
commit
865d3cf4f7
1 changed files with 27 additions and 1 deletions
|
@ -376,12 +376,35 @@ void Teardown() {
|
||||||
doInitialize = true;
|
doInitialize = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int slowCheckIdx = 0;
|
||||||
|
// Checks only one check every call
|
||||||
|
bool SlowUpdateCheck() {
|
||||||
|
bool ret = false;
|
||||||
|
auto checkIt = checks.begin() + slowCheckIdx;
|
||||||
|
if (checkIt == checks.end()) {
|
||||||
|
slowCheckIdx = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
RandomizerCheckObject rcObj = *checkIt;
|
||||||
|
RandomizerCheckShow lastStatus = checkStatusMap.find(rcObj.rc)->second;
|
||||||
|
if (lastStatus != GetCheckStatus(rcObj, slowCheckIdx))
|
||||||
|
ret = true;
|
||||||
|
|
||||||
|
slowCheckIdx++;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
bool ShouldUpdateChecks() {
|
bool ShouldUpdateChecks() {
|
||||||
// TODO eventually will need to be hooked into game elements rather than just save file
|
// TODO eventually will need to be hooked into game elements rather than just save file
|
||||||
// TODO, saveCount isn't actually a thing. If not allowed to add it, will need to iterate over save bits and see if any changed
|
// TODO, saveCount isn't actually a thing. If not allowed to add it, will need to iterate over save bits and see if any changed
|
||||||
// TODO, or enhance hooks, but that is a LUS change
|
// TODO, or enhance hooks, but that is a LUS change
|
||||||
//return lastSaveCount != gSaveContext.sohStats.saveCount;
|
//return lastSaveCount != gSaveContext.sohStats.saveCount;
|
||||||
|
|
||||||
|
|
||||||
|
if (CVar_GetS32("gCheckTrackerOptionPerformanceMode", 0))
|
||||||
|
return SlowUpdateCheck();
|
||||||
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -765,6 +788,9 @@ void DrawCheckTrackerOptions(bool& open) {
|
||||||
UIWidgets::EnhancementCombobox("gCheckTrackerComboButton2", buttonStrings, 14, 8);
|
UIWidgets::EnhancementCombobox("gCheckTrackerComboButton2", buttonStrings, 14, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
UIWidgets::EnhancementCheckbox("Performance mode", "gCheckTrackerOptionPerformanceMode", 0);
|
||||||
|
UIWidgets::Tooltip("Slows down checking for updates to 1 check per frame. Only required if experiencing poor performance when using Check Tracker.");
|
||||||
|
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
|
|
||||||
ImGuiDrawTwoColorPickerSection("Area Incomplete", "gCheckTrackerAreaMainIncompleteColor", "gCheckTrackerAreaExtraIncompleteColor", Color_Area_Incomplete_Main, Color_Area_Incomplete_Extra, Color_Main_Default, Color_Area_Incomplete_Extra_Default, "gCheckTrackerAreaIncompleteHide" );
|
ImGuiDrawTwoColorPickerSection("Area Incomplete", "gCheckTrackerAreaMainIncompleteColor", "gCheckTrackerAreaExtraIncompleteColor", Color_Area_Incomplete_Main, Color_Area_Incomplete_Extra, Color_Main_Default, Color_Area_Incomplete_Extra_Default, "gCheckTrackerAreaIncompleteHide" );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue