bdbcef4...18b4bac

commit 18b4bacd5bb645f36f62e77587af971cb789d37c
Author: Daniel Asteljoki <daniel.asteljoki@gmail.com>
Date:   Fri Mar 8 13:04:51 2019 +0200

    Added a beginner level sub

commit eef09f7d07cde64d1f2f6971eda733505339a0c0
Author: itchyOwl <lauri.harkanen@gmail.com>
Date:   Thu Mar 7 19:05:14 2019 +0200

    Remove the old sprite when recreating the sprite.

commit a6c3ce00782882bc14f200f95abab0fa4d5d9a2d
Author: itchyOwl <lauri.harkanen@gmail.com>
Date:   Thu Mar 7 19:04:51 2019 +0200

    Fix gender specific wearables not refreshing when we change the gender.

commit f606b801dac9e4cbb4238506ff4d73981709a2f8
Author: itchyOwl <lauri.harkanen@gmail.com>
Date:   Thu Mar 7 18:42:14 2019 +0200

    Move some console commands from the shared project to the client. These should not be debug only, because they might be useful for modders too.

commit 154251c183eacf37e92fa7b27bb6d57bb15797d8
Author: itchyOwl <lauri.harkanen@gmail.com>
Date:   Thu Mar 7 14:42:22 2019 +0200

    Disable latchonto ai for now.
This commit is contained in:
Joonas Rikkonen
2019-03-18 22:31:34 +02:00
parent 110d803b78
commit eac98b22fa
13 changed files with 377 additions and 195 deletions
@@ -79,6 +79,7 @@ namespace Barotrauma
if (value == _gender) { return; }
_gender = value;
IsInitialized = false;
SpritePath = ParseSpritePath(SourceElement.GetAttributeString("texture", string.Empty));
Init(_gender);
}
}
@@ -111,15 +112,16 @@ namespace Barotrauma
/// <summary>
/// Note: this constructor cannot initialize automatically, because the gender is unknown at this point. We only know it when the item is equipped.
/// </summary>
public WearableSprite(XElement subElement, Wearable item)
public WearableSprite(XElement subElement, Wearable wearable)
{
Type = WearableType.Item;
WearableComponent = item;
string texturePath = subElement.GetAttributeString("texture", string.Empty);
SpritePath = texturePath.Contains("/") ? texturePath : $"{Path.GetDirectoryName(item.Item.Prefab.ConfigFile)}/{texturePath}";
WearableComponent = wearable;
SpritePath = ParseSpritePath(subElement.GetAttributeString("texture", string.Empty));
SourceElement = subElement;
}
private string ParseSpritePath(string texturePath) => texturePath.Contains("/") ? texturePath : $"{Path.GetDirectoryName(WearableComponent.Item.Prefab.ConfigFile)}/{texturePath}";
public bool IsInitialized { get; private set; }
public void Init(Gender gender = Gender.None)
{