Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr.Abc committed Dec 14, 2024
1 parent a0c01ce commit 7c35713
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions VGUI2/GameUI/BasePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ static void SetBasePanelState(bool state) {
}
}
void BasePanelInit() {
gCVars.pDynamicBackground = CREATE_CVAR("hud_dynamic_background", "1", FCVAR_VALUE, [](cvar_t* cvar) {
SetBasePanelState(cvar->value > 0);
});
//gCVars.pDynamicBackground = CREATE_CVAR("hud_dynamic_background", "1", FCVAR_VALUE, [](cvar_t* cvar) {
// SetBasePanelState(cvar->value > 0);
//});
}
void BasePanelPostInit() {
SetBasePanelState(gCVars.pDynamicBackground->value > 0);
/*SetBasePanelState(gCVars.pDynamicBackground->value > 0);*/
}
static void BasePanelSendJSEvent(const char* cmd) {
if (s_hHTMLBackground) {
Expand Down Expand Up @@ -152,17 +152,17 @@ static void* __fastcall CBasePanel_ctor(void* pthis, int dummy) {
return s_pBasePanel;
}
void BasePanel_InstallHook(void){
HINTERFACEMODULE hGameUI = (HINTERFACEMODULE)GetModuleHandle("GameUI.dll");
if (!hGameUI) {
SYS_ERROR("Failed to locate GameUI.dll");
return;
}
auto GameUIBase = g_pMetaHookAPI->GetModuleBase(hGameUI);
auto GameUISize = g_pMetaHookAPI->GetModuleSize(hGameUI);

#define SC_CBASEPANEL_CTOR_SIG "\x55\x8B\xEC\x51\x56\x68\x2A\x2A\x2A\x2A\x8B\xF1\x6A\x00\x89\x75\xFC\xE8\x2A\x2A\x2A\x2A\xC7"
Fill_Sig(SC_CBASEPANEL_CTOR_SIG, GameUIBase, GameUISize, CBasePanel_ctor);
Install_InlineHook(CBasePanel_ctor);
// HINTERFACEMODULE hGameUI = (HINTERFACEMODULE)GetModuleHandle("GameUI.dll");
// if (!hGameUI) {
// SYS_ERROR("Failed to locate GameUI.dll");
// return;
// }
// auto GameUIBase = g_pMetaHookAPI->GetModuleBase(hGameUI);
// auto GameUISize = g_pMetaHookAPI->GetModuleSize(hGameUI);
//
//#define SC_CBASEPANEL_CTOR_SIG "\x55\x8B\xEC\x51\x56\x68\x2A\x2A\x2A\x2A\x8B\xF1\x6A\x00\x89\x75\xFC\xE8\x2A\x2A\x2A\x2A\xC7"
// Fill_Sig(SC_CBASEPANEL_CTOR_SIG, GameUIBase, GameUISize, CBasePanel_ctor);
// Install_InlineHook(CBasePanel_ctor);
//#define SC_CBASEPANEL_PAINTBACKGROUNDIMAGE_SIG "\x55\x8B\xEC\x83\xEC\x38\x53\x8D\x45\xCC\x8B\xD9\x50\x8D\x45\xC8\x89\x5D\xD0\x50\xE8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x8D\x4D\xD4\x51"
//Fill_Sig(SC_CBASEPANEL_PAINTBACKGROUNDIMAGE_SIG, GameUIBase, GameUISize, CBasePanel_PaintBackground);
//Install_InlineHook(CBasePanel_PaintBackground);
Expand Down

0 comments on commit 7c35713

Please sign in to comment.