2
0
mirror of https://github.com/rehlds/reapi.git synced 2024-12-28 07:35:31 +03:00

API: UpdateStatusBar

This commit is contained in:
GLoOoccK 2024-06-13 13:02:04 -03:00
parent e5771ba16c
commit 492c865853
6 changed files with 24 additions and 0 deletions

View File

@ -940,6 +940,12 @@ enum GamedllFunc_CBasePlayer
* Params: (const this, bool:removeSuit) * Params: (const this, bool:removeSuit)
*/ */
RG_CBasePlayer_RemoveAllItems, RG_CBasePlayer_RemoveAllItems,
/*
* Description: -
* Params: (const this)
*/
RG_CBasePlayer_UpdateStatusBar,
}; };
/** /**

View File

@ -630,6 +630,10 @@ typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBa
typedef IHookChainClass<void, class CBasePlayer, BOOL> IReGameHook_CBasePlayer_RemoveAllItems; typedef IHookChainClass<void, class CBasePlayer, BOOL> IReGameHook_CBasePlayer_RemoveAllItems;
typedef IHookChainRegistryClass<void, class CBasePlayer, BOOL> IReGameHookRegistry_CBasePlayer_RemoveAllItems; typedef IHookChainRegistryClass<void, class CBasePlayer, BOOL> IReGameHookRegistry_CBasePlayer_RemoveAllItems;
// CBasePlayer::UpdateStatusBar hook
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_UpdateStatusBar;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_UpdateStatusBar;
class IReGameHookchains { class IReGameHookchains {
public: public:
virtual ~IReGameHookchains() {} virtual ~IReGameHookchains() {}
@ -792,6 +796,7 @@ public:
virtual IReGameHookRegistry_CBasePlayer_PlayerDeathThink *CBasePlayer_PlayerDeathThink() = 0; virtual IReGameHookRegistry_CBasePlayer_PlayerDeathThink *CBasePlayer_PlayerDeathThink() = 0;
virtual IReGameHookRegistry_CBasePlayer_Observer_Think *CBasePlayer_Observer_Think() = 0; virtual IReGameHookRegistry_CBasePlayer_Observer_Think *CBasePlayer_Observer_Think() = 0;
virtual IReGameHookRegistry_CBasePlayer_RemoveAllItems *CBasePlayer_RemoveAllItems() = 0; virtual IReGameHookRegistry_CBasePlayer_RemoveAllItems *CBasePlayer_RemoveAllItems() = 0;
virtual IReGameHookRegistry_CBasePlayer_UpdateStatusBar *CBasePlayer_UpdateStatusBar() = 0;
}; };
struct ReGameFuncs_t { struct ReGameFuncs_t {

View File

@ -1766,6 +1766,16 @@ void CSGameRules_SendDeathMessage(IReGameHook_CSGameRules_SendDeathMessage *chai
callVoidForward(RG_CSGameRules_SendDeathMessage, original, indexOfPDataAmx(pKiller), indexOfEdict(pVictim->pev), indexOfPDataAmx(pAssister), indexOfEdictAmx(pevInflictor), killerWeaponName, iDeathMessageFlags, iRarityOfKill); callVoidForward(RG_CSGameRules_SendDeathMessage, original, indexOfPDataAmx(pKiller), indexOfEdict(pVictim->pev), indexOfPDataAmx(pAssister), indexOfEdictAmx(pevInflictor), killerWeaponName, iDeathMessageFlags, iRarityOfKill);
} }
void CBasePlayer_UpdateStatusBar(IReGameHook_CBasePlayer_UpdateStatusBar *chain, CBasePlayer *pthis)
{
auto original = [chain](int _pthis)
{
chain->callNext(getPrivate<CBasePlayer>(_pthis));
};
callVoidForward(RG_CBasePlayer_UpdateStatusBar, original, indexOfEdict(pthis->pev));
}
/* /*
* VTC functions * VTC functions
*/ */

View File

@ -566,6 +566,7 @@ void CBasePlayer_PlayerDeathThink(IReGameHook_CBasePlayer_PlayerDeathThink *chai
void CBasePlayer_Observer_Think(IReGameHook_CBasePlayer_Observer_Think *chain, CBasePlayer *pthis); void CBasePlayer_Observer_Think(IReGameHook_CBasePlayer_Observer_Think *chain, CBasePlayer *pthis);
void CBasePlayer_RemoveAllItems(IReGameHook_CBasePlayer_RemoveAllItems *chain, CBasePlayer *pthis, BOOL removeSuit); void CBasePlayer_RemoveAllItems(IReGameHook_CBasePlayer_RemoveAllItems *chain, CBasePlayer *pthis, BOOL removeSuit);
void CSGameRules_SendDeathMessage(IReGameHook_CSGameRules_SendDeathMessage *chain, CBaseEntity *pKiller, CBasePlayer *pVictim, CBasePlayer *pAssister, entvars_t *pevInflictor, const char *killerWeaponName, int iDeathMessageFlags, int iRarityOfKill); void CSGameRules_SendDeathMessage(IReGameHook_CSGameRules_SendDeathMessage *chain, CBaseEntity *pKiller, CBasePlayer *pVictim, CBasePlayer *pAssister, entvars_t *pevInflictor, const char *killerWeaponName, int iDeathMessageFlags, int iRarityOfKill);
void CBasePlayer_UpdateStatusBar(IReGameHook_CBasePlayer_UpdateStatusBar *chain, CBasePlayer *pthis);
/* /*
* VTC functions * VTC functions

View File

@ -216,6 +216,7 @@ hook_t hooklist_player[] = {
DLL(CBasePlayer_PlayerDeathThink), DLL(CBasePlayer_PlayerDeathThink),
DLL(CBasePlayer_Observer_Think), DLL(CBasePlayer_Observer_Think),
DLL(CBasePlayer_RemoveAllItems), DLL(CBasePlayer_RemoveAllItems),
DLL(CBasePlayer_UpdateStatusBar),
}; };
hook_t hooklist_gamerules[] = { hook_t hooklist_gamerules[] = {

View File

@ -240,6 +240,7 @@ enum GamedllFunc_CBasePlayer
RG_CBasePlayer_PlayerDeathThink, RG_CBasePlayer_PlayerDeathThink,
RG_CBasePlayer_Observer_Think, RG_CBasePlayer_Observer_Think,
RG_CBasePlayer_RemoveAllItems, RG_CBasePlayer_RemoveAllItems,
RG_CBasePlayer_UpdateStatusBar,
// [...] // [...]
}; };