fix: Fixes commodity resource property hue (#1875)
### Summary - Fixes resource commodities so the hue changes when setting the resource - Fixes some commodities not being able to be modified in-game.
This commit is contained in:
parent
eed11be012
commit
3cb688a2fb
12 changed files with 151 additions and 45 deletions
|
|
@ -5,11 +5,6 @@ namespace Server.Items;
|
|||
[SerializationGenerator(2, false)]
|
||||
public abstract partial class BaseGranite : Item
|
||||
{
|
||||
[InvalidateProperties]
|
||||
[SerializableField(0)]
|
||||
[SerializedCommandProperty(AccessLevel.GameMaster)]
|
||||
private CraftResource _resource;
|
||||
|
||||
public BaseGranite(CraftResource resource) : base(0x1779)
|
||||
{
|
||||
Hue = CraftResources.GetHue(resource);
|
||||
|
|
@ -20,6 +15,24 @@ public abstract partial class BaseGranite : Item
|
|||
|
||||
public override double DefaultWeight => Core.ML ? 1.0 : 10.0;
|
||||
|
||||
[SerializableProperty(0)]
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get => _resource;
|
||||
set
|
||||
{
|
||||
if (_resource != value)
|
||||
{
|
||||
_resource = value;
|
||||
Hue = CraftResources.GetHue(value);
|
||||
|
||||
InvalidateProperties();
|
||||
this.MarkDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1044607; // high quality granite
|
||||
|
||||
private void Deserialize(IGenericReader reader, int version)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue