(ee33ee49f) reverted all doors back to original autodoors, reset prefabs for several doors to ensure correct repair messages, flipped stairs on humpback to ease AI steering issues.

This commit is contained in:
Joonas Rikkonen
2019-04-26 11:17:44 +03:00
parent cb9f33dc68
commit efca3a49fc
6 changed files with 20 additions and 18 deletions
@@ -41,19 +41,32 @@ namespace Barotrauma
InnerFrame = new GUIFrame(new RectTransform(new Point(width, height), RectTransform, Anchor.Center) { IsFixedSize = false }, style: null); InnerFrame = new GUIFrame(new RectTransform(new Point(width, height), RectTransform, Anchor.Center) { IsFixedSize = false }, style: null);
GUI.Style.Apply(InnerFrame, "", this); GUI.Style.Apply(InnerFrame, "", this);
InnerFrame = new GUIFrame(new RectTransform(new Point(width, height), RectTransform, Anchor.Center) { IsFixedSize = false }, style: null);
GUI.Style.Apply(InnerFrame, "", this);
Content = new GUILayoutGroup(new RectTransform(new Vector2(0.9f, 0.85f), InnerFrame.RectTransform, Anchor.Center)) { AbsoluteSpacing = 5 }; Content = new GUILayoutGroup(new RectTransform(new Vector2(0.9f, 0.85f), InnerFrame.RectTransform, Anchor.Center)) { AbsoluteSpacing = 5 };
Tag = tag; Tag = tag;
if (height == 0)
{
string wrappedText = ToolBox.WrapText(text, Content.Rect.Width, GUI.Font);
string[] lines = wrappedText.Split('\n');
foreach (string line in lines)
{
height += (int)GUI.Font.MeasureString(line).Y;
}
height += string.IsNullOrWhiteSpace(headerText) ? 220 : 220 - headerHeight;
}
InnerFrame.RectTransform.NonScaledSize = new Point(InnerFrame.Rect.Width, height);
Header = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), Content.RectTransform), Header = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), Content.RectTransform),
headerText, textAlignment: Alignment.Center, wrap: true); headerText, textAlignment: Alignment.Center, wrap: true);
Header.RectTransform.MinSize = new Point(0, Header.Rect.Height);
GUI.Style.Apply(Header, "", this); GUI.Style.Apply(Header, "", this);
if (!string.IsNullOrWhiteSpace(text)) if (height == 0)
{ {
Text = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), Content.RectTransform), Text = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), Content.RectTransform),
text, textAlignment: textAlignment, wrap: true); text, textAlignment: textAlignment, wrap: true);
Text.RectTransform.MinSize = new Point(0, Text.Rect.Height);
GUI.Style.Apply(Text, "", this); GUI.Style.Apply(Text, "", this);
} }
@@ -63,18 +76,7 @@ namespace Barotrauma
AbsoluteSpacing = 5, AbsoluteSpacing = 5,
IgnoreLayoutGroups = true IgnoreLayoutGroups = true
}; };
buttonContainer.RectTransform.NonScaledSize = buttonContainer.RectTransform.MinSize = buttonContainer.RectTransform.MaxSize =
new Point(buttonContainer.Rect.Width, (int)(30 * GUI.Scale));
if (height == 0)
{
height += Header.Rect.Height + Content.AbsoluteSpacing;
height += (Text == null ? 0 : Text.Rect.Height) + Content.AbsoluteSpacing;
height += buttonContainer.Rect.Height;
InnerFrame.RectTransform.NonScaledSize = new Point(InnerFrame.Rect.Width, (int)(height / Content.RectTransform.RelativeSize.Y));
}
Buttons = new List<GUIButton>(buttons.Length); Buttons = new List<GUIButton>(buttons.Length);
for (int i = 0; i < buttons.Length; i++) for (int i = 0; i < buttons.Length; i++)
{ {
@@ -22,7 +22,7 @@ namespace Barotrauma
drawRect = new Rectangle( drawRect = new Rectangle(
(int)(drawRect.X * scale) + drawArea.Center.X, -((int)((drawRect.Y - drawRect.Height) * scale) + drawArea.Center.Y), (int)(drawRect.X * scale) + drawArea.Center.X, -((int)((drawRect.Y - drawRect.Height) * scale) + drawArea.Center.Y),
(int)(drawRect.Width * scale), (int)(drawRect.Height * scale)); (int)(drawRect.Width * scale), (int)(drawRect.Height * scale));
entity.First.DrawPlacing(spriteBatch, drawRect, entity.First.Scale * scale); entity.First.DrawPlacing(spriteBatch, drawRect, scale);
} }
} }
@@ -34,7 +34,7 @@ namespace Barotrauma
{ {
Rectangle drawRect = entity.Second; Rectangle drawRect = entity.Second;
drawRect.Location += Submarine.MouseToWorldGrid(cam, Submarine.MainSub).ToPoint(); drawRect.Location += Submarine.MouseToWorldGrid(cam, Submarine.MainSub).ToPoint();
entity.First.DrawPlacing(spriteBatch, drawRect, entity.First.Scale); entity.First.DrawPlacing(spriteBatch, drawRect);
} }
} }
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.