Skip to content

Commit

Permalink
Make the Add Actor window closable incase the user wishes to no longe…
Browse files Browse the repository at this point in the history
…r add an actor
  • Loading branch information
shibbo committed Nov 7, 2023
1 parent 2abbf87 commit 3348f58
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Fushigi/ui/widgets/CourseScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ public void Save()

private void SelectActor()
{
bool status = ImGui.Begin("Add Actor");
bool button = true;
bool status = ImGui.Begin("Add Actor", ref button);

ImGui.BeginListBox("Select the actor you want to add.", ImGui.GetContentRegionAvail());

Expand All @@ -224,6 +225,17 @@ private void SelectActor()

ImGui.EndListBox();

if (ImGui.IsKeyDown(ImGuiKey.Escape))
{
button = false;
}

if (!button)
{
activeViewport.mEditorState = LevelViewport.EditorState.Selecting;
mShowAddActor = false;
}

if (status)
{
ImGui.End();
Expand Down

0 comments on commit 3348f58

Please sign in to comment.