Advertisement
keybode

source engine PaintTraverse hook

Jan 30th, 2015
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. inline bool CheckPanel(const char* pName) {
  2.     return !std::strcmp(pName, "MatSysTopPanel");
  3. }
  4.  
  5. void __fastcall Hooked_PaintTraverse(void* ecx, void* edx, unsigned int vguiPanel, bool forceRepaint, bool allowForce) {
  6.     m_pPanelHook->GetMethod<PaintTraverseFn>(HOOK_INDEX_PAINTTRAVERSE)(ecx, vguiPanel, forceRepaint, allowForce);
  7.  
  8.     const char* pPanelName = m_pPanel->GetName(vguiPanel);
  9.  
  10.     if (CheckPanel(pPanelName)) {
  11.         m_pSurface->DrawSetColor(255, 255, 255, 255);
  12.         m_pSurface->DrawFilledRect(0, 0, 100, 100);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement