Crazor9906
Member
- Joined
- Jul 20, 2025
- Messages
- 128
- Reaction score
- 44
- Points
- 28

* 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<CGraphicText*>(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 <fmt/format.h><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->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 & FLAG_MOVABLE)<br> flagInfo += "FLAG_MOVABLE ";<br> if (flags & FLAG_SNAP)<br> flagInfo += "FLAG_SNAP ";<br> if (flags & FLAG_DRAGABLE)<br> flagInfo += "FLAG_DRAGABLE ";<br> if (flags & FLAG_ATTACH)<br> flagInfo += "FLAG_ATTACH ";<br> if (flags & FLAG_RESTRICT_X)<br> flagInfo += "FLAG_RESTRICT_X ";<br> if (flags & FLAG_RESTRICT_Y)<br> flagInfo += "FLAG_RESTRICT_Y ";<br> if (flags & FLAG_FLOAT)<br> flagInfo += "FLAG_FLOAT ";<br> if (flags & FLAG_NOT_PICK)<br> flagInfo += "FLAG_NOT_PICK ";<br> if (flags & FLAG_IGNORE_SIZE)<br> flagInfo += "FLAG_IGNORE_SIZE ";<br> if (flags & FLAG_RTL)<br> flagInfo += "FLAG_RTL ";<br><br> const auto parentName = m_pParent ? m_pParent->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)`.