mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-06 03:54:14 +00:00
Apply @mittorn's patch for nvg.
This commit is contained in:
parent
1b75238280
commit
1d9056fb27
@ -26,7 +26,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
DECLARE_MESSAGE( m_Flash, FlashBat )
|
||||
DECLARE_MESSAGE( m_Flash, Flashlight )
|
||||
//DECLARE_MESSAGE( m_Flash, Flashlight )
|
||||
|
||||
#define BAT_NAME "sprites/%d_Flashlight.spr"
|
||||
|
||||
@ -35,7 +35,7 @@ int CHudFlashlight::Init( void )
|
||||
m_fFade = 0;
|
||||
m_fOn = 0;
|
||||
|
||||
HOOK_MESSAGE( Flashlight );
|
||||
//HOOK_MESSAGE( Flashlight );
|
||||
HOOK_MESSAGE( FlashBat );
|
||||
|
||||
m_iFlags |= HUD_ACTIVE;
|
||||
|
@ -25,7 +25,8 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
DECLARE_MESSAGE(m_Nightvision, Nightvision)
|
||||
DECLARE_MESSAGE( m_Nightvision, Nightvision )
|
||||
DECLARE_MESSAGE( m_Nightvision, Flashlight )
|
||||
|
||||
#define NIGHTVISION_SPRITE1_NAME "sprites/of_nv.spr"
|
||||
#define NIGHTVISION_SPRITE2_NAME "sprites/of_nv_a.spr"
|
||||
@ -37,6 +38,7 @@ int CHudNightvision::Init(void)
|
||||
m_fOn = 0;
|
||||
|
||||
HOOK_MESSAGE(Nightvision);
|
||||
HOOK_MESSAGE(Flashlight);
|
||||
|
||||
m_iFlags |= HUD_ACTIVE;
|
||||
|
||||
@ -77,6 +79,14 @@ int CHudNightvision::MsgFunc_Nightvision(const char *pszName, int iSize, void *p
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CHudNightvision::MsgFunc_Flashlight( const char *pszName, int iSize, void *pbuf )
|
||||
{
|
||||
BEGIN_READ( pbuf, iSize );
|
||||
m_fOn = READ_BYTE();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CHudNightvision::Draw(float flTime)
|
||||
{
|
||||
if (gHUD.m_iHideHUDDisplay & (HIDEHUD_FLASHLIGHT | HIDEHUD_ALL))
|
||||
@ -131,4 +141,4 @@ int CHudNightvision::Draw(float flTime)
|
||||
m_iFrame++;
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -433,6 +433,7 @@ public:
|
||||
int Draw( float flTime );
|
||||
void Reset( void );
|
||||
int MsgFunc_Nightvision( const char *pszName, int iSize, void *pbuf );
|
||||
int MsgFunc_Flashlight( const char *pszName, int iSize, void *pbuf );
|
||||
|
||||
private:
|
||||
HSPRITE m_hSprite1, m_hSprite2, m_hSprite3, m_hSprite4;
|
||||
|
Loading…
x
Reference in New Issue
Block a user