mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 14:01:45 +00:00
Merge branch 'stats_native_ui'
# Conflicts: # src/d_stats.cpp
This commit is contained in:
commit
def0ea0103
2 changed files with 33 additions and 0 deletions
|
@ -2352,6 +2352,9 @@ void D_DoomMain (void)
|
|||
|
||||
D_DoomInit();
|
||||
|
||||
extern void D_ConfirmSendStats();
|
||||
D_ConfirmSendStats();
|
||||
|
||||
// [RH] Make sure zdoom.pk3 is always loaded,
|
||||
// as it contains magic stuff we need.
|
||||
wad = BaseFileSearch (BASEWAD, NULL, true);
|
||||
|
|
|
@ -29,6 +29,8 @@ extern int sys_ostype;
|
|||
|
||||
EXTERN_CVAR(Bool, vid_glswfb)
|
||||
extern int currentrenderer;
|
||||
|
||||
CVAR(Int, sys_statsenabled, -1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOSET)
|
||||
CVAR(String, sys_statshost, "gzstats.drdteam.org", CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOSET)
|
||||
CVAR(Int, sys_statsport, 80, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOSET)
|
||||
|
||||
|
@ -275,6 +277,11 @@ static void D_DoHTTPRequest(const char *request)
|
|||
|
||||
void D_DoAnonStats()
|
||||
{
|
||||
if (sys_statsenabled != 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static bool done = false; // do this only once per session.
|
||||
if (done) return;
|
||||
done = true;
|
||||
|
@ -292,3 +299,26 @@ void D_DoAnonStats()
|
|||
}
|
||||
|
||||
#endif // NO_SEND_STATS
|
||||
|
||||
void D_ConfirmSendStats()
|
||||
{
|
||||
if (sys_statsenabled >= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: texts
|
||||
static const char *const MESSAGE_TEXT = "send stats?";
|
||||
static const char *const TITLE_TEXT = GAMENAME;
|
||||
|
||||
UCVarValue enabled = { 0 };
|
||||
|
||||
#ifdef _WIN32
|
||||
extern HWND Window;
|
||||
enabled = { MessageBox(Window, MESSAGE_TEXT, TITLE_TEXT, MB_ICONQUESTION | MB_YESNO) == IDYES };
|
||||
#else
|
||||
// TODO
|
||||
#endif
|
||||
|
||||
sys_statsenabled.ForceSet(enabled, CVAR_Int);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue