(f0d812055) v0.9.9.0
This commit is contained in:
@@ -140,11 +140,11 @@ namespace Barotrauma.Items.Components
|
||||
var inputArea = new GUILayoutGroup(new RectTransform(new Vector2(0.95f, 1f), bottomFrame.RectTransform, Anchor.BottomCenter), isHorizontal: true, childAnchor: Anchor.BottomLeft);
|
||||
|
||||
// === INPUT SLOTS === //
|
||||
inputInventoryHolder = new GUIFrame(new RectTransform(new Vector2(0.8f, 1f), inputArea.RectTransform), style: null);
|
||||
inputInventoryHolder = new GUIFrame(new RectTransform(new Vector2(0.7f, 1f), inputArea.RectTransform), style: null);
|
||||
new GUICustomComponent(new RectTransform(Vector2.One, inputInventoryHolder.RectTransform), DrawInputOverLay) { CanBeFocused = false };
|
||||
|
||||
// === ACTIVATE BUTTON === //
|
||||
var buttonFrame = new GUILayoutGroup(new RectTransform(new Vector2(0.2f, 0.8f), inputArea.RectTransform), childAnchor: Anchor.CenterRight);
|
||||
var buttonFrame = new GUILayoutGroup(new RectTransform(new Vector2(0.3f, 0.8f), inputArea.RectTransform), childAnchor: Anchor.CenterRight);
|
||||
activateButton = new GUIButton(new RectTransform(new Vector2(1f, 0.6f), buttonFrame.RectTransform),
|
||||
TextManager.Get("FabricatorCreate"), style: "DeviceButton")
|
||||
{
|
||||
@@ -356,6 +356,8 @@ namespace Barotrauma.Items.Components
|
||||
private void DrawOutputOverLay(SpriteBatch spriteBatch, GUICustomComponent overlayComponent)
|
||||
{
|
||||
overlayComponent.RectTransform.SetAsLastChild();
|
||||
|
||||
if (outputContainer.Inventory.Items.First() != null) { return; }
|
||||
|
||||
FabricationRecipe targetItem = fabricatedItem ?? selectedItem;
|
||||
if (targetItem != null)
|
||||
|
||||
@@ -91,6 +91,7 @@ namespace Barotrauma.Items.Components
|
||||
if ((item.Submarine == null && displayedSubs.Count > 0) || //item not inside a sub anymore, but display is still showing subs
|
||||
!displayedSubs.Contains(item.Submarine) || //current sub not displayer
|
||||
item.Submarine.DockedTo.Any(s => !displayedSubs.Contains(s)) || //some of the docked subs not diplayed
|
||||
!submarineContainer.Children.Any() || // We lack a GUI
|
||||
displayedSubs.Any(s => s != item.Submarine && !item.Submarine.DockedTo.Contains(s))) //displaying a sub that shouldn't be displayed
|
||||
{
|
||||
CreateHUD();
|
||||
@@ -116,21 +117,23 @@ namespace Barotrauma.Items.Components
|
||||
private void DrawHUDFront(SpriteBatch spriteBatch, GUICustomComponent container)
|
||||
{
|
||||
if (Voltage < MinVoltage)
|
||||
{
|
||||
{
|
||||
Vector2 textSize = GUI.Font.MeasureString(noPowerTip);
|
||||
Vector2 textPos = GuiFrame.Rect.Center.ToVector2();
|
||||
|
||||
GUI.DrawString(spriteBatch, textPos - textSize / 2, noPowerTip,
|
||||
GUI.Style.Orange * (float)Math.Abs(Math.Sin(Timing.TotalTime)), Color.Black * 0.8f, font: GUI.SubHeadingFont);
|
||||
GUI.Style.Orange * (float)Math.Abs(Math.Sin(Timing.TotalTime)), Color.Black * 0.8f, font: GUI.SubHeadingFont);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!submarineContainer.Children.Any()) { return; }
|
||||
|
||||
foreach (GUIComponent child in submarineContainer.Children.First().Children)
|
||||
{
|
||||
if (child.UserData is Hull hull)
|
||||
{
|
||||
if (hull.Submarine == null || !hull.Submarine.IsOutpost) { continue; }
|
||||
string text = TextManager.GetWithVariable("MiniMapOutpostDockingInfo", "[outpost]", hull.Submarine.Name);
|
||||
if (hull.Submarine == null || !hull.Submarine.Info.IsOutpost) { continue; }
|
||||
string text = TextManager.GetWithVariable("MiniMapOutpostDockingInfo", "[outpost]", hull.Submarine.Info.Name);
|
||||
Vector2 textSize = GUI.Font.MeasureString(text);
|
||||
Vector2 textPos = child.Center;
|
||||
if (textPos.X + textSize.X / 2 > submarineContainer.Rect.Right)
|
||||
@@ -151,7 +154,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
foreach (Hull hull in Hull.hullList)
|
||||
{
|
||||
var hullFrame = submarineContainer.Children.First().FindChild(hull);
|
||||
var hullFrame = submarineContainer.Children.FirstOrDefault()?.FindChild(hull);
|
||||
if (hullFrame == null) { continue; }
|
||||
|
||||
if (GUI.MouseOn == hullFrame || hullFrame.IsParentOf(GUI.MouseOn))
|
||||
@@ -175,7 +178,7 @@ namespace Barotrauma.Items.Components
|
||||
foreach (Hull hull in Hull.hullList)
|
||||
{
|
||||
if (hull.Submarine == null) continue;
|
||||
var hullFrame = submarineContainer.Children.First().FindChild(hull);
|
||||
var hullFrame = submarineContainer.Children.FirstOrDefault()?.FindChild(hull);
|
||||
if (hullFrame == null) continue;
|
||||
|
||||
hullDatas.TryGetValue(hull, out HullData hullData);
|
||||
|
||||
@@ -99,6 +99,10 @@ namespace Barotrauma.Items.Components
|
||||
Step = 0.05f,
|
||||
OnMoved = (GUIScrollBar scrollBar, float barScroll) =>
|
||||
{
|
||||
if (pumpSpeedLockTimer <= 0.0f)
|
||||
{
|
||||
targetLevel = null;
|
||||
}
|
||||
float newValue = barScroll * 200.0f - 100.0f;
|
||||
if (Math.Abs(newValue - FlowPercentage) < 0.1f) { return false; }
|
||||
|
||||
|
||||
@@ -192,9 +192,10 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
RelativeOffset = new Vector2(0, fissionMeter.RectTransform.RelativeOffset.Y + meterSize.Y)
|
||||
},
|
||||
style: "DeviceSlider", barSize: 0.1f)
|
||||
style: "DeviceSlider", barSize: 0.15f)
|
||||
{
|
||||
Enabled = false,
|
||||
Step = 1.0f / 255,
|
||||
OnMoved = (GUIScrollBar bar, float scrollAmount) =>
|
||||
{
|
||||
LastUser = Character.Controlled;
|
||||
@@ -209,9 +210,10 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
RelativeOffset = new Vector2(0, turbineMeter.RectTransform.RelativeOffset.Y + meterSize.Y)
|
||||
},
|
||||
style: "DeviceSlider", barSize: 0.1f, isHorizontal: true)
|
||||
style: "DeviceSlider", barSize: 0.15f, isHorizontal: true)
|
||||
{
|
||||
Enabled = false,
|
||||
Step = 1.0f / 255,
|
||||
OnMoved = (GUIScrollBar bar, float scrollAmount) =>
|
||||
{
|
||||
LastUser = Character.Controlled;
|
||||
@@ -715,8 +717,14 @@ namespace Barotrauma.Items.Components
|
||||
targetTurbineOutput = msg.ReadRangedSingle(0.0f, 100.0f, 8);
|
||||
degreeOfSuccess = msg.ReadRangedSingle(0.0f, 1.0f, 8);
|
||||
|
||||
FissionRateScrollBar.BarScroll = targetFissionRate / 100.0f;
|
||||
TurbineOutputScrollBar.BarScroll = targetTurbineOutput / 100.0f;
|
||||
if (Math.Abs(FissionRateScrollBar.BarScroll - targetFissionRate / 100.0f) > 0.01f)
|
||||
{
|
||||
FissionRateScrollBar.BarScroll = targetFissionRate / 100.0f;
|
||||
}
|
||||
if (Math.Abs(TurbineOutputScrollBar.BarScroll - targetTurbineOutput / 100.0f) > 0.01f)
|
||||
{
|
||||
TurbineOutputScrollBar.BarScroll = targetTurbineOutput / 100.0f;
|
||||
}
|
||||
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
@@ -490,6 +490,7 @@ namespace Barotrauma.Items.Components
|
||||
disruptedDirections.Clear();
|
||||
foreach (AITarget t in AITarget.List)
|
||||
{
|
||||
if (t.Entity is Character c && c.Params.HideInSonar) { continue; }
|
||||
if (t.SoundRange <= 0.0f || float.IsNaN(t.SoundRange) || float.IsInfinity(t.SoundRange)) { continue; }
|
||||
|
||||
float distSqr = Vector2.DistanceSquared(t.WorldPosition, transducerCenter);
|
||||
@@ -647,6 +648,8 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (GameMain.GameSession == null) { return; }
|
||||
|
||||
if (Level.Loaded == null) { return; }
|
||||
|
||||
DrawMarker(spriteBatch,
|
||||
GameMain.GameSession.StartLocation.Name,
|
||||
"outpost",
|
||||
@@ -699,8 +702,8 @@ namespace Barotrauma.Items.Components
|
||||
if (sub.WorldPosition.Y > Level.Loaded.Size.Y) { continue; }
|
||||
|
||||
DrawMarker(spriteBatch,
|
||||
sub.Name,
|
||||
sub.HasTag(SubmarineTag.Shuttle) ? "shuttle" : "submarine",
|
||||
sub.Info.DisplayName,
|
||||
sub.Info.HasTag(SubmarineTag.Shuttle) ? "shuttle" : "submarine",
|
||||
sub.WorldPosition - transducerCenter,
|
||||
displayScale, center, DisplayRadius * 0.95f);
|
||||
}
|
||||
@@ -799,8 +802,11 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
if (Level.Loaded != null && dockingPort.Item.Submarine.WorldPosition.Y > Level.Loaded.Size.Y) { continue; }
|
||||
|
||||
if (dockingPort.Item.Submarine == null) { continue; }
|
||||
if (dockingPort.Item.Submarine.Info.IsWreck) { continue; }
|
||||
|
||||
//don't show the docking ports of the opposing team on the sonar
|
||||
if (item.Submarine != null && dockingPort.Item.Submarine != null)
|
||||
if (item.Submarine != null)
|
||||
{
|
||||
if ((dockingPort.Item.Submarine.TeamID == Character.TeamType.Team1 && item.Submarine.TeamID == Character.TeamType.Team2) ||
|
||||
(dockingPort.Item.Submarine.TeamID == Character.TeamType.Team2 && item.Submarine.TeamID == Character.TeamType.Team1))
|
||||
@@ -1125,6 +1131,7 @@ namespace Barotrauma.Items.Components
|
||||
foreach (Character c in Character.CharacterList)
|
||||
{
|
||||
if (c.AnimController.CurrentHull != null || !c.Enabled) { continue; }
|
||||
if (c.Params.HideInSonar) { continue; }
|
||||
if (DetectSubmarineWalls && c.AnimController.CurrentHull == null && item.CurrentHull != null) { continue; }
|
||||
|
||||
if (c.AnimController.SimplePhysicsEnabled)
|
||||
|
||||
@@ -46,6 +46,8 @@ namespace Barotrauma.Items.Components
|
||||
private float checkConnectedPortsTimer;
|
||||
private const float CheckConnectedPortsInterval = 1.0f;
|
||||
|
||||
public DockingPort ActiveDockingSource, DockingTarget;
|
||||
|
||||
private Vector2 keyboardInput = Vector2.Zero;
|
||||
private float inputCumulation;
|
||||
|
||||
@@ -665,7 +667,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (Vector2.DistanceSquared(PlayerInput.MousePosition, steerArea.Rect.Center.ToVector2()) < steerRadius * steerRadius)
|
||||
{
|
||||
if (PlayerInput.PrimaryMouseButtonHeld() && !CrewManager.IsCommandInterfaceOpen && !GameSession.IsInfoFrameOpen)
|
||||
if (PlayerInput.PrimaryMouseButtonHeld() && !CrewManager.IsCommandInterfaceOpen && !GameSession.IsTabMenuOpen)
|
||||
{
|
||||
Vector2 displaySubPos = (-sonar.DisplayOffset * sonar.Zoom) / sonar.Range * sonar.DisplayRadius * sonar.Zoom;
|
||||
displaySubPos.Y = -displaySubPos.Y;
|
||||
|
||||
Reference in New Issue
Block a user