Add cl_show_centisecs

This commit is contained in:
def 2014-12-02 13:19:06 +01:00
parent d3837038eb
commit d0c85acc0d
2 changed files with 12 additions and 3 deletions

View file

@ -278,6 +278,7 @@ MACRO_CONFIG_INT(ClRaceGhost, cl_race_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAV
MACRO_CONFIG_INT(ClRaceShowGhost, cl_race_show_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ghost")
MACRO_CONFIG_INT(ClRaceSaveGhost, cl_race_save_ghost, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Save ghost")
MACRO_CONFIG_INT(ClDDRaceScoreBoard, cl_ddrace_scoreboard, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Enable DDRace Scoreboard ")
MACRO_CONFIG_INT(ClShowCentisecs, cl_show_centisecs, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Show centiseconds in game time")
MACRO_CONFIG_INT(SvResetPickups, sv_reset_pickups, 0, 0, 1, CFGFLAG_SERVER, "Whether the weapons are reset on passing the start tile or not")
MACRO_CONFIG_INT(ClShowOthers, cl_show_others, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show players in other teams")
MACRO_CONFIG_INT(ClShowOthersAlpha, cl_show_others_alpha, 40, 0, 100, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show players in other teams (alpha value, 0 invisible, 100 fully visible)")

View file

@ -62,14 +62,22 @@ void CHud::RenderGameTimer()
bool IsGameTypeRace = str_find_nocase(Info.m_aGameType, "race") || str_find_nocase(Info.m_aGameType, "fastcap");
bool IsGameTypeDDRace = str_find_nocase(Info.m_aGameType, "ddrace") || str_find_nocase(Info.m_aGameType, "mkrace");
if(Time <= 0)
if(Time <= 0 && g_Config.m_ClShowCentisecs)
str_format(Buf, sizeof(Buf), "00:00.0");
else if(Time <= 0)
str_format(Buf, sizeof(Buf), "00:00");
else if(IsGameTypeRace && !IsGameTypeDDRace && m_ServerRecord >= 0)
str_format(Buf, sizeof(Buf), "%02d:%02d", (int)(m_ServerRecord*100)/60, ((int)(m_ServerRecord*100)%60));
else
else if(g_Config.m_ClShowCentisecs)
str_format(Buf, sizeof(Buf), "%02d:%02d.%d", Time/60, Time%60, m_DDRaceTick/10);
else
str_format(Buf, sizeof(Buf), "%02d:%02d", Time/60, Time%60);
float FontSize = 10.0f;
float w = TextRender()->TextWidth(0, 12,"00:00.0",-1);
float w;
if(g_Config.m_ClShowCentisecs)
w = TextRender()->TextWidth(0, 12,"00:00.0",-1);
else
w = TextRender()->TextWidth(0, 12,"00:00",-1);
// last 60 sec red, last 10 sec blink
if(m_pClient->m_Snap.m_pGameInfoObj->m_TimeLimit && Time <= 60 && !m_pClient->m_Snap.m_pGameInfoObj->m_WarmupTimer)
{