Engineer's helmet (#188)
* refacting some sprite things * fix sprites * Netcode for sending a new icon state to the ClientComponent * Fixed broken torches. * Fix dirty calls. * ClothingComponentState now also includes EquippedPrefix * Inherritance ClothingComponent : ItemComponent * Added parameter to ItemComponentState constructor. * Update RobustToolbox * Revert "Update RobustToolbox" This reverts commit 82c7e98ff3853b64698d5e80a45cd7a3758618e0. Undo weird commit to toolbox?
This commit is contained in:
committed by
Pieter-Jan Briers
parent
50433c7ab6
commit
35f3cbe3f9
@@ -1,4 +1,7 @@
|
||||
using SS14.Shared.Serialization;
|
||||
using Content.Shared.GameObjects;
|
||||
using Content.Shared.GameObjects.Components.Items;
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
|
||||
@@ -8,11 +11,28 @@ namespace Content.Server.GameObjects
|
||||
public class ClothingComponent : ItemComponent
|
||||
{
|
||||
public override string Name => "Clothing";
|
||||
public override uint? NetID => ContentNetIDs.CLOTHING;
|
||||
public override Type StateType => typeof(ClothingComponentState);
|
||||
|
||||
public SlotFlags SlotFlags = SlotFlags.PREVENTEQUIP; //Different from None, NONE allows equips if no slot flags are required
|
||||
|
||||
private int _heatResistance;
|
||||
public int HeatResistance => _heatResistance;
|
||||
|
||||
private string _clothingEquippedPrefix;
|
||||
public string ClothingEquippedPrefix
|
||||
{
|
||||
get
|
||||
{
|
||||
return _clothingEquippedPrefix;
|
||||
}
|
||||
set
|
||||
{
|
||||
Dirty();
|
||||
_clothingEquippedPrefix = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
@@ -28,5 +48,10 @@ namespace Content.Server.GameObjects
|
||||
|
||||
serializer.DataFieldCached(ref _heatResistance, "HeatResistance", 323);
|
||||
}
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
{
|
||||
return new ClothingComponentState(ClothingEquippedPrefix, EquippedPrefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,13 +3,32 @@ using SS14.Server.Interfaces.GameObjects;
|
||||
using Content.Shared.GameObjects;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using SS14.Shared.GameObjects;
|
||||
using System;
|
||||
using Content.Shared.GameObjects.Components.Items;
|
||||
|
||||
namespace Content.Server.GameObjects
|
||||
{
|
||||
public class ItemComponent : StoreableComponent, IAttackHand
|
||||
{
|
||||
public override string Name => "Item";
|
||||
public override uint? NetID => ContentNetIDs.ITEM;
|
||||
public override Type StateType => typeof(ItemComponentState);
|
||||
|
||||
private string _equippedPrefix;
|
||||
|
||||
public string EquippedPrefix
|
||||
{
|
||||
get
|
||||
{
|
||||
return _equippedPrefix;
|
||||
}
|
||||
set
|
||||
{
|
||||
Dirty();
|
||||
_equippedPrefix = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void RemovedFromSlot()
|
||||
{
|
||||
@@ -63,5 +82,10 @@ namespace Content.Server.GameObjects
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
{
|
||||
return new ItemComponentState(EquippedPrefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Content.Server.GameObjects
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user