mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Editor: Don't react to server settings shortcuts when dialog is open
as reported by Sorah
This commit is contained in:
parent
c59bc6595f
commit
3b3b2c70af
|
@ -5239,7 +5239,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd
|
|||
// buttons
|
||||
ToolBar.VSplitRight(50.0f, &ToolBar, &Button);
|
||||
static int s_AddButton = 0;
|
||||
if(DoButton_Editor(&s_AddButton, "Add", 0, &Button, 0, "Add a command to command list.") || ((Input()->KeyPress(KEY_RETURN) || Input()->KeyPress(KEY_KP_ENTER)) && UI()->LastActiveItem() == &m_CommandBox))
|
||||
if(DoButton_Editor(&s_AddButton, "Add", 0, &Button, 0, "Add a command to command list.") || ((Input()->KeyPress(KEY_RETURN) || Input()->KeyPress(KEY_KP_ENTER)) && UI()->LastActiveItem() == &m_CommandBox && m_Dialog == DIALOG_NONE))
|
||||
{
|
||||
if(m_aSettingsCommand[0] != 0 && str_find(m_aSettingsCommand, " "))
|
||||
{
|
||||
|
@ -5267,7 +5267,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd
|
|||
ToolBar.VSplitRight(50.0f, &ToolBar, &Button);
|
||||
Button.VSplitRight(5.0f, &Button, 0);
|
||||
static int s_ModButton = 0;
|
||||
if(DoButton_Editor(&s_ModButton, "Mod", 0, &Button, 0, "Modify a command from the command list.") || (Input()->KeyPress(KEY_M) && UI()->LastActiveItem() != &m_CommandBox))
|
||||
if(DoButton_Editor(&s_ModButton, "Mod", 0, &Button, 0, "Modify a command from the command list.") || (Input()->KeyPress(KEY_M) && UI()->LastActiveItem() != &m_CommandBox && m_Dialog == DIALOG_NONE))
|
||||
{
|
||||
if(str_comp(m_Map.m_lSettings[s_CommandSelectedIndex].m_aCommand, m_aSettingsCommand) != 0 && m_aSettingsCommand[0] != 0 && str_find(m_aSettingsCommand, " "))
|
||||
{
|
||||
|
@ -5295,7 +5295,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd
|
|||
ToolBar.VSplitRight(50.0f, &ToolBar, &Button);
|
||||
Button.VSplitRight(5.0f, &Button, 0);
|
||||
static int s_DelButton = 0;
|
||||
if(DoButton_Editor(&s_DelButton, "Del", 0, &Button, 0, "Delete a command from the command list.") || (Input()->KeyPress(KEY_DELETE) && UI()->LastActiveItem() != &m_CommandBox))
|
||||
if(DoButton_Editor(&s_DelButton, "Del", 0, &Button, 0, "Delete a command from the command list.") || (Input()->KeyPress(KEY_DELETE) && UI()->LastActiveItem() != &m_CommandBox && m_Dialog == DIALOG_NONE))
|
||||
{
|
||||
m_Map.m_lSettings.remove_index(s_CommandSelectedIndex);
|
||||
if(s_CommandSelectedIndex >= m_Map.m_lSettings.size())
|
||||
|
|
Loading…
Reference in a new issue