Add MOTD input

This commit is contained in:
mittorn 2015-10-27 10:15:59 +06:00
parent be67c60078
commit 7851be6f73
2 changed files with 22 additions and 6 deletions

View File

@ -208,7 +208,7 @@ private:
//
// REMOVED: Vgui has replaced this.
//
/*
class CHudMOTD : public CHudBase
{
public:
@ -218,14 +218,18 @@ public:
void Reset( void );
int MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf );
void Scroll( int dir );
void Scroll( float amount );
float scroll;
bool m_bShow;
protected:
static int MOTD_DISPLAY_TIME;
char m_szMOTD[ MAX_MOTD_LENGTH ];
float m_flActiveRemaining;
int m_iLines;
};
*/
class CHudScoreboard: public CHudBase
{
@ -645,6 +649,7 @@ public:
CHudTextMessage m_TextMessage;
CHudStatusIcons m_StatusIcons;
CHudScoreboard m_Scoreboard;
CHudMOTD m_MOTD;
void Init( void );
void VidInit( void );

View File

@ -683,8 +683,16 @@ void DLLEXPORT CL_CreateMove ( float frametime, struct usercmd_s *cmd, int activ
if ( !(in_klook.state & 1 ) )
{
cmd->forwardmove += cl_forwardspeed->value * CL_KeyState (&in_forward);
cmd->forwardmove -= cl_backspeed->value * CL_KeyState (&in_back);
if(gHUD.m_MOTD.m_bShow)
{
gHUD.m_MOTD.scroll -= CL_KeyState (&in_forward);
gHUD.m_MOTD.scroll += CL_KeyState (&in_back);
}
else
{
cmd->forwardmove += cl_forwardspeed->value * CL_KeyState (&in_forward);
cmd->forwardmove -= cl_backspeed->value * CL_KeyState (&in_back);
}
}
// adjust for speed key
@ -779,7 +787,10 @@ int CL_ButtonBits( int bResetState )
if ( in_attack.state & 3 )
{
bits |= IN_ATTACK;
if(gHUD.m_MOTD.m_bShow)
gHUD.m_MOTD.Reset();
else
bits |= IN_ATTACK;
}
if (in_duck.state & 3)