İlan
04 Haz 2026 19 çevrimiçi üye Duyurular
Ana Sayfa C++ / C# / Python
Ana Sayfa Forum C++ / C# / Python Oyun içi pencere debug eklentisini aktif etme...
İlan Yan banner placeholder

Oyun içi pencere debug eklentisini aktif etme

ht02 15.03.2026 02:03 762 görüntüleme 6 cevap
Son Mesaj
ht02
Üye
Üye
Katılım12 Şub 2026
Konular4
Mesajlar46
Elmas Konular0
Başarım0
ZirveCoin 0
Ticaret Puanı
+0 -0
15.03.2026 02:03 #1


Fare ile üzerine geldiğiniz pencereye ait bilgileri gösterir, mevcut pencereyi yeşil, oluşturan üst pencereyi mavi çerçeve ile gösterir

* EterPythonLib\PythonGraphic.cpp

Arat:
Kod:
long CPythonGraphic::GenerateColor(float r, float g, float b, float a)

Üstüne ekle:
Kod:
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();
}

* EterPythonLib\PythonGraphic.h

Arat:
Kod:
        long GenerateColor(float r, float g, float b, float a);

Üstüne ekle:
Kod:
        void RenderTextLine(float x, float y, const char* c_szText, DWORD dwColor);


* EterPythonLib/PythonWindow.cpp

Ekle:
Kod:
#include <fmt/format.h>

Arat:
Kod:
        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);
        }

Değiştir:
Kod:
        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);
            }
        }

* UserInterface\GameType.cpp

Arat:
Kod:
static CResource* gs_pkDefaultFont = NULL;

Değiştir:
Kod:
CResource* gs_pkDefaultFont = NULL;


Aktif etme:
EterPythonLib\PythonWindow.cpp içerisinde "BOOL g_bOutlineBoxEnable" değerini "TRUE" olarak değiştirebilir ya da python üzerinden "wndMgr.SetOutlineFlag(True)" ile aktif edebilirsiniz
ht02
Üye
Üye
Katılım12 Şub 2026
Konular4
Mesajlar46
Elmas Konular0
Başarım0
ZirveCoin 0
Ticaret Puanı
+0 -0
04.04.2026 00:39 #2
kütüphane problemi yaşayabilecek arkadaşlar için alternatif:
#include <sstream>:
        if (g_bOutlineBoxEnable)
        {
            if (CWindowManager::instance().GetPointWindow() == this)
            {
                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);

                CPythonGraphic::Instance().SetDiffuseColor(0.0f, 1.0f, 0.0f);
                CPythonGraphic::Instance().RenderBox2d(m_rect.left, m_rect.top, m_rect.right, m_rect.bottom);

                std::ostringstream oss;
                oss << m_strName << " (" << Type() << ")";
                CPythonGraphic::Instance().RenderTextLine(m_rect.left + 5, m_rect.top - 30, oss.str().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";

                std::ostringstream ossInfo;
                ossInfo << "Pos: (" << m_rect.left << ", " << m_rect.top << "), "
                        << "Size: " << (m_rect.right - m_rect.left) << "x" << (m_rect.bottom - m_rect.top) << ", "
                        << "Flags: " << flagInfo << ", "
                        << "Parent: " << parentName;

                CPythonGraphic::Instance().RenderTextLine(m_rect.left + 5, m_rect.top - 15, ossInfo.str().c_str(), 0xFFFFFFFF);
            }
        }
ht02
Üye
Üye
Katılım12 Şub 2026
Konular4
Mesajlar46
Elmas Konular0
Başarım0
ZirveCoin 0
Ticaret Puanı
+0 -0
17.04.2026 16:28 #3
Paylaşım için teşekkürler. Konuyu sabite aldım.
A.AY
Üye
Üye
Katılım09 Mar 2026
Konular13
Mesajlar83
Elmas Konular0
Başarım0
ZirveCoin 0
Ticaret Puanı
+0 -0
03.05.2026 08:37 #4
Eline sağlık
masivesstroke
Üye
Üye
Katılım21 Ara 2025
Konular5
Mesajlar51
Elmas Konular0
Başarım0
ZirveCoin 0
Ticaret Puanı
+0 -0
03.05.2026 22:03 #5
çok güzel bir paylaşım olmuş ellerine sağlık
agrzm
Üye
Üye
Katılım22 Nis 2026
Konular4
Mesajlar63
Elmas Konular0
Başarım0
ZirveCoin 0
Ticaret Puanı
+0 -0
04.05.2026 23:12 #6
paylaşım için teşekkürler
ntg12
Üye
Üye
Katılım20 Ara 2025
Konular4
Mesajlar49
Elmas Konular0
Başarım0
ZirveCoin 0
Ticaret Puanı
+0 -0
05.05.2026 04:06 #7
Eline sağlık
Bu konuyu görüntüleyenler
1 misafir
Cevap yazmak için giriş yapın.
Benzer Konular
6 cevap
2K görüntüleme
9 cevap
1.9K görüntüleme
4 cevap
1.9K görüntüleme
8 cevap
1.9K görüntüleme
İlan Yan banner placeholder