Skip to content

Commit

Permalink
Fix editor modified state not updated for server settings changes
Browse files Browse the repository at this point in the history
Closes ddnet#6856.
  • Loading branch information
Robyt3 committed Jul 15, 2023
1 parent cfdc696 commit 1526065
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/game/editor/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6027,6 +6027,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd
str_copy(Setting.m_aCommand, m_SettingsCommandInput.GetString());
m_Map.m_vSettings.push_back(Setting);
s_CommandSelectedIndex = m_Map.m_vSettings.size() - 1;
m_Map.OnModify();
}
}
UI()->SetActiveItem(&m_SettingsCommandInput);
Expand Down Expand Up @@ -6058,6 +6059,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd
{
str_copy(m_Map.m_vSettings[s_CommandSelectedIndex].m_aCommand, m_SettingsCommandInput.GetString());
}
m_Map.OnModify();
}
UI()->SetActiveItem(&m_SettingsCommandInput);
}
Expand All @@ -6073,6 +6075,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd
if(s_CommandSelectedIndex >= 0)
m_SettingsCommandInput.Set(m_Map.m_vSettings[s_CommandSelectedIndex].m_aCommand);
UI()->SetActiveItem(&m_SettingsCommandInput);
m_Map.OnModify();
}

ToolBar.VSplitRight(25.0f, &ToolBar, &Button);
Expand All @@ -6082,6 +6085,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd
{
std::swap(m_Map.m_vSettings[s_CommandSelectedIndex], m_Map.m_vSettings[s_CommandSelectedIndex + 1]);
s_CommandSelectedIndex++;
m_Map.OnModify();
}

ToolBar.VSplitRight(25.0f, &ToolBar, &Button);
Expand All @@ -6091,6 +6095,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd
{
std::swap(m_Map.m_vSettings[s_CommandSelectedIndex], m_Map.m_vSettings[s_CommandSelectedIndex - 1]);
s_CommandSelectedIndex--;
m_Map.OnModify();
}
}
}
Expand Down

0 comments on commit 1526065

Please sign in to comment.