mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-21 02:17:20 +02:00
feat: tanks tree small screen start
This commit is contained in:
1 parent
091831bc97
commit
ece6efaf58
8 files changed
+118
-29
No files matched your search
+12
-6
@@ -11,18 +11,24 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl
|
||||
{
|
||||
return serializedValue switch
|
||||
{
|
||||
"NONE" => MarkOfMastery.None, "RANK3" => MarkOfMastery.Rank3, "RANK2" => MarkOfMastery.Rank2, "RANK1" => MarkOfMastery.Rank1, "MASTER" => MarkOfMastery.Master, _ => throw new global::StrawberryShake.GraphQLClientException()}
|
||||
|
||||
;
|
||||
"NONE" => MarkOfMastery.None,
|
||||
"RANK3" => MarkOfMastery.Rank3,
|
||||
"RANK2" => MarkOfMastery.Rank2,
|
||||
"RANK1" => MarkOfMastery.Rank1,
|
||||
"MASTER" => MarkOfMastery.Master,
|
||||
_ => throw new global::StrawberryShake.GraphQLClientException()};
|
||||
}
|
||||
|
||||
public global::System.Object Format(global::System.Object? runtimeValue)
|
||||
{
|
||||
return runtimeValue switch
|
||||
{
|
||||
MarkOfMastery.None => "NONE", MarkOfMastery.Rank3 => "RANK3", MarkOfMastery.Rank2 => "RANK2", MarkOfMastery.Rank1 => "RANK1", MarkOfMastery.Master => "MASTER", _ => throw new global::StrawberryShake.GraphQLClientException()}
|
||||
|
||||
;
|
||||
MarkOfMastery.None => "NONE",
|
||||
MarkOfMastery.Rank3 => "RANK3",
|
||||
MarkOfMastery.Rank2 => "RANK2",
|
||||
MarkOfMastery.Rank1 => "RANK1",
|
||||
MarkOfMastery.Master => "MASTER",
|
||||
_ => throw new global::StrawberryShake.GraphQLClientException()};
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
-6
@@ -11,18 +11,22 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl
|
||||
{
|
||||
return serializedValue switch
|
||||
{
|
||||
"RU" => RealmType.Ru, "EU" => RealmType.Eu, "NA" => RealmType.Na, "ASIA" => RealmType.Asia, _ => throw new global::StrawberryShake.GraphQLClientException()}
|
||||
|
||||
;
|
||||
"RU" => RealmType.Ru,
|
||||
"EU" => RealmType.Eu,
|
||||
"NA" => RealmType.Na,
|
||||
"ASIA" => RealmType.Asia,
|
||||
_ => throw new global::StrawberryShake.GraphQLClientException()};
|
||||
}
|
||||
|
||||
public global::System.Object Format(global::System.Object? runtimeValue)
|
||||
{
|
||||
return runtimeValue switch
|
||||
{
|
||||
RealmType.Ru => "RU", RealmType.Eu => "EU", RealmType.Na => "NA", RealmType.Asia => "ASIA", _ => throw new global::StrawberryShake.GraphQLClientException()}
|
||||
|
||||
;
|
||||
RealmType.Ru => "RU",
|
||||
RealmType.Eu => "EU",
|
||||
RealmType.Na => "NA",
|
||||
RealmType.Asia => "ASIA",
|
||||
_ => throw new global::StrawberryShake.GraphQLClientException()};
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-6
@@ -11,18 +11,20 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl
|
||||
{
|
||||
return serializedValue switch
|
||||
{
|
||||
"RU" => RequestLanguage.Ru, "EN" => RequestLanguage.En, "DE" => RequestLanguage.De, _ => throw new global::StrawberryShake.GraphQLClientException()}
|
||||
|
||||
;
|
||||
"RU" => RequestLanguage.Ru,
|
||||
"EN" => RequestLanguage.En,
|
||||
"DE" => RequestLanguage.De,
|
||||
_ => throw new global::StrawberryShake.GraphQLClientException()};
|
||||
}
|
||||
|
||||
public global::System.Object Format(global::System.Object? runtimeValue)
|
||||
{
|
||||
return runtimeValue switch
|
||||
{
|
||||
RequestLanguage.Ru => "RU", RequestLanguage.En => "EN", RequestLanguage.De => "DE", _ => throw new global::StrawberryShake.GraphQLClientException()}
|
||||
|
||||
;
|
||||
RequestLanguage.Ru => "RU",
|
||||
RequestLanguage.En => "EN",
|
||||
RequestLanguage.De => "DE",
|
||||
_ => throw new global::StrawberryShake.GraphQLClientException()};
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-6
@@ -13,18 +13,16 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl.State
|
||||
global::System.String __typename = obj.GetProperty("__typename").GetString()!;
|
||||
return __typename switch
|
||||
{
|
||||
"Achievement" => ParseAchievementEntityId(obj, __typename), _ => throw new global::System.NotSupportedException()}
|
||||
|
||||
;
|
||||
"Achievement" => ParseAchievementEntityId(obj, __typename),
|
||||
_ => throw new global::System.NotSupportedException()};
|
||||
}
|
||||
|
||||
public global::System.String Format(global::StrawberryShake.EntityId entityId)
|
||||
{
|
||||
return entityId.Name switch
|
||||
{
|
||||
"Achievement" => FormatAchievementEntityId(entityId), _ => throw new global::System.NotSupportedException()}
|
||||
|
||||
;
|
||||
"Achievement" => FormatAchievementEntityId(entityId),
|
||||
_ => throw new global::System.NotSupportedException()};
|
||||
}
|
||||
|
||||
private global::StrawberryShake.EntityId ParseAchievementEntityId(global::System.Text.Json.JsonElement obj, global::System.String type)
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl.State
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
|
||||
public partial class WotBlitzStatisticsProClientStoreAccessor : global::StrawberryShake.StoreAccessor
|
||||
{
|
||||
public WotBlitzStatisticsProClientStoreAccessor(global::StrawberryShake.IOperationStore operationStore, global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer entityIdSerializer, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationRequestFactory> requestFactories, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationResultDataFactory> resultDataFactories): base(operationStore, entityStore, entityIdSerializer, requestFactories, resultDataFactories)
|
||||
public WotBlitzStatisticsProClientStoreAccessor(global::StrawberryShake.IOperationStore operationStore, global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer entityIdSerializer, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationRequestFactory> requestFactories, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationResultDataFactory> resultDataFactories) : base(operationStore, entityStore, entityIdSerializer, requestFactories, resultDataFactories)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,70 @@
|
||||
@inherits PlayerInfoTanksTreeBase;
|
||||
@using WotBlitzStatisticsPro.Blazor.Helpers
|
||||
@using System.Linq
|
||||
@inherits PlayerInfoTanksTreeBase;
|
||||
<div class="d-flex flex-column">
|
||||
<div class="d-flex flex-row mb-3">
|
||||
@foreach (var nationForFilter in NationsFilter)
|
||||
{
|
||||
<img src="@nationForFilter.ItemName" class="@NationFilterStyle(nationForFilter.ItemId)" @onclick="@(async (e) => { await ApplyNationFilter(e, nationForFilter.ItemId); })" />
|
||||
}
|
||||
</div>
|
||||
<div style="overflow-y: auto; overflow-x: auto;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
height="@((CardWidth + 40) * 10)"
|
||||
width="@FrameHeigth">
|
||||
|
||||
<TankListItem [email protected]()></TankListItem>
|
||||
<!-- Background -->
|
||||
@for (int i = 0; i < 10; i++)
|
||||
{
|
||||
<rect x="0"
|
||||
y="@(i * (CardWidth + 40))"
|
||||
width="@FrameHeigth"
|
||||
height="@(CardWidth + 40)"
|
||||
fill="@(i % 2 == 0 ? "#464A5D" : "#3A3D4B")">
|
||||
</rect>
|
||||
}
|
||||
|
||||
@if (TreeItems != null)
|
||||
{
|
||||
@for (int tier = 1; tier < 11; tier++)
|
||||
{
|
||||
@foreach (var tank in TreeItems.Where(t => t.Tier == tier).OrderBy(t => t.Row).ToList())
|
||||
{
|
||||
<!-- Tank card svg-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
x="@(tank.Row * (CardHeigth + 20) + 20)"
|
||||
y="@(((10 - tier)) * (CardWidth + 40) + 20)"
|
||||
height="@CardWidth"
|
||||
width="@CardHeigth">
|
||||
<g>
|
||||
<!--Rect fill = #275950 - researched, #2E353B - unresearched, #66502b - prem-->
|
||||
<rect x="0"
|
||||
y="0"
|
||||
height="@CardWidth"
|
||||
width="@CardHeigth"
|
||||
rx="10"
|
||||
ry="10"
|
||||
fill="@(tank.IsResearched ? (tank.IsPremium ? "#66502b" : "#275950") : "#2E353B")">
|
||||
</rect>
|
||||
|
||||
<!--Tank type-->
|
||||
<image x="5" y="7" width="25" height="25" href="@tank.TankTypeId.TankTypeAsset(tank.IsPremium)" />
|
||||
<!--Tank tier-->
|
||||
<text x="30" y="4" fill="@(tank.IsPremium ? Constants.ClanTagColor : "white")" text-anchor="start" alignment-baseline="before-edge" font-family="Segoe UI" font-size="19">
|
||||
@tank.Tier.RomanNumber()
|
||||
</text>
|
||||
<!--TankImage-->
|
||||
<image x="@((CardHeigth - 95) / 2)" y="5" width="95" height="70" href="@tank.PreviewImage" />
|
||||
<!--TankName-->
|
||||
<text x="5" y="80" fill="@(tank.IsPremium ? Constants.ClanTagColor : "white")" text-anchor="start" alignment-baseline="before-edge" font-family="Segoe UI" font-size="14">
|
||||
@tank.Name
|
||||
</text>
|
||||
|
||||
</g>
|
||||
</svg>
|
||||
}
|
||||
}
|
||||
}
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
.nation-filter-flag {
|
||||
width: 35px;
|
||||
height: 23px;
|
||||
border-radius: 4px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.filter-selected {
|
||||
border-width: 1px;
|
||||
border-color: #f5aa3b;
|
||||
border-style: solid;
|
||||
}
|
||||
@@ -55,11 +55,11 @@ namespace WotBlitzStatisticsPro.Blazor
|
||||
//var useMock = Environment.GetEnvironmentVariable("USE_GRAPH_QL_MOCK");
|
||||
//if (useMock != null && useMock == "true")
|
||||
//{
|
||||
//builder.Services.AddTransient<IGraphQlBackendService, GraphQlBackendMockService>();
|
||||
builder.Services.AddTransient<IGraphQlBackendService, GraphQlBackendMockService>();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
builder.Services.AddTransient<IGraphQlBackendService, GraphQlBackendService>();
|
||||
//builder.Services.AddTransient<IGraphQlBackendService, GraphQlBackendService>();
|
||||
//}
|
||||
|
||||
var host = builder.Build();
|
||||
|
||||
Reference in new issue
Block a user