feature(BuildCalc) Added reset button, can change micro delay, and can alter timing interval again
This commit is contained in:
@@ -17,7 +17,7 @@ else
|
||||
@foreach (var sprint in agileService.AgileSprintModels!
|
||||
.OrderBy(e => e.EndDate).Reverse())
|
||||
{
|
||||
<details class="sprintDisplayContainer @sprint.GetSprintType().ToLower()"
|
||||
<details class="sprintDisplayContainer @sprint.GetSprintType().ToLower()"
|
||||
open="@(sprint.GetSprintType() == SprintType.Current)">
|
||||
<summary class="sprintSummary">
|
||||
<div class="sprintTitle">@sprint.Name</div>
|
||||
@@ -91,8 +91,8 @@ else
|
||||
|
||||
void HasChanged()
|
||||
{
|
||||
if(!agileService.IsLoaded()) return;
|
||||
|
||||
if (!agileService.IsLoaded()) return;
|
||||
|
||||
backlog.Clear();
|
||||
|
||||
foreach (var task in agileService.AgileTaskModels!)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="tasksContainer">
|
||||
@if (AgileSprint.AgileTaskModels.Count > 0)
|
||||
{
|
||||
@foreach (var task in AgileSprint.AgileTaskModels.OrderBy(x=>x.OrderPriority))
|
||||
@foreach (var task in AgileSprint.AgileTaskModels.OrderBy(x => x.OrderPriority))
|
||||
{
|
||||
<div class="taskContainer @task.Status.ToLower() @task.Task.ToLower()">
|
||||
<div class="taskName">@task.Name</div>
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
@inject ITimingService timingService
|
||||
|
||||
@page "/build-calculator"
|
||||
@using Microsoft.Extensions.Localization
|
||||
|
||||
@implements IDisposable
|
||||
|
||||
@@ -20,89 +19,93 @@
|
||||
<AlertComponent Type="@SeverityType.Warning">
|
||||
<Title>Work In Progress and Not Fully Tested</Title>
|
||||
<Message>
|
||||
Currently not considering training queue times. Lacking error toasts for invalid actions. Performance needs to be optimized. Calculations haven't been thoroughly compared against real gameplay. Added a 2 second delay to actions to account for casual micro (will probably tweak later).
|
||||
Currently not considering training queue times.
|
||||
</Message>
|
||||
</AlertComponent>
|
||||
|
||||
<ContentDividerComponent></ContentDividerComponent>
|
||||
|
||||
|
||||
<div class="calculatorGrid">
|
||||
|
||||
<div style="grid-area: timing;" class="gridItem">
|
||||
<InfoTooltipComponent InfoText="@locale["Tooltip Timing Info"]">
|
||||
|
||||
<TimingComponent></TimingComponent>
|
||||
</InfoTooltipComponent>
|
||||
<div class="gridItem" style="grid-area: timing;">
|
||||
<ButtonComponent OnClick="OnResetClicked">Clear Build Order</ButtonComponent>
|
||||
<PanelComponent>
|
||||
<InfoTooltipComponent InfoText="@locale["Tooltip Timing Info"]">
|
||||
<TimingComponent></TimingComponent>
|
||||
</InfoTooltipComponent>
|
||||
</PanelComponent>
|
||||
</div>
|
||||
|
||||
|
||||
@if (true)
|
||||
{
|
||||
<div style="grid-area: chart;" class="gridItem">
|
||||
<div class="gridItem" style="grid-area: chart;">
|
||||
<PanelComponent>
|
||||
<InfoTooltipComponent InfoText="@locale["Tooltip Chart Info"]">
|
||||
<ChartComponent></ChartComponent>
|
||||
</InfoTooltipComponent>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div style="grid-area: filter;" class="gridItem">
|
||||
<InfoTooltipComponent InfoText="@locale["Tooltip Filter Info"]">
|
||||
<FilterComponent></FilterComponent>
|
||||
</InfoTooltipComponent>
|
||||
</PanelComponent>
|
||||
</div>
|
||||
|
||||
@if (true)
|
||||
{
|
||||
<div style="grid-area: view;" class="gridItem">
|
||||
<div class="gridItem" style="grid-area: filter;">
|
||||
<PanelComponent>
|
||||
<InfoTooltipComponent InfoText="@locale["Tooltip Filter Info"]">
|
||||
<FilterComponent></FilterComponent>
|
||||
</InfoTooltipComponent>
|
||||
</PanelComponent>
|
||||
|
||||
<PanelComponent>
|
||||
<InfoTooltipComponent InfoText="@locale["Tooltip Options Info"]">
|
||||
<OptionsComponent></OptionsComponent>
|
||||
</InfoTooltipComponent>
|
||||
</PanelComponent>
|
||||
</div>
|
||||
|
||||
<div class="gridItem" style="grid-area: view;">
|
||||
<PanelComponent>
|
||||
<InfoTooltipComponent InfoText="@locale["Tooltip Entity Info"]">
|
||||
<EntityClickViewComponent/>
|
||||
</InfoTooltipComponent>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (true)
|
||||
{
|
||||
<div style="grid-area: bank;" class="gridItem">
|
||||
</PanelComponent>
|
||||
</div>
|
||||
|
||||
<div class="gridItem" style="grid-area: bank;">
|
||||
<PanelComponent>
|
||||
<InfoTooltipComponent InfoText="@locale["Tooltip Bank Info"]">
|
||||
<BankComponent></BankComponent>
|
||||
</InfoTooltipComponent>
|
||||
</div>
|
||||
}
|
||||
</PanelComponent>
|
||||
</div>
|
||||
|
||||
@if (true)
|
||||
{
|
||||
<div style="grid-area: army;" class="gridItem">
|
||||
<div class="gridItem" style="grid-area: army;">
|
||||
<PanelComponent>
|
||||
<InfoTooltipComponent InfoText="@locale["Tooltip Army Info"]">
|
||||
<ArmyComponent></ArmyComponent>
|
||||
</InfoTooltipComponent>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="gridItem gridKeys">
|
||||
|
||||
<InfoTooltipComponent InfoText="@locale["Tooltip Hotkey Info"]">
|
||||
|
||||
<HotkeyViewerComponent Size="80"></HotkeyViewerComponent>
|
||||
</InfoTooltipComponent>
|
||||
</PanelComponent>
|
||||
</div>
|
||||
|
||||
@if (true)
|
||||
{
|
||||
<div style="grid-area: highlights;" class="gridItem">
|
||||
<div class="gridItem gridKeys">
|
||||
<PanelComponent>
|
||||
<InfoTooltipComponent InfoText="@locale["Tooltip Hotkey Info"]">
|
||||
<HotkeyViewerComponent Size="80"></HotkeyViewerComponent>
|
||||
</InfoTooltipComponent>
|
||||
</PanelComponent>
|
||||
</div>
|
||||
|
||||
<div class="gridItem" style="grid-area: highlights;">
|
||||
<PanelComponent>
|
||||
<InfoTooltipComponent InfoText="@locale["Tooltip Highlights Info"]">
|
||||
<HighlightsComponent></HighlightsComponent>
|
||||
</InfoTooltipComponent>
|
||||
</div>
|
||||
}
|
||||
@if (true)
|
||||
{
|
||||
<div style="grid-area: buildorder;" class="gridItem">
|
||||
</PanelComponent>
|
||||
</div>
|
||||
|
||||
<div class="gridItem" style="grid-area: buildorder;">
|
||||
<PanelComponent>
|
||||
<InfoTooltipComponent InfoText="@locale["Tooltip BuildOrder Info"]">
|
||||
<BuildOrderComponent></BuildOrderComponent>
|
||||
</InfoTooltipComponent>
|
||||
</div>
|
||||
}
|
||||
</PanelComponent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ContentDividerComponent></ContentDividerComponent>
|
||||
@@ -135,7 +138,7 @@
|
||||
|
||||
<InfoBodyComponent>
|
||||
<InfoQuestionComponent>
|
||||
What is CONTROl key for?
|
||||
What is CONTROL key for?
|
||||
</InfoQuestionComponent>
|
||||
<InfoAnswerComponent>
|
||||
Economy and tech related upgrades for townhalls.
|
||||
@@ -165,6 +168,12 @@
|
||||
|
||||
|
||||
<style>
|
||||
.gridItem {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.calculatorGrid {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
@@ -178,12 +187,6 @@
|
||||
'chart chart chart chart';
|
||||
}
|
||||
|
||||
.gridItem {
|
||||
border: 2px solid var(--paper-border);
|
||||
padding: 20px;
|
||||
background-color: var(--paper);
|
||||
}
|
||||
|
||||
.gridKeys {
|
||||
grid-area: keys;
|
||||
}
|
||||
@@ -209,30 +212,35 @@
|
||||
padding-left: 2px;
|
||||
padding-right: 2px;
|
||||
}
|
||||
|
||||
.gridItem {
|
||||
padding: 0px;
|
||||
border: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
economyService.Calculate(buildOrderService, timingService, 0);
|
||||
|
||||
|
||||
keyService.Subscribe(HandleClick);
|
||||
}
|
||||
|
||||
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
keyService.Unsubscribe(HandleClick);
|
||||
}
|
||||
|
||||
|
||||
private void OnResetClicked()
|
||||
{
|
||||
toastService.AddToast(new ToastModel(){
|
||||
SeverityType = SeverityType.Success,
|
||||
Message = "Build order has been cleared.",
|
||||
Title = "Reset"});
|
||||
|
||||
buildOrderService.Reset();
|
||||
}
|
||||
|
||||
|
||||
private void HandleClick()
|
||||
{
|
||||
var hotkey = keyService.GetHotkey();
|
||||
@@ -254,16 +262,17 @@
|
||||
var faction = filterService.GetFactionType();
|
||||
var immortal = filterService.GetImmortalType();
|
||||
|
||||
EntityModel? entity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal);
|
||||
var entity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal);
|
||||
|
||||
if (entity == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (buildOrderService.Add(entity, economyService, toastService))
|
||||
{
|
||||
economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
@inject IJSRuntime jsRuntime;
|
||||
@inject IJSRuntime jsRuntime
|
||||
|
||||
@inject IBuildOrderService BuildOrder
|
||||
@inject IBuildOrderService buildOrder
|
||||
|
||||
@implements IDisposable
|
||||
|
||||
@@ -35,12 +35,12 @@
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
BuildOrder.Subscribe(OnBuildOrderChanged);
|
||||
buildOrder.Subscribe(OnBuildOrderChanged);
|
||||
}
|
||||
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
BuildOrder.Unsubscribe(OnBuildOrderChanged);
|
||||
buildOrder.Unsubscribe(OnBuildOrderChanged);
|
||||
}
|
||||
|
||||
protected override bool ShouldRender()
|
||||
@@ -57,20 +57,20 @@
|
||||
jsRuntime.InvokeVoidAsync("console.timeEnd", "ArmyComponent");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void OnBuildOrderChanged()
|
||||
{
|
||||
int armyCountWas = 0;
|
||||
var armyCountWas = 0;
|
||||
foreach (var army in armyCount)
|
||||
{
|
||||
armyCountWas += army.Value;
|
||||
}
|
||||
|
||||
|
||||
armyCount.Clear();
|
||||
|
||||
lastInterval = 0;
|
||||
|
||||
var entitiesOverTime = BuildOrder.GetOrders();
|
||||
var entitiesOverTime = buildOrder.GetOrders();
|
||||
|
||||
foreach (var entitiesAtTime in entitiesOverTime)
|
||||
{
|
||||
@@ -91,19 +91,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
//TODO Better
|
||||
int armyCountIs = 0;
|
||||
//TODO Better
|
||||
var armyCountIs = 0;
|
||||
foreach (var army in armyCount)
|
||||
{
|
||||
armyCountIs += army.Value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (armyCountWas != armyCountIs)
|
||||
{
|
||||
StateHasChanged();
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -43,7 +43,7 @@
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.time", "BankComponent");
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@inject IJSRuntime jsRuntime;
|
||||
|
||||
|
||||
@inject IBuildOrderService buildOrderService
|
||||
|
||||
@implements IDisposable
|
||||
@@ -29,7 +28,7 @@
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.time", "BuildOrderComponent");
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,4 +38,5 @@
|
||||
jsRuntime.InvokeVoidAsync("console.timeEnd", "BuildOrderComponent");
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,6 @@
|
||||
@if (lastRequestedRefreshIndex != requestedRefreshIndex)
|
||||
{
|
||||
<LoadingComponent/>
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -30,8 +29,8 @@ else
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
.chartsContainer {
|
||||
position: relative;
|
||||
@@ -60,8 +59,6 @@ else
|
||||
<Display>@highestArmyPoint</Display>
|
||||
</FormDisplayComponent>
|
||||
</FormLayoutComponent>
|
||||
|
||||
|
||||
}
|
||||
|
||||
@code {
|
||||
@@ -80,7 +77,7 @@ else
|
||||
|
||||
private Timer ageTimer = null!;
|
||||
|
||||
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
buildOrderService.Subscribe(OnBuilderOrderChanged);
|
||||
@@ -89,12 +86,13 @@ else
|
||||
ageTimer.Elapsed += OnAge!;
|
||||
ageTimer.Enabled = true;
|
||||
|
||||
|
||||
|
||||
GenerateChart();
|
||||
}
|
||||
|
||||
|
||||
int lastRequestedRefreshIndex = 0;
|
||||
|
||||
void OnAge(object? sender, ElapsedEventArgs elapsedEventArgs)
|
||||
{
|
||||
if (requestedRefreshIndex > 0)
|
||||
@@ -105,14 +103,13 @@ else
|
||||
requestedRefreshIndex = 0;
|
||||
lastRequestedRefreshIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
lastRequestedRefreshIndex = requestedRefreshIndex;
|
||||
}
|
||||
|
||||
|
||||
ageTimer.Enabled = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
@@ -121,6 +118,7 @@ else
|
||||
|
||||
|
||||
int requestedRefreshIndex = 0;
|
||||
|
||||
void OnBuilderOrderChanged()
|
||||
{
|
||||
requestedRefreshIndex++;
|
||||
@@ -133,7 +131,7 @@ else
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.time", "ChartComponent");
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -143,7 +141,7 @@ else
|
||||
jsRuntime.InvokeVoidAsync("console.timeEnd", "ChartComponent");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void GenerateChart()
|
||||
{
|
||||
var economyOverTime = economyService.GetOverTime();
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
@inject IJSRuntime jsRuntime;
|
||||
|
||||
|
||||
@inject IKeyService keyService
|
||||
@inject IImmortalSelectionService filterService
|
||||
@inject IBuildOrderService buildOrderService
|
||||
@inject IKeyService keyService
|
||||
@inject IImmortalSelectionService filterService
|
||||
@inject IBuildOrderService buildOrderService
|
||||
|
||||
@implements IDisposable
|
||||
|
||||
@@ -68,4 +66,5 @@
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
@inject IJSRuntime jsRuntime;
|
||||
@inject IImmortalSelectionService filterService
|
||||
|
||||
<FormLayoutComponent>
|
||||
<FormSelectComponent OnChange="@OnFactionChanged">
|
||||
@@ -12,12 +13,12 @@
|
||||
<FormSelectComponent OnChange="@OnImmortalChanged">
|
||||
<FormLabelComponent>Immortal</FormLabelComponent>
|
||||
<ChildContent>
|
||||
@if (FilterService.GetFactionType() == FactionType.QRath)
|
||||
@if (filterService.GetFactionType() == FactionType.QRath)
|
||||
{
|
||||
<option value="@DataType.IMMORTAL_Orzum" selected>Orzum</option>
|
||||
<option value="@DataType.IMMORTAL_Ajari">Ajari</option>
|
||||
}
|
||||
@if (FilterService.GetFactionType() == FactionType.Aru)
|
||||
@if (filterService.GetFactionType() == FactionType.Aru)
|
||||
{
|
||||
<option value="@DataType.IMMORTAL_Mala" selected>Mala</option>
|
||||
<option value="@DataType.IMMORTAL_Xol">Xol</option>
|
||||
@@ -28,17 +29,14 @@
|
||||
|
||||
@code {
|
||||
|
||||
[Inject]
|
||||
public IImmortalSelectionService FilterService { get; set; } = default!;
|
||||
|
||||
void OnFactionChanged(ChangeEventArgs e)
|
||||
{
|
||||
FilterService.SelectFactionType(e.Value!.ToString()!);
|
||||
filterService.SelectFactionType(e.Value!.ToString()!);
|
||||
}
|
||||
|
||||
void OnImmortalChanged(ChangeEventArgs e)
|
||||
{
|
||||
FilterService.SelectImmortalType(e.Value!.ToString()!);
|
||||
filterService.SelectImmortalType(e.Value!.ToString()!);
|
||||
}
|
||||
|
||||
protected override bool ShouldRender()
|
||||
@@ -46,7 +44,7 @@
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.time", "FilterComponent");
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,4 +54,5 @@
|
||||
jsRuntime.InvokeVoidAsync("console.timeEnd", "FilterComponent");
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
@inject IJSRuntime jsRuntime;
|
||||
|
||||
@inject IEconomyService economyService
|
||||
@inject IBuildOrderService buildOrderService
|
||||
@inject ITimingService timingService
|
||||
|
||||
@implements IDisposable
|
||||
|
||||
@@ -7,7 +9,7 @@
|
||||
<div>
|
||||
<div>Requested</div>
|
||||
|
||||
@foreach (var ordersAtTime in BuildOrderService.StartedOrders.Reverse())
|
||||
@foreach (var ordersAtTime in buildOrderService.StartedOrders.Reverse())
|
||||
{
|
||||
foreach (var order in ordersAtTime.Value)
|
||||
{
|
||||
@@ -26,7 +28,7 @@
|
||||
<div>
|
||||
<div>Finished</div>
|
||||
|
||||
@foreach (var ordersAtTime in BuildOrderService.CompletedOrders.Reverse())
|
||||
@foreach (var ordersAtTime in buildOrderService.CompletedOrders.Reverse())
|
||||
{
|
||||
foreach (var order in ordersAtTime.Value)
|
||||
{
|
||||
@@ -57,25 +59,16 @@
|
||||
|
||||
@code {
|
||||
|
||||
[Inject]
|
||||
IEconomyService EconomyService { get; set; } = default!;
|
||||
|
||||
[Inject]
|
||||
IBuildOrderService BuildOrderService { get; set; } = default!;
|
||||
|
||||
[Inject]
|
||||
ITimingService TimingService { get; set; } = default!;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
EconomyService.Subscribe(StateHasChanged);
|
||||
BuildOrderService.Subscribe(StateHasChanged);
|
||||
economyService.Subscribe(StateHasChanged);
|
||||
buildOrderService.Subscribe(StateHasChanged);
|
||||
}
|
||||
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
EconomyService.Unsubscribe(StateHasChanged);
|
||||
BuildOrderService.Unsubscribe(StateHasChanged);
|
||||
economyService.Unsubscribe(StateHasChanged);
|
||||
buildOrderService.Unsubscribe(StateHasChanged);
|
||||
}
|
||||
|
||||
protected override bool ShouldRender()
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
@inject IJSRuntime jsRuntime;
|
||||
|
||||
@using System.Diagnostics
|
||||
@implements IDisposable
|
||||
@inject IKeyService keyService
|
||||
@inject IKeyService keyService
|
||||
@inject IBuildOrderService buildOrderService
|
||||
@inject IImmortalSelectionService filterService
|
||||
|
||||
@@ -57,7 +55,6 @@
|
||||
@hotkey.KeyText
|
||||
@foreach (var entity in data.Values)
|
||||
{
|
||||
|
||||
if (InvalidKey(entity, hotkey) || InvalidKeyGroup(entity, hotkey) || InvalidHoldSpace(entity))
|
||||
{
|
||||
continue;
|
||||
@@ -67,7 +64,7 @@
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (InvalidVanguard(entity) || InvalidNonVanguard(entity))
|
||||
{
|
||||
continue;
|
||||
@@ -75,7 +72,7 @@
|
||||
|
||||
var isVanguard = entity.VanguardAdded() != null;
|
||||
var style = isVanguard ? "font-weight: bold;" : "";
|
||||
|
||||
|
||||
if (buildOrderService.WillMeetRequirements(entity) == null)
|
||||
{
|
||||
style += "color:gray; font-style: italic;";
|
||||
@@ -138,6 +135,7 @@
|
||||
}
|
||||
|
||||
int completedTimeCount = 0;
|
||||
|
||||
void OnBuilderOrderChanged()
|
||||
{
|
||||
if (buildOrderService.UniqueCompletedTimes.Count != completedTimeCount)
|
||||
@@ -146,13 +144,13 @@
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override bool ShouldRender()
|
||||
{
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.time", "HotKeyViewerComponent");
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -177,8 +175,8 @@
|
||||
// Move to Filter Service
|
||||
bool InvalidVanguard(EntityModel entity)
|
||||
{
|
||||
if (entity.VanguardAdded() != null
|
||||
&& entity.VanguardAdded()?.ImmortalId != filterService.GetImmortalType()
|
||||
if (entity.VanguardAdded() != null
|
||||
&& entity.VanguardAdded()?.ImmortalId != filterService.GetImmortalType()
|
||||
&& filterService.GetImmortalType() != ImmortalType.Any)
|
||||
{
|
||||
return true;
|
||||
@@ -252,11 +250,10 @@
|
||||
|
||||
void OnKeyPressed()
|
||||
{
|
||||
|
||||
string controlGroupWas = controlGroup;
|
||||
string keyWas = key;
|
||||
|
||||
|
||||
var controlGroupWas = controlGroup;
|
||||
var keyWas = key;
|
||||
|
||||
|
||||
if (keyService.GetAllPressedKeys().Contains("Z"))
|
||||
{
|
||||
controlGroup = "Z";
|
||||
@@ -299,13 +296,11 @@
|
||||
|
||||
if (controlGroupWas != controlGroup || keyWas != key)
|
||||
{
|
||||
|
||||
StateHasChanged();
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void HandleClick()
|
||||
{
|
||||
var hotkey = keyService.GetHotkey();
|
||||
@@ -327,16 +322,17 @@
|
||||
var faction = filterService.GetFactionType();
|
||||
var immortal = filterService.GetImmortalType();
|
||||
|
||||
EntityModel? entity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal);
|
||||
var entity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal);
|
||||
|
||||
if (entity == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (buildOrderService.Add(entity, economyService, toastService))
|
||||
{
|
||||
economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
@inject IKeyService keyService
|
||||
@inject IKeyService keyService
|
||||
|
||||
@inject IJSRuntime jsRuntime;
|
||||
|
||||
@@ -13,9 +13,10 @@
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment ChildContent { get; set; } = default!;
|
||||
|
||||
|
||||
private void HandleKeyDown(KeyboardEventArgs e)
|
||||
{
|
||||
keyService.AddPressedKey(e.Key);
|
||||
@@ -31,7 +32,7 @@
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.time", "InputPanelComponent");
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -41,4 +42,5 @@
|
||||
jsRuntime.InvokeVoidAsync("console.timeEnd", "InputPanelComponent");
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
@inject IJSRuntime jsRuntime;
|
||||
|
||||
@inject IBuildOrderService buildOrderService
|
||||
@inject IEconomyService economyService
|
||||
@inject IToastService toastService
|
||||
@inject ITimingService timingService
|
||||
|
||||
<FormLayoutComponent>
|
||||
<FormNumberComponent Max="600"
|
||||
Min="0"
|
||||
Value="@buildOrderService.BuildingInputDelay"
|
||||
OnChange="@OnBuildingInputDelayChanged">
|
||||
<FormLabelComponent>Building Input Delay</FormLabelComponent>
|
||||
<FormInfoComponent>Add a input delay to constructing buildings for simulating worker movement and player micro.</FormInfoComponent>
|
||||
</FormNumberComponent>
|
||||
|
||||
</FormLayoutComponent>
|
||||
|
||||
@code {
|
||||
|
||||
void OnBuildingInputDelayChanged(ChangeEventArgs changeEventArgs)
|
||||
{
|
||||
buildOrderService.BuildingInputDelay = int.Parse(changeEventArgs.Value!.ToString()!);
|
||||
}
|
||||
|
||||
protected override bool ShouldRender()
|
||||
{
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.time", "TimingComponent");
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void OnAfterRender(bool firstRender)
|
||||
{
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.timeEnd", "TimingComponent");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
@inject IJSRuntime jsRuntime;
|
||||
|
||||
@inject IJSRuntime jsRuntime
|
||||
@inject IEconomyService economyService
|
||||
@inject IBuildOrderService buildOrderService
|
||||
|
||||
@implements IDisposable
|
||||
|
||||
<Virtualize Items="@EconomyService.GetOverTime()" Context="economyAtSecond" ItemSize="400" OverscanCount="4">
|
||||
<Virtualize Items="@economyService.GetOverTime()" Context="economyAtSecond" ItemSize="400" OverscanCount="4">
|
||||
<div style="display: grid; gap: 8px; grid-template-columns: 1fr 1fr;">
|
||||
<div>
|
||||
<div>
|
||||
@@ -27,19 +28,19 @@
|
||||
<br/>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@if (BuildOrderService.StartedOrders.TryGetValue(economyAtSecond.Interval, out var ordersAtTime))
|
||||
|
||||
@if (buildOrderService.StartedOrders.TryGetValue(economyAtSecond.Interval, out var ordersAtTime))
|
||||
{
|
||||
@foreach (var order in ordersAtTime)
|
||||
{
|
||||
<div>
|
||||
Requested: @order.Info().Name
|
||||
</div>
|
||||
}
|
||||
<div>
|
||||
Requested: @order.Info().Name
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@if (BuildOrderService.CompletedOrders.TryGetValue(economyAtSecond.Interval, out var ordersCompletedAtTime))
|
||||
|
||||
|
||||
@if (buildOrderService.CompletedOrders.TryGetValue(economyAtSecond.Interval, out var ordersCompletedAtTime))
|
||||
{
|
||||
@foreach (var order in ordersCompletedAtTime)
|
||||
{
|
||||
@@ -55,30 +56,24 @@
|
||||
|
||||
@code {
|
||||
|
||||
[Inject]
|
||||
IEconomyService EconomyService { get; set; } = default!;
|
||||
|
||||
[Inject]
|
||||
IBuildOrderService BuildOrderService { get; set; } = default!;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
EconomyService.Subscribe(StateHasChanged);
|
||||
BuildOrderService.Subscribe(StateHasChanged);
|
||||
economyService.Subscribe(StateHasChanged);
|
||||
buildOrderService.Subscribe(StateHasChanged);
|
||||
}
|
||||
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
EconomyService.Unsubscribe(StateHasChanged);
|
||||
BuildOrderService.Unsubscribe(StateHasChanged);
|
||||
economyService.Unsubscribe(StateHasChanged);
|
||||
buildOrderService.Unsubscribe(StateHasChanged);
|
||||
}
|
||||
|
||||
|
||||
protected override bool ShouldRender()
|
||||
{
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.time", "TimelineComponent");
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,11 +5,8 @@
|
||||
@inject IToastService toastService
|
||||
@inject ITimingService timingService
|
||||
|
||||
|
||||
|
||||
<FormLayoutComponent>
|
||||
<FormNumberComponent ReadOnly="true"
|
||||
Max="600"
|
||||
<FormNumberComponent Max="2048"
|
||||
Min="0"
|
||||
Value="@timingService.GetTiming()"
|
||||
OnChange="@OnTimingChanged">
|
||||
@@ -27,10 +24,17 @@
|
||||
</FormLayoutComponent>
|
||||
|
||||
@code {
|
||||
|
||||
void OnTimingChanged(ChangeEventArgs changeEventArgs)
|
||||
{
|
||||
timingService.SetTiming(int.Parse(changeEventArgs.Value!.ToString()!));
|
||||
economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval());
|
||||
toastService.AddToast(new ToastModel()
|
||||
{
|
||||
Title = "Timing Interval",
|
||||
Message = "Timing interval has changed.",
|
||||
SeverityType = SeverityType.Success
|
||||
});
|
||||
}
|
||||
|
||||
void OnNameChanged(ChangeEventArgs changeEventArgs)
|
||||
@@ -48,13 +52,13 @@
|
||||
{
|
||||
buildOrderService.SetNotes(changeEventArgs.Value!.ToString()!);
|
||||
}
|
||||
|
||||
|
||||
protected override bool ShouldRender()
|
||||
{
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.time", "TimingComponent");
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -65,5 +69,4 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -21,7 +21,7 @@ grid-template-areas: 'loader sand compare compare' ;">
|
||||
|
||||
<div style="grid-area: compare; border: 2px solid black; padding: 20px;">
|
||||
Comparision Charts
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ grid-template-areas: 'loader sand compare compare' ;">
|
||||
|
||||
[Inject]
|
||||
IEconomyService EconomyService { get; set; } = default!;
|
||||
|
||||
|
||||
|
||||
[Inject]
|
||||
ITimingService TimingService { get; set; } = default!;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
var requirements = passive.Requirements();
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<b>Passive Name:</b> @info.Name
|
||||
@@ -46,7 +46,7 @@
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@if (requirements.Count > 0)
|
||||
{
|
||||
@foreach (var requirement in requirements)
|
||||
@@ -71,7 +71,7 @@
|
||||
var info = passive.Info();
|
||||
|
||||
var production = passive.Production();
|
||||
|
||||
|
||||
var requirements = passive.Requirements();
|
||||
|
||||
|
||||
@@ -89,20 +89,20 @@
|
||||
<b>Notes:</b> @((MarkupString)info.Notes)
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@if (requirements.Count > 0)
|
||||
{
|
||||
@foreach (var requirement in requirements)
|
||||
|
||||
|
||||
@if (requirements.Count > 0)
|
||||
{
|
||||
var requirementModel = DATA.Get()[requirement.Id];
|
||||
<div>
|
||||
<span>
|
||||
<b>@requirement.Requirement.Replace("_", " "):</b> @requirementModel.Info().Name
|
||||
</span>
|
||||
</div>
|
||||
@foreach (var requirement in requirements)
|
||||
{
|
||||
var requirementModel = DATA.Get()[requirement.Id];
|
||||
<div>
|
||||
<span>
|
||||
<b>@requirement.Requirement.Replace("_", " "):</b> @requirementModel.Info().Name
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (production != null)
|
||||
@@ -122,7 +122,6 @@
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
}
|
||||
</EntityDisplayComponent>
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
{
|
||||
<div>
|
||||
<b>Shields:</b> @Production.DefensiveLayer
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!Production.BuildTime.Equals(0))
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
@using System.Net.Http.Json
|
||||
@using Markdig.Extensions.Yaml
|
||||
@using Markdig.Syntax
|
||||
@using YamlDotNet.Serialization
|
||||
@inject HttpClient httpClient
|
||||
|
||||
@if (content == null)
|
||||
@@ -19,10 +15,10 @@ else
|
||||
</div>
|
||||
</div>
|
||||
<div class="docContent">@((MarkupString)Markdown.ToHtml(content, Pipeline))</div>
|
||||
<div class="docFooter"><EditLinkComponent Href="@GitUrl"></EditLinkComponent></div>
|
||||
<div class="docFooter">
|
||||
<EditLinkComponent Href="@GitUrl"></EditLinkComponent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
}
|
||||
|
||||
<style>
|
||||
@@ -56,22 +52,33 @@ else
|
||||
</style>
|
||||
|
||||
@code {
|
||||
[Parameter] public DocContentModel DocContentModel { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public DocContentModel DocContentModel { get; set; } = default!;
|
||||
|
||||
DocFrontMatterModel docFrontMatter = null!;
|
||||
private string? content = null;
|
||||
|
||||
|
||||
private string Filepath => $"content/docs/{DocContentModel.Content}.md";
|
||||
private string GitUrl => $"{Project.GitResourcesUrl}/{Filepath}";
|
||||
private MarkdownPipeline Pipeline => MarkdownFiles.Pipeline;
|
||||
|
||||
private async Task<DocFrontMatterModel> LoadContent() {
|
||||
private async Task<DocFrontMatterModel> LoadContent()
|
||||
{
|
||||
content = await MarkdownFiles.LoadMarkdown(httpClient, Filepath);
|
||||
|
||||
|
||||
return docFrontMatter =
|
||||
await MarkdownFiles.LoadFrontMatter<DocFrontMatterModel>(httpClient, Filepath);
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync() => await LoadContent();
|
||||
protected override async Task OnInitializedAsync() => await LoadContent();
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await LoadContent();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadContent();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -77,16 +77,16 @@
|
||||
Border: <input type="color" value="@info_border" @onchange="e => info_border = e.Value!.ToString()!"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="color info_secondary">
|
||||
<div>Info Secondary</div>
|
||||
<div>
|
||||
Base: <input type="color" value="@info_secondary" @onchange="e => info_secondary = e.Value!.ToString()!"/>
|
||||
</div>
|
||||
<div>
|
||||
Border: <input type="color" value="@info_secondary_border" @onchange="e => info_secondary_border = e.Value!.ToString()!"/>
|
||||
</div>
|
||||
|
||||
<div class="color info_secondary">
|
||||
<div>Info Secondary</div>
|
||||
<div>
|
||||
Base: <input type="color" value="@info_secondary" @onchange="e => info_secondary = e.Value!.ToString()!"/>
|
||||
</div>
|
||||
<div>
|
||||
Border: <input type="color" value="@info_secondary_border" @onchange="e => info_secondary_border = e.Value!.ToString()!"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
@@ -183,6 +183,6 @@
|
||||
string info_border = "#210b36";
|
||||
string info_secondary = "#4c3e59";
|
||||
string info_secondary_border = "#7e58a2";
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -6,15 +6,15 @@
|
||||
Group specfic webpages. Each webpage link is used to navigate to that specific webpage. If on the webpage, the link turns dark gray. It can be clicked again to leave the page and return to home.
|
||||
</Description>
|
||||
<Example>
|
||||
<NavSectionComponent Section=@(new WebSectionModel { Name = "Example Section" })
|
||||
Children=@(new List<WebPageModel> { new() { Name = "Example Page", Href = "immortal-makingof", IsPrivate = "False" }, new() { Name = "Database", Href = "immortal-database", IsPrivate = "False" } })>
|
||||
</NavSectionComponent>
|
||||
<DesktopNavSectionComponent Section=@(new WebSectionModel { Name = "Example Section" })
|
||||
Children=@(new List<WebPageModel> { new() { Name = "Example Page", Href = "immortal-makingof", IsPrivate = "False" }, new() { Name = "Database", Href = "immortal-database", IsPrivate = "False" } })>
|
||||
</DesktopNavSectionComponent>
|
||||
</Example>
|
||||
<Usage>
|
||||
<CodeComponent>
|
||||
<NavSectionComponent Section=@@(new WebSectionModel{Name = "Example Section"})
|
||||
<DesktopNavSectionComponent Section=@@(new WebSectionModel{Name = "Example Section"})
|
||||
Children=@@(new List<WebPageModel>{new WebPageModel{Name="Example Page", Href = "immortal-makingof", IsPrivate = false}, new WebPageModel{Name="Database", Href = "immortal-database", IsPrivate = false}})>
|
||||
</NavSectionComponent>
|
||||
</DesktopNavSectionComponent>
|
||||
</CodeComponent>
|
||||
</Usage>
|
||||
<Code>
|
||||
|
||||
@@ -15,7 +15,9 @@ else
|
||||
</div>
|
||||
</div>
|
||||
<div class="noteContent">@((MarkupString)Markdown.ToHtml(content, Pipeline))</div>
|
||||
<div class="noteFooter"><EditLinkComponent Href="@GitUrl"></EditLinkComponent></div>
|
||||
<div class="noteFooter">
|
||||
<EditLinkComponent Href="@GitUrl"></EditLinkComponent>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -43,23 +45,33 @@ else
|
||||
</style>
|
||||
|
||||
@code {
|
||||
[Parameter] public NoteContentModel NoteContentModel { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public NoteContentModel NoteContentModel { get; set; } = default!;
|
||||
|
||||
NoteFrontMatterModel noteFrontMatter = null!;
|
||||
private string? content = null;
|
||||
|
||||
|
||||
private string Filepath => $"content/notes/{NoteContentModel.Content}.md";
|
||||
private string GitUrl => $"{Project.GitResourcesUrl}/{Filepath}";
|
||||
private MarkdownPipeline Pipeline => MarkdownFiles.Pipeline;
|
||||
|
||||
private async Task<NoteFrontMatterModel> LoadContent() {
|
||||
private async Task<NoteFrontMatterModel> LoadContent()
|
||||
{
|
||||
content = await MarkdownFiles.LoadMarkdown(httpClient, Filepath);
|
||||
|
||||
|
||||
return noteFrontMatter =
|
||||
await MarkdownFiles.LoadFrontMatter<NoteFrontMatterModel>(httpClient, Filepath);
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync() => await LoadContent();
|
||||
protected override async Task OnInitializedAsync() => await LoadContent();
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await LoadContent();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadContent();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user