3840: Make sure ctrl+shift+s works same as clicking UI r=Jupeyy a=ChillerDragon

Do not overwrite the current map when saving as a new file

closed #1972

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
This commit is contained in:
bors[bot] 2021-05-22 09:44:13 +00:00 committed by GitHub
commit 1dc85e9f4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)