(a75fe2e5e) Added: OSX hack for some Macs having a distorted Main Menu on launch
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
class MainMenuScreen : Screen
|
class MainMenuScreen : Screen
|
||||||
{
|
{
|
||||||
public enum Tab { NewGame = 1, LoadGame = 2, HostServer = 3, Settings = 4, Tutorials = 5, JoinServer = 6, CharacterEditor = 7, SubmarineEditor = 8, QuickStartDev = 9, SteamWorkshop = 10, Credits = 11 }
|
public enum Tab { NewGame = 1, LoadGame = 2, HostServer = 3, Settings = 4, Tutorials = 5, JoinServer = 6, CharacterEditor = 7, SubmarineEditor = 8, QuickStartDev = 9, SteamWorkshop = 10, Credits = 11, Empty = 12 }
|
||||||
|
|
||||||
private GUIComponent buttonsParent;
|
private GUIComponent buttonsParent;
|
||||||
|
|
||||||
@@ -37,7 +37,11 @@ namespace Barotrauma
|
|||||||
private GUIComponent titleText;
|
private GUIComponent titleText;
|
||||||
|
|
||||||
private CreditsPlayer creditsPlayer;
|
private CreditsPlayer creditsPlayer;
|
||||||
|
|
||||||
|
#if OSX
|
||||||
|
private bool firstLoadOnMac = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
#region Creation
|
#region Creation
|
||||||
public MainMenuScreen(GameMain game)
|
public MainMenuScreen(GameMain game)
|
||||||
{
|
{
|
||||||
@@ -360,9 +364,9 @@ namespace Barotrauma
|
|||||||
OnClicked = SelectTab
|
OnClicked = SelectTab
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Selection
|
#region Selection
|
||||||
public override void Select()
|
public override void Select()
|
||||||
{
|
{
|
||||||
base.Select();
|
base.Select();
|
||||||
@@ -378,6 +382,25 @@ namespace Barotrauma
|
|||||||
ResetButtonStates(null);
|
ResetButtonStates(null);
|
||||||
|
|
||||||
GameAnalyticsManager.SetCustomDimension01("");
|
GameAnalyticsManager.SetCustomDimension01("");
|
||||||
|
|
||||||
|
#if OSX
|
||||||
|
// Hack for adjusting the viewport properly after splash screens on older Macs
|
||||||
|
if (firstLoadOnMac)
|
||||||
|
{
|
||||||
|
firstLoadOnMac = false;
|
||||||
|
|
||||||
|
menuTabs[(int)Tab.Empty] = new GUIFrame(new RectTransform(new Vector2(1f, 1f), GUI.Canvas), "", Color.Transparent)
|
||||||
|
{
|
||||||
|
CanBeFocused = false
|
||||||
|
};
|
||||||
|
var emptyList = new GUIListBox(new RectTransform(new Vector2(0.0f, 0.0f), menuTabs[(int)Tab.Empty].RectTransform))
|
||||||
|
{
|
||||||
|
CanBeFocused = false
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectTab(null, Tab.Empty);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deselect()
|
public override void Deselect()
|
||||||
|
|||||||
Reference in New Issue
Block a user