Files
NebulaLauncher/Nebula.Launcher/Views/ServerEntryView.axaml

265 lines
12 KiB
Plaintext
Raw Normal View History

2025-01-17 16:23:50 +03:00
<UserControl
2025-01-27 15:55:30 +03:00
d:DesignHeight="500"
2025-01-17 16:23:50 +03:00
d:DesignWidth="800"
mc:Ignorable="d"
x:Class="Nebula.Launcher.Views.ServerEntryView"
x:DataType="viewModels:ServerEntryModelView"
xmlns="https://github.com/avaloniaui"
2025-01-19 12:55:39 +03:00
xmlns:converters="clr-namespace:Nebula.Launcher.Converters"
2025-01-17 16:23:50 +03:00
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
2025-01-27 15:55:30 +03:00
xmlns:models="clr-namespace:Nebula.Shared.Models;assembly=Nebula.Shared"
2025-01-17 16:23:50 +03:00
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:viewModels="clr-namespace:Nebula.Launcher.ViewModels"
2025-01-27 15:55:30 +03:00
xmlns:views="clr-namespace:Nebula.Launcher.Views"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2025-06-23 19:48:11 +03:00
xmlns:services="clr-namespace:Nebula.Launcher.Services"
IsVisible="{Binding IsVisible}">
2025-01-16 21:07:50 +03:00
<Design.DataContext>
<viewModels:ServerEntryModelView />
</Design.DataContext>
2025-01-17 16:23:50 +03:00
2025-01-19 12:55:39 +03:00
<Border
2025-02-02 10:57:29 +03:00
Background="{StaticResource DefaultGrad}"
2025-01-28 19:59:35 +03:00
BoxShadow="-2 0 5 -1 #121212"
2025-01-19 12:55:39 +03:00
CornerRadius="10"
2025-01-21 20:44:36 +03:00
Margin="5">
2025-02-02 10:57:29 +03:00
2025-06-22 22:11:27 +03:00
<Grid ColumnDefinitions="*,80,50,50,50" RowDefinitions="35,*,*">
2025-01-17 16:23:50 +03:00
<Border
2025-01-23 20:43:52 +03:00
Background="Transparent"
2025-02-02 10:57:29 +03:00
BoxShadow="0 3 3 -2 #121212"
2025-01-17 16:23:50 +03:00
CornerRadius="10"
2025-01-21 20:44:36 +03:00
Grid.Column="0"
2025-01-17 16:23:50 +03:00
Grid.ColumnSpan="2"
Grid.Row="0"
IsVisible="{Binding ExpandInfo}" />
2025-01-19 12:55:39 +03:00
2025-01-17 16:23:50 +03:00
<Button
2025-02-02 10:57:29 +03:00
Background="Transparent"
2025-01-17 16:23:50 +03:00
Command="{Binding ExpandInfoRequired}"
Grid.Column="0"
Grid.Row="0"
2025-01-23 20:43:52 +03:00
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
2025-01-21 20:44:36 +03:00
<ScrollViewer
HorizontalScrollBarVisibility="Hidden"
Margin="10,0,0,0"
VerticalScrollBarVisibility="Disabled"
x:Name="AutoScrollViewer">
<Label VerticalAlignment="Center">
2025-06-22 22:11:27 +03:00
<TextBlock Text="{Binding RealName}" />
2025-01-21 20:44:36 +03:00
</Label>
</ScrollViewer>
2025-01-17 16:23:50 +03:00
</Button>
2025-01-23 20:43:52 +03:00
2025-01-16 21:07:50 +03:00
<StackPanel
2025-01-21 20:44:36 +03:00
Grid.Column="1"
2025-01-17 16:23:50 +03:00
Grid.Row="0"
2025-01-16 21:07:50 +03:00
HorizontalAlignment="Center"
Orientation="Horizontal"
VerticalAlignment="Center">
<Label>
2025-01-28 19:59:35 +03:00
<TextBlock Text="{Binding Status.Players}" />
2025-01-16 21:07:50 +03:00
</Label>
<Label>/</Label>
<Label>
2025-01-28 19:59:35 +03:00
<TextBlock Text="{Binding Status.SoftMaxPlayers}" />
2025-01-16 21:07:50 +03:00
</Label>
</StackPanel>
2025-06-22 22:11:27 +03:00
<Button
2025-01-21 20:44:36 +03:00
Grid.Column="2"
2025-01-17 16:23:50 +03:00
Grid.Row="0"
2025-06-22 22:11:27 +03:00
Command="{Binding EditName}"
CornerRadius="10,10,10,10"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Svg Margin="4" Path="/Assets/svg/pencil.svg" />
</Button>
<Panel
Grid.Column="3"
Grid.Row="0"
2025-01-17 16:23:50 +03:00
Margin="5,0,0,0">
2025-01-29 12:32:42 +03:00
<Button
Command="{Binding ToggleFavorites}"
CornerRadius="10,10,10,10"
HorizontalAlignment="Stretch"
IsVisible="{Binding !IsFavorite}"
VerticalAlignment="Stretch">
<Svg Margin="4" Path="/Assets/svg/star.svg" />
</Button>
<Button
Command="{Binding ToggleFavorites}"
CornerRadius="10,10,10,10"
HorizontalAlignment="Stretch"
IsVisible="{Binding IsFavorite}"
VerticalAlignment="Stretch">
<Svg Margin="4" Path="/Assets/svg/starfull.svg" />
</Button>
</Panel>
<Panel
2025-06-22 22:11:27 +03:00
Grid.Column="4"
2025-01-29 12:32:42 +03:00
Grid.Row="0"
Margin="5,0,0,0">
2025-01-16 21:07:50 +03:00
<Button
2025-01-17 16:23:50 +03:00
Command="{Binding RunInstance}"
CornerRadius="10,10,10,10"
2025-01-16 21:07:50 +03:00
HorizontalAlignment="Stretch"
2025-01-17 16:23:50 +03:00
IsVisible="{Binding RunVisible}"
2025-01-16 21:07:50 +03:00
VerticalAlignment="Stretch">
2025-01-19 12:55:39 +03:00
<Svg Margin="4" Path="/Assets/svg/play.svg" />
2025-01-16 21:07:50 +03:00
</Button>
2025-01-19 12:55:39 +03:00
<Grid ColumnDefinitions="*" IsVisible="{Binding !RunVisible}">
2025-01-17 16:23:50 +03:00
<Button
Command="{Binding ReadLog}"
2025-01-19 12:55:39 +03:00
CornerRadius="10"
2025-01-17 16:23:50 +03:00
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
2025-01-19 12:55:39 +03:00
<Svg Margin="4" Path="/Assets/svg/newspaper.svg" />
2025-01-17 16:23:50 +03:00
</Button>
</Grid>
</Panel>
2025-01-23 20:43:52 +03:00
<Label
FontSize="12"
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="1"
HorizontalAlignment="Left"
IsVisible="{Binding ExpandInfo}"
Margin="15">
2025-01-21 20:44:36 +03:00
<TextBlock Text="{Binding Description}" TextWrapping="Wrap" />
</Label>
2025-01-23 20:43:52 +03:00
2025-01-17 16:23:50 +03:00
<Border
2025-01-22 21:06:05 +03:00
Background="Transparent"
2025-02-02 10:57:29 +03:00
BoxShadow="0 -3 3 -2 #121212"
2025-01-17 16:23:50 +03:00
CornerRadius="10"
2025-01-21 20:44:36 +03:00
Grid.Column="0"
2025-01-23 20:43:52 +03:00
Grid.ColumnSpan="3"
2025-01-17 16:23:50 +03:00
Grid.Row="2"
IsVisible="{Binding ExpandInfo}"
2025-01-23 20:43:52 +03:00
Margin="5">
2025-01-21 20:44:36 +03:00
<StackPanel Margin="5" Spacing="5">
2025-01-17 16:23:50 +03:00
<StackPanel Orientation="Horizontal">
2025-06-23 19:48:11 +03:00
<Label FontSize="10" VerticalAlignment="Center" Content="{services:LocaledText serverentry-tag}"/>
2025-01-17 16:23:50 +03:00
<ItemsControl ItemsSource="{Binding Tags}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type system:String}">
<Border
2025-01-22 21:06:05 +03:00
Background="{StaticResource DefaultForeground}"
BorderThickness="0"
2025-01-23 20:43:52 +03:00
CornerRadius="8"
2025-01-17 16:23:50 +03:00
HorizontalAlignment="Center"
Margin="1,1,1,1"
VerticalAlignment="Center">
<Label FontSize="10" Margin="5,0,5,0">
<TextBlock Text="{Binding}" />
</Label>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
2025-01-23 20:43:52 +03:00
<StackPanel
2025-01-17 16:23:50 +03:00
HorizontalAlignment="Left"
2025-01-23 20:43:52 +03:00
Margin="5"
2025-01-17 16:23:50 +03:00
Orientation="Horizontal"
2025-01-23 20:43:52 +03:00
Spacing="8"
VerticalAlignment="Center" />
2025-01-17 16:23:50 +03:00
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</StackPanel>
2025-01-23 20:43:52 +03:00
<StackPanel Orientation="Horizontal">
2025-06-23 19:48:11 +03:00
<Label FontSize="10" VerticalAlignment="Center" Content="{services:LocaledText serverentry-map}"/>
2025-01-23 20:43:52 +03:00
<Border
2025-01-22 21:06:05 +03:00
Background="{StaticResource DefaultForeground}"
BorderThickness="0"
2025-01-23 20:43:52 +03:00
CornerRadius="8"
2025-01-17 16:23:50 +03:00
HorizontalAlignment="Center"
2025-01-21 20:44:36 +03:00
Margin="5"
2025-01-17 16:23:50 +03:00
VerticalAlignment="Center">
<Label FontSize="10" Margin="5,0,5,0">
2025-01-28 19:59:35 +03:00
<TextBlock Text="{Binding Status.Map}" />
2025-01-17 16:23:50 +03:00
</Label>
</Border>
</StackPanel>
<StackPanel Orientation="Horizontal">
2025-06-23 19:48:11 +03:00
<Label FontSize="10" VerticalAlignment="Center" Content="{services:LocaledText serverentry-preset}"/>
2025-01-17 16:23:50 +03:00
<Border
2025-01-22 21:06:05 +03:00
Background="{StaticResource DefaultForeground}"
BorderThickness="0"
2025-01-23 20:43:52 +03:00
CornerRadius="8"
2025-01-17 16:23:50 +03:00
HorizontalAlignment="Center"
2025-01-21 20:44:36 +03:00
Margin="5"
2025-01-17 16:23:50 +03:00
VerticalAlignment="Center">
<Label FontSize="10" Margin="5,0,5,0">
2025-01-28 19:59:35 +03:00
<TextBlock Text="{Binding Status.Preset}" />
2025-01-17 16:23:50 +03:00
</Label>
</Border>
</StackPanel>
2025-01-27 15:55:30 +03:00
<ItemsControl ItemsSource="{Binding Links}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type models:ServerLink}">
<Border
Background="Transparent"
BoxShadow="0 0 13 -1 #121212"
CornerRadius="10">
<Button
Command="{Binding $parent[views:ServerEntryView].((viewModels:ServerEntryModelView)DataContext).OnLinkGo}"
CommandParameter="{Binding Url}"
Margin="3">
<StackPanel Orientation="Horizontal" Spacing="5">
<Svg Height="20" Path="{Binding Icon, Converter={x:Static converters:TypeConverters.IconConverter}}" />
<Label FontSize="10">
<TextBlock Text="{Binding Name}" />
</Label>
</StackPanel>
</Button>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel
HorizontalAlignment="Left"
Margin="5"
Orientation="Horizontal"
Spacing="8"
VerticalAlignment="Center" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
2025-01-17 16:23:50 +03:00
</StackPanel>
</Border>
2025-01-19 12:55:39 +03:00
<StackPanel
2025-02-01 18:19:18 +03:00
Grid.Column="3"
2025-01-19 12:55:39 +03:00
Grid.Row="1"
IsVisible="{Binding ExpandInfo}"
Margin="5,5,0,0"
Spacing="5">
<Button
Command="{Binding OpenContentViewer}">
<Svg Margin="4" Path="/Assets/svg/folder.svg" />
</Button>
2025-01-19 12:55:39 +03:00
<Button
Command="{Binding StopInstance}"
CornerRadius="10"
Height="35"
HorizontalAlignment="Stretch"
IsVisible="{Binding !RunVisible}"
VerticalAlignment="Stretch">
<Svg Margin="4" Path="/Assets/svg/stop.svg" />
</Button>
</StackPanel>
2025-01-17 16:23:50 +03:00
</Grid>
</Border>
2025-01-16 21:07:50 +03:00
</UserControl>