From 0534066c68cdab0388cf0c32cbb0c345e9316e4c Mon Sep 17 00:00:00 2001 From: jupahe64 Date: Sat, 23 Dec 2023 23:59:33 +0100 Subject: [PATCH] make background tiles in minimap darker --- Fushigi/ui/widgets/CourseScene.cs | 43 +++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/Fushigi/ui/widgets/CourseScene.cs b/Fushigi/ui/widgets/CourseScene.cs index fbdbcf38..a4b580ca 100644 --- a/Fushigi/ui/widgets/CourseScene.cs +++ b/Fushigi/ui/widgets/CourseScene.cs @@ -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,