mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #2922
2922: Don't show wrong decisecs in game time in HUD r=heinrich5991 a=def- I think .me' reported this to me 7 years ago and I've been noticing that they're wrong since then. Time to remove I guess, they don't seem useful anyway. Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
commit
2a76cddb4e
|
@ -288,7 +288,6 @@ MACRO_CONFIG_INT(ClRaceGhostServerControl, cl_race_ghost_server_control, 1, 0, 1
|
|||
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(ClShowDecisecs, cl_show_decisecs, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Show deciseconds in game time")
|
||||
MACRO_CONFIG_INT(SvResetPickups, sv_reset_pickups, 0, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME, "Whether the weapons are reset on passing the start tile or not")
|
||||
MACRO_CONFIG_INT(ClShowOthers, cl_show_others, 0, 0, 2, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show players in other teams (2 to show own team only)")
|
||||
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)")
|
||||
|
|
|
@ -70,7 +70,6 @@ void CHud::OnReset()
|
|||
m_DDRaceTime = 0;
|
||||
m_LastReceivedTimeTick = 0;
|
||||
m_CheckpointTick = 0;
|
||||
m_DDRaceTick = 0;
|
||||
m_FinishTime = false;
|
||||
m_DDRaceTimeReceived = false;
|
||||
m_ServerRecord = -1.0f;
|
||||
|
@ -122,18 +121,20 @@ void CHud::RenderGameTimer()
|
|||
else
|
||||
Time = (Client()->GameTick(g_Config.m_ClDummy) - m_pClient->m_Snap.m_pGameInfoObj->m_RoundStartTick) / Client()->GameTickSpeed();
|
||||
|
||||
if(Time <= 0 && g_Config.m_ClShowDecisecs)
|
||||
str_format(aBuf, sizeof(aBuf), "00:00.0");
|
||||
else if(Time <= 0)
|
||||
if(Time <= 0)
|
||||
str_format(aBuf, sizeof(aBuf), "00:00");
|
||||
else if(g_Config.m_ClShowDecisecs)
|
||||
str_format(aBuf, sizeof(aBuf), "%02d:%02d.%d", Time / 60, Time % 60, m_DDRaceTick / 10);
|
||||
else if(Time >= 3600 * 24)
|
||||
str_format(aBuf, sizeof(aBuf), "%dd %02d:%02d:%02d", Time / (3600 * 24), (Time % (3600 * 24)) / 3600, (Time % 3600) / 60, Time % 60);
|
||||
else if(Time >= 3600)
|
||||
str_format(aBuf, sizeof(aBuf), "%02d:%02d:%02d", Time / 3600, (Time % 3600) / 60, Time % 60);
|
||||
else
|
||||
str_format(aBuf, sizeof(aBuf), "%02d:%02d", Time / 60, Time % 60);
|
||||
float FontSize = 10.0f;
|
||||
float w;
|
||||
if(g_Config.m_ClShowDecisecs)
|
||||
w = TextRender()->TextWidth(0, 12, "00:00.0", -1, -1.0f);
|
||||
if(Time >= 3600 * 24)
|
||||
w = TextRender()->TextWidth(0, 12, "00d 00:00:00", -1, -1.0f);
|
||||
else if(Time >= 3600)
|
||||
w = TextRender()->TextWidth(0, 12, "00:00:00", -1, -1.0f);
|
||||
else
|
||||
w = TextRender()->TextWidth(0, 12, "00:00", -1, -1.0f);
|
||||
// last 60 sec red, last 10 sec blink
|
||||
|
@ -804,16 +805,6 @@ void CHud::OnRender()
|
|||
RenderRecord();
|
||||
}
|
||||
RenderCursor();
|
||||
|
||||
static int LastChangeTick = 0;
|
||||
if(LastChangeTick != Client()->PredGameTick(g_Config.m_ClDummy))
|
||||
{
|
||||
m_DDRaceTick += 100 / Client()->GameTickSpeed();
|
||||
LastChangeTick = Client()->PredGameTick(g_Config.m_ClDummy);
|
||||
}
|
||||
|
||||
if(m_DDRaceTick >= 100)
|
||||
m_DDRaceTick = 0;
|
||||
}
|
||||
|
||||
void CHud::OnMessage(int MsgType, void *pRawMsg)
|
||||
|
@ -825,7 +816,6 @@ void CHud::OnMessage(int MsgType, void *pRawMsg)
|
|||
CNetMsg_Sv_DDRaceTime *pMsg = (CNetMsg_Sv_DDRaceTime *)pRawMsg;
|
||||
|
||||
m_DDRaceTime = pMsg->m_Time;
|
||||
m_DDRaceTick = 0;
|
||||
|
||||
m_LastReceivedTimeTick = Client()->GameTick(g_Config.m_ClDummy);
|
||||
|
||||
|
@ -856,7 +846,6 @@ void CHud::OnMessage(int MsgType, void *pRawMsg)
|
|||
m_DDRaceTimeReceived = true;
|
||||
|
||||
m_DDRaceTime = pMsg->m_ServerTimeBest; // First value: m_Time
|
||||
m_DDRaceTick = 0;
|
||||
|
||||
m_LastReceivedTimeTick = Client()->GameTick(g_Config.m_ClDummy);
|
||||
|
||||
|
@ -915,11 +904,6 @@ void CHud::RenderDDRaceEffects()
|
|||
TextRender()->TextColor(1, 1, 1, 1);
|
||||
}
|
||||
}
|
||||
/*else if(m_DDRaceTimeReceived)
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "%02d:%02d.%d", m_DDRaceTime/60, m_DDRaceTime%60, m_DDRaceTick/10);
|
||||
TextRender()->Text(0, 150*Graphics()->ScreenAspect()-TextRender()->TextWidth(0, 12, "00:00.0", -1, -1.0f)/2, 20, 12, aBuf, -1.0f); // use fixed value for text width so its not shaky
|
||||
}*/
|
||||
}
|
||||
|
||||
void CHud::RenderRecord()
|
||||
|
|
|
@ -84,7 +84,6 @@ private:
|
|||
int m_DDRaceTime;
|
||||
int m_LastReceivedTimeTick;
|
||||
int m_CheckpointTick;
|
||||
int m_DDRaceTick;
|
||||
bool m_FinishTime;
|
||||
bool m_DDRaceTimeReceived;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue