(db8417634) Merge branch 'dev' of https://github.com/Regalis11/Barotrauma-development into dev
This commit is contained in:
@@ -175,63 +175,6 @@ namespace Barotrauma.Items.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplyTo(RectTransform target)
|
|
||||||
{
|
|
||||||
if (RelativeOffset.HasValue)
|
|
||||||
{
|
|
||||||
target.RelativeOffset = RelativeOffset.Value;
|
|
||||||
}
|
|
||||||
else if (AbsoluteOffset.HasValue)
|
|
||||||
{
|
|
||||||
target.AbsoluteOffset = AbsoluteOffset.Value;
|
|
||||||
}
|
|
||||||
if (RelativeSize.HasValue)
|
|
||||||
{
|
|
||||||
target.RelativeSize = RelativeSize.Value;
|
|
||||||
}
|
|
||||||
else if (AbsoluteSize.HasValue)
|
|
||||||
{
|
|
||||||
target.NonScaledSize = AbsoluteSize.Value;
|
|
||||||
}
|
|
||||||
if (Anchor.HasValue)
|
|
||||||
{
|
|
||||||
target.Anchor = Anchor.Value;
|
|
||||||
}
|
|
||||||
if (Pivot.HasValue)
|
|
||||||
{
|
|
||||||
target.Pivot = Pivot.Value;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
target.Pivot = RectTransform.MatchPivotToAnchor(target.Anchor);
|
|
||||||
}
|
|
||||||
target.RecalculateChildren(true, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public GUIFrame GuiFrame { get; protected set; }
|
|
||||||
|
|
||||||
[Serialize(false, false)]
|
|
||||||
public bool AllowUIOverlap
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ItemComponent linkToUIComponent;
|
|
||||||
[Serialize("", false)]
|
|
||||||
public string LinkUIToComponent
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Serialize(0, false)]
|
|
||||||
public int HudPriority
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
private set;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool shouldMuffleLooping;
|
private bool shouldMuffleLooping;
|
||||||
@@ -553,7 +496,11 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
msg = msg.Replace("[" + inputType.ToString().ToLowerInvariant() + "]", GameMain.Config.KeyBind(inputType).ToString());
|
msg = msg.Replace("[" + inputType.ToString().ToLowerInvariant() + "]", GameMain.Config.KeyBind(inputType).ToString());
|
||||||
}
|
}
|
||||||
Msg = msg;
|
DisplayMsg = msg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DisplayMsg = Msg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -189,8 +189,7 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
get { return name; }
|
get { return name; }
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: this shouldn't be saved as-is, causes tags ("ItemMsgPressSelect" etc) to be converted into actual texts when saving the subs
|
|
||||||
[Editable, Serialize("", true)]
|
[Editable, Serialize("", true)]
|
||||||
public string Msg
|
public string Msg
|
||||||
{
|
{
|
||||||
@@ -204,12 +203,6 @@ namespace Barotrauma.Items.Components
|
|||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AITarget AITarget
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
private set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AITarget AITarget
|
public AITarget AITarget
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
@@ -254,7 +247,7 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
DebugConsole.ThrowError("Invalid pick key in " + element + "!", e);
|
DebugConsole.ThrowError("Invalid pick key in " + element + "!", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
SerializableProperties = SerializableProperty.DeserializeProperties(this, element);
|
SerializableProperties = SerializableProperty.DeserializeProperties(this, element);
|
||||||
ParseMsg();
|
ParseMsg();
|
||||||
|
|
||||||
|
|||||||
@@ -521,39 +521,6 @@ namespace Barotrauma
|
|||||||
|
|
||||||
AllowedLinks = element.GetAttributeStringArray("allowedlinks", new string[0], convertToLowerInvariant: true).ToList();
|
AllowedLinks = element.GetAttributeStringArray("allowedlinks", new string[0], convertToLowerInvariant: true).ToList();
|
||||||
|
|
||||||
if (sprite == null)
|
|
||||||
{
|
|
||||||
DebugConsole.ThrowError("Item \"" + Name + "\" has no sprite!");
|
|
||||||
#if SERVER
|
|
||||||
sprite = new Sprite("", Vector2.Zero);
|
|
||||||
sprite.SourceRect = new Rectangle(0, 0, 32, 32);
|
|
||||||
#else
|
|
||||||
sprite = new Sprite(TextureLoader.PlaceHolderTexture, null, null)
|
|
||||||
{
|
|
||||||
Origin = TextureLoader.PlaceHolderTexture.Bounds.Size.ToVector2() / 2
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
size = sprite.size;
|
|
||||||
sprite.EntityID = identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!category.HasFlag(MapEntityCategory.Legacy) && string.IsNullOrEmpty(identifier))
|
|
||||||
{
|
|
||||||
DebugConsole.ThrowError(
|
|
||||||
"Item prefab \"" + name + "\" has no identifier. All item prefabs have a unique identifier string that's used to differentiate between items during saving and loading.");
|
|
||||||
}
|
|
||||||
if (!string.IsNullOrEmpty(identifier))
|
|
||||||
{
|
|
||||||
MapEntityPrefab existingPrefab = List.Find(e => e.Identifier == identifier);
|
|
||||||
if (existingPrefab != null)
|
|
||||||
{
|
|
||||||
DebugConsole.ThrowError(
|
|
||||||
"Map entity prefabs \"" + name + "\" and \"" + existingPrefab.Name + "\" have the same identifier!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AllowedLinks = element.GetAttributeStringArray("allowedlinks", new string[0], convertToLowerInvariant: true).ToList();
|
|
||||||
|
|
||||||
List.Add(this);
|
List.Add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user