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 <noreply@anthropic.com>
This commit is contained in:
+23
-14
@@ -304,12 +304,35 @@ namespace MSCO
|
|||||||
return;
|
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.Label(s.Name, titleStyle);
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
GUILayout.Label(s.RequireSteam ? "STEAM" : "NON-STEAM", badgeStyle, GUILayout.ExpandWidth(false));
|
GUILayout.Label(s.RequireSteam ? "STEAM" : "NON-STEAM", badgeStyle, GUILayout.ExpandWidth(false));
|
||||||
if (s.IsLocal) { GUILayout.Space(10); GUILayout.Label("LOCAL", badgeStyle, GUILayout.ExpandWidth(false)); }
|
if (s.IsLocal) { GUILayout.Space(10); GUILayout.Label("LOCAL", badgeStyle, GUILayout.ExpandWidth(false)); }
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
GUILayout.EndHorizontal();
|
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);
|
if (!string.IsNullOrEmpty(s.Description)) GUILayout.Label(s.Description, textStyle);
|
||||||
GUILayout.Space(10);
|
GUILayout.Space(10);
|
||||||
|
|
||||||
@@ -337,20 +360,6 @@ namespace MSCO
|
|||||||
}
|
}
|
||||||
|
|
||||||
GUILayout.FlexibleSpace();
|
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Kleines abgerundetes Abzeichen, so breit wie sein Text. Gibt die belegte Breite zurück.</summary>
|
/// <summary>Kleines abgerundetes Abzeichen, so breit wie sein Text. Gibt die belegte Breite zurück.</summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user