diff --git a/src/g_gamedata.cpp b/src/g_gamedata.cpp index d95b3796e..b8f54656d 100644 --- a/src/g_gamedata.cpp +++ b/src/g_gamedata.cpp @@ -52,6 +52,7 @@ void srb2::save_ng_gamedata() ng.playtime.special = gamedata->modeplaytime[GDGT_SPECIAL]; ng.playtime.custom = gamedata->modeplaytime[GDGT_CUSTOM]; ng.playtime.menus = gamedata->totalmenutime; + ng.playtime.statistics = gamedata->totaltimestaringatstatistics; ng.rings.total = gamedata->totalrings; ng.playtime.tumble = gamedata->totaltumbletime; ng.rounds.race = gamedata->roundsplayed[GDGT_RACE]; @@ -434,6 +435,7 @@ void srb2::load_ng_gamedata() gamedata->modeplaytime[GDGT_SPECIAL] = js.playtime.special; gamedata->modeplaytime[GDGT_CUSTOM] = js.playtime.custom; gamedata->totalmenutime = js.playtime.menus; + gamedata->totaltimestaringatstatistics = js.playtime.statistics; gamedata->totalrings = js.rings.total; gamedata->totaltumbletime = js.playtime.tumble; gamedata->roundsplayed[GDGT_RACE] = js.rounds.race; diff --git a/src/g_gamedata.h b/src/g_gamedata.h index 0b34c477a..1c7260c81 100644 --- a/src/g_gamedata.h +++ b/src/g_gamedata.h @@ -33,6 +33,7 @@ struct GamedataPlaytimeJson final uint32_t special; uint32_t custom; uint32_t menus; + uint32_t statistics; uint32_t tumble; NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT( @@ -44,6 +45,7 @@ struct GamedataPlaytimeJson final special, custom, menus, + statistics, tumble ) }; diff --git a/src/m_cond.c b/src/m_cond.c index e113d0b9f..019f10ada 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -655,6 +655,7 @@ void M_ClearStats(void) for (i = 0; i < GDGT_MAX; ++i) gamedata->modeplaytime[i] = 0; gamedata->totalmenutime = 0; + gamedata->totaltimestaringatstatistics = 0; gamedata->totalrings = 0; gamedata->totaltumbletime = 0; for (i = 0; i < GDGT_MAX; ++i) diff --git a/src/m_cond.h b/src/m_cond.h index c90877383..25abd437b 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -371,6 +371,7 @@ struct gamedata_t UINT32 totalplaytime; UINT32 modeplaytime[GDGT_MAX]; UINT32 totalmenutime; + UINT32 totaltimestaringatstatistics; UINT32 roundsplayed[GDGT_MAX]; UINT32 totalrings; UINT32 totaltumbletime; diff --git a/src/menus/extras-challenges.c b/src/menus/extras-challenges.c index dfc0bd69e..dc488f953 100644 --- a/src/menus/extras-challenges.c +++ b/src/menus/extras-challenges.c @@ -23,6 +23,12 @@ extern consvar_t cv_debugchallenges; #endif +static void M_StatisticsTicker(void) +{ + // the funny + gamedata->totaltimestaringatstatistics++; +} + menuitem_t MISC_ChallengesStatsDummyMenu[] = { {IT_STRING | IT_CALL, "Back", NULL, NULL, {.routine = M_GoBack}, 0, 0}, @@ -60,7 +66,7 @@ menu_t MISC_StatisticsDef = { 98, 0, M_DrawStatistics, M_DrawExtrasBack, - NULL, + M_StatisticsTicker, NULL, NULL, M_StatisticsInputs,