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:
Kamron Batman 2024-07-20 15:37:16 -07:00 • committed by GitHub
parent eed11be012
commit 3cb688a2fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 151 additions and 45 deletions

View file

@ -6,10 +6,6 @@ namespace Server.Items;
[SerializationGenerator(4, false)]
public partial class Board : Item, ICommodity
{
[InvalidateProperties]
[SerializableField(0)]
private CraftResource _resource;
[Constructible]
public Board(int amount = 1) : this(CraftResource.RegularWood, amount)
{
@ -25,6 +21,24 @@ public partial class Board : Item, ICommodity
Hue = CraftResources.GetHue(resource);
}
[SerializableProperty(0)]
[CommandProperty(AccessLevel.GameMaster)]
public CraftResource Resource
{
get => _resource;
set
{
if (_resource != value)
{
_resource = value;
Hue = CraftResources.GetHue(value);
InvalidateProperties();
this.MarkDirty();
}
}
}
int ICommodity.DescriptionNumber
{
get