2025-02-04 18:39:29 -06:00
|
|
|
@using LANCommander.SDK.Models
|
2025-12-31 20:01:04 -06:00
|
|
|
@namespace LANCommander.Launcher.UI
|
2024-10-23 18:17:01 -05:00
|
|
|
@inherits FeedbackComponent<Data.Models.Game>
|
|
|
|
|
@inject SaveService SaveService
|
|
|
|
|
@inject IMessageService MessageService
|
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
|
2024-10-23 18:17:01 -05:00
|
|
|
|
2024-10-24 02:29:26 -05:00
|
|
|
<Table DataSource="Saves" Size="TableSize.Small" PageIndex="@CurrentPage" PageSize="@PageSize" PaginationPosition="none">
|
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
|
|
|
<PropertyColumn Property="s => s.CreatedOn" Title="@LocalizationService.GetString("CreatedOn")" />
|
2024-10-23 18:17:01 -05:00
|
|
|
<PropertyColumn Property="s => s.Size">
|
2025-01-29 23:02:59 -06:00
|
|
|
<ByteSize Value="context.Size" />
|
2024-10-23 18:17:01 -05:00
|
|
|
</PropertyColumn>
|
|
|
|
|
<ActionColumn>
|
2024-12-31 18:21:41 -06:00
|
|
|
<Flex Justify="FlexJustify.End">
|
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
|
|
|
<Popconfirm Title="@LocalizationService.GetString("AreYouSureReplaceLocalSaves")" OnConfirm="() => Download(context)">
|
2024-10-23 18:17:01 -05:00
|
|
|
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Download" />
|
|
|
|
|
</Popconfirm>
|
|
|
|
|
|
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
|
|
|
<Popconfirm Title="@LocalizationService.GetString("AreYouSureDeleteSave")" OnConfirm="() => Delete(context)">
|
2024-10-23 18:17:01 -05:00
|
|
|
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Close" Danger />
|
|
|
|
|
</Popconfirm>
|
|
|
|
|
</Flex>
|
|
|
|
|
</ActionColumn>
|
|
|
|
|
</Table>
|
|
|
|
|
|
2024-10-24 02:29:26 -05:00
|
|
|
<GridRow Wrap="false" Style="padding: 10px 16px;">
|
|
|
|
|
<GridCol Flex="@("auto")" Style=";display: flex; align-items: center;">
|
|
|
|
|
@if (Saves.Count() > PageSize)
|
|
|
|
|
{
|
|
|
|
|
<Pagination Simple PageSize="@PageSize" OnChange="OnPageChange" Total="Saves.Count()" />
|
|
|
|
|
}
|
|
|
|
|
</GridCol>
|
|
|
|
|
|
|
|
|
|
<GridCol>
|
2024-12-31 18:21:41 -06:00
|
|
|
<Space Direction="SpaceDirection.Horizontal">
|
2024-10-24 02:29:26 -05:00
|
|
|
<SpaceItem>
|
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 OnClick="() => Upload()">@LocalizationService.GetString("Upload")</Button>
|
2024-10-24 02:29:26 -05:00
|
|
|
</SpaceItem>
|
|
|
|
|
<SpaceItem>
|
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.Primary" OnClick="() => Close()">@LocalizationService.GetString("Close")</Button>
|
2024-10-24 02:29:26 -05:00
|
|
|
</SpaceItem>
|
|
|
|
|
</Space>
|
|
|
|
|
</GridCol>
|
|
|
|
|
</GridRow>
|
|
|
|
|
|
2024-10-23 18:17:01 -05:00
|
|
|
@code {
|
|
|
|
|
IEnumerable<GameSave> Saves = new List<GameSave>();
|
|
|
|
|
|
2024-10-24 02:29:26 -05:00
|
|
|
int PageSize = 10;
|
|
|
|
|
int CurrentPage = 1;
|
|
|
|
|
|
2024-10-23 18:31:33 -05:00
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
|
{
|
|
|
|
|
await LoadData();
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-24 02:29:26 -05:00
|
|
|
async Task OnPageChange(PaginationEventArgs args)
|
|
|
|
|
{
|
|
|
|
|
CurrentPage = args.Page;
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-23 18:17:01 -05:00
|
|
|
async Task Download(GameSave save)
|
|
|
|
|
{
|
|
|
|
|
await SaveService.DownloadAsync(Options.InstallDirectory, Options.Id, save.Id);
|
|
|
|
|
|
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
|
|
|
MessageService.Success(LocalizationService.GetString("SaveDownloaded"));
|
2024-10-23 18:17:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async Task Delete(GameSave save)
|
|
|
|
|
{
|
|
|
|
|
await SaveService.DeleteAsync(save.Id);
|
|
|
|
|
|
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
|
|
|
MessageService.Success(LocalizationService.GetString("SaveDeleted"));
|
2024-10-24 02:29:26 -05:00
|
|
|
|
|
|
|
|
await LoadData();
|
2024-10-23 18:17:01 -05:00
|
|
|
}
|
|
|
|
|
|
2024-10-24 02:29:26 -05:00
|
|
|
async Task Upload()
|
2024-10-23 18:17:01 -05:00
|
|
|
{
|
2024-10-24 02:29:26 -05:00
|
|
|
await SaveService.UploadAsync(Options.InstallDirectory, Options.Id);
|
|
|
|
|
|
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
|
|
|
MessageService.Success(LocalizationService.GetString("SaveUploaded"));
|
2024-10-24 02:29:26 -05:00
|
|
|
|
|
|
|
|
await LoadData();
|
2024-10-23 18:17:01 -05:00
|
|
|
}
|
|
|
|
|
|
2024-10-24 02:29:26 -05:00
|
|
|
async Task Close()
|
2024-10-23 18:17:01 -05:00
|
|
|
{
|
2024-10-24 02:29:26 -05:00
|
|
|
await CloseFeedbackAsync();
|
|
|
|
|
}
|
2024-10-23 18:17:01 -05:00
|
|
|
|
2024-10-24 02:29:26 -05:00
|
|
|
async Task LoadData()
|
|
|
|
|
{
|
2025-03-11 17:27:57 -05:00
|
|
|
Saves = await SaveService.Get(Options.Id);
|
|
|
|
|
Saves = Saves.OrderByDescending(s => s.CreatedOn);
|
2024-10-23 18:17:01 -05:00
|
|
|
}
|
|
|
|
|
}
|