- add: Favorite, start.
This commit is contained in:
1
.idea/.idea.Nebula/.idea/avalonia.xml
generated
1
.idea/.idea.Nebula/.idea/avalonia.xml
generated
@@ -14,6 +14,7 @@
|
||||
<entry key="Nebula.Launcher/Views/Pages/AccountInfoPage.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||
<entry key="Nebula.Launcher/Views/Pages/AccountInfoView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||
<entry key="Nebula.Launcher/Views/Pages/ContentBrowserView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||
<entry key="Nebula.Launcher/Views/Pages/FavoriteServerListView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||
<entry key="Nebula.Launcher/Views/Pages/ServerListPage.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||
<entry key="Nebula.Launcher/Views/Pages/ServerListView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||
<entry key="Nebula.Launcher/Views/Popup/ExceptionView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||
|
||||
BIN
Nebula.Launcher/Assets/star-full.png
Normal file
BIN
Nebula.Launcher/Assets/star-full.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
Nebula.Launcher/Assets/star.png
Normal file
BIN
Nebula.Launcher/Assets/star.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -143,6 +143,7 @@ public sealed partial class ContentBrowserViewModel : ViewModelBase
|
||||
if (path.Pathes.Count > 0 && (path.Pathes[0].StartsWith("ss14://") || path.Pathes[0].StartsWith("ss14s://")))
|
||||
{
|
||||
ServerText = path.Pathes[0];
|
||||
path = new ContentPath("");
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(ServerText))
|
||||
@@ -157,14 +158,14 @@ public sealed partial class ContentBrowserViewModel : ViewModelBase
|
||||
SelectedEntry = await CreateEntry(ServerText);
|
||||
}
|
||||
|
||||
_debugService.Debug(path.Path);
|
||||
_debugService.Debug("Going to:" + path.Path);
|
||||
|
||||
var oriPath = path.Clone();
|
||||
try
|
||||
{
|
||||
if (SelectedEntry == null || !SelectedEntry.GetRoot().TryGetEntry(path, out var centry))
|
||||
{
|
||||
throw new Exception("Not found!");
|
||||
throw new Exception("Not found! " + oriPath.Path);
|
||||
}
|
||||
|
||||
if (appendHistory)
|
||||
|
||||
13
Nebula.Launcher/ViewModels/FavoriteServerListViewModel.cs
Normal file
13
Nebula.Launcher/ViewModels/FavoriteServerListViewModel.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using Nebula.Shared.Models;
|
||||
|
||||
namespace Nebula.Launcher.ViewModels;
|
||||
|
||||
public class FavoriteServerListViewModel : ViewModelBase
|
||||
{
|
||||
public FavoriteServerListViewModel() : base(){}
|
||||
public FavoriteServerListViewModel(IServiceProvider provider) : base(provider){}
|
||||
|
||||
public ObservableCollection<ServerHubInfo> Servers = new();
|
||||
}
|
||||
@@ -13,44 +13,58 @@
|
||||
<viewModels:ContentBrowserViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
<StackPanel Margin="5">
|
||||
<Border BorderThickness="2,0,0,0" CornerRadius="10">
|
||||
<Grid ColumnDefinitions="*,2*,40,40" RowDefinitions="*">
|
||||
<TextBox
|
||||
Margin="0"
|
||||
Text="{Binding ServerText}"
|
||||
VerticalAlignment="Center"
|
||||
Watermark="Server Url..." />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Margin="0"
|
||||
Text="{Binding SearchText}"
|
||||
VerticalAlignment="Center"
|
||||
Watermark="Path..." />
|
||||
<Button
|
||||
Command="{Binding OnBackEnter}"
|
||||
Grid.Column="2"
|
||||
Padding="10">
|
||||
<Image Source="/Assets/back.png" />
|
||||
</Button>
|
||||
<Button
|
||||
Command="{Binding OnGoEnter}"
|
||||
Grid.Column="3"
|
||||
Padding="10">
|
||||
<Image Source="/Assets/go.png" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ScrollViewer Margin="0,5,10,5">
|
||||
<Grid
|
||||
ColumnDefinitions="*,2*,40,40"
|
||||
Margin="10"
|
||||
RowDefinitions="40,*">
|
||||
<Border
|
||||
BorderThickness="2,0,0,0"
|
||||
CornerRadius="10,10,0,0"
|
||||
Grid.ColumnSpan="4" />
|
||||
<TextBox
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Margin="5"
|
||||
Text="{Binding ServerText}"
|
||||
VerticalAlignment="Center"
|
||||
Watermark="Server Url..." />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Margin="5"
|
||||
Text="{Binding SearchText}"
|
||||
VerticalAlignment="Center"
|
||||
Watermark="Path..." />
|
||||
<Button
|
||||
Command="{Binding OnBackEnter}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="0"
|
||||
Padding="10">
|
||||
<Image Source="/Assets/back.png" />
|
||||
</Button>
|
||||
<Button
|
||||
Command="{Binding OnGoEnter}"
|
||||
Grid.Column="3"
|
||||
Grid.Row="0"
|
||||
Padding="10">
|
||||
<Image Source="/Assets/go.png" />
|
||||
</Button>
|
||||
|
||||
<ScrollViewer
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
Grid.Row="1"
|
||||
Margin="0,0,0,5">
|
||||
<ItemsControl
|
||||
Background="#00000000"
|
||||
ItemsSource="{Binding Entries}"
|
||||
Padding="0">
|
||||
Padding="0,0,0,0">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type viewModels:ContentEntry}">
|
||||
<Button
|
||||
Command="{Binding OnPathGo}"
|
||||
CornerRadius="0"
|
||||
Height="30"
|
||||
HorizontalAlignment="Stretch">
|
||||
<StackPanel Orientation="Horizontal" Spacing="15">
|
||||
<Border
|
||||
@@ -63,7 +77,7 @@
|
||||
Source="{Binding IconPath}" />
|
||||
</Border>
|
||||
<Label>
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
<TextBlock Text="{Binding Name}" VerticalAlignment="Center" />
|
||||
</Label>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
@@ -71,5 +85,5 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
11
Nebula.Launcher/Views/Pages/FavoriteServerListView.axaml
Normal file
11
Nebula.Launcher/Views/Pages/FavoriteServerListView.axaml
Normal file
@@ -0,0 +1,11 @@
|
||||
<UserControl
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d"
|
||||
x:Class="Nebula.Launcher.Views.Pages.FavoriteServerListView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
Welcome to Avalonia!
|
||||
</UserControl>
|
||||
13
Nebula.Launcher/Views/Pages/FavoriteServerListView.axaml.cs
Normal file
13
Nebula.Launcher/Views/Pages/FavoriteServerListView.axaml.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Nebula.Launcher.Views.Pages;
|
||||
|
||||
public partial class FavoriteServerListView : UserControl
|
||||
{
|
||||
public FavoriteServerListView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user