(9253f5b70) Added libvlc.so to LinuxClient
This commit is contained in:
@@ -279,7 +279,7 @@ namespace Barotrauma
|
||||
if (text[i] == '\n')
|
||||
{
|
||||
currentLineX = 0.0f;
|
||||
retVal.Y += baseHeight * 1.8f;
|
||||
retVal.Y += baseHeight * 18 / 10;
|
||||
continue;
|
||||
}
|
||||
uint charIndex = text[i];
|
||||
|
||||
@@ -41,22 +41,33 @@ namespace Barotrauma
|
||||
InnerFrame = new GUIFrame(new RectTransform(new Point(width, height), RectTransform, Anchor.Center) { IsFixedSize = false }, style: null);
|
||||
GUI.Style.Apply(InnerFrame, "", this);
|
||||
|
||||
InnerFrame = new GUIFrame(new RectTransform(new Point(width, height), RectTransform, Anchor.Center) { IsFixedSize = false }, style: null);
|
||||
GUI.Style.Apply(InnerFrame, "", this);
|
||||
|
||||
Content = new GUILayoutGroup(new RectTransform(new Vector2(0.9f, 0.85f), InnerFrame.RectTransform, Anchor.Center)) { AbsoluteSpacing = 5 };
|
||||
Tag = tag;
|
||||
|
||||
|
||||
if (height == 0)
|
||||
{
|
||||
string wrappedText = ToolBox.WrapText(text, Content.Rect.Width, GUI.Font);
|
||||
string[] lines = wrappedText.Split('\n');
|
||||
foreach (string line in lines)
|
||||
{
|
||||
height += (int)GUI.Font.MeasureString(line).Y;
|
||||
}
|
||||
height += string.IsNullOrWhiteSpace(headerText) ? 220 : 220 - headerHeight;
|
||||
}
|
||||
InnerFrame.RectTransform.NonScaledSize = new Point(InnerFrame.Rect.Width, height);
|
||||
|
||||
Header = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), Content.RectTransform),
|
||||
headerText, textAlignment: Alignment.Center, wrap: true);
|
||||
GUI.Style.Apply(Header, "", this);
|
||||
Header.RectTransform.MinSize = new Point(0, Header.Rect.Height);
|
||||
GUI.Style.Apply(Header, "", this);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(text))
|
||||
if (height == 0)
|
||||
{
|
||||
Text = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), Content.RectTransform),
|
||||
text, textAlignment: textAlignment, wrap: true);
|
||||
GUI.Style.Apply(Text, "", this);
|
||||
Text.RectTransform.NonScaledSize = Text.RectTransform.MinSize = Text.RectTransform.MaxSize =
|
||||
new Point(Text.Rect.Width, Text.Rect.Height);
|
||||
Text.RectTransform.IsFixedSize = true;
|
||||
}
|
||||
|
||||
var buttonContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.15f), Content.RectTransform, Anchor.BottomCenter, maxSize: new Point(1000, 50)),
|
||||
@@ -65,22 +76,7 @@ namespace Barotrauma
|
||||
AbsoluteSpacing = 5,
|
||||
IgnoreLayoutGroups = true
|
||||
};
|
||||
buttonContainer.RectTransform.NonScaledSize = buttonContainer.RectTransform.MinSize = buttonContainer.RectTransform.MaxSize =
|
||||
new Point(buttonContainer.Rect.Width, (int)(30 * GUI.Scale));
|
||||
buttonContainer.RectTransform.IsFixedSize = true;
|
||||
|
||||
if (height == 0)
|
||||
{
|
||||
height += Header.Rect.Height + Content.AbsoluteSpacing;
|
||||
height += (Text == null ? 0 : Text.Rect.Height) + Content.AbsoluteSpacing;
|
||||
height += buttonContainer.Rect.Height;
|
||||
|
||||
InnerFrame.RectTransform.NonScaledSize =
|
||||
new Point(InnerFrame.Rect.Width, (int)Math.Max(height / Content.RectTransform.RelativeSize.Y, height + 50));
|
||||
Content.RectTransform.NonScaledSize =
|
||||
new Point(Content.Rect.Width, height);
|
||||
}
|
||||
|
||||
|
||||
Buttons = new List<GUIButton>(buttons.Length);
|
||||
for (int i = 0; i < buttons.Length; i++)
|
||||
{
|
||||
|
||||
@@ -717,7 +717,7 @@ namespace Barotrauma
|
||||
PerformanceCounter.DrawTimeGraph.Update(sw.ElapsedTicks / (float)TimeSpan.TicksPerMillisecond);
|
||||
}
|
||||
|
||||
public void ShowCampaignDisclaimer(Action onContinue)
|
||||
public void ShowCampaignDisclaimer()
|
||||
{
|
||||
var msgBox = new GUIMessageBox(TextManager.Get("CampaignDisclaimerTitle"), TextManager.Get("CampaignDisclaimerText"),
|
||||
new string[] { TextManager.Get("CampaignRoadMapTitle"), TextManager.Get("OK") });
|
||||
@@ -726,15 +726,13 @@ namespace Barotrauma
|
||||
{
|
||||
var roadMap = new GUIMessageBox(TextManager.Get("CampaignRoadMapTitle"), TextManager.Get("CampaignRoadMapText"),
|
||||
new string[] { TextManager.Get("Back"), TextManager.Get("OK") });
|
||||
roadMap.Buttons[0].OnClicked = (_, __) => { ShowCampaignDisclaimer(); return true; };
|
||||
roadMap.Buttons[0].OnClicked += roadMap.Close;
|
||||
roadMap.Buttons[0].OnClicked += (_, __) => { ShowCampaignDisclaimer(onContinue); return true; };
|
||||
roadMap.Buttons[1].OnClicked += roadMap.Close;
|
||||
roadMap.Buttons[1].OnClicked += (_, __) => { onContinue?.Invoke(); return true; };
|
||||
return true;
|
||||
};
|
||||
msgBox.Buttons[0].OnClicked += msgBox.Close;
|
||||
msgBox.Buttons[1].OnClicked += msgBox.Close;
|
||||
msgBox.Buttons[1].OnClicked += (_, __) => { onContinue?.Invoke(); return true; };
|
||||
|
||||
Config.CampaignDisclaimerShown = true;
|
||||
Config.SaveNewPlayerConfig();
|
||||
@@ -744,13 +742,12 @@ namespace Barotrauma
|
||||
{
|
||||
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, RelativeSpacing = 0.025f };
|
||||
linkHolder.RectTransform.MaxSize = new Point(int.MaxValue, linkHolder.Rect.Height);
|
||||
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("EditorDisclaimerDiscordLink"),TextManager.Get("EditorDisclaimerDiscordUrl")),
|
||||
new Pair<string, string>(TextManager.Get("EditorDisclaimerForumLink"),TextManager.Get("EditorDisclaimerForumUrl")),
|
||||
};
|
||||
{
|
||||
new Pair<string, string>(TextManager.Get("EditorDisclaimerWikiLink"),TextManager.Get("EditorDisclaimerWikiUrl")),
|
||||
new Pair<string, string>(TextManager.Get("EditorDisclaimerDiscordLink"),TextManager.Get("EditorDisclaimerDiscordUrl")),
|
||||
new Pair<string, string>(TextManager.Get("EditorDisclaimerForumLink"),TextManager.Get("EditorDisclaimerForumUrl")),
|
||||
};
|
||||
foreach (var link in links)
|
||||
{
|
||||
new GUIButton(new RectTransform(new Vector2(1.0f, 0.2f), linkHolder.RectTransform), link.First, style: "MainMenuGUIButton", textAlignment: Alignment.Left)
|
||||
@@ -770,6 +767,19 @@ namespace Barotrauma
|
||||
Config.SaveNewPlayerConfig();
|
||||
}
|
||||
|
||||
// ToDo: Move texts/links to localization, when possible.
|
||||
public void ShowBugReporter()
|
||||
{
|
||||
var msgBox = new GUIMessageBox("", "");
|
||||
var linkHolder = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.5f), msgBox.Content.RectTransform)) { Stretch = true, RelativeSpacing = 0.05f };
|
||||
|
||||
msgBox.Text.RectTransform.MaxSize = new Point(int.MaxValue, msgBox.Text.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 * 8);
|
||||
Config.EditorDisclaimerShown = true;
|
||||
Config.SaveNewPlayerConfig();
|
||||
}
|
||||
|
||||
// ToDo: Move texts/links to localization, when possible.
|
||||
public void ShowBugReporter()
|
||||
{
|
||||
|
||||
@@ -382,12 +382,14 @@ namespace Barotrauma.Tutorials
|
||||
};
|
||||
|
||||
string objectiveText = TextManager.ParseInputTypes(objectiveTranslated);
|
||||
int yOffset = (int)((GUI.ObjectiveNameFont.MeasureString(objectiveText).Y / 2f + 5));
|
||||
int yOffset = (int)((GUI.ObjectiveNameFont.MeasureString(objectiveText).Y / 2f + 5) * GUI.Scale);
|
||||
segment.LinkedTitle = new GUITextBlock(new RectTransform(new Point((int)GUI.ObjectiveNameFont.MeasureString(objectiveText).X, yOffset), segment.ReplayButton.RectTransform, Anchor.CenterRight, Pivot.BottomRight) { AbsoluteOffset = new Point((int)(-10 * GUI.Scale), 0) },
|
||||
objectiveText, textColor: Color.White, font: GUI.ObjectiveTitleFont, textAlignment: Alignment.CenterRight);
|
||||
segment.LinkedText = new GUITextBlock(new RectTransform(new Point(replayButtonSize.X, yOffset), segment.ReplayButton.RectTransform, Anchor.Center, Pivot.TopCenter) { AbsoluteOffset = new Point((int)(10 * GUI.Scale), 0) },
|
||||
TextManager.ParseInputTypes(segment.Objective), textColor: new Color(4, 180, 108), font: GUI.ObjectiveNameFont, textAlignment: Alignment.CenterRight);
|
||||
|
||||
|
||||
segment.LinkedTitle.TextScale = segment.LinkedText.TextScale = GUI.Scale;
|
||||
|
||||
segment.LinkedTitle.Color = segment.LinkedTitle.HoverColor = segment.LinkedTitle.PressedColor = segment.LinkedTitle.SelectedColor = Color.Transparent;
|
||||
segment.LinkedText.Color = segment.LinkedText.HoverColor = segment.LinkedText.PressedColor = segment.LinkedText.SelectedColor = Color.Transparent;
|
||||
segment.ReplayButton.Color = segment.ReplayButton.HoverColor = segment.ReplayButton.PressedColor = segment.ReplayButton.SelectedColor = Color.Transparent;
|
||||
@@ -482,10 +484,11 @@ namespace Barotrauma.Tutorials
|
||||
protected GUIComponent CreateInfoFrame(string title, string text, int width = 300, int height = 80, string anchorStr = "", bool hasButton = false, Action callback = null, Action showVideo = null)
|
||||
{
|
||||
if (hasButton) height += 60;
|
||||
|
||||
string wrappedText = ToolBox.WrapText(text, width, GUI.Font);
|
||||
|
||||
height += (int)(GUI.Font.MeasureString(wrappedText).Y + 50);
|
||||
float textScale = GUI.Scale;
|
||||
string wrappedText = ToolBox.WrapText(text, width, GUI.Font, textScale);
|
||||
|
||||
height += (int)(GUI.Font.MeasureString(wrappedText).Y * textScale + 50);
|
||||
if (title.Length > 0)
|
||||
{
|
||||
height += 35;
|
||||
@@ -506,18 +509,17 @@ namespace Barotrauma.Tutorials
|
||||
var infoContent = new GUILayoutGroup(new RectTransform(new Vector2(0.9f, 0.8f), infoBlock.RectTransform, Anchor.Center))
|
||||
{
|
||||
Stretch = true,
|
||||
AbsoluteSpacing = 5
|
||||
RelativeSpacing = 0.02f
|
||||
};
|
||||
|
||||
if (title.Length > 0)
|
||||
{
|
||||
var titleBlock = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), infoContent.RectTransform),
|
||||
var titleBlock = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.3f), infoContent.RectTransform),
|
||||
title, font: GUI.VideoTitleFont, textAlignment: Alignment.Center, textColor: new Color(253, 174, 0));
|
||||
titleBlock.RectTransform.IsFixedSize = true;
|
||||
titleBlock.TextScale = textScale;
|
||||
}
|
||||
|
||||
var textBlock = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), infoContent.RectTransform), text, wrap: true);
|
||||
textBlock.RectTransform.IsFixedSize = true;
|
||||
var textBlock = new GUITextBlock(new RectTransform(new Vector2(1.0f, 1.0f), infoContent.RectTransform), text, wrap: true);
|
||||
|
||||
infoBoxClosedCallback = callback;
|
||||
|
||||
@@ -528,7 +530,6 @@ namespace Barotrauma.Tutorials
|
||||
Stretch = true,
|
||||
RelativeSpacing = 0.1f
|
||||
};
|
||||
buttonContainer.RectTransform.IsFixedSize = true;
|
||||
|
||||
if (showVideo != null)
|
||||
{
|
||||
@@ -550,8 +551,6 @@ namespace Barotrauma.Tutorials
|
||||
};
|
||||
}
|
||||
|
||||
infoBlock.RectTransform.NonScaledSize = new Point(infoBlock.Rect.Width, (int)(infoContent.Children.Sum(c => c.Rect.Height + infoContent.AbsoluteSpacing) / infoContent.RectTransform.RelativeSize.Y));
|
||||
|
||||
GUI.PlayUISound(GUISoundType.UIMessage);
|
||||
|
||||
return background;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Barotrauma
|
||||
drawRect = new Rectangle(
|
||||
(int)(drawRect.X * scale) + drawArea.Center.X, -((int)((drawRect.Y - drawRect.Height) * scale) + drawArea.Center.Y),
|
||||
(int)(drawRect.Width * scale), (int)(drawRect.Height * scale));
|
||||
entity.First.DrawPlacing(spriteBatch, drawRect, entity.First.Scale * scale);
|
||||
entity.First.DrawPlacing(spriteBatch, drawRect, scale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Barotrauma
|
||||
{
|
||||
Rectangle drawRect = entity.Second;
|
||||
drawRect.Location += Submarine.MouseToWorldGrid(cam, Submarine.MainSub).ToPoint();
|
||||
entity.First.DrawPlacing(spriteBatch, drawRect, entity.First.Scale);
|
||||
entity.First.DrawPlacing(spriteBatch, drawRect);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -397,12 +397,6 @@ namespace Barotrauma
|
||||
switch (selectedTab)
|
||||
{
|
||||
case Tab.NewGame:
|
||||
if (!GameMain.Config.CampaignDisclaimerShown)
|
||||
{
|
||||
selectedTab = 0;
|
||||
GameMain.Instance.ShowCampaignDisclaimer(() => { SelectTab(null, Tab.NewGame); });
|
||||
return true;
|
||||
}
|
||||
campaignSetupUI.CreateDefaultSaveName();
|
||||
campaignSetupUI.RandomizeSeed();
|
||||
campaignSetupUI.UpdateSubList(Submarine.SavedSubmarines);
|
||||
@@ -421,12 +415,6 @@ namespace Barotrauma
|
||||
case Tab.HostServer:
|
||||
break;
|
||||
case Tab.Tutorials:
|
||||
if (!GameMain.Config.CampaignDisclaimerShown)
|
||||
{
|
||||
selectedTab = 0;
|
||||
GameMain.Instance.ShowCampaignDisclaimer(() => { SelectTab(null, Tab.Tutorials); });
|
||||
return true;
|
||||
}
|
||||
UpdateTutorialList();
|
||||
break;
|
||||
case Tab.CharacterEditor:
|
||||
|
||||
Reference in New Issue
Block a user