- tweak: rework FileApi for services

- tweak: rework filter think
- add: content view button
- fix: little fixes in services
This commit is contained in:
2025-05-02 20:06:33 +03:00
parent ef8ee5a8d3
commit f066bb1188
18 changed files with 426 additions and 268 deletions

View File

@@ -120,7 +120,7 @@
https://cinka.ru/nebula-launcher/
</TextBlock>
</Button>
<TextBlock HorizontalAlignment="Right" VerticalAlignment="Center">v0.05-a</TextBlock>
<TextBlock HorizontalAlignment="Right" VerticalAlignment="Center">v0.08-a</TextBlock>
</Panel>
</Label>
</Border>

View File

@@ -8,7 +8,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pages="clr-namespace:Nebula.Launcher.ViewModels.Pages"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Nebula.Launcher.Controls">
<Design.DataContext>
<pages:ServerListViewModel />
@@ -22,7 +23,7 @@
Grid.RowSpan="2"
Margin="5,0,0,10"
Padding="0,0,10,0">
<StackPanel>
<StackPanel Margin="0,0,0,30">
<ItemsControl ItemsSource="{Binding HubErrors}" Margin="10,0,10,0" />
<ItemsControl
IsVisible="{Binding IsFavoriteMode}"
@@ -41,19 +42,8 @@
VerticalAlignment="Bottom"
IsVisible="{Binding IsFilterVisible}">
<StackPanel Orientation="Vertical" Spacing="2" Margin="15">
<StackPanel Orientation="Horizontal" Spacing="15">
<TextBlock Text="Roleplay:" VerticalAlignment="Center" Margin="0,0,15,0"/>
<CheckBox Click="Button_OnClick" Name="rp_none"><TextBlock Text="NonRP"/></CheckBox>
<CheckBox Click="Button_OnClick" Name="rp_low"><TextBlock Text="LowRP"/></CheckBox>
<CheckBox Click="Button_OnClick" Name="rp_med"><TextBlock Text="MediumRP"/></CheckBox>
<CheckBox Click="Button_OnClick" Name="rp_high"><TextBlock Text="HardRP"/></CheckBox>
<CheckBox Click="Button_OnClick" Name="ERPYes"><TextBlock Text="18+"/></CheckBox>
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="15">
<TextBlock Text="Language:" VerticalAlignment="Center" Margin="0,0,4,0"/>
<CheckBox Click="Button_OnClick" Name="lang_ru"><TextBlock Text="RU"/></CheckBox>
<CheckBox Click="Button_OnClick" Name="lang_en"><TextBlock Text="EN"/></CheckBox>
</StackPanel>
<controls:FilterBox Name="EssentialFilters" FilterBoxName="Roleplay" FilterCommand="{Binding OnFilterChanged}"/>
<controls:FilterBox Name="LanguageFilters" FilterBoxName="Language" FilterCommand="{Binding OnFilterChanged}"/>
</StackPanel>
</Border>

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using Avalonia.Controls;
using Avalonia.Interactivity;
using ServerListViewModel = Nebula.Launcher.ViewModels.Pages.ServerListViewModel;
namespace Nebula.Launcher.Views.Pages;
@@ -12,6 +9,15 @@ public partial class ServerListView : UserControl
public ServerListView()
{
InitializeComponent();
EssentialFilters.AddFilter("Non RP", "rp:none");
EssentialFilters.AddFilter("Low RP", "rp:low");
EssentialFilters.AddFilter("Medium RP", "rp:med");
EssentialFilters.AddFilter("Hard RP", "rp:high");
EssentialFilters.AddFilter("18+", "18+");
LanguageFilters.AddFilter("RU","lang:ru");
LanguageFilters.AddFilter("EN","lang:en");
}
// This constructor is used when the view is created via dependency injection
@@ -26,11 +32,4 @@ public partial class ServerListView : UserControl
var context = (ServerListViewModel?)DataContext;
context?.OnSearchChange?.Invoke();
}
private void Button_OnClick(object? sender, RoutedEventArgs e)
{
var send = sender as CheckBox;
var context = (ServerListViewModel?)DataContext;
context?.OnFilterChanged(send.Name, send.IsChecked.Value);
}
}

View File

@@ -5,7 +5,6 @@
x:Class="Nebula.Launcher.Views.ServerEntryView"
x:DataType="viewModels:ServerEntryModelView"
xmlns="https://github.com/avaloniaui"
xmlns:asyncImageLoader="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia"
xmlns:converters="clr-namespace:Nebula.Launcher.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -13,7 +12,8 @@
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:viewModels="clr-namespace:Nebula.Launcher.ViewModels"
xmlns:views="clr-namespace:Nebula.Launcher.Views"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
IsVisible="{Binding IsVisible}">
<Design.DataContext>
<viewModels:ServerEntryModelView />
</Design.DataContext>
@@ -234,6 +234,10 @@
IsVisible="{Binding ExpandInfo}"
Margin="5,5,0,0"
Spacing="5">
<Button
Command="{Binding OpenContentViewer}">
<Svg Margin="4" Path="/Assets/svg/folder.svg" />
</Button>
<Button
Command="{Binding StopInstance}"
CornerRadius="10"