Clearing Entity Click View on Clear and other notes

This commit is contained in:
2026-06-01 11:37:40 -04:00
parent 3974fcfb91
commit 026aebd5ad
13 changed files with 248 additions and 147 deletions
@@ -25,7 +25,9 @@
<div class="gridItem" style="grid-area: timing;">
<PanelComponent>
<InfoTooltipComponent InfoText="@Locale["Tooltip Filter Info"]">
<FilterComponent></FilterComponent>
<FactionBorderComponent>
<FilterComponent></FilterComponent>
</FactionBorderComponent>
</InfoTooltipComponent>
</PanelComponent>
@@ -56,7 +58,9 @@
<div class="gridItem" style="grid-area: view;">
<PanelComponent>
<InfoTooltipComponent InfoText="@Locale["Tooltip Entity Info"]">
<EntityClickViewComponent/>
<ImmortalBorderComponent>
<EntityClickViewComponent/>
</ImmortalBorderComponent>
</InfoTooltipComponent>
</PanelComponent>
@@ -2,6 +2,7 @@
@inject IKeyService KeyService
@inject IImmortalSelectionService FilterService
@inject IStorageService StorageService
@inject IBuildOrderService BuildOrderService
@using Services.Website
@implements IDisposable
@@ -33,6 +34,7 @@
base.OnInitialized();
KeyService.Subscribe(HandleClick);
StorageService.Subscribe(RefreshDefaults);
BuildOrderService.Subscribe(OnBuildOrderServiceChanged);
RefreshDefaults();
}
@@ -40,11 +42,20 @@
void IDisposable.Dispose()
{
KeyService.Unsubscribe(HandleClick);
StorageService.Unsubscribe(RefreshDefaults);
BuildOrderService.Unsubscribe(OnBuildOrderServiceChanged);
}
void OnBuildOrderServiceChanged()
{
if (BuildOrderService.GetLastRequestInterval() == 0)
{
_entity = null;
StateHasChanged();
}
}
void RefreshDefaults()
{
_viewType = StorageService.GetValue<bool>(StorageKeys.IsPlainView) ? EntityViewType.Plain : EntityViewType.Detailed;
@@ -0,0 +1,32 @@
@inject IImmortalSelectionService FilterService
@using Model.Entity.Data
@implements IDisposable
<FormLayoutComponent>
<div style="@GetBorderStyle()">
@ChildContent
</div>
</FormLayoutComponent>
@code {
[Parameter] public RenderFragment? ChildContent { get; set; }
protected override void OnInitialized()
{
base.OnInitialized();
FilterService.Subscribe(StateHasChanged);
}
void IDisposable.Dispose()
{
FilterService.Unsubscribe(StateHasChanged);
}
string GetBorderStyle()
{
var faction = FilterService.GetFaction();
var color = faction == DataType.FACTION_Aru ? "#CD5C5C" : "#8EACCD";
return $"border-top: 4px solid {color}; padding-top: 4px;";
}
}
@@ -0,0 +1,37 @@
@inject IImmortalSelectionService FilterService
@using Model.Entity.Data
@implements IDisposable
<FormLayoutComponent>
<div style="@GetBorderStyle()">
@ChildContent
</div>
</FormLayoutComponent>
@code {
[Parameter] public RenderFragment? ChildContent { get; set; }
protected override void OnInitialized()
{
base.OnInitialized();
FilterService.Subscribe(StateHasChanged);
}
void IDisposable.Dispose()
{
FilterService.Unsubscribe(StateHasChanged);
}
string GetBorderStyle()
{
var immortal = FilterService.GetImmortal();
var color = "#666666";
if (immortal == DataType.IMMORTAL_Orzum) color = "#4A6B8A";
else if (immortal == DataType.IMMORTAL_Ajari) color = "#A3B8CC";
else if (immortal == DataType.IMMORTAL_Atzlan) color = "#8B7355";
else if (immortal == DataType.IMMORTAL_Mala) color = "#6B8E23";
else if (immortal == DataType.IMMORTAL_Xol) color = "#9CA89C";
return $"border-top: 4px solid {color}; padding-top: 4px;";
}
}
@@ -0,0 +1,82 @@
@inject IImmortalSelectionService FilterService
@implements IDisposable
<FormLayoutComponent>
<InfoBodyComponent>
<InfoQuestionComponent>
What is this tool?
</InfoQuestionComponent>
<InfoAnswerComponent>
This is a calculator to determine build timings. Mostly so someone can quickly try out a few build
orders to see if they somewhat make sense.
</InfoAnswerComponent>
</InfoBodyComponent>
<InfoBodyComponent>
<InfoQuestionComponent>
How does it work?
</InfoQuestionComponent>
<InfoAnswerComponent>
The tool calculates every second of game time. So if you attempt to build a <b>Legion Hall</b> as
your first action, the tool will scan every second, until you get to one where the request can be
made. In this case, that is interval 58.
<br/>
<br/>
If you then build 2 <b>Apostle of Bindings</b> a <b>Soul Foundry</b> and a 3 <b>Absolvers</b> you
should see yourself roughly floating 500 alloy, with barely having any ether. Which means you could
of gotten an <b>Acropolis</b> and a <b>Zentari</b> without hurting your build.
<br/>
<br/>
Try building <b>Apostle of Bindings</b> before the <b>Legion Hall</b> and see how that changes the
timing of your 3 <b>Absolvers</b>. (Spoiler:
<SpoilerTextComponent> your <b>Absolvers</b> will be built much faster, and you won't be floating so
much alloy.
</SpoilerTextComponent>
)
</InfoAnswerComponent>
</InfoBodyComponent>
<InfoBodyComponent>
<InfoQuestionComponent>
What is CONTROL key for?
</InfoQuestionComponent>
<InfoAnswerComponent>
Economy and tech related upgrades for townhalls.
</InfoAnswerComponent>
</InfoBodyComponent>
<InfoBodyComponent>
<InfoQuestionComponent>
What is SHIFT key for?
</InfoQuestionComponent>
<InfoAnswerComponent>
Misc building related upgrades. (Omnivores)
</InfoAnswerComponent>
</InfoBodyComponent>
<InfoBodyComponent>
<InfoQuestionComponent>
What is 2 key for?
</InfoQuestionComponent>
<InfoAnswerComponent>
It will be for Pyre camps. Currently not implemented.
</InfoAnswerComponent>
</InfoBodyComponent>
</FormLayoutComponent>
@code {
protected override void OnInitialized()
{
base.OnInitialized();
FilterService.Subscribe(StateHasChanged);
}
void IDisposable.Dispose()
{
FilterService.Unsubscribe(StateHasChanged);
}
}