Skip to content

Commit

Permalink
feat: showing bigger map in a popup
Browse files Browse the repository at this point in the history
  • Loading branch information
ktos committed Jun 18, 2024
1 parent 65c618b commit f705b5e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Server/Components/Popups/MapPopup.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@using Fracture.Server.Modules.MapGenerator.UI.Models

<div class="row">
<MapView Map="Map" MapDisplayData="MapDisplayData" Path="null"></MapView>
<MapView Map="Map" MapDisplayData="MapDisplayData" Path="null" IsMiniMap="false"></MapView>
</div>

@code {
Expand Down
4 changes: 3 additions & 1 deletion Server/Modules/MapGenerator/UI/MapView.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div id="map">
@if (Map != null && MapDisplayData != null)
{
<table class="miniMapTable">
<table class="@(IsMiniMap ? "miniMapTable" : "mapTable")">
@for (int y = 0; y < Map.Grid.GetLength(1); y++)
{
<tr>
Expand Down Expand Up @@ -49,6 +49,8 @@
[Parameter]
public List<IPathfindingNode>? Path { get; set; }

[Parameter] public bool IsMiniMap { get; set; } = true;

private string GetTileColor(Node node)
{
if (MapDisplayData!.ShowColorMap)
Expand Down
14 changes: 11 additions & 3 deletions Server/wwwroot/css/game.css
Original file line number Diff line number Diff line change
Expand Up @@ -281,17 +281,25 @@ body {
border-bottom: #000 solid 2px;
}

.miniMapTable {
.miniMapTable, .mapTable {
border: #000 1px solid;
border-collapse: collapse;
box-shadow: 0px 0px 10px #000;
}

.miniMapTable tr td {
.miniMapTable tr td, .mapTable tr td {
border: #000 1px solid;
background-color: blue;
}

.miniMapTable tr td {
width: 5px;
height: 5px;
background-color: blue;
}

.mapTable tr td {
width: 20px;
height: 20px;
}

.settings {
Expand Down

0 comments on commit f705b5e

Please sign in to comment.