From fdb81a898151278a66af544dfae6bfcbbf9dc3d2 Mon Sep 17 00:00:00 2001 From: jz0 Date: Sun, 3 May 2020 22:38:59 +0300 Subject: Initial commit --- source2-basehook/Hooks/PaintTraverse.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 source2-basehook/Hooks/PaintTraverse.cpp (limited to 'source2-basehook/Hooks/PaintTraverse.cpp') diff --git a/source2-basehook/Hooks/PaintTraverse.cpp b/source2-basehook/Hooks/PaintTraverse.cpp new file mode 100644 index 0000000..62399e0 --- /dev/null +++ b/source2-basehook/Hooks/PaintTraverse.cpp @@ -0,0 +1,28 @@ +#include "PaintTraverse.hpp" + +oPaintTraverse OriginalPaint; +void __fastcall hkPaintTraverse(void* panel, IVGuiPaintSurface* surface, unsigned long long VGUIPanel, bool ForceRepaint, bool AllowForce) +{ + OriginalPaint(panel, surface, VGUIPanel, ForceRepaint, AllowForce); + + static unsigned long long RenderSystemTop; + if (RenderSystemTop == NULL) + { + const char* Name = pPanel->GetName(panel, VGUIPanel); + + //RenderSystemTopPanel + if (Name[0] == 'R' && Name[6] == 'S' && Name[12] == 'T') + { + Msg(Color(255, 255, 255, 255), "Panel: %s \n", Name); + RenderSystemTop = VGUIPanel; + } + } + + if (RenderSystemTop == VGUIPanel) + { + pRendererSurface = surface; + + EngineRenderer::DrawString(11, 550, 150, Color(255, 255, 255, 255), "Hello world!"); + EngineRenderer::DrawRect(150, 50, 50, 50, Color(255, 0, 0, 255)); + } +} -- cgit v1.2.3