Skip to content

Commit

Permalink
Update packages + add kills per team
Browse files Browse the repository at this point in the history
  • Loading branch information
JimGeersinga committed Nov 6, 2024
1 parent e6eff9d commit c739497
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 39 deletions.
15 changes: 8 additions & 7 deletions NED.WoT.BattleResults.Client/NED.WoT.BattleResults.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appiconfg.svg" />
<MauiIcon Include="Resources\AppIcon\appiconfg.svg" />

<!-- Splash Screen -->
<MauiSplashScreen Include="wwwroot\images\logo.png">
Expand All @@ -60,12 +60,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.10" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.10" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.3" />
<PackageReference Include="MudBlazor" Version="6.17.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.92" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.92" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.92" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.10" />
<PackageReference Include="MudBlazor" Version="7.15.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
17 changes: 7 additions & 10 deletions NED.WoT.BattleResults.Client/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</MudGrid>
</MudToolBar>

<MudTable Items="@_reports" FixedHeader="true" FixedFooter="true" Dense="true" Hover="true" Virtualize="true" Bordered="true" Loading="@_loading" GroupHeaderStyle="background-color:var(--mud-palette-background-grey)" GroupHeaderClass="group-info"
<MudTable Items="@_reports" FixedHeader="true" FixedFooter="true" Dense="true" Hover="true" Virtualize="true" Bordered="true" Loading="@_loading" GroupHeaderStyle="background-color:var(--mud-palette-background-gray)" GroupHeaderClass="group-info"
RowClassFunc="@SelectedRowClass" Filter="new Func<BattleReport,bool>(TableFilter)" Height="calc(100vh - 128px);" Class="report-table" RowClass="@(SettingService.Settings.OnlyHighlistOwnMatches ? "highlight-own-result match-info" : "match-info")" GroupBy="@_groupDefinition" AllowUnsorted="false">
<ColGroup>
<col style="width: 50px" />
Expand Down Expand Up @@ -100,7 +100,6 @@
}
else
{

var group = _reports.Where(x => TableFilter(x)).GroupBy(x => x.Group).First(x => x.Any(i => i.FileName == context.FileName)).OrderBy(x => x.MatchStart).ToList();
var index = group.FindIndex(x => x.FileName == context.FileName) + 1;

Expand Down Expand Up @@ -133,15 +132,13 @@
<MudTd DataLabel="MapName">@context.MapName @mapBase</MudTd>
<MudTd DataLabel="Versus" Class="versus-column">
<div class="versus-info">
<span>
<strong class="@context.Team1.Result.ToString() @(ownTeam?.Number == 1? "highlight" : "")">@context.Team1.Abbreviation</strong>
</span>
<span>
<span class="team-name text-right @context.Team1.Result.ToString() @(ownTeam?.Number == 1? "highlight" : "")">@context.Team1.Abbreviation</span>
<span class="death-count text-right">@context.Team2.Players.Count(x => x.DeathReason != -1)</span>
<span class="versus-text">
vs
</span>
<span>
<strong class="@context.Team2.Result.ToString() @(ownTeam?.Number == 2? "highlight" : "")">@context.Team2.Abbreviation</strong>
</span>
</span>
<span class="death-count text-left">@context.Team1.Players.Count(x => x.DeathReason != -1)</span>
<span class="team-name text-left @context.Team2.Result.ToString() @(ownTeam?.Number == 2? "highlight" : "")">@context.Team2.Abbreviation</span>
</div>
<MudIconButton Variant="Variant.Outlined" Color="Color.Default" Size="Size.Small" Icon="@Icons.Material.Filled.ContentCopy" OnClick="(e) => CopyResultAsync(context, ownTeam)" Style="float:right;" Disabled="(ownTeam == null)" />
</MudTd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">

<Identity Name="maui-package-name-placeholder" Publisher="CN=JimG" Version="1.8.10.0" />
<Identity Name="maui-package-name-placeholder" Publisher="CN=JimG" Version="1.9.10.0" />

<mp:PhoneIdentity PhoneProductId="3DAE7680-3F65-440F-908F-252D648F20FC" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

Expand Down
31 changes: 30 additions & 1 deletion NED.WoT.BattleResults.Client/Services/TankNameResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,30 @@ public static class TankNameResolver
{"J45_Mitsu_108","Mitsu 108" },
{"G164_Kpz_Pr_68_P","Mittlerer Kpz. Pr. 68 (P)" },
{"J35_Ho_Ri_3","Ho-Ri 3" },
{"J40_Type_71", "Type 71" }
{"J40_Type_71", "Type 71" },

{"Cz34_Vz_71_Tesak", "Vz. 71 Tesák"},
{"Cz28_LPT_67_Selma", "LPT-67 Šelma"},
{"A151_TS_60", "TS-60"},
{"J41_Type_68", "Type 68"},
{"Pl21_CS_63_OSP3", "Hurricane"},
{"Pl30_SDP_Wz58T", "SDP 58 Kilana"},
{"Cz24_Vz_64_Blesk", "Vz. 64 Blesk"},
{"GB145_Crusher_ASE_4", "Nergal"},
{"J33_Ho_Ri_2", "Ho-Ri 2"},
{"Pl27_SDP_Wz_66T", "SDP wz 66 Grom"},
{"R159_SU_130PM_DR", "Forest Spirit"},
{"A146_TL_7_120", "TL-7"},
{"A169_PattonIII_120", "Patton the Tank"},
{"G166_LKpz_70_K", "Leichter Kpz. 70 (K)"},
{"Pl24_56TP", "56TP"},
{"J31_Type_5_KaRi", "Type 5 Ka-Ri"},
{"F116_Bat_Chatillon_Bourrasque_DV", "Miel"},
{"G167_Tiger_Maus_120t", "Tiger-Maus"},
{"Pl28_SDP_Wz_60", "SDP 60 Gonkiewicza"},
{"Cz23_Skoda_T_17", "Škoda T 17"},
{"G171_E77", "E 77"},
{"GB123_GSOR_1006_v7", "GSOR 1006 Scheme 7"}
};

