From 7d87089acdcecf614de3010a3fbd824ee2267868 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Sat, 22 May 2021 11:24:48 +0200 Subject: [PATCH] Make sure ctrl+shift+s works same as clicking UI Do not overwrite the current map when saving as a new file closed #1972 --- src/game/editor/editor.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index f5c9130bf..e845362aa 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -5995,8 +5995,14 @@ void CEditor::Render() } } + // ctrl+shift+alt+s to save as + if(Input()->KeyPress(KEY_S) && CtrlPressed && ShiftPressed && AltPressed) + InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", "", CallbackSaveCopyMap, this); + // ctrl+shift+s to save as + else if(Input()->KeyPress(KEY_S) && CtrlPressed && ShiftPressed) + InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", "", CallbackSaveMap, this); // ctrl+s to save - if(Input()->KeyPress(KEY_S) && CtrlPressed) + else if(Input()->KeyPress(KEY_S) && CtrlPressed) { if(m_aFileName[0] && m_ValidSaveFilename) { @@ -6009,14 +6015,6 @@ void CEditor::Render() else InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", "", CallbackSaveMap, this); } - - // ctrl+shift+s to save as - if(Input()->KeyPress(KEY_S) && CtrlPressed && ShiftPressed) - InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", "", CallbackSaveMap, this); - - // ctrl+shift+alt+s to save as - if(Input()->KeyPress(KEY_S) && CtrlPressed && ShiftPressed && AltPressed) - InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", "", CallbackSaveCopyMap, this); } if(m_GuiActive)