Skip to content

Commit

Permalink
Don't allow adding new land brush with the same name, also enabled la…
Browse files Browse the repository at this point in the history
…ndbrush manager
  • Loading branch information
kaczy93 committed Oct 8, 2024
1 parent 7ca73fb commit fd80ada
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CentrED/UI/Windows/LandBrushManagerWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ protected override void InternalDraw()

DrawImport();

ImGui.Text("Coming soon ;)");
return; //For now until we fix the landbrushes

if (ImGui.Button("Save"))
{
ProfileManager.Save();
Expand Down Expand Up @@ -333,6 +330,7 @@ private void DrawBrushPopups()
if (ImGui.BeginPopupModal("LandBrushAdd", ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoDecoration))
{
ImGui.InputText("Name", ref _landBrushNewName, 64);
ImGui.BeginDisabled(_landBrushes.ContainsKey(_landBrushNewName) || string.IsNullOrWhiteSpace(_landBrushNewName));
if (ImGui.Button("Add"))
{
if (!_landBrushes.ContainsKey(_landBrushNewName))
Expand All @@ -342,10 +340,12 @@ private void DrawBrushPopups()
Name = _landBrushNewName
});
_selectedLandBrushName = _landBrushNewName;
_selectedTransitionBrushName = Selected.Transitions.Keys.FirstOrDefault("");
_landBrushNewName = "";
ImGui.CloseCurrentPopup();
}
}
ImGui.EndDisabled();
ImGui.SameLine();
if (ImGui.Button("Cancel"))
{
Expand Down

0 comments on commit fd80ada

Please sign in to comment.