diff --git a/src/Gui/MapPanel.cs b/src/Gui/MapPanel.cs index 1f30eda..86f2049 100644 --- a/src/Gui/MapPanel.cs +++ b/src/Gui/MapPanel.cs @@ -50,6 +50,10 @@ namespace WorldOfPeacecraft private Image BeachTopRight; private Image BeachBottomLeft; private Image BeachBottomRight; + private Image BeachInnerTopLeft; + private Image BeachInnerTopRight; + private Image BeachInnerBotLeft; + private Image BeachInnerBotRight; private int FlowerCounter; public MapPanel (IBackend backend) @@ -149,6 +153,7 @@ namespace WorldOfPeacecraft DrawWallEdge(g, CountWater (bot, botleft, left), x, y, 0, offset, WallEdgeBotLeft, WallCornerBotLeft, (bot.IsWater () ? BeachBottom : BeachLeft)); } else if (tile.IsWater ()) { PaintImage(g, x, y, Water); + PaintBeachInnerEdge(g, locx, locy, x, y, map); PaintWallInnerEdge(g, locx, locy, x, y, map); } else { @@ -228,6 +233,30 @@ namespace WorldOfPeacecraft } } + private void PaintBeachInnerEdge (Graphics g, int locx, int locy, int x, int y, ITile[,] map) + { + bool topDry = GetTile (locx, locy - 1, map).IsWalkable() || GetTile (locx, locy - 1, map).IsWall(); + bool rightDry = GetTile (locx + 1, locy, map).IsWalkable() || GetTile (locx + 1, locy, map).IsWall(); + bool botDry = GetTile (locx, locy + 1, map).IsWalkable() || GetTile (locx, locy + 1, map).IsWall(); + bool leftDry = GetTile (locx - 1, locy, map).IsWalkable() || GetTile (locx - 1, locy, map).IsWall(); + if (leftDry) { + if (topDry) + if (GetTile (locx - 1, locy - 1, map).IsWalkable() || GetTile (locx - 1, locy - 1, map).IsWall()) + PaintImage (g, x, y, BeachInnerTopLeft); + if (botDry) + if (GetTile (locx - 1, locy + 1, map).IsWalkable()|| GetTile (locx - 1, locy + 1, map).IsWall()) + PaintImage (g, x, y, BeachInnerBotLeft); + } + if (rightDry) { + if (topDry) + if (GetTile (locx + 1, locy - 1, map).IsWalkable()|| GetTile (locx + 1, locy - 1, map).IsWall()) + PaintImage (g, x, y, BeachInnerTopRight); + if (botDry) + if (GetTile (locx + 1, locy + 1, map).IsWalkable()|| GetTile (locx + 1, locy + 1, map).IsWall()) + PaintImage (g, x, y, BeachInnerBotRight); + } + } + private void PaintWallInnerEdge (Graphics g, int locx, int locy, int x, int y, ITile[,] map) { bool topWall = NullsafeIsWall (locx, locy - 1, map); @@ -388,6 +417,10 @@ namespace WorldOfPeacecraft BeachBottomLeft = RotateFlipImage (BeachBottomRight, RotateFlipType.Rotate90FlipNone); BeachTopLeft = RotateFlipImage (BeachBottomRight, RotateFlipType.Rotate180FlipNone); BeachTopRight = RotateFlipImage (BeachBottomRight, RotateFlipType.Rotate270FlipNone); + BeachInnerBotRight = Image.FromFile (ImagesFolder + "beachcorner_inner.png"); + BeachInnerBotLeft = RotateFlipImage (BeachInnerBotRight, RotateFlipType.Rotate90FlipNone); + BeachInnerTopLeft = RotateFlipImage (BeachInnerBotRight, RotateFlipType.Rotate180FlipNone); + BeachInnerTopRight = RotateFlipImage (BeachInnerBotRight, RotateFlipType.Rotate270FlipNone); WallBase = Image.FromFile(ImagesFolder + "wall_base.png"); WallEdgeBotLeft = Image.FromFile (ImagesFolder + "wall_edge_botleft.png"); WallEdgeBotRight = Image.FromFile (ImagesFolder + "wall_edge_botright.png"); @@ -406,6 +439,7 @@ namespace WorldOfPeacecraft WaterInnerTopRight = Image.FromFile (ImagesFolder + "water_topright.png"); WaterInnerBotLeft = Image.FromFile (ImagesFolder + "water_botleft.png"); WaterInnerBotRight = Image.FromFile (ImagesFolder + "water_botright.png"); + } public void InitializeComponents(){ diff --git a/textures/beachcorner_inner.png b/textures/beachcorner_inner.png new file mode 100644 index 0000000..985e561 Binary files /dev/null and b/textures/beachcorner_inner.png differ