commit bb8997938db89d9989f9048c96afa472158aedf1 Author: Cinka Date: Wed Dec 18 12:37:00 2024 +0300 - init: initial think diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..add57be --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +bin/ +obj/ +/packages/ +riderModule.iml +/_ReSharper.Caches/ \ No newline at end of file diff --git a/.idea/.idea.Nebula/.idea/.gitignore b/.idea/.idea.Nebula/.idea/.gitignore new file mode 100644 index 0000000..76a2d52 --- /dev/null +++ b/.idea/.idea.Nebula/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/modules.xml +/contentModel.xml +/projectSettingsUpdater.xml +/.idea.Nebula.iml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.Nebula/.idea/avalonia.xml b/.idea/.idea.Nebula/.idea/avalonia.xml new file mode 100644 index 0000000..f46dd60 --- /dev/null +++ b/.idea/.idea.Nebula/.idea/avalonia.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Nebula/.idea/indexLayout.xml b/.idea/.idea.Nebula/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.Nebula/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Nebula/.idea/vcs.xml b/.idea/.idea.Nebula/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.Nebula/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Nebula.Launcher/App.axaml b/Nebula.Launcher/App.axaml new file mode 100644 index 0000000..f78de88 --- /dev/null +++ b/Nebula.Launcher/App.axaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Nebula.Launcher/App.axaml.cs b/Nebula.Launcher/App.axaml.cs new file mode 100644 index 0000000..be91370 --- /dev/null +++ b/Nebula.Launcher/App.axaml.cs @@ -0,0 +1,42 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Data.Core; +using Avalonia.Data.Core.Plugins; +using System.Linq; +using Avalonia.Markup.Xaml; +using Nebula.Launcher.ViewModels; +using Nebula.Launcher.Views; + +namespace Nebula.Launcher; + +public partial class App : Application +{ + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + DisableAvaloniaDataAnnotationValidation(); + desktop.MainWindow = new MainWindow(); + } + + base.OnFrameworkInitializationCompleted(); + } + + private void DisableAvaloniaDataAnnotationValidation() + { + // Get an array of plugins to remove + var dataValidationPluginsToRemove = + BindingPlugins.DataValidators.OfType().ToArray(); + + // remove each entry found + foreach (var plugin in dataValidationPluginsToRemove) + { + BindingPlugins.DataValidators.Remove(plugin); + } + } +} \ No newline at end of file diff --git a/Nebula.Launcher/Assets/account.png b/Nebula.Launcher/Assets/account.png new file mode 100644 index 0000000..a83cbdd Binary files /dev/null and b/Nebula.Launcher/Assets/account.png differ diff --git a/Nebula.Launcher/Assets/attribution.txt b/Nebula.Launcher/Assets/attribution.txt new file mode 100644 index 0000000..68b82db --- /dev/null +++ b/Nebula.Launcher/Assets/attribution.txt @@ -0,0 +1,2 @@ +account.png Icon by Icon Desai +list.png Icon by Vector Stall diff --git a/Nebula.Launcher/Assets/avalonia-logo.ico b/Nebula.Launcher/Assets/avalonia-logo.ico new file mode 100644 index 0000000..da8d49f Binary files /dev/null and b/Nebula.Launcher/Assets/avalonia-logo.ico differ diff --git a/Nebula.Launcher/Assets/list.png b/Nebula.Launcher/Assets/list.png new file mode 100644 index 0000000..c127fda Binary files /dev/null and b/Nebula.Launcher/Assets/list.png differ diff --git a/Nebula.Launcher/Nebula.Launcher.csproj b/Nebula.Launcher/Nebula.Launcher.csproj new file mode 100644 index 0000000..2557ae7 --- /dev/null +++ b/Nebula.Launcher/Nebula.Launcher.csproj @@ -0,0 +1,30 @@ + + + WinExe + net8.0 + enable + true + app.manifest + true + + + + + + + + + + + + + + + + + None + All + + + + diff --git a/Nebula.Launcher/Program.cs b/Nebula.Launcher/Program.cs new file mode 100644 index 0000000..5ca638c --- /dev/null +++ b/Nebula.Launcher/Program.cs @@ -0,0 +1,23 @@ +using Avalonia; +using System; +using Avalonia.ReactiveUI; + +namespace Nebula.Launcher; + +sealed class Program +{ + // Initialization code. Don't use any Avalonia, third-party APIs or any + // SynchronizationContext-reliant code before AppMain is called: things aren't initialized + // yet and stuff might break. + [STAThread] + public static void Main(string[] args) => BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UsePlatformDetect() + .WithInterFont() + .UseReactiveUI() + .LogToTrace(); +} \ No newline at end of file diff --git a/Nebula.Launcher/ViewLocator.cs b/Nebula.Launcher/ViewLocator.cs new file mode 100644 index 0000000..91d6a95 --- /dev/null +++ b/Nebula.Launcher/ViewLocator.cs @@ -0,0 +1,30 @@ +using System; +using Avalonia.Controls; +using Avalonia.Controls.Templates; +using Nebula.Launcher.ViewModels; + +namespace Nebula.Launcher; + +public class ViewLocator : IDataTemplate +{ + public Control? Build(object? param) + { + if (param is null) + return null; + + var name = param.GetType().FullName!.Replace("ViewModel", "View", StringComparison.Ordinal); + var type = Type.GetType(name); + + if (type != null) + { + return (Control)Activator.CreateInstance(type)!; + } + + return new TextBlock { Text = "Not Found: " + name }; + } + + public bool Match(object? data) + { + return data is ViewModelBase; + } +} \ No newline at end of file diff --git a/Nebula.Launcher/ViewModels/TestViewModel.cs b/Nebula.Launcher/ViewModels/TestViewModel.cs new file mode 100644 index 0000000..9556325 --- /dev/null +++ b/Nebula.Launcher/ViewModels/TestViewModel.cs @@ -0,0 +1,21 @@ +using System; +using ReactiveUI; + +namespace Nebula.Launcher.ViewModels; + +public sealed class TestViewModel : ViewModelBase +{ + private string _greeting = "Welcome to Avalonia!"; + + public string Greeting + { + get => _greeting; + set => this.RaiseAndSetIfChanged(ref _greeting, value); + } + + public void ButtonAction() + { + Console.WriteLine("HAS"); + Greeting = "Another greeting from Avalonia"; + } +} \ No newline at end of file diff --git a/Nebula.Launcher/ViewModels/ViewModelBase.cs b/Nebula.Launcher/ViewModels/ViewModelBase.cs new file mode 100644 index 0000000..2dbe305 --- /dev/null +++ b/Nebula.Launcher/ViewModels/ViewModelBase.cs @@ -0,0 +1,7 @@ +using ReactiveUI; + +namespace Nebula.Launcher.ViewModels; + +public abstract class ViewModelBase : ReactiveObject +{ +} \ No newline at end of file diff --git a/Nebula.Launcher/Views/MainWindow.axaml b/Nebula.Launcher/Views/MainWindow.axaml new file mode 100644 index 0000000..636070e --- /dev/null +++ b/Nebula.Launcher/Views/MainWindow.axaml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + Site: ssilka | Discord: lala + v1.5 + + + + + diff --git a/Nebula.Launcher/Views/MainWindow.axaml.cs b/Nebula.Launcher/Views/MainWindow.axaml.cs new file mode 100644 index 0000000..0c12e8f --- /dev/null +++ b/Nebula.Launcher/Views/MainWindow.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.Controls; + +namespace Nebula.Launcher.Views; + +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Nebula.Launcher/Views/ServerContainer.axaml b/Nebula.Launcher/Views/ServerContainer.axaml new file mode 100644 index 0000000..0a1e562 --- /dev/null +++ b/Nebula.Launcher/Views/ServerContainer.axaml @@ -0,0 +1,36 @@ + + + + Server name + + + 15/15 + + + + + + + + + + + + + + diff --git a/Nebula.Launcher/Views/ServerContainer.axaml.cs b/Nebula.Launcher/Views/ServerContainer.axaml.cs new file mode 100644 index 0000000..48c1acb --- /dev/null +++ b/Nebula.Launcher/Views/ServerContainer.axaml.cs @@ -0,0 +1,13 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace Nebula.Launcher.Views; + +public partial class ServerContainer : UserControl +{ + public ServerContainer() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Nebula.Launcher/Views/ServerList.axaml b/Nebula.Launcher/Views/ServerList.axaml new file mode 100644 index 0000000..c707c07 --- /dev/null +++ b/Nebula.Launcher/Views/ServerList.axaml @@ -0,0 +1,17 @@ + + + + + + + + + + + diff --git a/Nebula.Launcher/Views/ServerList.axaml.cs b/Nebula.Launcher/Views/ServerList.axaml.cs new file mode 100644 index 0000000..459939e --- /dev/null +++ b/Nebula.Launcher/Views/ServerList.axaml.cs @@ -0,0 +1,13 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace Nebula.Launcher.Views; + +public partial class ServerList : UserControl +{ + public ServerList() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Nebula.Launcher/app.manifest b/Nebula.Launcher/app.manifest new file mode 100644 index 0000000..c10c4bf --- /dev/null +++ b/Nebula.Launcher/app.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/Nebula.sln b/Nebula.sln new file mode 100644 index 0000000..a80f9b9 --- /dev/null +++ b/Nebula.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nebula.Launcher", "Nebula.Launcher\Nebula.Launcher.csproj", "{D8F9728D-6153-4351-8BE2-52F7D54C299D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D8F9728D-6153-4351-8BE2-52F7D54C299D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D8F9728D-6153-4351-8BE2-52F7D54C299D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D8F9728D-6153-4351-8BE2-52F7D54C299D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D8F9728D-6153-4351-8BE2-52F7D54C299D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal