diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 88757bea9..117c52d76 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "auto_map.h" @@ -4136,6 +4137,7 @@ int CEditor::PopupMenuFile(CEditor *pEditor, CUIRect View) void CEditor::RenderMenubar(CUIRect MenuBar) { + CUIRect ExitButton; static CUIRect s_File /*, view, help*/; MenuBar.VSplitLeft(60.0f, &s_File, &MenuBar); @@ -4143,14 +4145,26 @@ void CEditor::RenderMenubar(CUIRect MenuBar) UiInvokePopupMenu(&s_File, 1, s_File.x, s_File.y+s_File.h-1.0f, 120, 150, PopupMenuFile, this); CUIRect Info; + MenuBar.VSplitRight(20.f, &MenuBar, &ExitButton); MenuBar.VSplitLeft(40.0f, 0, &MenuBar); MenuBar.VSplitLeft(MenuBar.w*0.75f, &MenuBar, &Info); + + char aBuf[128]; str_format(aBuf, sizeof(aBuf), "File: %s", m_aFileName); UI()->DoLabel(&MenuBar, aBuf, 10.0f, CUI::ALIGN_LEFT); str_format(aBuf, sizeof(aBuf), "Z: %i, A: %.1f, G: %i", m_ZoomLevel, m_AnimateSpeed, m_GridFactor); UI()->DoLabel(&Info, aBuf, 10.0f, CUI::ALIGN_RIGHT); + + // Exit editor button + static int s_ExitButton; + ExitButton.VSplitRight(13.f, 0, &ExitButton); + if(DoButton_Editor(&s_ExitButton, "\xE2\x9C\x95", 1, &ExitButton, 0, "[ctrl+shift+e] Exit")) + { + g_Config.m_ClEditor ^= 1; + Input()->MouseModeRelative(); + } } void CEditor::Render()