From 711748ef402118ac7c77884c22ae5615ca346b5c Mon Sep 17 00:00:00 2001 From: RedFlames Date: Sun, 25 Aug 2024 16:32:47 +0200 Subject: [PATCH] Give 'Server' a custom setter since that's public, and simplify EffectiveServer setter since that's private anyway --- CelesteNet.Client/CelesteNetClientSettings.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/CelesteNet.Client/CelesteNetClientSettings.cs b/CelesteNet.Client/CelesteNetClientSettings.cs index 2eeef944..7bf29f84 100644 --- a/CelesteNet.Client/CelesteNetClientSettings.cs +++ b/CelesteNet.Client/CelesteNetClientSettings.cs @@ -102,12 +102,7 @@ public bool ConnectDefaultVisible { public string EffectiveServer { get => ServerOverride.IsNullOrEmpty() ? Server : ServerOverride; private set { - if (Server == value) - return; - Server = value; - - UpdateServerInDialogs(); } } @@ -117,7 +112,18 @@ private set { [SettingIgnore] #endif [SettingSubText("modoptions_celestenetclient_devonlyhint")] - public string Server { get; set; } = DefaultServer; + public string Server { + get => _Server; + set { + if (_Server == value) + return; + + _Server = value; + + UpdateServerInDialogs(); + } + } + private string _Server = DefaultServer; // Any non-empty string will override Server property temporarily. (setting not saved) // Currently only used for "connect locally" button (for Nucleus etc.)