From 5f1f524beeed04b719fd8d8dbbbe7e91904b0945 Mon Sep 17 00:00:00 2001 From: MrMaho Date: Sun, 27 Sep 2026 10:31:17 +0200 Subject: [PATCH] Server profile: JOIN button (and name field without Steam) at the top so it never slides out of the window Co-Authored-By: Claude Opus 5.5 --- LobbyUI.cs | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/LobbyUI.cs b/LobbyUI.cs index ce3f456..3a7afb6 100644 --- a/LobbyUI.cs +++ b/LobbyUI.cs @@ -304,12 +304,35 @@ namespace MSCO return; } + // Kopf: Name + Abzeichen links, JOIN (und ohne Steam das Namensfeld) rechts - immer sichtbar, + // egal wie lang Beschreibung und Spielerliste darunter sind + GUILayout.BeginHorizontal(); + GUILayout.BeginVertical(); GUILayout.Label(s.Name, titleStyle); GUILayout.BeginHorizontal(); GUILayout.Label(s.RequireSteam ? "STEAM" : "NON-STEAM", badgeStyle, GUILayout.ExpandWidth(false)); if (s.IsLocal) { GUILayout.Space(10); GUILayout.Label("LOCAL", badgeStyle, GUILayout.ExpandWidth(false)); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); + GUILayout.EndVertical(); + GUILayout.FlexibleSpace(); + GUILayout.BeginVertical(GUILayout.Width(190)); + GUI.enabled = CanJoin(mp, s); + if (GUILayout.Button(s.Players >= s.MaxPlayers ? "SERVER FULL" : "JOIN SERVER", primaryStyle, GUILayout.Height(42), GUILayout.Width(190))) + mp.JoinServer(s.Address, s.Port, s.Name, s.MaxPlayers); + GUI.enabled = true; + if (s.RequireSteam && !mp.SteamAvailable) + GUILayout.Label("This server requires Steam.", textStyle); + else if (!mp.SteamAvailable) + { + GUILayout.Space(4); + GUILayout.BeginHorizontal(); + GUILayout.Label("NAME", captionStyle, GUILayout.Width(42)); + DrawNameField(mp, 140); + GUILayout.EndHorizontal(); + } + GUILayout.EndVertical(); + GUILayout.EndHorizontal(); if (!string.IsNullOrEmpty(s.Description)) GUILayout.Label(s.Description, textStyle); GUILayout.Space(10); @@ -337,20 +360,6 @@ namespace MSCO } GUILayout.FlexibleSpace(); - GUILayout.BeginHorizontal(); - GUI.enabled = CanJoin(mp, s); - if (GUILayout.Button(s.Players >= s.MaxPlayers ? "SERVER FULL" : "JOIN SERVER", primaryStyle, GUILayout.Height(42), GUILayout.Width(190))) - mp.JoinServer(s.Address, s.Port, s.Name, s.MaxPlayers); - GUI.enabled = true; - GUILayout.Space(12); - if (s.RequireSteam && !mp.SteamAvailable) - GUILayout.Label("This server requires Steam.", textStyle); - else if (!mp.SteamAvailable) - { - GUILayout.Label("NAME", captionStyle, GUILayout.Width(42)); - DrawNameField(mp, 150); - } - GUILayout.EndHorizontal(); } /// Kleines abgerundetes Abzeichen, so breit wie sein Text. Gibt die belegte Breite zurück.