feat(Storage) Storage feature done
This commit is contained in:
@@ -150,7 +150,7 @@
|
||||
entityDialogService.Subscribe(OnUpdate);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
entityDialogService.Unsubscribe(OnUpdate);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
searchService.Unsubscribe(OnSearchChanged);
|
||||
timer.Elapsed -= FocusTimer;
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
@layout PageLayout
|
||||
|
||||
<DevOnlyComponent>
|
||||
<PermissionsPage/>
|
||||
<StoragePage/>
|
||||
</DevOnlyComponent>
|
||||
|
||||
<HomePage/>
|
||||
@@ -257,8 +257,8 @@
|
||||
|
||||
var hotkeyGroup = keyService.GetHotkeyGroup();
|
||||
var isHoldSpace = keyService.IsHoldingSpace();
|
||||
var faction = filterService.GetFactionType();
|
||||
var immortal = filterService.GetImmortalType();
|
||||
var faction = filterService.GetFaction();
|
||||
var immortal = filterService.GetImmortal();
|
||||
|
||||
var entity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal);
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@
|
||||
var hotkey = KeyService.GetHotkey();
|
||||
var hotkeyGroup = KeyService.GetHotkeyGroup();
|
||||
var isHoldSpace = KeyService.IsHoldingSpace();
|
||||
var faction = FilterService.GetFactionType();
|
||||
var immortal = FilterService.GetImmortalType();
|
||||
var faction = FilterService.GetFaction();
|
||||
var immortal = FilterService.GetImmortal();
|
||||
|
||||
var foundEntity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal);
|
||||
|
||||
|
||||
@@ -1,27 +1,33 @@
|
||||
@inject IJSRuntime jsRuntime;
|
||||
@inject IImmortalSelectionService filterService
|
||||
@inject IJSRuntime JsRuntime;
|
||||
@inject IImmortalSelectionService FilterService
|
||||
|
||||
<FormLayoutComponent>
|
||||
<FormSelectComponent OnChange="@OnFactionChanged">
|
||||
<FormLabelComponent>Faction</FormLabelComponent>
|
||||
<ChildContent>
|
||||
<option value="@FactionType.Aru">Aru</option>
|
||||
<option value="@FactionType.QRath" selected>Q'Rath</option>
|
||||
<option value="@DataType.FACTION_Aru"
|
||||
selected="@(FilterService.GetFaction().Equals(DataType.FACTION_Aru))">Aru</option>
|
||||
<option value="@DataType.FACTION_QRath"
|
||||
selected="@(FilterService.GetFaction().Equals(DataType.FACTION_QRath))">Q'Rath</option>
|
||||
</ChildContent>
|
||||
</FormSelectComponent>
|
||||
|
||||
<FormSelectComponent OnChange="@OnImmortalChanged">
|
||||
<FormLabelComponent>Immortal</FormLabelComponent>
|
||||
<ChildContent>
|
||||
@if (filterService.GetFactionType() == FactionType.QRath)
|
||||
@if (FilterService.GetFaction() == DataType.FACTION_QRath)
|
||||
{
|
||||
<option value="@DataType.IMMORTAL_Orzum" selected>Orzum</option>
|
||||
<option value="@DataType.IMMORTAL_Ajari">Ajari</option>
|
||||
<option value="@DataType.IMMORTAL_Orzum"
|
||||
selected="@(FilterService.GetImmortal().Equals(DataType.IMMORTAL_Orzum))">Orzum</option>
|
||||
<option value="@DataType.IMMORTAL_Ajari"
|
||||
selected="@(FilterService.GetImmortal().Equals(DataType.IMMORTAL_Ajari))">Ajari</option>
|
||||
}
|
||||
@if (filterService.GetFactionType() == FactionType.Aru)
|
||||
@if (FilterService.GetFaction() == DataType.FACTION_Aru)
|
||||
{
|
||||
<option value="@DataType.IMMORTAL_Mala" selected>Mala</option>
|
||||
<option value="@DataType.IMMORTAL_Xol">Xol</option>
|
||||
<option value="@DataType.IMMORTAL_Mala"
|
||||
selected="@(FilterService.GetImmortal().Equals(DataType.IMMORTAL_Mala))">Mala</option>
|
||||
<option value="@DataType.IMMORTAL_Xol"
|
||||
selected="@(FilterService.GetImmortal().Equals(DataType.IMMORTAL_Xol))">Xol</option>
|
||||
}
|
||||
</ChildContent>
|
||||
</FormSelectComponent>
|
||||
@@ -31,18 +37,18 @@
|
||||
|
||||
void OnFactionChanged(ChangeEventArgs e)
|
||||
{
|
||||
filterService.SelectFactionType(e.Value!.ToString()!);
|
||||
FilterService.SelectFaction(e.Value!.ToString()!);
|
||||
}
|
||||
|
||||
void OnImmortalChanged(ChangeEventArgs e)
|
||||
{
|
||||
filterService.SelectImmortalType(e.Value!.ToString()!);
|
||||
FilterService.SelectImmortal(e.Value!.ToString()!);
|
||||
}
|
||||
|
||||
protected override bool ShouldRender()
|
||||
{
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.time", "FilterComponent");
|
||||
JsRuntime.InvokeVoidAsync("console.time", "FilterComponent");
|
||||
#endif
|
||||
|
||||
return true;
|
||||
@@ -51,7 +57,7 @@
|
||||
protected override void OnAfterRender(bool firstRender)
|
||||
{
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.timeEnd", "FilterComponent");
|
||||
JsRuntime.InvokeVoidAsync("console.timeEnd", "FilterComponent");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
// Move to Filter Service
|
||||
bool InvalidFaction(EntityModel entity)
|
||||
{
|
||||
if (entity.Faction() != null && entity.Faction()?.Faction != filterService.GetFactionType() && filterService.GetFactionType() != FactionType.Any)
|
||||
if (entity.Faction() != null && entity.Faction()?.Faction != filterService.GetFaction() && filterService.GetFaction() != DataType.Any)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -176,8 +176,8 @@
|
||||
bool InvalidVanguard(EntityModel entity)
|
||||
{
|
||||
if (entity.VanguardAdded() != null
|
||||
&& entity.VanguardAdded()?.ImmortalId != filterService.GetImmortalType()
|
||||
&& filterService.GetImmortalType() != ImmortalType.Any)
|
||||
&& entity.VanguardAdded()?.ImmortalId != filterService.GetImmortal()
|
||||
&& filterService.GetImmortal() != DataType.Any)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -192,7 +192,7 @@
|
||||
{
|
||||
foreach (var replaced in entity.Replaceds())
|
||||
{
|
||||
if (filterService.GetImmortalType() == replaced.ImmortalId)
|
||||
if (filterService.GetImmortal() == replaced.ImmortalId)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -319,8 +319,8 @@
|
||||
|
||||
var hotkeyGroup = keyService.GetHotkeyGroup();
|
||||
var isHoldSpace = keyService.IsHoldingSpace();
|
||||
var faction = filterService.GetFactionType();
|
||||
var immortal = filterService.GetImmortalType();
|
||||
var faction = filterService.GetFaction();
|
||||
var immortal = filterService.GetImmortal();
|
||||
|
||||
var entity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal);
|
||||
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
@inject IJSRuntime jsRuntime;
|
||||
@inject IJSRuntime JsRuntime;
|
||||
|
||||
@inject IBuildOrderService buildOrderService
|
||||
@inject IEconomyService economyService
|
||||
@inject IToastService toastService
|
||||
@inject ITimingService timingService
|
||||
@inject IBuildOrderService BuildOrderService
|
||||
@inject IEconomyService EconomyService
|
||||
@inject IToastService ToastService
|
||||
@inject ITimingService TimingService
|
||||
|
||||
@using System.Data
|
||||
@implements IDisposable
|
||||
|
||||
<FormLayoutComponent>
|
||||
<FormNumberComponent Max="600"
|
||||
Min="0"
|
||||
Value="@buildOrderService.BuildingInputDelay"
|
||||
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>
|
||||
@@ -17,7 +20,7 @@
|
||||
<FormLayoutComponent>
|
||||
<FormNumberComponent Max="600"
|
||||
Min="1"
|
||||
Value="@WaitTime"
|
||||
Value="WaitTime"
|
||||
OnChange="@OnWaitTimeChanged">
|
||||
<FormLabelComponent>Wait Time</FormLabelComponent>
|
||||
</FormNumberComponent>
|
||||
@@ -26,7 +29,7 @@
|
||||
<FormLayoutComponent>
|
||||
<FormNumberComponent Max="2048"
|
||||
Min="1"
|
||||
Value="@WaitTo"
|
||||
Value="WaitTo"
|
||||
OnChange="@OnWaitToChanged">
|
||||
<FormLabelComponent>Wait To</FormLabelComponent>
|
||||
</FormNumberComponent>
|
||||
@@ -43,45 +46,69 @@
|
||||
</style>
|
||||
|
||||
@code {
|
||||
private int BuildDelay { get; set; } = 2;
|
||||
private int WaitTime { get; set; } = 30;
|
||||
private int WaitTo { get; set; } = 30;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
TimingService.Subscribe(RefreshDefaults);
|
||||
|
||||
RefreshDefaults();
|
||||
}
|
||||
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
TimingService.Unsubscribe(RefreshDefaults);
|
||||
}
|
||||
|
||||
void RefreshDefaults()
|
||||
{
|
||||
BuildDelay = TimingService.BuildingInputDelay;
|
||||
WaitTime = TimingService.WaitTime;
|
||||
WaitTo = TimingService.WaitTo;
|
||||
|
||||
StateHasChanged();
|
||||
|
||||
}
|
||||
|
||||
void OnBuildingInputDelayChanged(ChangeEventArgs changeEventArgs)
|
||||
{
|
||||
buildOrderService.BuildingInputDelay = int.Parse(changeEventArgs.Value!.ToString()!);
|
||||
TimingService.BuildingInputDelay = int.Parse(changeEventArgs.Value!.ToString()!);
|
||||
}
|
||||
|
||||
void OnWaitTimeChanged(ChangeEventArgs changeEventArgs)
|
||||
{
|
||||
TimingService.WaitTime = (int)changeEventArgs.Value!;
|
||||
WaitTime = (int)changeEventArgs.Value!;
|
||||
}
|
||||
|
||||
void OnWaitToChanged(ChangeEventArgs changeEventArgs)
|
||||
{
|
||||
TimingService.WaitTo = (int)changeEventArgs.Value!;
|
||||
WaitTo = (int)changeEventArgs.Value!;
|
||||
}
|
||||
|
||||
private void OnWaitClicked()
|
||||
{
|
||||
if (buildOrderService.AddWait(WaitTime))
|
||||
if (BuildOrderService.AddWait(WaitTime))
|
||||
{
|
||||
economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval());
|
||||
EconomyService.Calculate(BuildOrderService, TimingService, BuildOrderService.GetLastRequestInterval());
|
||||
}
|
||||
}
|
||||
|
||||
private void OnWaitToClicked()
|
||||
{
|
||||
if (buildOrderService.AddWaitTo(WaitTo))
|
||||
if (BuildOrderService.AddWaitTo(WaitTo))
|
||||
{
|
||||
economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval());
|
||||
EconomyService.Calculate(BuildOrderService, TimingService, BuildOrderService.GetLastRequestInterval());
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool ShouldRender()
|
||||
{
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.time", "TimingComponent");
|
||||
JsRuntime.InvokeVoidAsync("console.time", "TimingComponent");
|
||||
#endif
|
||||
|
||||
return true;
|
||||
@@ -90,9 +117,8 @@
|
||||
protected override void OnAfterRender(bool firstRender)
|
||||
{
|
||||
#if DEBUG
|
||||
jsRuntime.InvokeVoidAsync("console.timeEnd", "TimingComponent");
|
||||
JsRuntime.InvokeVoidAsync("console.timeEnd", "TimingComponent");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
@inject IEconomyService economyService
|
||||
@inject IToastService toastService
|
||||
@inject ITimingService timingService
|
||||
@implements IDisposable
|
||||
|
||||
<FormLayoutComponent>
|
||||
<FormNumberComponent Max="2048"
|
||||
@@ -30,6 +31,16 @@
|
||||
|
||||
@code {
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
timingService.Subscribe(StateHasChanged);
|
||||
}
|
||||
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
timingService.Unsubscribe(StateHasChanged);
|
||||
}
|
||||
|
||||
void OnAttackTimeChanged(ChangeEventArgs changeEventArgs)
|
||||
{
|
||||
timingService.SetAttackTime(int.Parse(changeEventArgs.Value!.ToString()!));
|
||||
|
||||
@@ -79,8 +79,8 @@ grid-template-areas: 'loader sand compare compare' ;">
|
||||
var hotkey = KeyService.GetHotkey();
|
||||
var hotkeyGroup = KeyService.GetHotkeyGroup();
|
||||
var isHoldSpace = KeyService.IsHoldingSpace();
|
||||
var faction = FilterService.GetFactionType();
|
||||
var immortal = FilterService.GetImmortalType();
|
||||
var faction = FilterService.GetFaction();
|
||||
var immortal = FilterService.GetImmortal();
|
||||
|
||||
if (hotkey == "`")
|
||||
{
|
||||
|
||||
@@ -127,8 +127,8 @@
|
||||
List<EntityModel> searches = default!;
|
||||
|
||||
|
||||
string selectedFactionType = FactionType.Any;
|
||||
string selectedImmortalType = ImmortalType.Any;
|
||||
string selectedFactionType = DataType.Any;
|
||||
string selectedImmortalType = DataType.Any;
|
||||
string selectedEntityType = EntityType.Army;
|
||||
string searchText = "";
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
{
|
||||
selectedFactionType = EntityFilterService.GetFactionType();
|
||||
|
||||
if (selectedFactionType == FactionType.Any)
|
||||
if (selectedFactionType == DataType.Any)
|
||||
{
|
||||
factions = defaults.ToList();
|
||||
}
|
||||
@@ -199,7 +199,7 @@
|
||||
{
|
||||
selectedImmortalType = EntityFilterService.GetImmortalType();
|
||||
|
||||
if (selectedImmortalType == ImmortalType.Any)
|
||||
if (selectedImmortalType == DataType.Any)
|
||||
{
|
||||
immortals = factions.ToList();
|
||||
}
|
||||
|
||||
@@ -51,16 +51,16 @@
|
||||
<FormSelectComponent OnChange="@OnFactionChanged">
|
||||
<FormLabelComponent>Faction</FormLabelComponent>
|
||||
<ChildContent>
|
||||
<option value="@FactionType.Any" selected>Any</option>
|
||||
<option value="@FactionType.Aru">Aru</option>
|
||||
<option value="@FactionType.QRath">Q'Rath</option>
|
||||
<option value="@DataType.Any" selected>Any</option>
|
||||
<option value="@DataType.FACTION_Aru">Aru</option>
|
||||
<option value="@DataType.FACTION_QRath">Q'Rath</option>
|
||||
</ChildContent>
|
||||
</FormSelectComponent>
|
||||
|
||||
<FormSelectComponent OnChange="@OnImmortalChanged">
|
||||
<FormLabelComponent>Immortal</FormLabelComponent>
|
||||
<ChildContent>
|
||||
<option value="@ImmortalType.Any" selected>Any</option>
|
||||
<option value="@DataType.Any" selected>Any</option>
|
||||
<option value="@DataType.IMMORTAL_Mala">Mala</option>
|
||||
<option value="@DataType.IMMORTAL_Xol">Xol</option>
|
||||
<option value="@DataType.IMMORTAL_Orzum">Orzum</option>
|
||||
|
||||
@@ -107,7 +107,7 @@ else
|
||||
documentationService.Load();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
documentationService.Unsubscribe(StateHasChanged);
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ else
|
||||
documentationService.Load();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
documentationService.Unsubscribe(StateHasChanged);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ else
|
||||
}
|
||||
|
||||
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
noteService.Unsubscribe(StateHasChanged);
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ else
|
||||
noteService.Load();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
noteService.Unsubscribe(StateHasChanged);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
PermissionService.Unsubscribe(Update);
|
||||
}
|
||||
|
||||
+152
-9
@@ -1,13 +1,11 @@
|
||||
@page "/storage"
|
||||
|
||||
@inject IStorageService StorageService
|
||||
|
||||
@using Services.Website
|
||||
@implements IDisposable
|
||||
@layout PageLayout
|
||||
|
||||
<LayoutMediumContentComponent>
|
||||
|
||||
@if (!_enabledPermissions)
|
||||
{
|
||||
<AlertComponent Type="@SeverityType.Error">
|
||||
@@ -25,6 +23,90 @@
|
||||
OnChange="EntityViewChanged"/>
|
||||
</FormLayoutComponent>
|
||||
</PaperComponent>
|
||||
|
||||
<PaperComponent>
|
||||
<FormLayoutComponent>
|
||||
<FormNumberComponent Max="2048"
|
||||
Min="0"
|
||||
Value="@(_attackTime == null ? 0 : (int)_attackTime)"
|
||||
OnChange="AttackTimeChanged">
|
||||
<FormLabelComponent>Attack Time</FormLabelComponent>
|
||||
<FormInfoComponent>
|
||||
@if (_attackTime != null)
|
||||
{
|
||||
<i>  T @Interval.ToTime((int)_attackTime)</i>
|
||||
}
|
||||
</FormInfoComponent>
|
||||
</FormNumberComponent>
|
||||
|
||||
<FormNumberComponent Max="2048"
|
||||
Min="0"
|
||||
Value="@(_travelTime == null ? 0 : (int)_travelTime)"
|
||||
OnChange="TravelTimeChanged">
|
||||
<FormLabelComponent>Travel Time</FormLabelComponent>
|
||||
<FormInfoComponent>
|
||||
@if (_travelTime != null)
|
||||
{
|
||||
<i>  T @Interval.ToTime((int)_travelTime)</i>
|
||||
}
|
||||
</FormInfoComponent>
|
||||
</FormNumberComponent>
|
||||
|
||||
<FormSelectComponent OnChange="@OnFactionChanged">
|
||||
<FormLabelComponent>Faction</FormLabelComponent>
|
||||
<ChildContent>
|
||||
<option value="@DataType.FACTION_Aru"
|
||||
selected="@(Faction.Equals(DataType.FACTION_Aru))">Aru</option>
|
||||
<option value="@DataType.FACTION_QRath"
|
||||
selected="@(Faction.Equals(DataType.FACTION_QRath))">Q'Rath</option>
|
||||
</ChildContent>
|
||||
</FormSelectComponent>
|
||||
|
||||
<FormSelectComponent OnChange="@OnImmortalChanged">
|
||||
<FormLabelComponent>Immortal</FormLabelComponent>
|
||||
<ChildContent>
|
||||
@if (Faction == DataType.FACTION_QRath)
|
||||
{
|
||||
<option value="@DataType.IMMORTAL_Orzum"
|
||||
selected="@(Immortal.Equals(DataType.IMMORTAL_Orzum))">Orzum</option>
|
||||
<option value="@DataType.IMMORTAL_Ajari"
|
||||
selected="@(Immortal.Equals(DataType.IMMORTAL_Ajari))">Ajari</option>
|
||||
}
|
||||
@if (Faction == DataType.FACTION_Aru)
|
||||
{
|
||||
<option value="@DataType.IMMORTAL_Mala"
|
||||
selected="@(Immortal.Equals(DataType.IMMORTAL_Mala))">Mala</option>
|
||||
<option value="@DataType.IMMORTAL_Xol"
|
||||
selected="@(Immortal.Equals(DataType.IMMORTAL_Xol))">Xol</option>
|
||||
}
|
||||
</ChildContent>
|
||||
</FormSelectComponent>
|
||||
|
||||
|
||||
<FormNumberComponent Max="600"
|
||||
Min="0"
|
||||
Value="@(_buildingInputDelay == null ? 0 : (int)_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>
|
||||
<FormNumberComponent Max="600"
|
||||
Min="1"
|
||||
Value="@(_waitTime == null ? 0 : (int)_waitTime)"
|
||||
OnChange="@OnWaitTimeChanged">
|
||||
<FormLabelComponent>Wait Time</FormLabelComponent>
|
||||
</FormNumberComponent>
|
||||
</FormLayoutComponent>
|
||||
<FormLayoutComponent>
|
||||
<FormNumberComponent Max="2048"
|
||||
Min="1"
|
||||
Value="@(_waitTo == null ? 0 : (int)_waitTo)"
|
||||
OnChange="@OnWaitToChanged">
|
||||
<FormLabelComponent>Wait To</FormLabelComponent>
|
||||
</FormNumberComponent>
|
||||
|
||||
</FormLayoutComponent>
|
||||
</PaperComponent>
|
||||
}
|
||||
|
||||
<ContentDividerComponent/>
|
||||
@@ -41,21 +123,47 @@
|
||||
{
|
||||
_enabledPermissions = StorageService.GetValue<bool>(StorageKeys.EnabledStorage);
|
||||
|
||||
Update();
|
||||
RefreshDefaults();
|
||||
|
||||
StorageService.Subscribe(Update);
|
||||
StorageService.Subscribe(RefreshDefaults);
|
||||
}
|
||||
|
||||
|
||||
public void Dispose()
|
||||
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
StorageService.Unsubscribe(Update);
|
||||
StorageService.Unsubscribe(RefreshDefaults);
|
||||
}
|
||||
|
||||
void Update()
|
||||
private int? _attackTime = null;
|
||||
private int? _travelTime = null;
|
||||
|
||||
private string? _faction = null;
|
||||
private string? _immortal = null;
|
||||
|
||||
private string? Faction => _faction == null ? DataType.FACTION_QRath : _faction;
|
||||
private string? Immortal => _immortal == null ? DataType.IMMORTAL_Orzum : _immortal;
|
||||
|
||||
|
||||
|
||||
private int? _buildingInputDelay;
|
||||
private int? _waitTime;
|
||||
private int? _waitTo;
|
||||
|
||||
|
||||
|
||||
void RefreshDefaults()
|
||||
{
|
||||
_isEntityPlainView = StorageService.GetValue<bool>(StorageKeys.IsPlainView);
|
||||
_attackTime = StorageService.GetValue<int?>(StorageKeys.AttackTime);
|
||||
_travelTime = StorageService.GetValue<int?>(StorageKeys.TravelTime);
|
||||
|
||||
|
||||
_faction = StorageService.GetValue<string?>(StorageKeys.SelectedFaction);
|
||||
_immortal = StorageService.GetValue<string?>(StorageKeys.SelectedImmortal);
|
||||
|
||||
_buildingInputDelay = StorageService.GetValue<int?>(StorageKeys.BuildInputDelay);
|
||||
_waitTime = StorageService.GetValue<int?>(StorageKeys.WaitTime);
|
||||
_waitTo = StorageService.GetValue<int?>(StorageKeys.WaitTo);
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
@@ -65,4 +173,39 @@
|
||||
{
|
||||
StorageService.SetValue(StorageKeys.IsPlainView, obj.Value);
|
||||
}
|
||||
|
||||
private void AttackTimeChanged(ChangeEventArgs obj)
|
||||
{
|
||||
StorageService.SetValue(StorageKeys.AttackTime, obj.Value);
|
||||
}
|
||||
|
||||
private void TravelTimeChanged(ChangeEventArgs obj)
|
||||
{
|
||||
StorageService.SetValue(StorageKeys.TravelTime, obj.Value);
|
||||
}
|
||||
|
||||
private void OnFactionChanged(ChangeEventArgs obj)
|
||||
{
|
||||
StorageService.SetValue(StorageKeys.SelectedFaction, obj.Value);
|
||||
}
|
||||
|
||||
private void OnImmortalChanged(ChangeEventArgs obj)
|
||||
{
|
||||
StorageService.SetValue(StorageKeys.SelectedImmortal, obj.Value);
|
||||
}
|
||||
private void OnBuildingInputDelayChanged(ChangeEventArgs obj)
|
||||
{
|
||||
StorageService.SetValue(StorageKeys.BuildInputDelay, obj.Value);
|
||||
}
|
||||
|
||||
private void OnWaitTimeChanged(ChangeEventArgs obj)
|
||||
{
|
||||
StorageService.SetValue(StorageKeys.WaitTime, obj.Value);
|
||||
}
|
||||
|
||||
private void OnWaitToChanged(ChangeEventArgs obj)
|
||||
{
|
||||
StorageService.SetValue(StorageKeys.WaitTo, obj.Value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
entityDialogService.Subscribe(OnUpdate);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
entityDialogService.Unsubscribe(OnUpdate);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
|
||||
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
searchService.Unsubscribe(OnUpdate);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
ageTimer.Enabled = true;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
toastService.Unsubscribe(OnUpdate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user