forked from icantstandpeople/potassium
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPanels.cpp
More file actions
73 lines (63 loc) · 2.02 KB
/
Panels.cpp
File metadata and controls
73 lines (63 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "SDK.h"
#include "Panels.h"
#include "CDrawManager.h"
#include "Util.h"
#include "ESP.h"
CScreenSize gScreenSize;
//===================================================================================
void __fastcall Hooked_PaintTraverse( PVOID pPanels, int edx, unsigned int vguiPanel, bool forceRepaint, bool allowForce )
{
try
{
VMTManager& hook = VMTManager::GetHook(pPanels);
hook.GetMethod<void(__thiscall*)(PVOID, unsigned int, bool, bool)>(gOffsets.iPaintTraverseOffset)(pPanels, vguiPanel, forceRepaint, allowForce); //Call the original.
static unsigned int vguiFocusOverlayPanel;
if (vguiFocusOverlayPanel == NULL)
{ //FocusOverlayPanel
const char* szName = gInts.Panels->GetName(vguiPanel);
if( szName[0] == 'F' && szName[5] == 'O' && szName[12] == 'P' )
{
vguiFocusOverlayPanel = vguiPanel;
Intro();
}
}
if (vguiFocusOverlayPanel == vguiPanel )
{
int iWidth, iHeight; //Resolution fix, so this can work in Fullscreen
gInts.Engine->GetScreenSize(iWidth, iHeight);
if (gScreenSize.iScreenWidth != iWidth || gScreenSize.iScreenHeight != iHeight)
gInts.Engine->GetScreenSize(gScreenSize.iScreenWidth, gScreenSize.iScreenHeight);
if( gInts.Engine->IsDrawingLoadingImage() || !gInts.Engine->IsInGame( ) || !gInts.Engine->IsConnected() || gInts.Engine->Con_IsVisible( ) )
{
gDrawManager.DrawString(5, 5, Color::White(), "Polly.xyz");
return; //No need to draw the rest.
}
CBaseEntity* pLocal = gInts.EntList->GetClientEntity(me);
if (!pLocal)
return;
gESP.Run(pLocal);
if (gCheatMenu.bMenuActive)
{
gCheatMenu.DrawMenu();
gCheatMenu.Render();
}
}
}
catch(...)
{
Log::Fatal("Failed PaintTraverse");
}
}
//===================================================================================
void Intro( void )
{
try
{
gDrawManager.Initialize(); //Initalize the drawing class.
gNetVars.Initialize();
}
catch(...)
{
Log::Fatal("Failed Intro");
}
}