(052ab6307) Use MonoKickstart on Linux so installing Mono is not required, fixed division by zero if the width of the server console window is 0

This commit is contained in:
Joonas Rikkonen
2019-04-16 17:11:49 +03:00
parent edb8c39c58
commit bd07acf26d
121 changed files with 1546 additions and 1777 deletions
@@ -3,7 +3,6 @@ using Lidgren.Network;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Xml.Linq;
@@ -17,22 +16,16 @@ namespace Barotrauma.Items.Components
{
uiElements.Clear();
var visibleElements = customInterfaceElementList.Where(ciElement => !string.IsNullOrEmpty(ciElement.Label));
GUILayoutGroup paddedFrame = new GUILayoutGroup(new RectTransform(new Vector2(0.9f, 0.8f), GuiFrame.RectTransform, Anchor.Center),
childAnchor: customInterfaceElementList.Count > 1 ? Anchor.TopCenter : Anchor.Center)
{
RelativeSpacing = 0.05f,
Stretch = visibleElements.Count() > 2
};
{ RelativeSpacing = 0.05f };
float elementSize = Math.Min(1.0f / visibleElements.Count(), 0.5f);
foreach (CustomInterfaceElement ciElement in visibleElements)
float elementSize = Math.Min(1.0f / customInterfaceElementList.Count, 0.5f);
foreach (CustomInterfaceElement ciElement in customInterfaceElementList)
{
if (ciElement.ContinuousSignal)
{
var tickBox = new GUITickBox(new RectTransform(new Vector2(1.0f, elementSize), paddedFrame.RectTransform),
TextManager.Get(ciElement.Label, returnNull: true) ?? ciElement.Label)
var tickBox = new GUITickBox(new RectTransform(new Vector2(1.0f, elementSize), paddedFrame.RectTransform), ciElement.Label)
{
UserData = ciElement
};
@@ -52,8 +45,7 @@ namespace Barotrauma.Items.Components
}
else
{
var btn = new GUIButton(new RectTransform(new Vector2(1.0f, elementSize), paddedFrame.RectTransform),
TextManager.Get(ciElement.Label, returnNull: true) ?? ciElement.Label, style: "GUIButtonLarge")
var btn = new GUIButton(new RectTransform(new Vector2(1.0f, elementSize), paddedFrame.RectTransform), ciElement.Label, style: "GUIButtonLarge")
{
UserData = ciElement
};
@@ -74,24 +66,6 @@ namespace Barotrauma.Items.Components
}
}
public override void CreateEditingHUD(SerializableEntityEditor editor)
{
base.CreateEditingHUD(editor);
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(customInterfaceElementList[0]);
PropertyDescriptor labelProperty = properties.Find("Label", false);
PropertyDescriptor signalProperty = properties.Find("Signal", false);
for (int i = 0; i< customInterfaceElementList.Count; i++)
{
editor.CreateStringField(customInterfaceElementList[i],
new SerializableProperty(labelProperty, customInterfaceElementList[i]),
customInterfaceElementList[i].Label, "Label #" + (i + 1), "");
editor.CreateStringField(customInterfaceElementList[i],
new SerializableProperty(signalProperty, customInterfaceElementList[i]),
customInterfaceElementList[i].Signal, "Signal #" + (i + 1), "");
}
}
partial void UpdateLabelsProjSpecific()
{
for (int i = 0; i < labels.Length && i < uiElements.Count; i++)