From 6f1533ee182ee21f9eaa6f8f29daf48ac1ac043b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sat, 25 Mar 2023 16:48:59 +0100 Subject: [PATCH] Group UI code of right and left editor file dialog buttons Move UI code for "New folder" button close to the code the "Map details" button. --- src/game/editor/editor.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index c82c85ce8..d6a59b733 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -5043,18 +5043,6 @@ void CEditor::RenderFileDialog() if(DoButton_Editor(&s_CancelButton, "Cancel", 0, &Button, 0, nullptr) || (s_ListBoxUsed && UI()->ConsumeHotkey(CUI::HOTKEY_ESCAPE))) m_Dialog = DIALOG_NONE; - if(m_FileDialogStorageType == IStorage::TYPE_SAVE) - { - ButtonBar.VSplitLeft(70.0f, &Button, &ButtonBar); - if(DoButton_Editor(&s_NewFolderButton, "New folder", 0, &Button, 0, nullptr)) - { - m_aFileDialogNewFolderName[0] = 0; - static int s_NewFolderPopupID = 0; - UiInvokePopupMenu(&s_NewFolderPopupID, 0, Width / 2.0f - 200.0f, Height / 2.0f - 100.0f, 400.0f, 200.0f, PopupNewFolder); - UI()->SetActiveItem(nullptr); - } - } - ButtonBar.VSplitRight(40.0f, &ButtonBar, &Button); ButtonBar.VSplitRight(50.0f, &ButtonBar, &Button); if(DoButton_Editor(&s_RefreshButton, "Refresh", 0, &Button, 0, nullptr) || (s_ListBoxUsed && (Input()->KeyIsPressed(KEY_F5) || (Input()->ModifierIsPressed() && Input()->KeyIsPressed(KEY_R))))) @@ -5072,6 +5060,15 @@ void CEditor::RenderFileDialog() if(m_FileDialogStorageType == IStorage::TYPE_SAVE) { + ButtonBar.VSplitLeft(70.0f, &Button, &ButtonBar); + if(DoButton_Editor(&s_NewFolderButton, "New folder", 0, &Button, 0, nullptr)) + { + m_aFileDialogNewFolderName[0] = 0; + static int s_NewFolderPopupID = 0; + UiInvokePopupMenu(&s_NewFolderPopupID, 0, Width / 2.0f - 200.0f, Height / 2.0f - 100.0f, 400.0f, 200.0f, PopupNewFolder); + UI()->SetActiveItem(nullptr); + } + ButtonBar.VSplitLeft(40.0f, nullptr, &ButtonBar); ButtonBar.VSplitLeft(70.0f, &Button, &ButtonBar); if(DoButton_Editor(&s_MapInfoButton, "Map details", 0, &Button, 0, nullptr))