- add: some info

This commit is contained in:
2024-12-23 20:45:34 +03:00
parent fd347a4fc8
commit 4ba2a5e2b8
3 changed files with 114 additions and 49 deletions

View File

@@ -45,10 +45,15 @@ public sealed record ServerStatus(
List<string> Tags, List<string> Tags,
string Preset, string Preset,
int Players, int Players,
[property: JsonPropertyName("round_id")]
int RoundId, int RoundId,
[property: JsonPropertyName("run_level")]
int RunLevel, int RunLevel,
[property: JsonPropertyName("panic_bunker")]
bool PanicBunker, bool PanicBunker,
[property: JsonPropertyName("round_start_time")]
DateTime? RoundStartTime, DateTime? RoundStartTime,
[property: JsonPropertyName("soft_max_players")]
int SoftMaxPlayers); int SoftMaxPlayers);
public sealed record ModulesInfo(Dictionary<string, Module> Modules); public sealed record ModulesInfo(Dictionary<string, Module> Modules);

View File

@@ -20,7 +20,7 @@ public partial class ServerListViewModel : ViewModelBase
public ServerListViewModel() public ServerListViewModel()
{ {
ServerInfos = new ObservableCollection<ServerHubInfo>(); ServerInfos = new ObservableCollection<ServerHubInfo>();
ServerInfos.Add(new ServerHubInfo("ss14://localhost",new ServerStatus("","TestCraft", [], "super", 12,55,1,false,DateTime.Now, 20),[])); ServerInfos.Add(new ServerHubInfo("ss14://localhost",new ServerStatus("Nebula","TestCraft", ["16+","RU"], "super", 12,55,1,false,DateTime.Now, 20),[]));
} }
//real think //real think

View File

@@ -5,12 +5,12 @@
x:Class="Nebula.Launcher.Views.Pages.ServerListView" x:Class="Nebula.Launcher.Views.Pages.ServerListView"
x:DataType="viewModels:ServerListViewModel" x:DataType="viewModels:ServerListViewModel"
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:asyncImageLoader="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:models="clr-namespace:Nebula.Launcher.Models" xmlns:models="clr-namespace:Nebula.Launcher.Models"
xmlns:viewModels="clr-namespace:Nebula.Launcher.ViewModels" xmlns:viewModels="clr-namespace:Nebula.Launcher.ViewModels"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:asyncImageLoader="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia">
<Design.DataContext> <Design.DataContext>
<viewModels:ServerListViewModel /> <viewModels:ServerListViewModel />
@@ -33,7 +33,9 @@
Grid.Column="0" Grid.Column="0"
Grid.Row="0" Grid.Row="0"
Padding="10"> Padding="10">
<Label>
<TextBlock Text="{Binding StatusData.Name}" /> <TextBlock Text="{Binding StatusData.Name}" />
</Label>
</Border> </Border>
<Border <Border
BorderThickness="2,0,0,0" BorderThickness="2,0,0,0"
@@ -41,10 +43,17 @@
Grid.Column="1" Grid.Column="1"
Grid.Row="0" Grid.Row="0"
Padding="5"> Padding="5">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> <StackPanel
HorizontalAlignment="Center"
Orientation="Horizontal"
VerticalAlignment="Center">
<Label>
<TextBlock Text="{Binding StatusData.Players}" /> <TextBlock Text="{Binding StatusData.Players}" />
<TextBlock>/</TextBlock> </Label>
<Label>/</Label>
<Label>
<TextBlock Text="{Binding StatusData.SoftMaxPlayers}" /> <TextBlock Text="{Binding StatusData.SoftMaxPlayers}" />
</Label>
</StackPanel> </StackPanel>
</Border> </Border>
@@ -58,6 +67,57 @@
<Border.Background> <Border.Background>
<ImageBrush Stretch="UniformToFill" asyncImageLoader:ImageBrushLoader.Source="https://t4.ftcdn.net/jpg/00/81/55/69/360_F_81556974_8sF8cKszJaRfBGd5sDt1RXE2QbzDtQqs.jpg" /> <ImageBrush Stretch="UniformToFill" asyncImageLoader:ImageBrushLoader.Source="https://t4.ftcdn.net/jpg/00/81/55/69/360_F_81556974_8sF8cKszJaRfBGd5sDt1RXE2QbzDtQqs.jpg" />
</Border.Background> </Border.Background>
<Border
BorderThickness="0,2,2,0"
CornerRadius="0,10,10,10"
IsVisible="True"
Margin="0,0,5,0"
Opacity="40"
Padding="0">
<UniformGrid Margin="15,5,15,0">
<UniformGrid.Styles>
<Style Selector="Label">
<Setter Property="FontSize" Value="8" />
</Style>
</UniformGrid.Styles>
<Label>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0,0,5,0">RoundStart:</TextBlock>
<TextBlock Text="{Binding StatusData.RoundStartTime}" />
</StackPanel>
</Label>
<Label>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0,0,5,0">Map:</TextBlock>
<TextBlock Text="{Binding StatusData.Map}" />
</StackPanel>
</Label>
<Label>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0,0,5,0">Preset:</TextBlock>
<TextBlock Text="{Binding StatusData.Preset}" />
</StackPanel>
</Label>
<Label>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0,0,5,0">PanicBunker:</TextBlock>
<TextBlock Text="{Binding StatusData.PanicBunker}" />
</StackPanel>
</Label>
<Label>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0,0,5,0">Round Id:</TextBlock>
<TextBlock Text="{Binding StatusData.RoundId}" />
</StackPanel>
</Label>
<Label>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0,0,5,0">Run Level:</TextBlock>
<TextBlock Text="{Binding StatusData.RunLevel}" />
</StackPanel>
</Label>
</UniformGrid>
</Border>
</Border> </Border>
<Panel Grid.Column="1" Grid.Row="1"> <Panel Grid.Column="1" Grid.Row="1">