(5c35a640e) Update tutorial-rework with dev

This commit is contained in:
Joonas Rikkonen
2019-03-27 20:52:47 +02:00
parent 47b16f4f9e
commit 080ac78ded
113 changed files with 3206 additions and 1298 deletions
@@ -33,7 +33,7 @@ namespace Barotrauma
private readonly bool isMultiplayer;
public CampaignSetupUI(bool isMultiplayer, GUIComponent newGameContainer, GUIComponent loadGameContainer, IEnumerable<string> saveFiles=null)
public CampaignSetupUI(bool isMultiplayer, GUIComponent newGameContainer, GUIComponent loadGameContainer, IEnumerable<Submarine> submarines, IEnumerable<string> saveFiles = null)
{
this.isMultiplayer = isMultiplayer;
this.newGameContainer = newGameContainer;
@@ -45,6 +45,12 @@ namespace Barotrauma
RelativeSpacing = 0.05f
};
var columnContainer = new GUILayoutGroup(new RectTransform(Vector2.One, newGameContainer.RectTransform), isHorizontal: true)
{
Stretch = true,
RelativeSpacing = 0.05f
};
var leftColumn = new GUILayoutGroup(new RectTransform(Vector2.One, columnContainer.RectTransform))
{
Stretch = true,
@@ -63,7 +69,7 @@ namespace Barotrauma
OnSelected = CheckForPax
};
UpdateSubList();
UpdateSubList(submarines);
// New game right sideon
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), rightColumn.RectTransform), TextManager.Get("SaveName") + ":", textAlignment: Alignment.BottomLeft);
@@ -90,9 +96,8 @@ namespace Barotrauma
return false;
}
Submarine selectedSub = subList.SelectedData as Submarine;
if (selectedSub == null) return false;
if (!(subList.SelectedData is Submarine selectedSub)) { return false; }
if (string.IsNullOrEmpty(selectedSub.MD5Hash.Hash))
{
((GUITextBlock)subList.SelectedComponent).TextColor = Color.DarkRed * 0.8f;
@@ -199,9 +204,9 @@ namespace Barotrauma
public void UpdateSubList(IEnumerable<Submarine> submarines)
{
#if DEBUG
var subsToShow = Submarine.SavedSubmarines.Where(s => !s.HasTag(SubmarineTag.HideInMenus));
var subsToShow = submarines.Where(s => !s.HasTag(SubmarineTag.HideInMenus));
#else
var subsToShow = Submarine.SavedSubmarines;
var subsToShow = submarines;
#endif
subList.ClearChildren();