public static string GetTankName(string key)
Expand All @@ -1448,6 +1471,12 @@ public static string GetTankName(string key)
return name;
}

strippedKey = strippedKey[..strippedKey.LastIndexOf('_')];
if (_tankNames.TryGetValue(strippedKey, out name))
{
return name;
}

if (!string.IsNullOrWhiteSpace(key))
{
UndefinedTankNames.Add(key);
Expand Down
4 changes: 2 additions & 2 deletions NED.WoT.BattleResults.Client/Shared/ClanMembersDialog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<DialogContent>
<MudTable Items="@GetClanMembers()" Hover="true" Breakpoint="Breakpoint.Sm" FixedHeader="true" Dense="false" Height="600px" Bordered="false">
<HeaderContent>
<MudTh>Speler</MudTh>
<MudTh Style="text-align:right;">Battles</MudTh>
<MudTh><MudTableSortLabel InitialDirection="SortDirection.Ascending" SortBy="new Func<ClanMember, object>(x => x.Name)">Speler</MudTableSortLabel></MudTh>
<MudTh Style="text-align:right;"><MudTableSortLabel InitialDirection="SortDirection.Descending" SortBy="new Func<ClanMember, object>(x => x.Battles)">Battles</MudTableSortLabel></MudTh>
</HeaderContent>
<RowTemplate>
<MudTd DataLabel="Speler">@context.Name</MudTd>
Expand Down
4 changes: 2 additions & 2 deletions NED.WoT.BattleResults.Client/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
@inject NavigationManager NavigationManager
@inject SettingService SettingService


<MudThemeProvider @ref="@_mudThemeProvider" @bind-IsDarkMode="@_isDarkMode" />
<MudPopoverProvider />
<MudDialogProvider />
<MudSnackbarProvider />

Expand Down Expand Up @@ -114,7 +114,7 @@
{
MaxWidth = MaxWidth.Medium,
FullWidth = true,
DisableBackdropClick = true,
BackdropClick = false,
CloseButton = false
});
}
Expand Down
8 changes: 4 additions & 4 deletions NED.WoT.BattleResults.Client/Shared/SettingsDialog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
<MudTextField Label="Clan afkorting"
@bind-Value="@modal.ClanAbbreviation" For="(() => modal.ClanAbbreviation)" />
<MudTextField Label="Speler naam"
@bind-Value="@modal.PlayerName" For="(() => modal.PlayerName)" />
@bind-Value="@modal.PlayerName" For="(() => modal.PlayerName)" />

