Fixed issue with the multiplayer ui on small screens not being fully to the right side

This commit is contained in:
Twirlbug 2023-07-04 19:47:48 -05:00
parent b9489f4bb4
commit 528395d102

View file

@ -63,6 +63,11 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI>
{ {
base.Awake(); base.Awake();
//set default ui location width adapting numbers for smaller resolutions
float width = 300;
if (Screen.width / 4 < width) width = Screen.width / 4;
windowRect = new Rect(Screen.width - width - 20, 20, width, 500);
Globals.Username = PlayerPrefs.GetString("SRMP_Username", ""); Globals.Username = PlayerPrefs.GetString("SRMP_Username", "");
ipaddress = PlayerPrefs.GetString("SRMP_IP", "localhost"); ipaddress = PlayerPrefs.GetString("SRMP_IP", "localhost");
port = PlayerPrefs.GetString("SRMP_Port", "16500"); port = PlayerPrefs.GetString("SRMP_Port", "16500");