- Moves Redistributables for games to separate panel - Add option override for games - Add Monaco completions for option schema editing - Add UI for editing options for a redistributable - Add config importing to translate from INI, JSON, XML, etc to redist option schema
48 lines
1.7 KiB
Text
48 lines
1.7 KiB
Text
@inherits FeedbackComponent<IEnumerable<Redistributable>, Redistributable>
|
|
|
|
<Search Placeholder="Search redistributables..." @bind-Value="_search" Style="margin-bottom: 12px;" />
|
|
|
|
<div style="max-height: 400px; overflow-y: auto;">
|
|
@foreach (var redist in FilteredRedistributables)
|
|
{
|
|
<div class="@($"ant-list-item{(_selected == redist ? " ant-list-item-selected" : "")}")"
|
|
style="padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f0f0f0; background: @(_selected == redist ? "#e6f4ff" : "transparent");"
|
|
@onclick="() => _selected = redist">
|
|
<Flex Justify="FlexJustify.SpaceBetween" Align="FlexAlign.Center">
|
|
<div>
|
|
<strong>@redist.Name</strong>
|
|
@if (!string.IsNullOrWhiteSpace(redist.Description))
|
|
{
|
|
<br />
|
|
<span style="color: rgba(0,0,0,0.45);">@redist.Description</span>
|
|
}
|
|
</div>
|
|
@if (_selected == redist)
|
|
{
|
|
<Icon Type="@IconType.Outline.Check" Theme="IconThemeType.Outline" />
|
|
}
|
|
</Flex>
|
|
</div>
|
|
}
|
|
</div>
|
|
|
|
@code {
|
|
string _search = "";
|
|
Redistributable? _selected;
|
|
|
|
IEnumerable<Redistributable> FilteredRedistributables =>
|
|
string.IsNullOrWhiteSpace(_search)
|
|
? Options
|
|
: Options.Where(r => r.Name.Contains(_search, StringComparison.OrdinalIgnoreCase));
|
|
|
|
public override async Task OnFeedbackOkAsync(ModalClosingEventArgs args)
|
|
{
|
|
if (_selected == null)
|
|
{
|
|
args.Reject();
|
|
return;
|
|
}
|
|
|
|
await base.OkCancelRefWithResult!.OnOk(_selected);
|
|
}
|
|
}
|