CPLUSPLUSPaintTraverse hook

Posts 1–15 of 25 · Page 1 of 2
PaintTraverse hook
if you cannot figure out how to use this yourself leave the thread



Code:
void __fastcall hkPaintTraverse(void *pThis, DWORD dwEDX, VPANEL vguiPanel, bool forceRepaint, bool allowForce) {
	pPaintTraverse(pThis, vguiPanel, forceRepaint, allowForce); // for this make ur own hook of PaintTraverseFn it isnt hard just use vmttable hooking, the offset is 41

	/*
	pointers._panel is defined as IPanel *_panel;
	this->m_pPanel is defined as IPanel *m_pPanel;
	heres the interfacing code for it

	this->m_pPanel = (IPanel *) VMTHookManager.GetPointer( "vgui2.dll", "VGUI_Panel" ); // pretty sure VGUI_Panel is fine and it doesnt matter, if u are paranoid just look for the actual name defined in the sdk
	pointers._panel = this->m_pPanel;
	*/

	static VPANEL OverlayPopupPanel; // VPANEL is just a more fancy version of unsigned int for use in vgui
	if (OverlayPopupPanel == NULL) { // check if its null (doesnt have a value)
		const char* panelName = pointers._panel->GetClassName(vguiPanel); // get class name of the panel
		if (panelName[0] == 'O' && panelName[7] == 'P') { // found this bit on pastebin, it works
			OverlayPopupPanel = vguiPanel; // set the value of OverlayPopupPanel
		}
	}
	if (vguiPanel == OverlayPopupPanel) { // check if our vguipanel is overlaypopuppanel
		try { // incase gmod has a sperg attack
			if (pointers._engine->IsInGame()) { // check if u are in the game (fully connected to a server and not loading and active in the game)
				// draw stuff
			}
		} catch(...) { // incase gmod has a sperg attack

		}

	}
}
i posted some vmt hook class a while ago just look for it
use the isurface library to draw with this where i commented
or use your own drawing functions?
This would work, but be sure to actually define the OverlayPopupPanel. It's good coding practice.
Quote Originally Posted by MeepDarknessMeep View Post
This would work, but be sure to actually define the OverlayPopupPanel. It's good coding practice.
Just some copypasta for beginners
Good job, though this should work without 'try'.

Edit:
Good job on getting minion.
Quote Originally Posted by gayguy911 View Post
Good job, though this should work without 'try'.
it most likely would
but its just incase
also, instead of using the useless DWORD dwEDX you can just make that argument a void pointer with no name.
Quote Originally Posted by MeepDarknessMeep View Post
also, instead of using the useless DWORD dwEDX you can just make that argument a void pointer with no name.
^

Also, you can use:
Code:
void __fastcall hkPaintTraverse(void* thisptr, void* EDX, unsigned int vguiPanel, bool forceRepaint, bool allowForce)
It works for me.
Quote Originally Posted by gayguy911 View Post
^

Also, you can use:
Code:
void __fastcall hkPaintTraverse(void* thisptr, void* EDX, unsigned int vguiPanel, bool forceRepaint, bool allowForce)
It works for me.
VPANEL is better than unsigned int
because vguiPanel isnt a unsigned int its a VPANEL
fag dont delete my post, you're supposed to grab the interface for IEngineVGui, so you can draw before the original PaintTraverse is called
i think you can figure out what func to use
uh huh
namespace vgui
{
// handle to an internal vgui panel
// this is the only handle to a panel that is valid across dll boundaries
typedef unsigned int VPANEL;

// handles to vgui objects
// NULL values signify an invalid value
typedef unsigned long HScheme;
typedef unsigned long HTexture;
typedef unsigned long HCursor;
typedef unsigned long HPanel;
const HPanel INVALID_PANEL = 0xffffffff;
typedef unsigned long HFont;
const HFont INVALID_FONT = 0; // the value of an invalid font handle
}
Quote Originally Posted by ExiledStyles View Post
uh huh
namespace vgui
{
// handle to an internal vgui panel
// this is the only handle to a panel that is valid across dll boundaries
typedef unsigned int VPANEL;

// handles to vgui objects
// NULL values signify an invalid value
typedef unsigned long HScheme;
typedef unsigned long HTexture;
typedef unsigned long HCursor;
typedef unsigned long HPanel;
const HPanel INVALID_PANEL = 0xffffffff;
typedef unsigned long HFont;
const HFont INVALID_FONT = 0; // the value of an invalid font handle
}

it's not an unsigned int
use __stdcall to be a pro fuck that other useless shit
You can use unsigned int instead of VPANEL, it doesn't make any difference.

You also don't have to actually check if you're in-game to use painttraverse because afaik it's called in the menu anyway. You can draw your menu in the game's menu by using OPP.
Quote Originally Posted by TheyCallMeDaz View Post
You can use unsigned int instead of VPANEL, it doesn't make any difference.

You also don't have to actually check if you're in-game to use painttraverse because afaik it's called in the menu anyway. You can draw your menu in the game's menu by using OPP.
it doesnt make any difference i dont know why everyone has to fight about a fucking argument

if someone wants to actually use this then they should be capable of making an else statement so they can draw in the menu
Posts 1–15 of 25 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us