<MudSwitch Label="Maximaal één battle resultaat open" Color="Color.Primary"
@bind-Checked="@modal.SingleBattleResultOpenedOnly" For="(() => modal.SingleBattleResultOpenedOnly)" />
@bind-Value="@modal.SingleBattleResultOpenedOnly" For="(() => modal.SingleBattleResultOpenedOnly)" />

<MudSwitch Label="Alleen eigen match results highlighten" Color="Color.Primary"
@bind-Checked="@modal.OnlyHighlistOwnMatches" For="(() => modal.OnlyHighlistOwnMatches)" />
@bind-Value="@modal.OnlyHighlistOwnMatches" For="(() => modal.OnlyHighlistOwnMatches)" />
</DialogContent>
<DialogActions>
<MudButton OnClick="AppInfo.Current.ShowSettingsUI" Class="mr-auto">Ga naar app settings</MudButton>
Expand Down Expand Up @@ -59,7 +59,7 @@
ClanAbbreviation = SettingService.Settings.ClanAbbreviation,
PlayerName = SettingService.Settings.PlayerName,
SingleBattleResultOpenedOnly = SettingService.Settings.SingleBattleResultOpenedOnly,
OnlyHighlistOwnMatches = SettingService.Settings.OnlyHighlistOwnMatches
OnlyHighlistOwnMatches = SettingService.Settings.OnlyHighlistOwnMatches
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<MudDialog>
@using Microsoft.AspNetCore.Components

<MudDialog>
<DialogContent>
<MudList Clickable="false">
<MudList T="string" ReadOnly>
@if (MapNameResolver.UndefinedMapNames.Count > 0)
{
<MudListSubheader>Onbekende map namen</MudListSubheader>
Expand Down
45 changes: 35 additions & 10 deletions NED.WoT.BattleResults.Client/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
--mud-palette-primary-hover: rgba(254,135,0,0.058823529411764705) !important;
--mud-palette-primary-lighten: #ffab4b;
}

.progress-bar__progress {
background-color: #ff8800 !important;
}
Expand Down Expand Up @@ -172,14 +173,13 @@ a, .btn-link {
}

.mud-table.player-table .mud-table-cell:not(.sticky-left) {
text-align:right;
text-align: right;
}

.mud-table.report-table [data-label='Versus'] .highlight {

}

.mud-table.report-table .highlight-own-result [data-label='Versus'] strong:not(.highlight) {
.mud-table.report-table .highlight-own-result [data-label='Versus'] :not(.highlight) {
color: inherit !important;
}

Expand Down Expand Up @@ -217,6 +217,7 @@ a, .btn-link {
.report-table.mud-table-sticky-footer > .mud-table-container > .mud-table-root > .mud-table-foot * .mud-table-cell {
z-index: 4;
}

.fa-skull {
color: var(--mud-palette-error);
}
Expand All @@ -225,7 +226,7 @@ a, .btn-link {
padding: 6px !important;
}

.versus-column{
.versus-column {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
Expand All @@ -249,6 +250,7 @@ a, .btn-link {
.match-info.selected {
background-color: #bfbfbf !important;
}

.match-info:not(.selected):hover {
background-color: #f5f5f5 !important;
}
Expand All @@ -257,15 +259,38 @@ a, .btn-link {
z-index: 5;
}

.versus-column .versus-info span {
padding-inline: 0.25rem;
.versus-column .versus-info {
font-size: 1rem;
display: flex;
gap: 0.5rem;
align-items: center;
}
.versus-column .versus-info span:first-child {
display: inline-block;
width: 75px;
text-align: right;

.versus-column .versus-info .team-name {
width: 100px;
font-weight: bold;
}

.versus-column .versus-info .death-count {
font-size: 1.5rem;
width: 30px;
}


.versus-column .versus-info .versus-text {
padding-inline: 0.5rem;
}


.report-table .mud-table-body .match-info > td {
border-top: 1px solid var(--mud-palette-table-lines);
}


.text-right {
text-align: right;
}

.text-left {
text-align: left;
}

0 comments on commit c739497

Please sign in to comment.