You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.3 KiB
51 lines
1.3 KiB
@implements IDisposable |
|
|
|
<div style="overflow-y: scroll; width: 100%; overflow-x: hidden; height: 550px;"> |
|
@if (Entity != null) { |
|
<EntityViewComponent Entity=Entity></EntityViewComponent> |
|
} |
|
</div> |
|
|
|
@code { |
|
EntityModel Entity; |
|
|
|
[Inject] |
|
IKeyService KeyService { get; set; } |
|
|
|
[Inject] |
|
IImmortalSelectionService FilterService { get; set; } |
|
|
|
[Inject] |
|
IBuildOrderService BuildOrderService { get; set; } |
|
|
|
protected override void OnInitialized() { |
|
KeyService.Subscribe(HandleClick); |
|
BuildOrderService.Subscribe(OnBuildOrderChanged); |
|
} |
|
|
|
void IDisposable.Dispose() { |
|
KeyService.Unsubscribe(HandleClick); |
|
BuildOrderService.Unsubscribe(OnBuildOrderChanged); |
|
} |
|
|
|
|
|
protected void HandleClick() { |
|
var hotkey = KeyService.GetHotkey(); |
|
var hotkeyGroup = KeyService.GetHotkeyGroup(); |
|
var isHoldSpace = KeyService.IsHoldingSpace(); |
|
var faction = FilterService.GetFactionType(); |
|
var immortal = FilterService.GetImmortalType(); |
|
|
|
var foundEntity = EntityModel.GetFrom(hotkey, hotkeyGroup, isHoldSpace, faction, immortal); |
|
|
|
if (foundEntity != null) { |
|
Entity = foundEntity; |
|
StateHasChanged(); |
|
} |
|
} |
|
|
|
void OnBuildOrderChanged() { |
|
StateHasChanged(); |
|
} |
|
|
|
} |