From 517d913cd9af1627454026520b0c5a20fd40cfec Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Mon, 6 Nov 2023 17:54:24 -0500 Subject: [PATCH] Fix getting selected bg unit points --- Fushigi/ui/bgunit/BGUnitRail.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Fushigi/ui/bgunit/BGUnitRail.cs b/Fushigi/ui/bgunit/BGUnitRail.cs index e4b0213d..a56fbefe 100644 --- a/Fushigi/ui/bgunit/BGUnitRail.cs +++ b/Fushigi/ui/bgunit/BGUnitRail.cs @@ -18,7 +18,7 @@ internal class BGUnitRail { public List Points = new List(); - public List GetSelected() => Points.Where(x => x.IsSelected).ToList(); + public List GetSelected(CourseAreaEditContext ctx) => Points.Where(x => ctx.IsSelected(x)).ToList(); public bool IsClosed = false; @@ -97,7 +97,7 @@ public void AddPoint(LevelViewport viewport, RailPoint point) public void RemoveSelected(LevelViewport viewport) { - var selected = this.GetSelected(); + var selected = this.GetSelected(viewport.mEditContext); if (selected.Count == 0) return; @@ -142,7 +142,7 @@ public void OnMouseDown(LevelViewport viewport) mouseDownPos = viewport.ScreenToWorld(ImGui.GetMousePos()); - var selected = GetSelected(); + var selected = GetSelected(viewport.mEditContext); if (ImGui.GetIO().KeyAlt && selected.Count == 1) { @@ -224,7 +224,7 @@ public void OnSelecting(LevelViewport viewport) transformStart = true; //Store each selected point for undoing viewport.mEditContext.BeginUndoCollection(); - foreach (var point in this.GetSelected()) + foreach (var point in this.GetSelected(viewport.mEditContext)) viewport.mEditContext.AddToUndo(new TransformUndo(point.Transform)); viewport.mEditContext.EndUndoCollection(); }