From a4751485432165f03f39e7435a26275ec0646e80 Mon Sep 17 00:00:00 2001 From: Cinka Date: Sun, 13 Jul 2025 10:07:36 +0300 Subject: [PATCH] - tweak: a little bit of repair and tweaks --- Nebula.Launcher/LauncherConVar.cs | 2 +- Nebula.Launcher/ProcessHelper/GameRunnerPreparer.cs | 2 +- Nebula.Launcher/Services/LocalisationService.cs | 4 +++- Nebula.Launcher/ViewModels/Pages/ConfigurationViewModel.cs | 5 ++--- Nebula.Runner/Program.cs | 1 - .../{Services => }/ConfigMigrations/ProfileMigration.cs | 3 ++- 6 files changed, 9 insertions(+), 8 deletions(-) rename Nebula.Shared/{Services => }/ConfigMigrations/ProfileMigration.cs (95%) diff --git a/Nebula.Launcher/LauncherConVar.cs b/Nebula.Launcher/LauncherConVar.cs index afd9a61..3137dec 100644 --- a/Nebula.Launcher/LauncherConVar.cs +++ b/Nebula.Launcher/LauncherConVar.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.Globalization; using Nebula.Launcher.Models; using Nebula.Launcher.Models.Auth; +using Nebula.Shared.ConfigMigrations; using Nebula.Shared.Services; -using Nebula.Shared.Services.ConfigMigrations; namespace Nebula.Launcher; diff --git a/Nebula.Launcher/ProcessHelper/GameRunnerPreparer.cs b/Nebula.Launcher/ProcessHelper/GameRunnerPreparer.cs index 73c423f..e3dd663 100644 --- a/Nebula.Launcher/ProcessHelper/GameRunnerPreparer.cs +++ b/Nebula.Launcher/ProcessHelper/GameRunnerPreparer.cs @@ -9,7 +9,7 @@ using Nebula.Shared.Services; namespace Nebula.Launcher.ProcessHelper; [ServiceRegister] -public sealed class GameRunnerPreparer(IServiceProvider provider, ContentService contentService, EngineService engineService, DebugService debugService) +public sealed class GameRunnerPreparer(IServiceProvider provider, ContentService contentService, EngineService engineService) { public async Task> GetGameProcessStartInfoProvider(RobustUrl address, ILoadingHandler loadingHandler, CancellationToken cancellationToken = default) { diff --git a/Nebula.Launcher/Services/LocalisationService.cs b/Nebula.Launcher/Services/LocalisationService.cs index 2febf37..36e32b4 100644 --- a/Nebula.Launcher/Services/LocalisationService.cs +++ b/Nebula.Launcher/Services/LocalisationService.cs @@ -14,7 +14,8 @@ namespace Nebula.Launcher.Services; public partial class LocalisationService { [GenerateProperty] private ConfigurationService ConfigurationService { get; } - + [GenerateProperty] private DebugService DebugService { get; } + private CultureInfo _currentCultureInfo = CultureInfo.CurrentCulture; private static MessageContext? _currentMessageContext; @@ -42,6 +43,7 @@ public partial class LocalisationService _currentMessageContext = mc; } catch (Exception e) { + DebugService.GetLogger("localisationService").Error(e); LoadLanguage(CultureInfo.GetCultureInfo("en-US")); } } diff --git a/Nebula.Launcher/ViewModels/Pages/ConfigurationViewModel.cs b/Nebula.Launcher/ViewModels/Pages/ConfigurationViewModel.cs index 0300285..9da50d1 100644 --- a/Nebula.Launcher/ViewModels/Pages/ConfigurationViewModel.cs +++ b/Nebula.Launcher/ViewModels/Pages/ConfigurationViewModel.cs @@ -7,7 +7,6 @@ using System.IO; using System.IO.Compression; using System.Linq; using System.Reflection; -using System.Threading; using System.Threading.Tasks; using Avalonia; using Avalonia.Controls; @@ -195,7 +194,7 @@ public sealed class ComplexUnitConfigControl : Border, IConfigControl var propValue = propInfo.GetValue(value); - var control = ConfigControlHelper.GetConfigControl(propInfo.Name, propValue); + var control = ConfigControlHelper.GetConfigControl(propInfo.Name, propValue!); ((Control)control).Margin = new Thickness(5); _panel.Children.Add((Control)control); @@ -211,7 +210,7 @@ public sealed class ComplexUnitConfigControl : Border, IConfigControl fieldInfo.SetValue(obj, configControl.GetValue()); } - return obj; + return obj!; } } diff --git a/Nebula.Runner/Program.cs b/Nebula.Runner/Program.cs index f27b07f..14be293 100644 --- a/Nebula.Runner/Program.cs +++ b/Nebula.Runner/Program.cs @@ -1,6 +1,5 @@ using Microsoft.Extensions.DependencyInjection; using Nebula.Shared; -using Nebula.Shared.Services; namespace Nebula.Runner; diff --git a/Nebula.Shared/Services/ConfigMigrations/ProfileMigration.cs b/Nebula.Shared/ConfigMigrations/ProfileMigration.cs similarity index 95% rename from Nebula.Shared/Services/ConfigMigrations/ProfileMigration.cs rename to Nebula.Shared/ConfigMigrations/ProfileMigration.cs index 88ba322..63cba0f 100644 --- a/Nebula.Shared/Services/ConfigMigrations/ProfileMigration.cs +++ b/Nebula.Shared/ConfigMigrations/ProfileMigration.cs @@ -1,7 +1,8 @@ using Microsoft.Extensions.DependencyInjection; using Nebula.Shared.Models; +using Nebula.Shared.Services; -namespace Nebula.Shared.Services.ConfigMigrations; +namespace Nebula.Shared.ConfigMigrations; public class ProfileMigrationV2(string oldName, string newName) : BaseConfigurationMigration(oldName, newName)