Unstable v0.19.5.0
This commit is contained in:
@@ -67,6 +67,8 @@ namespace Barotrauma
|
||||
|
||||
public static readonly Queue<ulong> WorkshopItemsToUpdate = new Queue<ulong>();
|
||||
|
||||
private readonly GUIListBox tutorialList;
|
||||
|
||||
#region Creation
|
||||
public MainMenuScreen(GameMain game)
|
||||
{
|
||||
@@ -429,26 +431,19 @@ namespace Barotrauma
|
||||
menuTabs[Tab.Tutorials] = new GUIFrame(new RectTransform(relativeSize, GUI.Canvas, anchor, pivot, minSize, maxSize) { RelativeOffset = relativeSpacing });
|
||||
|
||||
//PLACEHOLDER
|
||||
var tutorialList = new GUIListBox(
|
||||
tutorialList = new GUIListBox(
|
||||
new RectTransform(new Vector2(0.95f, 0.85f), menuTabs[Tab.Tutorials].RectTransform, Anchor.TopCenter) { RelativeOffset = new Vector2(0.0f, 0.1f) })
|
||||
{
|
||||
PlaySoundOnSelect = true,
|
||||
};
|
||||
foreach (var tutorialPrefab in TutorialPrefab.Prefabs.OrderBy(p => p.Order))
|
||||
{
|
||||
var tutorial = new Tutorial(tutorialPrefab);
|
||||
var tutorialText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.15f), tutorialList.Content.RectTransform), tutorial.DisplayName, textAlignment: Alignment.Center, font: GUIStyle.LargeFont)
|
||||
{
|
||||
TextColor = GUIStyle.Green,
|
||||
UserData = tutorial
|
||||
};
|
||||
}
|
||||
tutorialList.OnSelected += (component, obj) =>
|
||||
{
|
||||
(obj as Tutorial)?.Start();
|
||||
return true;
|
||||
};
|
||||
|
||||
CreateTutorialButtons();
|
||||
|
||||
this.game = game;
|
||||
|
||||
menuTabs[Tab.Credits] = new GUIFrame(new RectTransform(Vector2.One, GUI.Canvas, Anchor.Center), style: null)
|
||||
@@ -463,7 +458,28 @@ namespace Barotrauma
|
||||
var creditsContainer = new GUIFrame(new RectTransform(new Vector2(0.75f, 1.5f), menuTabs[Tab.Credits].RectTransform, Anchor.CenterRight), style: "OuterGlow", color: Color.Black * 0.8f);
|
||||
creditsPlayer = new CreditsPlayer(new RectTransform(Vector2.One, creditsContainer.RectTransform), "Content/Texts/Credits.xml");
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void CreateTutorialButtons()
|
||||
{
|
||||
foreach (var tutorialPrefab in TutorialPrefab.Prefabs.OrderBy(p => p.Order))
|
||||
{
|
||||
var tutorial = new Tutorial(tutorialPrefab);
|
||||
var tutorialText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.15f), tutorialList.Content.RectTransform), tutorial.DisplayName, textAlignment: Alignment.Center, font: GUIStyle.LargeFont)
|
||||
{
|
||||
TextColor = GUIStyle.Green,
|
||||
UserData = tutorial
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static void UpdateInstanceTutorialButtons()
|
||||
{
|
||||
if (GameMain.MainMenuScreen is not MainMenuScreen menuScreen) { return; }
|
||||
menuScreen.tutorialList.ClearChildren();
|
||||
menuScreen.CreateTutorialButtons();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Selection
|
||||
public override void Select()
|
||||
@@ -1117,7 +1133,7 @@ namespace Barotrauma
|
||||
var playstyleContainer = new GUIFrame(new RectTransform(new Vector2(1.35f, 0.1f), parent.RectTransform), style: null, color: Color.Black);
|
||||
|
||||
playstyleBanner = new GUIImage(new RectTransform(new Vector2(1.0f, 0.1f), playstyleContainer.RectTransform),
|
||||
ServerListScreen.PlayStyleBanners[0], scaleToFit: true)
|
||||
GUIStyle.GetComponentStyle($"PlayStyleBanner.{PlayStyle.Serious}").GetSprite(GUIComponent.ComponentState.None), scaleToFit: true)
|
||||
{
|
||||
UserData = PlayStyle.Serious
|
||||
};
|
||||
@@ -1336,12 +1352,15 @@ namespace Barotrauma
|
||||
|
||||
private void SetServerPlayStyle(PlayStyle playStyle)
|
||||
{
|
||||
playstyleBanner.Sprite = ServerListScreen.PlayStyleBanners[(int)playStyle];
|
||||
playstyleBanner.Sprite = GUIStyle
|
||||
.GetComponentStyle($"PlayStyleBanner.{playStyle}")
|
||||
.GetSprite(GUIComponent.ComponentState.None);
|
||||
playstyleBanner.UserData = playStyle;
|
||||
|
||||
var nameText = playstyleBanner.GetChild<GUITextBlock>();
|
||||
nameText.Text = TextManager.AddPunctuation(':', TextManager.Get("serverplaystyle"), TextManager.Get("servertag." + playStyle));
|
||||
nameText.Color = ServerListScreen.PlayStyleColors[(int)playStyle];
|
||||
nameText.Color = playstyleBanner.Sprite
|
||||
.SourceElement.GetAttributeColor("BannerColor") ?? Color.White;
|
||||
nameText.RectTransform.NonScaledSize = (nameText.Font.MeasureString(nameText.Text) + new Vector2(25, 10) * GUI.Scale).ToPoint();
|
||||
|
||||
playstyleDescription.Text = TextManager.Get("servertagdescription." + playStyle);
|
||||
|
||||
Reference in New Issue
Block a user