Welcome to Metin2Resources

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Debug window

Crazor9906

Member
Joined
Jul 20, 2025
Messages
128
Reaction score
44
Points
28
1753123763448.png
* EterPythonLib\PythonGraphic.cpp<br><br>Search for:<br>Code:<br>long CPythonGraphic::GenerateColor(float r, float g, float b, float a)<br><br>Add the following code above it:<br>void CPythonGraphic::RenderTextLine(float x, float y, const char* c_szText, DWORD dwColor)<br>{<br> assert(ms_lpd3dDevice != NULL);<br><br> // Create a text instance with the provided text<br> CGraphicTextInstance textInstance;<br><br> // Set properties<br> textInstance.SetColor(dwColor);<br><br> // Get the default font from FontManager<br> extern CResource* gs_pkDefaultFont;<br> CGraphicText* pFont = static_cast&lt;CGraphicText*&gt;(gs_pkDefaultFont);<br> if (!pFont)<br> return;<br><br> textInstance.SetTextPointer(pFont);<br> textInstance.SetValue(c_szText);<br> textInstance.SetPosition(x, y);<br><br> // Update the text layout<br> textInstance.Update();<br><br> // Render the text at the specified position<br> textInstance.Render();<br>}<br><br>* EterPythonLib\PythonGraphic.h<br><br>Search for:<br>Code:<br> long GenerateColor(float r, float g, float b, float a);<br><br>Add the following code above it:<br> void RenderTextLine(float x, float y, const char* c_szText, DWORD dwColor);<br><br>* EterPythonLib/PythonWindow.cpp<br><br>Add the following include:<br>#include &lt;fmt/format.h&gt;<br><br>Search for:<br>Code:<br> if (g_bOutlineBoxEnable)<br> {<br> CPythonGraphic::Instance().SetDiffuseColor(1.0f, 1.0f, 1.0f);<br> CPythonGraphic::Instance().RenderBox2d(m_rect.left, m_rect.top, m_rect.right, m_rect.bottom);<br> }<br><br>Replace it with:<br> if (g_bOutlineBoxEnable)<br> {<br> if (CWindowManager::instance().GetPointWindow() == this)<br> {<br> // Render parent rect with blue outline<br> const auto parentRect = m_pParent ? m_pParent-&gt;m_rect : RECT{ 0, 0, 0, 0 };<br> CPythonGraphic::Instance().SetDiffuseColor(0.0f, 0.0f, 1.0f);<br> CPythonGraphic::Instance().RenderBox2d(parentRect.left, parentRect.top, parentRect.right, parentRect.bottom);<br><br> // Render this rect with green outline<br> CPythonGraphic::Instance().SetDiffuseColor(0.0f, 1.0f, 0.0f);<br> CPythonGraphic::Instance().RenderBox2d(m_rect.left, m_rect.top, m_rect.right, m_rect.bottom);<br><br> // Render info text with window name and flags<br> const auto buffer = fmt::format("{} ({})", m_strName, Type());<br> CPythonGraphic::Instance().RenderTextLine(m_rect.left + 5, m_rect.top - 30, buffer.c_str(), 0xFFFFFF00);<br><br> const auto flags = m_dwFlag;<br> std::string flagInfo;<br> if (flags &amp; FLAG_MOVABLE)<br> flagInfo += "FLAG_MOVABLE ";<br> if (flags &amp; FLAG_SNAP)<br> flagInfo += "FLAG_SNAP ";<br> if (flags &amp; FLAG_DRAGABLE)<br> flagInfo += "FLAG_DRAGABLE ";<br> if (flags &amp; FLAG_ATTACH)<br> flagInfo += "FLAG_ATTACH ";<br> if (flags &amp; FLAG_RESTRICT_X)<br> flagInfo += "FLAG_RESTRICT_X ";<br> if (flags &amp; FLAG_RESTRICT_Y)<br> flagInfo += "FLAG_RESTRICT_Y ";<br> if (flags &amp; FLAG_FLOAT)<br> flagInfo += "FLAG_FLOAT ";<br> if (flags &amp; FLAG_NOT_PICK)<br> flagInfo += "FLAG_NOT_PICK ";<br> if (flags &amp; FLAG_IGNORE_SIZE)<br> flagInfo += "FLAG_IGNORE_SIZE ";<br> if (flags &amp; FLAG_RTL)<br> flagInfo += "FLAG_RTL ";<br><br> const auto parentName = m_pParent ? m_pParent-&gt;GetName() : "None";<br><br> const auto stRectInfo = fmt::format("Pos: ({0}, {1}), Size: {2}x{3}, Flags: {4}, Parent: {5}",<br> m_rect.left, m_rect.top, m_rect.right - m_rect.left, m_rect.bottom - m_rect.top,<br> flagInfo, parentName<br> );<br> CPythonGraphic::Instance().RenderTextLine(m_rect.left + 5, m_rect.top - 15, stRectInfo.c_str(), 0xFFFFFFFF);<br> }<br> }<br><br>* UserInterface\GameType.cpp<br><br>Search for:<br>Code:<br>static CResource* gs_pkDefaultFont = NULL;<br><br>Replace it with:<br>CResource* gs_pkDefaultFont = NULL;<br><br>Activation:<br>Inside `EterPythonLib\PythonWindow.cpp`, you can change the value of `BOOL g_bOutlineBoxEnable` to `TRUE` or activate it via Python using `wndMgr.SetOutlineFlag(True)`.
 
double post ^^
 

Latest posts

355Threads
747Messages
154Members
centarusLatest member
Back
Top