(a88311cf8) Fixed editor disclamer message box links overlapping with OK button
This commit is contained in:
@@ -725,10 +725,11 @@ namespace Barotrauma
|
|||||||
Config.CampaignDisclaimerShown = true;
|
Config.CampaignDisclaimerShown = true;
|
||||||
Config.SaveNewPlayerConfig();
|
Config.SaveNewPlayerConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowEditorDisclaimer()
|
public void ShowEditorDisclaimer()
|
||||||
{
|
{
|
||||||
var msgBox = new GUIMessageBox(TextManager.Get("EditorDisclaimerTitle"), TextManager.Get("EditorDisclaimerText"));
|
var msgBox = new GUIMessageBox(TextManager.Get("EditorDisclaimerTitle"), TextManager.Get("EditorDisclaimerText"));
|
||||||
var linkHolder = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.25f), msgBox.Content.RectTransform)) { Stretch = true, AbsoluteSpacing = 5 };
|
var linkHolder = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.25f), msgBox.Content.RectTransform)) { Stretch = true, RelativeSpacing = 0.025f };
|
||||||
List<Pair<string, string>> links = new List<Pair<string, string>>()
|
List<Pair<string, string>> links = new List<Pair<string, string>>()
|
||||||
{
|
{
|
||||||
new Pair<string, string>(TextManager.Get("EditorDisclaimerWikiLink"),TextManager.Get("EditorDisclaimerWikiUrl")),
|
new Pair<string, string>(TextManager.Get("EditorDisclaimerWikiLink"),TextManager.Get("EditorDisclaimerWikiUrl")),
|
||||||
@@ -737,7 +738,7 @@ namespace Barotrauma
|
|||||||
};
|
};
|
||||||
foreach (var link in links)
|
foreach (var link in links)
|
||||||
{
|
{
|
||||||
new GUIButton(new RectTransform(new Vector2(1.0f, 0.2f), linkHolder.RectTransform), link.First, style: "MainMenuGUIButton")
|
new GUIButton(new RectTransform(new Vector2(1.0f, 0.2f), linkHolder.RectTransform), link.First, style: "MainMenuGUIButton", textAlignment: Alignment.Left)
|
||||||
{
|
{
|
||||||
UserData = link.Second,
|
UserData = link.Second,
|
||||||
OnClicked = (btn, userdata) =>
|
OnClicked = (btn, userdata) =>
|
||||||
@@ -747,9 +748,10 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
msgBox.Text.RectTransform.MaxSize = new Point(int.MaxValue, msgBox.Text.Rect.Height);
|
msgBox.Text.RectTransform.MaxSize = new Point(int.MaxValue, msgBox.Text.Rect.Height);
|
||||||
linkHolder.RectTransform.MaxSize = new Point(int.MaxValue, linkHolder.Rect.Height);
|
linkHolder.RectTransform.MaxSize = new Point(int.MaxValue, linkHolder.Rect.Height);
|
||||||
msgBox.RectTransform.MinSize = new Point(0, msgBox.Rect.Height + linkHolder.Rect.Height + msgBox.Buttons.First().Rect.Height * 2);
|
msgBox.RectTransform.MinSize = new Point(0, msgBox.Rect.Height + linkHolder.Rect.Height + msgBox.Buttons.First().Rect.Height * 8);
|
||||||
Config.EditorDisclaimerShown = true;
|
Config.EditorDisclaimerShown = true;
|
||||||
Config.SaveNewPlayerConfig();
|
Config.SaveNewPlayerConfig();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user