Use gBuildVersion instead of sohStats.buildVersion for gameplay stats (#2913)

Co-authored-by: Christopher Leggett <chris@leggett.dev>
This commit is contained in:
Garrett Cox 2023-05-27 17:09:24 -05:00 committed by GitHub
parent f4fbc79b5d
commit b9c2640671
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -434,7 +434,7 @@ void DrawGameplayStatsHeader() {
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, { 4.0f, 4.0f }); ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, { 4.0f, 4.0f });
ImGui::BeginTable("gameplayStatsHeader", 1, ImGuiTableFlags_BordersOuter); ImGui::BeginTable("gameplayStatsHeader", 1, ImGuiTableFlags_BordersOuter);
ImGui::TableSetupColumn("stat", ImGuiTableColumnFlags_WidthStretch); ImGui::TableSetupColumn("stat", ImGuiTableColumnFlags_WidthStretch);
GameplayStatsRow("Build Version:", gSaveContext.sohStats.buildVersion); GameplayStatsRow("Build Version:", (char*) gBuildVersion);
if (gSaveContext.sohStats.rtaTiming) { if (gSaveContext.sohStats.rtaTiming) {
GameplayStatsRow("Total Time (RTA):", formatTimestampGameplayStat(GAMEPLAYSTAT_TOTAL_TIME), gSaveContext.sohStats.gameComplete ? COLOR_GREEN : COLOR_WHITE); GameplayStatsRow("Total Time (RTA):", formatTimestampGameplayStat(GAMEPLAYSTAT_TOTAL_TIME), gSaveContext.sohStats.gameComplete ? COLOR_GREEN : COLOR_WHITE);
} else { } else {
@ -615,8 +615,8 @@ void DrawGameplayStatsOptionsTab() {
void DrawStatsTracker(bool& open) { void DrawStatsTracker(bool& open) {
if (!open) { if (!open) {
if (CVarGetInteger("gGameplayStatsEnabled", 0)) { if (CVarGetInteger("gGameplayStats.Enabled", 0)) {
CVarClear("gGameplayStatsEnabled"); CVarClear("gGameplayStats.Enabled");
LUS::RequestCvarSaveOnNextTick(); LUS::RequestCvarSaveOnNextTick();
} }
return; return;
@ -844,6 +844,7 @@ extern "C" void InitStatTracker() {
LUS::AddWindow("Enhancements", "Gameplay Stats", DrawStatsTracker, CVarGetInteger("gGameplayStats.Enabled", 0)); LUS::AddWindow("Enhancements", "Gameplay Stats", DrawStatsTracker, CVarGetInteger("gGameplayStats.Enabled", 0));
SetupDisplayNames(); SetupDisplayNames();
SetupDisplayColors(); SetupDisplayColors();
SaveManager::Instance->AddLoadFunction("sohStats", 1, LoadStatsVersion1); SaveManager::Instance->AddLoadFunction("sohStats", 1, LoadStatsVersion1);
// Add main section save, no parent // Add main section save, no parent
SaveManager::Instance->AddSaveFunction("sohStats", 1, SaveStats, true, SECTION_PARENT_NONE); SaveManager::Instance->AddSaveFunction("sohStats", 1, SaveStats, true, SECTION_PARENT_NONE);
@ -851,4 +852,4 @@ extern "C" void InitStatTracker() {
SaveManager::Instance->AddSaveFunction("entrances", 1, SaveStats, false, SECTION_ID_STATS); SaveManager::Instance->AddSaveFunction("entrances", 1, SaveStats, false, SECTION_ID_STATS);
SaveManager::Instance->AddSaveFunction("scenes", 1, SaveStats, false, SECTION_ID_STATS); SaveManager::Instance->AddSaveFunction("scenes", 1, SaveStats, false, SECTION_ID_STATS);
SaveManager::Instance->AddInitFunction(InitStats); SaveManager::Instance->AddInitFunction(InitStats);
} }