2
0
mirror of https://github.com/rehlds/reapi.git synced 2025-01-16 08:38:08 +03:00

Added forward: RG_HandleMenu_ChooseAppearance, RG_HandleMenu_ChooseTeam, RG_ShowMenu, RG_ShowVGUIMenu, RG_CBasePlayer_SetClientUserInfoModel

This commit is contained in:
s1lentq 2016-06-02 18:33:14 +06:00 committed by asmodai
parent fd7c58f32e
commit 8db34b7a52
5 changed files with 124 additions and 0 deletions

View File

@ -23,6 +23,7 @@
#define RG_CSGameRules_DeadPlayerWeapons RG_CSGameRules_DeadPlayerWpn #define RG_CSGameRules_DeadPlayerWeapons RG_CSGameRules_DeadPlayerWpn
#define RG_CSGameRules_CheckMapConditions RG_CSGameRules_CheckMapCond #define RG_CSGameRules_CheckMapConditions RG_CSGameRules_CheckMapCond
#define RG_CSGameRules_CheckWinConditions RG_CSGameRules_CheckWinCond #define RG_CSGameRules_CheckWinConditions RG_CSGameRules_CheckWinCond
#define RG_CBasePlayer_SetClientUserInfoModel RG_CBasePlayer_SetUserInfoModel
#endif #endif
enum AccountSet { AS_SET, AS_ADD }; enum AccountSet { AS_SET, AS_ADD };
@ -103,6 +104,32 @@ enum GiveType
GT_DROP_AND_REPLACE // drop all weapons on the ground GT_DROP_AND_REPLACE // drop all weapons on the ground
}; };
enum MenuChooseTeam
{
MenuChoose_T = 1,
MenuChoose_CT,
MenuChoose_VIP,
MenuChoose_AutoSelect = 5,
MenuChoose_Spec,
};
enum VGUIMenu
{
VGUI_Menu_Team = 2,
VGUI_Menu_MapBriefing = 4,
VGUI_Menu_Class_T = 26,
VGUI_Menu_Class_CT,
VGUI_Menu_Buy,
VGUI_Menu_Buy_Pistol,
VGUI_Menu_Buy_ShotGun,
VGUI_Menu_Buy_Rifle,
VGUI_Menu_Buy_SubMachineGun,
VGUI_Menu_Buy_MachineGun,
VGUI_Menu_Buy_Item,
};
enum GamedllFunc enum GamedllFunc
{ {
/* /*
@ -148,6 +175,30 @@ enum GamedllFunc
*/ */
RG_PM_AirMove, RG_PM_AirMove,
/*
* Description: -
* Params: (const index, const slot)
*/
RG_HandleMenu_ChooseAppearance,
/*
* Description: -
* Params: (const index, const MenuChooseTeam:slot)
*/
RG_HandleMenu_ChooseTeam,
/*
* Description: -
* Params: (const index, const bitsSlots, const iDisplayTime, const iNeedMore, pszText[])
*/
RG_ShowMenu,
/*
* Description: -
* Params: (const index, VGUIMenu:menuType, const bitsSlots, szOldMenu[])
*/
RG_ShowVGUIMenu,
// [...] // [...]
RG_End RG_End
}; };
@ -304,6 +355,12 @@ enum GamedllFunc_CBasePlayer
*/ */
RG_CBasePlayer_Blind, RG_CBasePlayer_Blind,
/*
* Description: -
* Params: (const this, infobuffer[], szNewModel[])
*/
RG_CBasePlayer_SetClientUserInfoModel,
/* /*
* Description: - * Description: -
* Params: (const this, iPlayerIndex, bool:bSameTeam) * Params: (const this, iPlayerIndex, bool:bSameTeam)

View File

@ -634,6 +634,56 @@ void CSGameRules_BalanceTeams(IReGameHook_CSGameRules_BalanceTeams *chain)
callVoidForward(RG_CSGameRules_BalanceTeams, original); callVoidForward(RG_CSGameRules_BalanceTeams, original);
} }
void CBasePlayer_SetClientUserInfoModel(IReGameHook_CBasePlayer_SetClientUserInfoModel *chain, CBasePlayer *pthis, char *infobuffer, char *szNewModel)
{
auto original = [chain](int _pthis, char *_infobuffer, char *_szNewModel)
{
chain->callNext(_infobuffer, _szNewModel);
};
callVoidForward(RG_CBasePlayer_SetClientUserInfoModel, original, indexOfEdict(pthis->pev), infobuffer, szNewModel);
}
void HandleMenu_ChooseAppearance(IReGameHook_HandleMenu_ChooseAppearance *chain, CBasePlayer *pPlayer, int slot)
{
auto original = [chain](int _pPlayer, int _slot)
{
chain->callNext(getPrivate<CBasePlayer>(_pPlayer), _slot);
};
callVoidForward(RG_HandleMenu_ChooseAppearance, original, indexOfEdict(pPlayer->pev), slot);
}
BOOL HandleMenu_ChooseTeam(IReGameHook_HandleMenu_ChooseTeam *chain, CBasePlayer *pPlayer, int slot)
{
auto original = [chain](int _pPlayer, int _slot)
{
return chain->callNext(getPrivate<CBasePlayer>(_pPlayer), _slot);
};
return callForward<BOOL>(RG_HandleMenu_ChooseTeam, original, indexOfEdict(pPlayer->pev), slot);
}
void ShowMenu(IReGameHook_ShowMenu *chain, CBasePlayer *pPlayer, int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText)
{
auto original = [chain](int _pPlayer, int _bitsValidSlots, int _nDisplayTime, BOOL _fNeedMore, char *_pszText)
{
chain->callNext(getPrivate<CBasePlayer>(_pPlayer), _bitsValidSlots, _nDisplayTime, _fNeedMore, _pszText);
};
callVoidForward(RG_ShowMenu, original, indexOfEdict(pPlayer->pev), bitsValidSlots, nDisplayTime, fNeedMore, pszText);
}
void ShowVGUIMenu(IReGameHook_ShowVGUIMenu *chain, CBasePlayer *pPlayer, int MenuType, int BitMask, char *szOldMenu)
{
auto original = [chain](int _pPlayer, int _MenuType, int _BitMask, char *_szOldMenu)
{
chain->callNext(getPrivate<CBasePlayer>(_pPlayer), _MenuType, _BitMask, _szOldMenu);
};
callVoidForward(RG_ShowVGUIMenu, original, indexOfEdict(pPlayer->pev), MenuType, BitMask, szOldMenu);
}
int g_iClientStartSpeak, g_iClientStopSpeak; int g_iClientStartSpeak, g_iClientStopSpeak;
void ClientStartSpeak(size_t clientIndex) void ClientStartSpeak(size_t clientIndex)

View File

@ -40,6 +40,7 @@ inline AType getApiType(int) { return ATYPE_INTEGER; }
inline AType getApiType(unsigned) { return ATYPE_INTEGER; } inline AType getApiType(unsigned) { return ATYPE_INTEGER; }
inline AType getApiType(float) { return ATYPE_FLOAT; } inline AType getApiType(float) { return ATYPE_FLOAT; }
inline AType getApiType(const char *) { return ATYPE_STRING; } inline AType getApiType(const char *) { return ATYPE_STRING; }
inline AType getApiType(char []) { return ATYPE_STRING; }
inline AType getApiType(CBaseEntity *) { return ATYPE_CLASSPTR; } inline AType getApiType(CBaseEntity *) { return ATYPE_CLASSPTR; }
inline AType getApiType(edict_t *) { return ATYPE_CLASSPTR; } inline AType getApiType(edict_t *) { return ATYPE_CLASSPTR; }
inline AType getApiType(entvars_t *) { return ATYPE_EVARS; } inline AType getApiType(entvars_t *) { return ATYPE_EVARS; }
@ -269,6 +270,12 @@ void CSGameRules_ChangeLevel(IReGameHook_CSGameRules_ChangeLevel *chain);
void CSGameRules_GoToIntermission(IReGameHook_CSGameRules_GoToIntermission *chain); void CSGameRules_GoToIntermission(IReGameHook_CSGameRules_GoToIntermission *chain);
void CSGameRules_BalanceTeams(IReGameHook_CSGameRules_BalanceTeams *chain); void CSGameRules_BalanceTeams(IReGameHook_CSGameRules_BalanceTeams *chain);
void CBasePlayer_SetClientUserInfoModel(IReGameHook_CBasePlayer_SetClientUserInfoModel *chain, CBasePlayer *pthis, char *infobuffer, char *szNewModel);
void HandleMenu_ChooseAppearance(IReGameHook_HandleMenu_ChooseAppearance *chain, CBasePlayer *pPlayer, int slot);
BOOL HandleMenu_ChooseTeam(IReGameHook_HandleMenu_ChooseTeam *chain, CBasePlayer *pPlayer, int slot);
void ShowMenu(IReGameHook_ShowMenu *chain, CBasePlayer *pPlayer, int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText);
void ShowVGUIMenu(IReGameHook_ShowVGUIMenu *chain, CBasePlayer *pPlayer, int MenuType, int BitMask, char *szOldMenu);
extern int g_iClientStartSpeak; extern int g_iClientStartSpeak;
extern int g_iClientStopSpeak; extern int g_iClientStopSpeak;

View File

@ -79,6 +79,10 @@ hook_t hooklist_gamedll[] = {
DLL(CanBuyThis), DLL(CanBuyThis),
DLL(PM_Move), DLL(PM_Move),
DLL(PM_AirMove), DLL(PM_AirMove),
DLL(HandleMenu_ChooseAppearance),
DLL(HandleMenu_ChooseTeam),
DLL(ShowMenu),
DLL(ShowVGUIMenu),
}; };
hook_t hooklist_animating[] = { hook_t hooklist_animating[] = {
@ -108,6 +112,7 @@ hook_t hooklist_player[] = {
DLL(CBasePlayer_ImpulseCommands), DLL(CBasePlayer_ImpulseCommands),
DLL(CBasePlayer_RoundRespawn), DLL(CBasePlayer_RoundRespawn),
DLL(CBasePlayer_Blind), DLL(CBasePlayer_Blind),
DLL(CBasePlayer_SetClientUserInfoModel),
DLL(CBasePlayer_Observer_IsValidTarget), DLL(CBasePlayer_Observer_IsValidTarget),
DLL(CBasePlayer_SetAnimation), DLL(CBasePlayer_SetAnimation),

View File

@ -87,6 +87,10 @@ enum GamedllFunc
RG_PM_Move, RG_PM_Move,
RG_PM_AirMove, RG_PM_AirMove,
RG_HandleMenu_ChooseAppearance,
RG_HandleMenu_ChooseTeam,
RG_ShowMenu,
RG_ShowVGUIMenu,
// [...] // [...]
RG_End RG_End
@ -126,6 +130,7 @@ enum GamedllFunc_CBasePlayer
RG_CBasePlayer_RoundRespawn, RG_CBasePlayer_RoundRespawn,
RG_CBasePlayer_Blind, RG_CBasePlayer_Blind,
RG_CBasePlayer_SetClientUserInfoModel,
RG_CBasePlayer_Observer_IsValidTarget, RG_CBasePlayer_Observer_IsValidTarget,
RG_CBasePlayer_SetAnimation, RG_CBasePlayer_SetAnimation,
RG_CBasePlayer_GiveDefaultItems, RG_CBasePlayer_GiveDefaultItems,