(5b2ce3831) Restart the credits sequence when re-selecting the credits tab, some changes to the credit texts

This commit is contained in:
Joonas Rikkonen
2019-05-16 06:48:53 +03:00
parent 3bb405bc9b
commit 97b6888274
13 changed files with 377 additions and 71 deletions
@@ -684,6 +684,8 @@ namespace Barotrauma
private GUILayoutGroup subPreviewContainer;
private GUILayoutGroup subPreviewContainer;
private GUIButton loadGameButton;
public Action<Submarine, string, string> StartNewGame;
@@ -9,7 +9,6 @@ namespace Barotrauma
private GUIListBox listBox;
private readonly float scrollSpeed;
public CreditsPlayer(RectTransform rectT, string configFile) : base(null, rectT)
{
var doc = XMLExtensions.TryLoadXml(configFile);
@@ -114,6 +113,11 @@ namespace Barotrauma
}
}
public void Restart()
{
listBox.BarScroll = 0.0f;
}
protected override void Update(float deltaTime)
{
listBox.BarScroll += scrollSpeed / listBox.TotalSize * deltaTime;
@@ -470,6 +470,7 @@ namespace Barotrauma
break;
case Tab.Credits:
titleText.Visible = false;
creditsPlayer.Restart();
break;
}
}