StartGame and JoinGame windows better behave with different font sizes

This commit is contained in:
in0finite 2019-07-28 19:40:28 +02:00
parent 46d9529277
commit d58482d524
2 changed files with 13 additions and 5 deletions

View file

@ -44,7 +44,12 @@ namespace SanAndreasUnity.UI
GUILayout.Label ("Port:"); GUILayout.Label ("Port:");
m_portStr = GUILayout.TextField(m_portStr, GUILayout.Width(100)); m_portStr = GUILayout.TextField(m_portStr, GUILayout.Width(100));
GUILayout.Space(40); }
protected override void OnWindowGUIAfterContent()
{
GUILayout.Space(40);
// label with status // label with status
string strStatus = "Disconnected"; string strStatus = "Disconnected";
@ -76,7 +81,7 @@ namespace SanAndreasUnity.UI
buttonAction = () => {}; buttonAction = () => {};
} }
if (GUILayout.Button(buttonText, GUILayout.MinWidth(80), GUILayout.MinHeight(30), GUILayout.ExpandWidth(false))) if (GUIUtils.ButtonWithCalculatedSize(buttonText))
buttonAction(); buttonAction();
} }

View file

@ -55,11 +55,14 @@ namespace SanAndreasUnity.UI
GUILayout.Label("Map:"); GUILayout.Label("Map:");
m_selectedSceneIndex = GUILayout.SelectionGrid(m_selectedSceneIndex, m_availableScenes, 4); 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(); StartGame();
} }
void StartGame() void StartGame()