Skip to content

Commit

Permalink
Fix getting selected bg unit points
Browse files Browse the repository at this point in the history
  • Loading branch information
KillzXGaming committed Nov 6, 2023
1 parent 07511d9 commit 517d913
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Fushigi/ui/bgunit/BGUnitRail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal class BGUnitRail
{
public List<RailPoint> Points = new List<RailPoint>();

public List<RailPoint> GetSelected() => Points.Where(x => x.IsSelected).ToList();
public List<RailPoint> GetSelected(CourseAreaEditContext ctx) => Points.Where(x => ctx.IsSelected(x)).ToList();

public bool IsClosed = false;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 517d913

Please sign in to comment.