From f70680aeb7708b670b3fb20886e89d1b401b969f Mon Sep 17 00:00:00 2001 From: in0finite Date: Sat, 27 Jul 2019 01:34:55 +0200 Subject: [PATCH] better behaviour for some windows with dynamic font size --- Assets/Scripts/UI/JoinGameWindow.cs | 2 +- Assets/Scripts/UI/MapWindow.cs | 4 ++-- Assets/Scripts/UI/StartGameWindow.cs | 2 +- Assets/Scripts/UI/UtilitiesWindow.cs | 3 ++- Docs/TODO.md | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Assets/Scripts/UI/JoinGameWindow.cs b/Assets/Scripts/UI/JoinGameWindow.cs index ad6c70fc..eea06bf4 100644 --- a/Assets/Scripts/UI/JoinGameWindow.cs +++ b/Assets/Scripts/UI/JoinGameWindow.cs @@ -76,7 +76,7 @@ namespace SanAndreasUnity.UI buttonAction = () => {}; } - if (GUILayout.Button(buttonText, GUILayout.MinWidth(80), GUILayout.Height(30), GUILayout.ExpandWidth(false))) + if (GUILayout.Button(buttonText, GUILayout.MinWidth(80), GUILayout.MinHeight(30), GUILayout.ExpandWidth(false))) buttonAction(); } diff --git a/Assets/Scripts/UI/MapWindow.cs b/Assets/Scripts/UI/MapWindow.cs index 75eec4ad..2adca08d 100644 --- a/Assets/Scripts/UI/MapWindow.cs +++ b/Assets/Scripts/UI/MapWindow.cs @@ -529,10 +529,10 @@ namespace SanAndreasUnity.UI { // first row - controls GUILayout.BeginHorizontal (GUILayout.MaxWidth (infoAreaRect.width)); - if (GUILayout.Button ("Focus on player [F]", GUILayout.Height(25))) { + if (GUILayout.Button ("Focus on player [F]", GUILayout.MinHeight(25))) { this.FocusOnPlayer (); } - if (GUILayout.Button ("Teleport to waypoint [T]", GUILayout.Height(25))) { + if (GUILayout.Button ("Teleport to waypoint [T]", GUILayout.MinHeight(25))) { this.TeleportToWaypoint (); } GUILayout.Space (5); diff --git a/Assets/Scripts/UI/StartGameWindow.cs b/Assets/Scripts/UI/StartGameWindow.cs index 58247f3d..06a02818 100644 --- a/Assets/Scripts/UI/StartGameWindow.cs +++ b/Assets/Scripts/UI/StartGameWindow.cs @@ -57,7 +57,7 @@ namespace SanAndreasUnity.UI GUILayout.Space(40); - if (GUILayout.Button("Start", GUILayout.Width(80), GUILayout.Height(30))) + if (GUILayout.Button("Start", GUILayout.MinWidth(80), GUILayout.MinHeight(30), GUILayout.ExpandWidth(false))) StartGame(); } diff --git a/Assets/Scripts/UI/UtilitiesWindow.cs b/Assets/Scripts/UI/UtilitiesWindow.cs index 9d8a8270..6b10dd4e 100644 --- a/Assets/Scripts/UI/UtilitiesWindow.cs +++ b/Assets/Scripts/UI/UtilitiesWindow.cs @@ -22,7 +22,8 @@ namespace SanAndreasUnity.UI { this.RegisterButtonInPauseMenu (); // adjust rect - this.windowRect = new Rect(Screen.width / 2 - 100, 10, 200, 180); + float width = 240; + this.windowRect = new Rect(Screen.width / 2 - width / 2, 10, width, 210); } diff --git a/Docs/TODO.md b/Docs/TODO.md index 962f8d3f..4e1fdfe1 100644 --- a/Docs/TODO.md +++ b/Docs/TODO.md @@ -27,9 +27,9 @@ - Chat -- Android: maybe add "/storage/" as predefined path ; predefined IP address in JoinGame window ? ; +- Android: set font size to 18 ? ; -- Touch input: repeat buttons don't work - cursor locking is probably the cause - don't lock the cursor, only hide it ; ignore mouse move input, and use panel which detects OnDrag event ; wider scrollbars ; +- Touch input: repeat buttons don't work - cursor locking is probably the cause - don't lock the cursor, only hide it ; ignore mouse move input, and use panel which detects OnDrag event ; adapt to dynamic font size: JoinGame, StartGame, main menu, utilities, map, vehicle spawner, ; - Play sounds: horn ; empty weapon slot ; ped damage ; footsteps in run and sprint states ;