(3dc4135ce) v0.9.5.1
This commit is contained in:
@@ -4,6 +4,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.Extensions;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -13,25 +14,24 @@ namespace Barotrauma
|
||||
|
||||
private UInt16 startWatchmanID, endWatchmanID;
|
||||
|
||||
public static GUIComponent StartCampaignSetup( IEnumerable<Submarine> submarines, IEnumerable<string> saveFiles)
|
||||
public static void StartCampaignSetup(IEnumerable<string> saveFiles)
|
||||
{
|
||||
GUIFrame background = new GUIFrame(new RectTransform(Vector2.One, GUI.Canvas), style: "GUIBackgroundBlocker");
|
||||
var parent = GameMain.NetLobbyScreen.CampaignSetupFrame;
|
||||
parent.ClearChildren();
|
||||
parent.Visible = true;
|
||||
GameMain.NetLobbyScreen.HighlightMode(2);
|
||||
|
||||
GUIFrame setupBox = new GUIFrame(new RectTransform(new Vector2(0.25f, 0.45f), background.RectTransform, Anchor.Center) { MinSize = new Point(500, 550) });
|
||||
var paddedFrame = new GUILayoutGroup(new RectTransform(new Vector2(0.9f, 0.9f), setupBox.RectTransform, Anchor.Center))
|
||||
var layout = new GUILayoutGroup(new RectTransform(Vector2.One, parent.RectTransform, Anchor.Center))
|
||||
{
|
||||
Stretch = true
|
||||
};
|
||||
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), paddedFrame.RectTransform,Anchor.TopCenter),
|
||||
TextManager.Get("CampaignSetup"), font: GUI.LargeFont);
|
||||
|
||||
var buttonContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.07f), paddedFrame.RectTransform) { RelativeOffset = new Vector2(0.0f, 0.1f) }, isHorizontal: true)
|
||||
var buttonContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.07f), layout.RectTransform) { RelativeOffset = new Vector2(0.0f, 0.1f) }, isHorizontal: true)
|
||||
{
|
||||
RelativeSpacing = 0.02f
|
||||
};
|
||||
|
||||
var campaignContainer = new GUIFrame(new RectTransform(new Vector2(1.0f, 0.9f), paddedFrame.RectTransform, Anchor.BottomLeft), style: "InnerFrame")
|
||||
var campaignContainer = new GUIFrame(new RectTransform(new Vector2(1.0f, 0.9f), layout.RectTransform, Anchor.BottomLeft), style: "InnerFrame")
|
||||
{
|
||||
CanBeFocused = false
|
||||
};
|
||||
@@ -39,9 +39,9 @@ namespace Barotrauma
|
||||
var newCampaignContainer = new GUIFrame(new RectTransform(Vector2.One, campaignContainer.RectTransform, Anchor.BottomLeft), style: null);
|
||||
var loadCampaignContainer = new GUIFrame(new RectTransform(Vector2.One, campaignContainer.RectTransform, Anchor.BottomLeft), style: null);
|
||||
|
||||
var campaignSetupUI = new CampaignSetupUI(true, newCampaignContainer, loadCampaignContainer, submarines, saveFiles);
|
||||
var campaignSetupUI = new CampaignSetupUI(true, newCampaignContainer, loadCampaignContainer, null, saveFiles);
|
||||
|
||||
var newCampaignButton = new GUIButton(new RectTransform(new Vector2(0.3f, 1.0f), buttonContainer.RectTransform),
|
||||
var newCampaignButton = new GUIButton(new RectTransform(new Vector2(0.5f, 1.0f), buttonContainer.RectTransform),
|
||||
TextManager.Get("NewCampaign"), style: "GUITabButton")
|
||||
{
|
||||
OnClicked = (btn, obj) =>
|
||||
@@ -52,7 +52,7 @@ namespace Barotrauma
|
||||
}
|
||||
};
|
||||
|
||||
var loadCampaignButton = new GUIButton(new RectTransform(new Vector2(0.3f, 1.00f), buttonContainer.RectTransform),
|
||||
var loadCampaignButton = new GUIButton(new RectTransform(new Vector2(0.5f, 1.00f), buttonContainer.RectTransform),
|
||||
TextManager.Get("LoadCampaign"), style: "GUITabButton")
|
||||
{
|
||||
OnClicked = (btn, obj) =>
|
||||
@@ -67,20 +67,6 @@ namespace Barotrauma
|
||||
|
||||
campaignSetupUI.StartNewGame = GameMain.Client.SetupNewCampaign;
|
||||
campaignSetupUI.LoadGame = GameMain.Client.SetupLoadCampaign;
|
||||
|
||||
var cancelButton = new GUIButton(new RectTransform(new Vector2(0.25f, 0.1f), paddedFrame.RectTransform, Anchor.BottomLeft),
|
||||
TextManager.Get("Cancel"), style: "GUIButtonLarge")
|
||||
{
|
||||
IgnoreLayoutGroups = true,
|
||||
OnClicked = (btn, obj) =>
|
||||
{
|
||||
background.Visible = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
return background;
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime)
|
||||
|
||||
+2
-2
@@ -255,9 +255,9 @@ namespace Barotrauma.Tutorials
|
||||
}
|
||||
if (order.Options[orderIndex] == option)
|
||||
{
|
||||
if (GameMain.GameSession.CrewManager.OrderOptionButtons[i].Frame.FlashTimer <= 0)
|
||||
if (GameMain.GameSession.CrewManager.OrderOptionButtons[i].FlashTimer <= 0)
|
||||
{
|
||||
GameMain.GameSession.CrewManager.OrderOptionButtons[i].Frame.Flash(highlightColor);
|
||||
GameMain.GameSession.CrewManager.OrderOptionButtons[i].Flash(highlightColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -370,9 +370,9 @@ namespace Barotrauma.Tutorials
|
||||
}
|
||||
else if (IsSelectedItem(engineer_brokenJunctionBox) && repairableJunctionBoxComponent.CurrentFixer == null)
|
||||
{
|
||||
if (repairableJunctionBoxComponent.RepairButton.Frame.FlashTimer <= 0)
|
||||
if (repairableJunctionBoxComponent.RepairButton.FlashTimer <= 0)
|
||||
{
|
||||
repairableJunctionBoxComponent.RepairButton.Frame.Flash();
|
||||
repairableJunctionBoxComponent.RepairButton.Flash();
|
||||
}
|
||||
}
|
||||
yield return null;
|
||||
|
||||
+6
-6
@@ -416,9 +416,9 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
if (mechanic_deconstructor.InputContainer.Inventory.FindItemByIdentifier("oxygentank") != null && !mechanic_deconstructor.IsActive)
|
||||
{
|
||||
if (mechanic_deconstructor.ActivateButton.Frame.FlashTimer <= 0)
|
||||
if (mechanic_deconstructor.ActivateButton.FlashTimer <= 0)
|
||||
{
|
||||
mechanic_deconstructor.ActivateButton.Frame.Flash(highlightColor, 1.5f, false);
|
||||
mechanic_deconstructor.ActivateButton.Flash(highlightColor, 1.5f, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -452,9 +452,9 @@ namespace Barotrauma.Tutorials
|
||||
}
|
||||
else if (mechanic_fabricator.InputContainer.Inventory.FindItemByIdentifier("aluminium") != null && mechanic_fabricator.InputContainer.Inventory.FindItemByIdentifier("sodium") != null && !mechanic_fabricator.IsActive)
|
||||
{
|
||||
if (mechanic_fabricator.ActivateButton.Frame.FlashTimer <= 0)
|
||||
if (mechanic_fabricator.ActivateButton.FlashTimer <= 0)
|
||||
{
|
||||
mechanic_fabricator.ActivateButton.Frame.Flash(highlightColor, 1.5f, false);
|
||||
mechanic_fabricator.ActivateButton.Flash(highlightColor, 1.5f, false);
|
||||
}
|
||||
}
|
||||
else if (mechanic.Inventory.FindItemByIdentifier("aluminium") != null || mechanic.Inventory.FindItemByIdentifier("sodium") != null)
|
||||
@@ -544,9 +544,9 @@ namespace Barotrauma.Tutorials
|
||||
}
|
||||
else if (IsSelectedItem(mechanic_brokenPump.Item) && repairablePumpComponent.CurrentFixer == null)
|
||||
{
|
||||
if (repairablePumpComponent.RepairButton.Frame.FlashTimer <= 0)
|
||||
if (repairablePumpComponent.RepairButton.FlashTimer <= 0)
|
||||
{
|
||||
repairablePumpComponent.RepairButton.Frame.Flash();
|
||||
repairablePumpComponent.RepairButton.Flash();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user