Skip to content

Commit

Permalink
фикс названия сервера в лобби
Browse files Browse the repository at this point in the history
  • Loading branch information
VigersRay committed Oct 31, 2024
1 parent 399ff6e commit cf7ce46
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Content.Client/Lobby/UI/LobbyGui.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public sealed partial class LobbyGui : UIScreen

public string LobbyParallax = "FastSpace"; // Sunrise-edit
public bool ShowParallax; // Sunrise-edit
private string _serverName = string.Empty;
[ViewVariables(VVAccess.ReadWrite)] public Vector2 Offset { get; set; } // Sunrise-edit
public const string DefaultIconExpanded = "/Textures/Interface/Nano/inverted_triangle.svg.png";
public const string DefaultIconCollapsed = "/Textures/Interface/Nano/top_triangle.svg.png";
Expand Down Expand Up @@ -131,18 +132,25 @@ public LobbyGui()

_configurationManager.OnValueChanged(SunriseCCVars.LobbyOpacity, OnLobbyOpacityChanged);
_configurationManager.OnValueChanged(SunriseCCVars.ServersHubEnable, OnServersHubEnableChanged);
_configurationManager.OnValueChanged(SunriseCCVars.InfoLinksDonate, OnServerNameChanged, true);

SetLobbyOpacity(_configurationManager.GetCVar(SunriseCCVars.LobbyOpacity));
SetServersHubEnable(_configurationManager.GetCVar(SunriseCCVars.ServersHubEnable));

Chat.SetChatOpacity();

ServerName.Text = Loc.GetString("ui-lobby-welcome", ("name", _configurationManager.GetCVar(SunriseCCVars.ServerName)));
ServerName.Text = Loc.GetString("ui-lobby-welcome", ("name", _serverName));
LoadIcons();
// Sunrise-end
}

// Sunrise-Start
private void OnServerNameChanged(string serverName)
{
ServerName.Text = Loc.GetString("ui-lobby-welcome", ("name", serverName));
_serverName = serverName;
}

private void LoadIcons()
{
if (!TryGetStyleProperty(StylePropertyIconExpanded, out IconExpanded))
Expand Down

0 comments on commit cf7ce46

Please sign in to comment.