Fix disallowing arrow keys in editor edit box

This commit is contained in:
Jupeyy 2021-07-17 12:48:22 +02:00
parent dbc05f6bb0
commit 432568bfd4

View file

@ -328,6 +328,8 @@ int CEditor::DoClearableEditBox(void *pID, void *pClearID, const CUIRect *pRect,
int CEditor::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrSize, float FontSize, float *Offset, bool Hidden, int Corners)
{
if(UI()->LastActiveItem() == pID)
m_EditBoxActive = 2;
return m_UIEx.DoEditBox(pID, pRect, pStr, StrSize, FontSize, Offset, Hidden, Corners);
}
@ -3342,7 +3344,7 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View)
}
}
if(Input()->KeyPress(KEY_DOWN) && m_Dialog == DIALOG_NONE)
if(Input()->KeyPress(KEY_DOWN) && m_Dialog == DIALOG_NONE && m_EditBoxActive == 0)
{
if(Input()->KeyIsPressed(KEY_LSHIFT) || Input()->KeyIsPressed(KEY_RSHIFT))
{
@ -3373,7 +3375,7 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View)
}
}
}
if(Input()->KeyPress(KEY_UP) && m_Dialog == DIALOG_NONE)
if(Input()->KeyPress(KEY_UP) && m_Dialog == DIALOG_NONE && m_EditBoxActive == 0)
{
if(Input()->KeyIsPressed(KEY_LSHIFT) || Input()->KeyIsPressed(KEY_RSHIFT))
{