Skip to content

Commit

Permalink
Give 'Server' a custom setter since that's public, and simplify Effec…
Browse files Browse the repository at this point in the history
…tiveServer setter since that's private anyway
  • Loading branch information
RedFlames committed Aug 25, 2024
1 parent 41bae2a commit 711748e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions CelesteNet.Client/CelesteNetClientSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,7 @@ public bool ConnectDefaultVisible {
public string EffectiveServer {
get => ServerOverride.IsNullOrEmpty() ? Server : ServerOverride;
private set {
if (Server == value)
return;

Server = value;

UpdateServerInDialogs();
}
}

Expand All @@ -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.)
Expand Down

0 comments on commit 711748e

Please sign in to comment.