add cvar to change the demo date formatting
bruh
This commit is contained in:
1 parent
3e60b1b388
commit
892a59ff15
4 files changed
+11
-2
No files matched your search
@@ -1093,6 +1093,8 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_verticallook[i]);
|
||||
}
|
||||
|
||||
CV_RegisterVar(&cv_demodateformat);
|
||||
|
||||
// ingame object placing
|
||||
COM_AddCommand("objectplace", Command_ObjectPlace_f);
|
||||
COM_AddCommand("writethings", Command_Writethings_f);
|
||||
|
||||
+7
-2
@@ -341,6 +341,9 @@ consvar_t cv_maxdemosize = {"maxdemosize", "10", CV_SAVE, maxdemosize_cons_t, NU
|
||||
static CV_PossibleValue_t demochangemap_cons_t[] = {{0, "Disabled"}, {1, "Diff Map"}, {2, "Always"}, {0, NULL}};
|
||||
consvar_t cv_demochangemap = {"netdemo_savemapchange", "Disabled", CV_SAVE, demochangemap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t demodateformat_cons_t[] = {{0, "Automatic"}, {1, "EU"}, {2, "US"}, {0, NULL}};
|
||||
consvar_t cv_demodateformat = {"netdemo_dateformat", "Automatic", CV_SAVE, demodateformat_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// Analog Control
|
||||
void SendWeaponPref(void);
|
||||
void SendWeaponPref2(void);
|
||||
@@ -6890,10 +6893,12 @@ gotcreationtime:
|
||||
const char *format;
|
||||
|
||||
// US ppl are special (:
|
||||
if (strstr(setlocale(LC_TIME, NULL), "en_US"))
|
||||
if (cv_demodateformat.value == 2)
|
||||
format = "%m.%d.%Y";
|
||||
else
|
||||
else if (cv_demodateformat.value == 1)
|
||||
format = "%d.%m.%Y";
|
||||
else
|
||||
format = strstr(setlocale(LC_TIME, NULL), "en_US") ? "%m.%d.%Y" : "%d.%m.%Y";
|
||||
|
||||
strftime(datetime, sizeof(pdemo->date), format, &tm_buf);
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ extern savebuffer_t demobuf;
|
||||
|
||||
// demoplaying back and demo recording
|
||||
extern consvar_t cv_recordmultiplayerdemos, cv_netdemosyncquality, cv_maxdemosize, cv_demochangemap;
|
||||
extern consvar_t cv_demodateformat;
|
||||
|
||||
// Publicly-accessible demo vars
|
||||
struct demovars_s {
|
||||
|
||||
@@ -647,6 +647,7 @@ static menuitem_t MISC_ReplayOptionsMenu[] =
|
||||
{IT_CVAR|IT_STRING, NULL, "Sync Check Interval", &cv_netdemosyncquality, 20},
|
||||
{IT_CVAR|IT_STRING, NULL, "Max demo size (MiB)", &cv_maxdemosize, 30},
|
||||
{IT_CVAR|IT_STRING, NULL, "Replay Search Rate", &cv_replaysearchrate, 40},
|
||||
{IT_CVAR|IT_STRING, NULL, "Replay Date Format", &cv_demodateformat, 50},
|
||||
};
|
||||
|
||||
static tic_t playback_last_menu_interaction_leveltime = 0;
|
||||
|
||||
Reference in new issue
Block a user