diff --git a/Nebula.Launcher/Assets/Style.axaml b/Nebula.Launcher/Assets/Style.axaml index 99c158b..db06416 100644 --- a/Nebula.Launcher/Assets/Style.axaml +++ b/Nebula.Launcher/Assets/Style.axaml @@ -107,10 +107,10 @@ pages|StringUnitConfigControl.ConfigBorder, pages|IntUnitConfigControl.ConfigBorder, pages|FloatUnitConfigControl.ConfigBorder"> - - - - + + + + \ No newline at end of file diff --git a/Nebula.Launcher/Assets/lang/en-US.ftl b/Nebula.Launcher/Assets/lang/en-US.ftl index 2e6b9bb..838d2a5 100644 --- a/Nebula.Launcher/Assets/lang/en-US.ftl +++ b/Nebula.Launcher/Assets/lang/en-US.ftl @@ -45,6 +45,7 @@ filter-roleplay = Roleplay filter-language = Language favorite-add = Add to favorites servername-set = Set server name +servername-clear = Clear server name twofa-enabled = You have two-factor authentication enabled. Please enter the code. twofa-set = Proceed diff --git a/Nebula.Launcher/Assets/lang/ru-RU.ftl b/Nebula.Launcher/Assets/lang/ru-RU.ftl index d79de2e..0fb7b7d 100644 --- a/Nebula.Launcher/Assets/lang/ru-RU.ftl +++ b/Nebula.Launcher/Assets/lang/ru-RU.ftl @@ -45,6 +45,7 @@ filter-roleplay = Ролевая игра filter-language = Язык favorite-add = Добавить в избранное servername-set = Установить имя сервера +servername-clear = Очистить twofa-enabled = У вас включена двухфакторная аутентификация. Введите код. twofa-set = Продолжить diff --git a/Nebula.Launcher/ViewModels/Pages/ServerOverviewModel.cs b/Nebula.Launcher/ViewModels/Pages/ServerOverviewModel.cs index 75de996..9828516 100644 --- a/Nebula.Launcher/ViewModels/Pages/ServerOverviewModel.cs +++ b/Nebula.Launcher/ViewModels/Pages/ServerOverviewModel.cs @@ -28,8 +28,7 @@ public partial class ServerOverviewModel : ViewModelBase [ObservableProperty] private ServerListView _currentServerList = new(); public readonly ServerFilter CurrentFilter = new(); - - public Action? OnSearchChange; + [GenerateProperty] private IServiceProvider ServiceProvider { get; } [GenerateProperty] private ConfigurationService ConfigurationService { get; } [GenerateProperty] private FavoriteServerListProvider FavoriteServerListProvider { get; } @@ -71,13 +70,11 @@ public partial class ServerOverviewModel : ViewModelBase Items = new ObservableCollection(tempItems); SelectedItem = Items[0]; - - OnSearchChange += SearchChangeEvent; } - private void SearchChangeEvent() + partial void OnSearchTextChanged(string value) { - CurrentFilter.SearchText = SearchText; + CurrentFilter.SearchText = value; ApplyFilter(); } diff --git a/Nebula.Launcher/ViewModels/Popup/EditServerNameViewModel.cs b/Nebula.Launcher/ViewModels/Popup/EditServerNameViewModel.cs index 96d15a5..3fe7c1f 100644 --- a/Nebula.Launcher/ViewModels/Popup/EditServerNameViewModel.cs +++ b/Nebula.Launcher/ViewModels/Popup/EditServerNameViewModel.cs @@ -24,8 +24,7 @@ public sealed partial class EditServerNameViewModel : PopupViewModelBase if (string.IsNullOrWhiteSpace(NameInput)) { - RemoveServerName(); - Dispose(); + OnClear(); return; } @@ -33,6 +32,12 @@ public sealed partial class EditServerNameViewModel : PopupViewModelBase Dispose(); } + public void OnClear() + { + RemoveServerName(); + Dispose(); + } + private void AddServerName() { var currentNames = ConfigurationService.GetConfigValue(LauncherConVar.ServerCustomNames)!; diff --git a/Nebula.Launcher/Views/Pages/ServerOverviewView.axaml b/Nebula.Launcher/Views/Pages/ServerOverviewView.axaml index 95b26ab..a160c31 100644 --- a/Nebula.Launcher/Views/Pages/ServerOverviewView.axaml +++ b/Nebula.Launcher/Views/Pages/ServerOverviewView.axaml @@ -71,7 +71,6 @@ + + + diff --git a/Nebula.Runner/App.cs b/Nebula.Runner/App.cs index 73221ad..2248f8e 100644 --- a/Nebula.Runner/App.cs +++ b/Nebula.Runner/App.cs @@ -28,21 +28,14 @@ public sealed class App(RunnerService runnerService, ContentService contentServi var args = new List { - // Pass username to launched client. - // We don't load username from client_config.toml when launched via launcher. "--username", login, - - // Tell game we are launcher "--cvar", "launch.launcher=true" }; var connectionString = url.ToString(); if (!string.IsNullOrEmpty(buildInfo.BuildInfo.ConnectAddress)) connectionString = buildInfo.BuildInfo.ConnectAddress; - - // We are using the launcher. Don't show main menu etc.. - // Note: --launcher also implied --connect. - // For this reason, content bundles do not set --launcher. + args.Add("--launcher"); args.Add("--connect-address"); diff --git a/Nebula.Runner/Services/HarmonyService.cs b/Nebula.Runner/Services/HarmonyService.cs index b769567..691955e 100644 --- a/Nebula.Runner/Services/HarmonyService.cs +++ b/Nebula.Runner/Services/HarmonyService.cs @@ -39,7 +39,6 @@ public class HarmonyService(ReflectionService reflectionService) static bool Prefix() { - // Returning false skips the execution of the original static constructor return false; } } diff --git a/Nebula.Runner/Services/RunnerService.cs b/Nebula.Runner/Services/RunnerService.cs index 9151bb8..3b1d711 100644 --- a/Nebula.Runner/Services/RunnerService.cs +++ b/Nebula.Runner/Services/RunnerService.cs @@ -91,23 +91,18 @@ public static class MetricsEnabledPatcher public static void ApplyPatch(ReflectionService reflectionService, HarmonyService harmonyService) { var harmony = harmonyService.Instance.Harmony; - - // Get the target method: the getter of MetricsEnabled + var targetType = reflectionService.GetType("Robust.Shared.GameObjects.EntitySystemManager"); var targetMethod = targetType.GetProperty("MetricsEnabled").GetGetMethod(); - - // Get MethodInfo for the prefix + var prefix = typeof(MetricsEnabledPatcher).GetMethod(nameof(MetricsEnabledGetterPrefix), BindingFlags.Static | BindingFlags.NonPublic); - - // Create HarmonyMethod + var prefixMethod = new HarmonyMethod(prefix); - - // Patch it! + harmony.Patch(targetMethod, prefix: prefixMethod); } - - // This prefix will override the getter and force return true + private static bool MetricsEnabledGetterPrefix(ref bool __result) { __result = true;