mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
editor: allow non-conflicting keybinds while line input is active
This commit is contained in:
parent
217103a0ee
commit
9e8dfc720a
|
@ -7827,11 +7827,21 @@ void CEditor::Render()
|
||||||
else if(m_Mode == MODE_SOUNDS)
|
else if(m_Mode == MODE_SOUNDS)
|
||||||
DoToolbarSounds(ToolBar);
|
DoToolbarSounds(ToolBar);
|
||||||
|
|
||||||
if(m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr)
|
if(m_Dialog == DIALOG_NONE)
|
||||||
{
|
{
|
||||||
const bool ModPressed = Input()->ModifierIsPressed();
|
const bool ModPressed = Input()->ModifierIsPressed();
|
||||||
const bool ShiftPressed = Input()->ShiftIsPressed();
|
const bool ShiftPressed = Input()->ShiftIsPressed();
|
||||||
const bool AltPressed = Input()->AltIsPressed();
|
const bool AltPressed = Input()->AltIsPressed();
|
||||||
|
|
||||||
|
if(CLineInput::GetActiveInput() == nullptr)
|
||||||
|
{
|
||||||
|
// ctrl+a to append map
|
||||||
|
if(Input()->KeyPress(KEY_A) && ModPressed)
|
||||||
|
{
|
||||||
|
InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_MAP, "Append map", "Append", "maps", false, CallbackAppendMap, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ctrl+n to create new map
|
// ctrl+n to create new map
|
||||||
if(Input()->KeyPress(KEY_N) && ModPressed)
|
if(Input()->KeyPress(KEY_N) && ModPressed)
|
||||||
{
|
{
|
||||||
|
@ -7849,11 +7859,6 @@ void CEditor::Render()
|
||||||
m_aFileName[0] = 0;
|
m_aFileName[0] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ctrl+a to append map
|
|
||||||
if(Input()->KeyPress(KEY_A) && ModPressed)
|
|
||||||
{
|
|
||||||
InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_MAP, "Append map", "Append", "maps", false, CallbackAppendMap, this);
|
|
||||||
}
|
|
||||||
// ctrl+o or ctrl+l to open
|
// ctrl+o or ctrl+l to open
|
||||||
if((Input()->KeyPress(KEY_O) || Input()->KeyPress(KEY_L)) && ModPressed)
|
if((Input()->KeyPress(KEY_O) || Input()->KeyPress(KEY_L)) && ModPressed)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue