mirror of
https://github.com/ddnet/ddnet.git
synced 2024-10-19 07:18:19 +00:00
Merge pull request #9091 from dobrykafe/pr-editor-ui-debug
Show UI debug info inside editor
This commit is contained in:
commit
f10d476964
|
@ -2275,7 +2275,7 @@ void CMenus::OnRender()
|
|||
|
||||
// render debug information
|
||||
if(g_Config.m_Debug)
|
||||
Ui()->DebugRender();
|
||||
Ui()->DebugRender(2.0f, Ui()->Screen()->h - 12.0f);
|
||||
|
||||
if(Ui()->ConsumeHotkey(CUi::HOTKEY_ESCAPE))
|
||||
SetActive(false);
|
||||
|
|
|
@ -258,13 +258,13 @@ void CUi::Update(vec2 MouseWorldPos)
|
|||
m_ProgressSpinnerOffset = std::fmod(m_ProgressSpinnerOffset, 1.0f);
|
||||
}
|
||||
|
||||
void CUi::DebugRender()
|
||||
void CUi::DebugRender(float X, float Y)
|
||||
{
|
||||
MapScreen();
|
||||
|
||||
char aBuf[128];
|
||||
str_format(aBuf, sizeof(aBuf), "hot=%p nexthot=%p active=%p lastactive=%p", HotItem(), NextHotItem(), ActiveItem(), m_pLastActiveItem);
|
||||
TextRender()->Text(2.0f, Screen()->h - 12.0f, 10.0f, aBuf);
|
||||
TextRender()->Text(X, Y, 10.0f, aBuf);
|
||||
}
|
||||
|
||||
bool CUi::MouseInside(const CUIRect *pRect) const
|
||||
|
|
|
@ -470,7 +470,7 @@ public:
|
|||
void SetEnabled(bool Enabled) { m_Enabled = Enabled; }
|
||||
bool Enabled() const { return m_Enabled; }
|
||||
void Update(vec2 MouseWorldPos = vec2(-1.0f, -1.0f));
|
||||
void DebugRender();
|
||||
void DebugRender(float X, float Y);
|
||||
|
||||
vec2 MousePos() const { return m_MousePos; }
|
||||
float MouseX() const { return m_MousePos.x; }
|
||||
|
|
|
@ -8777,6 +8777,9 @@ void CEditor::OnRender()
|
|||
m_ShowMousePointer = true;
|
||||
}
|
||||
|
||||
if(g_Config.m_Debug)
|
||||
Ui()->DebugRender(2.0f, Ui()->Screen()->h - 27.0f);
|
||||
|
||||
Ui()->FinishCheck();
|
||||
Ui()->ClearHotkeys();
|
||||
Input()->Clear();
|
||||
|
|
Loading…
Reference in a new issue