Skip to content

Commit

Permalink
make background tiles in minimap darker
Browse files Browse the repository at this point in the history
  • Loading branch information
jupahe64 committed Dec 23, 2023
1 parent 66a9bfa commit 0534066
Showing 1 changed file with 30 additions and 13 deletions.
43 changes: 30 additions & 13 deletions Fushigi/ui/widgets/CourseScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1801,25 +1801,42 @@ private void CourseMiniView()
MathF.Round(lvlRectTopLeft.Y + (pos.Y - bb.Max.Y) / (bb.Min.Y - bb.Max.Y) * lvlRectSize.Y)
);


foreach (var unit in area.mUnitHolder.mUnits)
var backgroundSubUnits = area.mUnitHolder.mUnits
.Where(x => x.mModelType == CourseUnit.ModelType.NoCollision)
.SelectMany(x => x.mTileSubUnits);

foreach (var subUnit in backgroundSubUnits)
{
foreach (var subUnit in unit.mTileSubUnits)
var origin2D = new Vector2(subUnit.mOrigin.X, subUnit.mOrigin.Y);

foreach (var tile in subUnit.GetTiles(bb.Min - origin2D, bb.Max - origin2D))
{
var origin2D = new Vector2(subUnit.mOrigin.X, subUnit.mOrigin.Y);
var pos = tile.pos + origin2D;
dl.AddRectFilled(
MapPointPixelAligned(pos),
MapPointPixelAligned(pos + Vector2.One),
0xFF444444);
}
}

foreach (var tile in subUnit.GetTiles(bb.Min - origin2D, bb.Max - origin2D))
{
var pos = tile.pos + origin2D;
dl.AddRectFilled(
MapPointPixelAligned(pos),
MapPointPixelAligned(pos + Vector2.One),
0xFF999999);
}
var foregroundSubUnits = area.mUnitHolder.mUnits
.Where(x => x.mModelType != CourseUnit.ModelType.NoCollision)
.SelectMany(x => x.mTileSubUnits);

foreach (var subUnit in foregroundSubUnits)
{
var origin2D = new Vector2(subUnit.mOrigin.X, subUnit.mOrigin.Y);

foreach (var tile in subUnit.GetTiles(bb.Min - origin2D, bb.Max - origin2D))
{
var pos = tile.pos + origin2D;
dl.AddRectFilled(
MapPointPixelAligned(pos),
MapPointPixelAligned(pos + Vector2.One),
0xFF999999);
}
}



dl.AddRect(lvlRectTopLeft,
lvlRectTopLeft + lvlRectSize,
Expand Down

0 comments on commit 0534066

Please sign in to comment.