From a9db705c1497044b32d5a722d484b275af92246a Mon Sep 17 00:00:00 2001 From: oy Date: Sun, 8 Jan 2012 13:36:47 +0100 Subject: fixed that refocus is done when using Home-key in a editor edit box. Closes #821 --- src/game/editor/editor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/game/editor/editor.cpp') diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 4f93f4fa..792c735a 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -228,6 +228,7 @@ int CEditor::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned Str if(UI()->LastActiveItem() == pID) { + m_EditBoxActive = 2; int Len = str_length(pStr); if(Len == 0) s_AtIndex = 0; @@ -971,7 +972,7 @@ void CEditor::DoToolbar(CUIRect ToolBar) // refocus button TB_Bottom.VSplitLeft(50.0f, &Button, &TB_Bottom); static int s_RefocusButton = 0; - if(DoButton_Editor(&s_RefocusButton, "Refocus", m_WorldOffsetX&&m_WorldOffsetY?0:-1, &Button, 0, "[HOME] Restore map focus") || Input()->KeyDown(KEY_HOME)) + if(DoButton_Editor(&s_RefocusButton, "Refocus", m_WorldOffsetX&&m_WorldOffsetY?0:-1, &Button, 0, "[HOME] Restore map focus") || (m_EditBoxActive == 0 && Input()->KeyDown(KEY_HOME))) { m_WorldOffsetX = 0; m_WorldOffsetY = 0; @@ -3620,6 +3621,9 @@ void CEditor::Render() // reset tip m_pTooltip = 0; + if(m_EditBoxActive) + --m_EditBoxActive; + // render checker RenderBackground(View, ms_CheckerTexture, 32.0f, 1.0f); -- cgit 1.4.1