Updating Mudblazor Version

This commit is contained in:
Jonathan
2025-04-27 19:34:50 -04:00
parent 38ff4e3e89
commit e820457176
153 changed files with 5010 additions and 2059 deletions
@@ -10,7 +10,7 @@
@inject IEconomyService EconomyService
@inject IToastService ToastService
@inject ITimingService TimingService
@inject IDataCollectionService DataCollectionService
@inject IDataCollectionService DataCollectionService
@page "/build-calculator"
@using Services.Website
@@ -22,7 +22,7 @@
<AlertComponent Type="@SeverityType.Warning">
<Title>Work In Progress and Not Fully Tested</Title>
<Message>
Build Calculator hasn't been thoroughly tested. Bugs and inaccurate results assumed.
Build Calculator hasn't been thoroughly tested. Bugs and inaccurate results assumed.
<br/>
Currently not considering running out of alloy and ether to harvest.
</Message>
@@ -32,7 +32,8 @@
<div class="calculatorGrid">
<div class="gridItem" style="grid-area: timing;">
<ButtonComponent MyButtonType="MyButtonType.Secondary" OnClick="OnResetClicked">Clear Build Order</ButtonComponent>
<ButtonComponent MyButtonType="MyButtonType.Secondary" OnClick="OnResetClicked">Clear Build Order
</ButtonComponent>
<PanelComponent>
<InfoTooltipComponent InfoText="@Locale["Tooltip Timing Info"]">
<TimingComponent></TimingComponent>
@@ -119,7 +120,8 @@
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.
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>
@@ -128,13 +130,22 @@
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.
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.
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>)
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>
@@ -230,7 +241,7 @@
DataCollectionService.SendEvent(
DataCollectionKeys.PageInitialized,
new Dictionary<string, string> { { "page", "build-calculator" } }
);
);
}
void IDisposable.Dispose()
@@ -13,7 +13,8 @@
<Display>@lastInterval | T @Interval.ToTime(lastInterval)</Display>
</FormDisplayComponent>
<FormDisplayComponent Label="Army Attacking At">
<Display>@(lastInterval + timingService.GetTravelTime()) | T @Interval.ToTime(lastInterval + timingService.GetTravelTime())</Display>
<Display>@(lastInterval + timingService.GetTravelTime()) |
T @Interval.ToTime(lastInterval + timingService.GetTravelTime())</Display>
</FormDisplayComponent>
</div>
<FormDisplayComponent Label="Army units built">
@@ -38,32 +39,36 @@
<style>
.armyView {
overflow-y: scroll; width: 100%; overflow-x: hidden; height: 350px;
}
overflow-y: scroll;
width: 100%;
overflow-x: hidden;
height: 350px;
}
.armyCardsContainer {
display: flex;
width: 100%;
gap: 16px;
flex-wrap: wrap;
}
.armyCardsContainer {
display: flex;
width: 100%;
gap: 16px;
flex-wrap: wrap;
}
.armyCard {
width:100px;
height: 80px;
width: 100px;
height: 80px;
padding: 16px;
}
.armyCountPosition {
height: 0;
top: -20px;
left: -16px;
position: relative;
}
.armyCount {
font-weight: bolder;
}
</style>
@code {
@@ -134,7 +139,7 @@
}
}
//TODO Better
//TODO Better
var armyCountIs = 0;
foreach (var army in armyCount)
{
@@ -7,7 +7,8 @@
<div class="bankContainer">
<FormDisplayComponent Label="Time">
<Display>@(BuildOrderService.GetLastRequestInterval() + 1) | T @Interval.ToTime(BuildOrderService.GetLastRequestInterval() + 1)</Display>
<Display>@(BuildOrderService.GetLastRequestInterval() + 1) |
T @Interval.ToTime(BuildOrderService.GetLastRequestInterval() + 1)</Display>
</FormDisplayComponent>
<div class="bankRow">
<FormDisplayComponent Label="Alloy">
@@ -48,7 +49,7 @@
flex-direction: column;
gap: 5px;
}
.workerText {
margin-bottom: -2px;
font-size: 0.8em;
@@ -62,11 +63,9 @@
@code {
[Inject]
IBuildOrderService BuildOrderService { get; set; } = default!;
[Inject] IBuildOrderService BuildOrderService { get; set; } = default!;
[Inject]
IEconomyService EconomyService { get; set; } = default!;
[Inject] IEconomyService EconomyService { get; set; } = default!;
EconomyModel _economy = new();
int _supplyGranted;
@@ -77,8 +76,8 @@
{
base.OnInitialized();
BuildOrderService.Subscribe(OnBuildOrderChanged);
_economy = EconomyService.GetEconomy(BuildOrderService.GetLastRequestInterval() + 1);
}
@@ -16,7 +16,8 @@ else
var takenPixels = new Dictionary<int, bool>();
<div style="width: @chart.IntervalDisplayMax.ToString()px; height: @chart.ValueDisplayMax.ToString()px">
<div style="position: relative; border: 2px solid gray; border-radius:2px; width: @chart.IntervalDisplayMax.ToString()px; height: @chart.ValueDisplayMax.ToString()px">
<div
style="position: relative; border: 2px solid gray; border-radius:2px; width: @chart.IntervalDisplayMax.ToString()px; height: @chart.ValueDisplayMax.ToString()px">
@foreach (var point in chart.Points)
{
var x = int.Parse(point.GetInterval(chart.HighestIntervalPoint, chart.IntervalDisplayMax));
@@ -27,11 +28,12 @@ else
<div style="position: absolute;
bottom:@point.GetValue(chart.HighestValuePoint, chart.ValueDisplayMax)px;
left:@point.GetInterval(chart.HighestIntervalPoint, chart.IntervalDisplayMax)px;
width: 0px;
height: 0px;">
<div style="width:1px; height: 1px; border-top-right-radius:10px; border-top-left-radius:10px; border: 2px solid @chart.ChartColor; background-color:@chart.ChartColor">
bottom:@point.GetValue(chart.HighestValuePoint, chart.ValueDisplayMax)px;
left:@point.GetInterval(chart.HighestIntervalPoint, chart.IntervalDisplayMax)px;
width: 0px;
height: 0px;">
<div
style="width:1px; height: 1px; border-top-right-radius:10px; border-top-left-radius:10px; border: 2px solid @chart.ChartColor; background-color:@chart.ChartColor">
</div>
</div>
}
@@ -42,16 +44,16 @@ else
<style>
.chartsContainer {
position: relative;
display: flex;
gap: 20px;
flex-wrap: wrap;
justify-content: center;
margin-bottom: 20px;
}
</style>
.chartsContainer {
position: relative;
display: flex;
gap: 20px;
flex-wrap: wrap;
justify-content: center;
margin-bottom: 20px;
}
</style>
<FormLayoutComponent>
<FormDisplayComponent Label="Highest Alloy">
@@ -103,7 +105,7 @@ else
}
int lastRequestedRefreshIndex = 0;
int lastRequestedRefreshIndex;
void OnAge(object? sender, ElapsedEventArgs elapsedEventArgs)
{
@@ -130,7 +132,7 @@ else
}
int requestedRefreshIndex = 0;
int requestedRefreshIndex;
void OnBuilderOrderChanged()
{
@@ -320,8 +322,8 @@ else
charts.Add(etherChart);
//TODO WIP
//charts.Add(pyreChart);
//TODO WIP
//charts.Add(pyreChart);
charts.Add(armyChart);
@@ -18,12 +18,15 @@
}
<style>
.entityClickView {
overflow-y: scroll; width: 100%; overflow-x: hidden; height: 550px;
overflow-y: scroll;
width: 100%;
overflow-x: hidden;
height: 550px;
}
</style>
@code {
private EntityModel? _entity = default!;
private EntityModel? _entity;
private string _viewType = EntityViewType.Detailed;
protected override void OnInitialized()
@@ -8,7 +8,7 @@
@inject IEconomyService EconomyService
@inject ITimingService TimingService
@inject IToastService ToastService
@inject IDataCollectionService DataCollectionService
@inject IDataCollectionService DataCollectionService
<InputPanelComponent>
@@ -22,7 +22,8 @@
var color = (hotkey.KeyText.Equals("SPACE") && KeyService.IsHoldingSpace()) || KeyService.GetAllPressedKeys().Contains(hotkey.KeyText)
? "#0a0f12" : hotkey.GetColor();
? "#0a0f12"
: hotkey.GetColor();
var x = hotkey.PositionX * Size;
var y = hotkey.PositionY * Size + (hotkey.PositionY == 0 ? 5 : -50);
@@ -37,6 +38,7 @@
{
border = "5px solid black";
}
if (hotkey.KeyText.Equals(controlGroup))
{
color = "#257525";
@@ -49,9 +51,9 @@
var keyText = hotkey.KeyText.Equals("CAPSLOCK") ? "Caps"
: hotkey.KeyText.Equals("CONTROL") ? "Ctrl"
: hotkey.KeyText.Equals("SHIFT") ? "Shift"
: hotkey.KeyText.Equals("TAB") ? "Tab"
: hotkey.KeyText.Equals("SPACE") ? "Space" : hotkey.KeyText;
: hotkey.KeyText.Equals("SHIFT") ? "Shift"
: hotkey.KeyText.Equals("TAB") ? "Tab"
: hotkey.KeyText.Equals("SPACE") ? "Space" : hotkey.KeyText;
var controlStyle = $"background-color:{color}; " +
@@ -74,11 +76,11 @@
var usedStyle = hotkey.PositionY == 0 ? controlStyle : keyStyle;
<div style="position:relative;
cursor:pointer;
top:@y.ToString()px;
left:@x.ToString()px;
width: 0px;
height: 0px;">
cursor:pointer;
top:@y.ToString()px;
left:@x.ToString()px;
width: 0px;
height: 0px;">
<div @onclick="e => ButtonClicked(e, hotkey)" style="@usedStyle">
@keyText
@@ -138,8 +140,7 @@
@code {
[Parameter]
public int Size { get; set; } = 100;
[Parameter] public int Size { get; set; } = 100;
readonly Dictionary<string, EntityModel> data = EntityModel.GetDictionary();
readonly List<HotkeyModel> hotkeys = HotkeyModel.GetAll();
@@ -163,7 +164,7 @@
BuildOrderService.Unsubscribe(OnBuilderOrderChanged);
}
int completedTimeCount = 0;
int completedTimeCount;
void OnBuilderOrderChanged()
{
@@ -237,6 +238,7 @@
{
return false;
}
return true;
}
@@ -256,6 +258,7 @@
{
return false;
}
return true;
}
@@ -265,6 +268,7 @@
{
return false;
}
return true;
}
@@ -274,6 +278,7 @@
{
return false;
}
return true;
}
@@ -286,26 +291,32 @@
{
controlGroup = "Z";
}
if (KeyService.GetAllPressedKeys().Contains("TAB"))
{
controlGroup = "TAB";
}
if (KeyService.GetAllPressedKeys().Contains("C"))
{
controlGroup = "C";
}
if (KeyService.GetAllPressedKeys().Contains("D"))
{
controlGroup = "D";
}
if (KeyService.GetAllPressedKeys().Contains("V"))
{
controlGroup = "V";
}
if (KeyService.GetAllPressedKeys().Contains("ALT"))
{
controlGroup = "ALT";
}
if (KeyService.GetAllPressedKeys().Contains("SHIFT"))
{
controlGroup = "SHIFT";
@@ -367,7 +378,7 @@
DataCollectionService.SendEvent(
DataCollectionKeys.BuildCalcInput,
new Dictionary<string, string> { { "key", hotkey.KeyText.ToLower() }, { "input-source", "mouse" } }
);
);
if (hotkey.KeyText.Equals(HotKeyType.SPACE.ToString()))
@@ -1,7 +1,7 @@
@using Services.Website
@inject IKeyService KeyService
@inject IDataCollectionService DataCollectionService
@inject IDataCollectionService DataCollectionService
@inject IJSRuntime JsRuntime
@@ -16,15 +16,14 @@
@code {
[Parameter]
public RenderFragment ChildContent { get; set; } = default!;
[Parameter] public RenderFragment ChildContent { get; set; } = default!;
private void HandleKeyDown(KeyboardEventArgs e)
{
DataCollectionService.SendEvent(
DataCollectionKeys.BuildCalcInput,
new Dictionary<string, string> { { "key", e.Key.ToLower() }, { "input-source", "keyboard" } }
);
);
KeyService.AddPressedKey(e.Key);
}
@@ -12,7 +12,9 @@
Value="BuildDelay"
OnChange="@OnBuildingInputDelayChanged">
<FormLabelComponent>Building Input Delay</FormLabelComponent>
<FormInfoComponent>Add a input delay to constructing buildings for simulating worker movement and player micro.</FormInfoComponent>
<FormInfoComponent>Add a input delay to constructing buildings for simulating worker movement and player
micro.
</FormInfoComponent>
</FormNumberComponent>
<div class="optionRow">
<FormLayoutComponent>