(909dcf05d) Merge branch 'dev' of https://github.com/Regalis11/Barotrauma-development into dev

This commit is contained in:
Joonas Rikkonen
2019-05-07 18:05:33 +03:00
parent 427526aba2
commit b83302408f
3 changed files with 9 additions and 8 deletions
@@ -141,7 +141,7 @@ namespace Barotrauma
} }
currentVideo = CreateVideo(scaledVideoResolution); currentVideo = CreateVideo(scaledVideoResolution);
title.Text = TextManager.Get(contentId); title.Text = textSettings != null ? TextManager.Get(contentId) : string.Empty;
textContent.Text = textSettings != null ? textSettings.Text : string.Empty; textContent.Text = textSettings != null ? textSettings.Text : string.Empty;
objectiveText.Text = objective; objectiveText.Text = objective;
@@ -305,7 +305,7 @@ namespace Barotrauma.Tutorials
infoBox = CreateInfoFrame(TextManager.Get(activeContentSegment.Id), tutorialText, infoBox = CreateInfoFrame(TextManager.Get(activeContentSegment.Id), tutorialText,
activeContentSegment.TextContent.GetAttributeInt("width", 300), activeContentSegment.TextContent.GetAttributeInt("width", 300),
activeContentSegment.TextContent.GetAttributeInt("height", 80), activeContentSegment.TextContent.GetAttributeInt("height", 80),
activeContentSegment.TextContent.GetAttributeString("anchor", "Center"), true, StopCurrentContentSegment, () => LoadVideo(activeContentSegment, false)); activeContentSegment.TextContent.GetAttributeString("anchor", "Center"), true, StopCurrentContentSegment, () => LoadVideo(activeContentSegment));
break; break;
case TutorialContentTypes.TextOnly: case TutorialContentTypes.TextOnly:
infoBox = CreateInfoFrame(TextManager.Get(activeContentSegment.Id), tutorialText, infoBox = CreateInfoFrame(TextManager.Get(activeContentSegment.Id), tutorialText,
@@ -404,7 +404,8 @@ namespace Barotrauma.Tutorials
{ {
if (ContentRunning) return; if (ContentRunning) return;
ContentRunning = true; ContentRunning = true;
videoPlayer.LoadContent(playableContentPath, new VideoPlayer.VideoSettings(segment.VideoContent), new VideoPlayer.TextSettings(segment.VideoContent), segment.Id, true, callback: () => ContentRunning = false); LoadVideo(segment);
//videoPlayer.LoadContent(playableContentPath, new VideoPlayer.VideoSettings(segment.VideoContent), new VideoPlayer.TextSettings(segment.VideoContent), segment.Id, true, callback: () => ContentRunning = false);
} }
private void ShowSegmentText(TutorialSegment segment) private void ShowSegmentText(TutorialSegment segment)
@@ -419,7 +420,7 @@ namespace Barotrauma.Tutorials
if (segment.ContentType != TutorialContentTypes.TextOnly) if (segment.ContentType != TutorialContentTypes.TextOnly)
{ {
videoAction = () => LoadVideo(segment, false); videoAction = () => LoadVideo(segment);
} }
infoBox = CreateInfoFrame(TextManager.Get(segment.Id), tutorialText, infoBox = CreateInfoFrame(TextManager.Get(segment.Id), tutorialText,
@@ -566,16 +567,16 @@ namespace Barotrauma.Tutorials
#endregion #endregion
#region Video #region Video
protected void LoadVideo(TutorialSegment segment, bool showText = true) protected void LoadVideo(TutorialSegment segment)
{ {
if (videoPlayer == null) videoPlayer = new VideoPlayer(); if (videoPlayer == null) videoPlayer = new VideoPlayer();
if (showText) if (segment.ContentType != TutorialContentTypes.ManualVideo)
{ {
videoPlayer.LoadContent(playableContentPath, new VideoPlayer.VideoSettings(segment.VideoContent), new VideoPlayer.TextSettings(segment.VideoContent), segment.Id, true, segment.Objective, StopCurrentContentSegment); videoPlayer.LoadContent(playableContentPath, new VideoPlayer.VideoSettings(segment.VideoContent), new VideoPlayer.TextSettings(segment.VideoContent), segment.Id, true, segment.Objective, StopCurrentContentSegment);
} }
else else
{ {
videoPlayer.LoadContent(playableContentPath, new VideoPlayer.VideoSettings(segment.VideoContent), null, segment.Id, true, segment.Objective, null); videoPlayer.LoadContent(playableContentPath, new VideoPlayer.VideoSettings(segment.VideoContent), null, segment.Id, true, string.Empty, null);
} }
} }
#endregion #endregion
@@ -252,7 +252,7 @@ namespace Barotrauma
OnClicked = SelectTab OnClicked = SelectTab
}; };
//TODO: translate //TODO: translate
new GUIButton(new RectTransform(new Vector2(1.0f, 1.0f), optionList.RectTransform), "Credits", textAlignment: Alignment.Left, style: "MainMenuGUIButton") new GUIButton(new RectTransform(new Vector2(1.0f, 1.0f), optionList.RectTransform), TextManager.Get("CreditsButton"), textAlignment: Alignment.Left, style: "MainMenuGUIButton")
{ {
ForceUpperCase = true, ForceUpperCase = true,
UserData = Tab.Credits, UserData = Tab.Credits,