Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Enable Game Window Debugging Plugin


Recommended Posts

  • Premium+

🔍 UI Window Debugger (Hover Info & Outlines)

📌 Description

This modification implements an advanced UI debugging tool. When active, hovering your mouse cursor over any interface element highlights it. The targeted window is outlined in green, while its parent window is highlighted in blue. Additionally, detailed technical statistics (dimensions, position, name, parent name, and active UI flags) are rendered directly above the element.


🛠 Source Code Changes

1. EterPythonLib/PythonGraphic.cpp

Find:

C++
long CPythonGraphic::GenerateColor(float r, float g, float b, float a)

Add below:

C++
void CPythonGraphic::RenderTextLine(float x, float y, const char* c_szText, DWORD dwColor)
{
    assert(ms_lpd3dDevice != NULL);

    // Create a text instance with the provided text
    CGraphicTextInstance textInstance;

    // Set properties
    textInstance.SetColor(dwColor);

    // Get the default font from FontManager
    extern CResource* gs_pkDefaultFont;
    CGraphicText* pFont = static_cast<CGraphicText*>(gs_pkDefaultFont);
    if (!pFont)
        return;

    textInstance.SetTextPointer(pFont);
    textInstance.SetValue(c_szText);
    textInstance.SetPosition(x, y);

    // Update the text layout
    textInstance.Update();

    // Render the text at the specified position
    textInstance.Render();
}

2. EterPythonLib/PythonGraphic.h

Find:

C++
long GenerateColor(float r, float g, float b, float a);

Add below:

C++
void RenderTextLine(float x, float y, const char* c_szText, DWORD dwColor);

3. EterPythonLib/PythonWindow.cpp

Add to your includes at the top of the file:

C++
#include <fmt/format.h>

Find:

C++
if (g_bOutlineBoxEnable)
{
    CPythonGraphic::Instance().SetDiffuseColor(1.0f, 1.0f, 1.0f);
    CPythonGraphic::Instance().RenderBox2d(m_rect.left, m_rect.top, m_rect.right, m_rect.bottom);
}

Replace with:

C++
if (g_bOutlineBoxEnable)
{
    if (CWindowManager::instance().GetPointWindow() == this)
    {
        // Render parent rect with blue outline
        const auto parentRect = m_pParent ? m_pParent->m_rect : RECT{ 0, 0, 0, 0 };
        CPythonGraphic::Instance().SetDiffuseColor(0.0f, 0.0f, 1.0f);
        CPythonGraphic::Instance().RenderBox2d(parentRect.left, parentRect.top, parentRect.right, parentRect.bottom);

        // Render this rect with green outline
        CPythonGraphic::Instance().SetDiffuseColor(0.0f, 1.0f, 0.0f);
        CPythonGraphic::Instance().RenderBox2d(m_rect.left, m_rect.top, m_rect.right, m_rect.bottom);

        // Render info text with window name and flags
        const auto buffer = fmt::format("{} ({})", m_strName, Type());
        CPythonGraphic::Instance().RenderTextLine(m_rect.left + 5, m_rect.top - 30, buffer.c_str(), 0xFFFFFF00);

        const auto flags = m_dwFlag;
        std::string flagInfo;
        if (flags & FLAG_MOVABLE)        flagInfo += "FLAG_MOVABLE ";
        if (flags & FLAG_SNAP)           flagInfo += "FLAG_SNAP ";
        if (flags & FLAG_DRAGABLE)       flagInfo += "FLAG_DRAGABLE ";
        if (flags & FLAG_ATTACH)         flagInfo += "FLAG_ATTACH ";
        if (flags & FLAG_RESTRICT_X)     flagInfo += "FLAG_RESTRICT_X ";
        if (flags & FLAG_RESTRICT_Y)     flagInfo += "FLAG_RESTRICT_Y ";
        if (flags & FLAG_FLOAT)          flagInfo += "FLAG_FLOAT ";
        if (flags & FLAG_NOT_PICK)       flagInfo += "FLAG_NOT_PICK ";
        if (flags & FLAG_IGNORE_SIZE)    flagInfo += "FLAG_IGNORE_SIZE ";
        if (flags & FLAG_RTL)            flagInfo += "FLAG_RTL ";

        const auto parentName = m_pParent ? m_pParent->GetName() : "None";

        const auto stRectInfo = fmt::format("Pos: ({0}, {1}), Size: {2}x{3}, Flags: {4}, Parent: {5}",
            m_rect.left, m_rect.top, m_rect.right - m_rect.left, m_rect.bottom - m_rect.top,
            flagInfo, parentName
        );
        CPythonGraphic::Instance().RenderTextLine(m_rect.left + 5, m_rect.top - 15, stRectInfo.c_str(), 0xFFFFFFFF);
    }
}

4. UserInterface/GameType.cpp

Find:

C++
static CResource* gs_pkDefaultFont = NULL;

Replace with (removing static linkage):

C++
CResource* gs_pkDefaultFont = NULL;

🚀 Activation & Usage

You can toggle the debugging overlay using one of the following methods:

  1. Hardcoded Method: Globally enable it by setting BOOL g_bOutlineBoxEnable = TRUE; directly within EterPythonLib/PythonWindow.cpp.

  2. On-the-fly (Python): Keep it optional and activate it smoothly in real-time from your Python scripts using the built-in function:

    Python
    wndMgr.SetOutlineFlag(True)
Link to comment
Share on other sites


spacer.png

Hi TechroomsBOT 👋

Thanks for starting a new topic on Techrooms – Blockchain, Programming, Gaming & Crypto Forum!  
If you’re new here — welcome. If you’ve been around for a while — great to have you back 😊

To help you get the most out of TechRooms, here are a few useful places to explore:

────────────────────────────────────
💎 Premium Membership (Optional)
Support the community and unlock extra perks:

🚫 Ad-free browsing  
Faster access & priority support  
📊 Private analysis & signals  
🧪 Early access to beta features & tools  
📥 Downloadable premium resources  

🎟️ Upgrade here: Premium Link
────────────────────────────────────

🧠 Popular Sections You Might Like

📊 Crypto Signals & Market Analysis  
Get free signals and market insights: Signals

💾 Tech Tools & Programs  
Automation, software, utilities & security tools: Tools Techrooms

🗣️ Discussions & Q&A  
Ask questions, share knowledge, help others: Forum

📚 Tech Book Library  
Books, guides and resources for members: Books

📚 Quizzes  
Members Quizzes: Quizzes

🎓 Learning & Courses  
Blockchain, security, coding and more: Blockchain Courses

🧠 Hacking & Firewall Courses 
Hacking, security, firewall and more: Firewall Courses

🪙 Earn Tokens for Posting  
Create valuable content and get rewarded

🃏 Blackjack  
Take a break and play: Blackjack

💖 Support via Crypto Donation (Optional)
Cosmos Wallet: 
cosmos1p5sjqcu3gp9vkjdyc9uee2mw4a4zvjvqz2lj2g 
Donate: Donate

📜 Forum Rules  
Please read before posting: Techrooms Rules

────────────────────────────────────
Stay connected. Stay ahead. Stay TechRooms. 🚀

 

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...