2025-10-15 21:26:40 -05:00
|
|
|
@using LANCommander.Launcher.Models
|
|
|
|
|
@inject InstallService InstallService
|
2024-11-12 02:35:28 -06:00
|
|
|
@inject NavigationManager NavigationManager
|
Add localization support to launcher
Adds localization across the launcher and includes English, German, Spanish, French, Italian, Japanese, Korean, Dutch, Portuguese, Ukranian, and Chinese. These localizations were generated by Claude 3.5 and need to be reviewed by a human for accuracy.
2025-08-18 21:29:38 -05:00
|
|
|
@inject LocalizationService LocalizationService
|
2025-09-24 20:58:23 -05:00
|
|
|
@inject IJSRuntime JS
|
2024-11-12 02:35:28 -06:00
|
|
|
|
2025-02-22 00:26:54 -06:00
|
|
|
<Flex Justify="FlexJustify.Center" Align="FlexAlign.Center" Gap="FlexGap.Small" Class="footer">
|
|
|
|
|
<div style="flex: 1;">
|
|
|
|
|
@if (NavigationManager.Uri.Contains("/Depot"))
|
|
|
|
|
{
|
2025-11-21 19:06:26 -06:00
|
|
|
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Hdd" OnClick="@(() => NavigationManager.NavigateTo("/Library"))">@LocalizationService.GetString("Library")</Button>
|
2025-02-22 00:26:54 -06:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2025-09-24 20:58:23 -05:00
|
|
|
if (true)
|
2025-02-22 00:26:54 -06:00
|
|
|
{
|
|
|
|
|
<ConnectionStateView>
|
|
|
|
|
<Online>
|
Add localization support to launcher
Adds localization across the launcher and includes English, German, Spanish, French, Italian, Japanese, Korean, Dutch, Portuguese, Ukranian, and Chinese. These localizations were generated by Claude 3.5 and need to be reviewed by a human for accuracy.
2025-08-18 21:29:38 -05:00
|
|
|
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.AppstoreAdd" OnClick="@(() => NavigationManager.NavigateTo("/Depot"))">@LocalizationService.GetString("Depot")</Button>
|
2025-02-22 00:26:54 -06:00
|
|
|
</Online>
|
|
|
|
|
<Offline>
|
Add localization support to launcher
Adds localization across the launcher and includes English, German, Spanish, French, Italian, Japanese, Korean, Dutch, Portuguese, Ukranian, and Chinese. These localizations were generated by Claude 3.5 and need to be reviewed by a human for accuracy.
2025-08-18 21:29:38 -05:00
|
|
|
<Tooltip Title="@LocalizationService.GetString("YouAreCurrentlyOffline")" Placement="Placement.TopLeft">
|
|
|
|
|
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.AppstoreAdd" Disabled>@LocalizationService.GetString("Depot")</Button>
|
2025-02-22 00:26:54 -06:00
|
|
|
</Tooltip>
|
|
|
|
|
</Offline>
|
|
|
|
|
</ConnectionStateView>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</div>
|
2024-05-27 17:07:28 -05:00
|
|
|
|
2025-06-09 20:01:54 +02:00
|
|
|
<ConnectionStateView>
|
|
|
|
|
<Online>
|
|
|
|
|
@if (InstallService.Queue.Any(qi => qi.State))
|
|
|
|
|
{
|
2025-10-15 21:26:40 -05:00
|
|
|
<Flex Align="FlexAlign.Center" Style="flex-shrink: 0" Class="downloader">
|
|
|
|
|
<div class="downloader" @onclick="ShowDownloadQueue">
|
|
|
|
|
<CurrentDownloadItem ShowIcon="true" @bind-CurrentQueueItem="_currentQueueItem"/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Button OnClick="Cancel" Type="ButtonType.Text" Size="ButtonSize.Small" Danger Icon="@IconType.Outline.Close"/>
|
|
|
|
|
</Flex>
|
2025-06-09 20:01:54 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
Add localization support to launcher
Adds localization across the launcher and includes English, German, Spanish, French, Italian, Japanese, Korean, Dutch, Portuguese, Ukranian, and Chinese. These localizations were generated by Claude 3.5 and need to be reviewed by a human for accuracy.
2025-08-18 21:29:38 -05:00
|
|
|
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Download" OnClick="() => ShowDownloadQueue()">@LocalizationService.GetString("Downloads")</Button>
|
2025-06-09 20:01:54 +02:00
|
|
|
}
|
|
|
|
|
</Online>
|
|
|
|
|
<Offline>
|
Add localization support to launcher
Adds localization across the launcher and includes English, German, Spanish, French, Italian, Japanese, Korean, Dutch, Portuguese, Ukranian, and Chinese. These localizations were generated by Claude 3.5 and need to be reviewed by a human for accuracy.
2025-08-18 21:29:38 -05:00
|
|
|
<Tooltip Title="@LocalizationService.GetString("YouAreCurrentlyOffline")" Placement="Placement.TopLeft">
|
|
|
|
|
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Download" Disabled>@LocalizationService.GetString("Downloads")</Button>
|
2025-06-09 20:01:54 +02:00
|
|
|
</Tooltip>
|
|
|
|
|
</Offline>
|
|
|
|
|
</ConnectionStateView>
|
2024-11-12 02:35:28 -06:00
|
|
|
|
2025-02-22 00:26:54 -06:00
|
|
|
<div style="flex: 1; text-align: right;">
|
2025-09-24 20:58:23 -05:00
|
|
|
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Message" OnClick="OpenChatWindow">@LocalizationService.GetString("Chat")</Button>
|
2025-02-22 00:26:54 -06:00
|
|
|
</div>
|
2024-11-12 02:35:28 -06:00
|
|
|
</Flex>
|
2024-05-27 17:07:28 -05:00
|
|
|
|
2024-08-09 01:24:24 -05:00
|
|
|
<DownloadQueue @ref="DownloadQueue" />
|
2024-05-29 20:13:38 -05:00
|
|
|
|
2024-05-27 17:07:28 -05:00
|
|
|
@code {
|
2025-01-18 20:25:39 -06:00
|
|
|
[CascadingParameter] public bool Connected { get; set; }
|
2025-06-09 20:01:54 +02:00
|
|
|
|
2024-05-29 20:13:38 -05:00
|
|
|
bool DownloadQueueVisible = false;
|
2025-10-15 21:26:40 -05:00
|
|
|
|
|
|
|
|
IInstallQueueItem _currentQueueItem { get; set; }
|
2024-05-29 20:13:38 -05:00
|
|
|
|
2024-08-09 01:24:24 -05:00
|
|
|
DownloadQueue DownloadQueue;
|
|
|
|
|
|
2024-06-12 01:28:26 -05:00
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
|
{
|
2025-11-21 18:20:01 -06:00
|
|
|
InstallService.OnQueueChanged += async () => { await InvokeAsync(StateHasChanged); };
|
|
|
|
|
|
|
|
|
|
NavigationManager.LocationChanged += LocationChanged;
|
2024-06-12 01:28:26 -05:00
|
|
|
}
|
2025-11-21 18:20:01 -06:00
|
|
|
|
|
|
|
|
async void LocationChanged(object sender, LocationChangedEventArgs args)
|
|
|
|
|
{
|
|
|
|
|
await InvokeAsync(StateHasChanged);
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-15 21:26:40 -05:00
|
|
|
async Task Cancel()
|
|
|
|
|
{
|
|
|
|
|
await InstallService.CancelInstallAsync(_currentQueueItem.Id);
|
|
|
|
|
}
|
2024-06-12 01:28:26 -05:00
|
|
|
|
2024-05-29 20:13:38 -05:00
|
|
|
async Task ShowDownloadQueue()
|
|
|
|
|
{
|
2024-08-09 01:24:24 -05:00
|
|
|
await DownloadQueue.Show();
|
2024-05-29 20:13:38 -05:00
|
|
|
}
|
2025-09-24 20:58:23 -05:00
|
|
|
|
|
|
|
|
async Task OpenChatWindow()
|
|
|
|
|
{
|
|
|
|
|
await JS.InvokeVoidAsync("window.external.sendMessage", "openChat");
|
|
|
|
|
}
|
2024-05-27 17:07:28 -05:00
|
|
|
}
|