diff --git a/Assets/Scripts/UI/JoinGameWindow.cs b/Assets/Scripts/UI/JoinGameWindow.cs index eea06bf4..569a7e60 100644 --- a/Assets/Scripts/UI/JoinGameWindow.cs +++ b/Assets/Scripts/UI/JoinGameWindow.cs @@ -44,7 +44,12 @@ namespace SanAndreasUnity.UI GUILayout.Label ("Port:"); m_portStr = GUILayout.TextField(m_portStr, GUILayout.Width(100)); - GUILayout.Space(40); + } + + protected override void OnWindowGUIAfterContent() + { + + GUILayout.Space(40); // label with status string strStatus = "Disconnected"; @@ -76,7 +81,7 @@ namespace SanAndreasUnity.UI buttonAction = () => {}; } - if (GUILayout.Button(buttonText, GUILayout.MinWidth(80), GUILayout.MinHeight(30), GUILayout.ExpandWidth(false))) + if (GUIUtils.ButtonWithCalculatedSize(buttonText)) buttonAction(); } diff --git a/Assets/Scripts/UI/StartGameWindow.cs b/Assets/Scripts/UI/StartGameWindow.cs index 06a02818..e7f8108d 100644 --- a/Assets/Scripts/UI/StartGameWindow.cs +++ b/Assets/Scripts/UI/StartGameWindow.cs @@ -55,11 +55,14 @@ namespace SanAndreasUnity.UI GUILayout.Label("Map:"); m_selectedSceneIndex = GUILayout.SelectionGrid(m_selectedSceneIndex, m_availableScenes, 4); - GUILayout.Space(40); + } - if (GUILayout.Button("Start", GUILayout.MinWidth(80), GUILayout.MinHeight(30), GUILayout.ExpandWidth(false))) + protected override void OnWindowGUIAfterContent() + { + GUILayout.Space(40); + + if (GUIUtils.ButtonWithCalculatedSize("Start")) StartGame(); - } void StartGame()