fix: Codegens construction items (#1520)
This commit is contained in:
parent
972949455b
commit
5dc2d09392
83 changed files with 972 additions and 1859 deletions
|
|
@ -1,25 +1,9 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public abstract partial class BaseSign : Item
|
||||
{
|
||||
public abstract class BaseSign : Item
|
||||
{
|
||||
public BaseSign(int dispID) : base(dispID) => Movable = false;
|
||||
|
||||
public BaseSign(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
public BaseSign(int dispID) : base(dispID) => Movable = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,56 +1,21 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class LocalizedSign : Sign
|
||||
{
|
||||
public class LocalizedSign : Sign
|
||||
{
|
||||
private int m_LabelNumber;
|
||||
[InvalidateProperties]
|
||||
[SerializableField(0)]
|
||||
[SerializedCommandProperty(AccessLevel.GameMaster)]
|
||||
private int _number;
|
||||
|
||||
[Constructible]
|
||||
public LocalizedSign(SignType type, SignFacing facing, int labelNumber) :
|
||||
base(0xB95 + 2 * (int)type + (int)facing) => m_LabelNumber = labelNumber;
|
||||
[Constructible]
|
||||
public LocalizedSign(SignType type, SignFacing facing, int labelNumber) :
|
||||
base(0xB95 + 2 * (int)type + (int)facing) => _number = labelNumber;
|
||||
|
||||
[Constructible]
|
||||
public LocalizedSign(int itemID, int labelNumber) : base(itemID) => m_LabelNumber = labelNumber;
|
||||
[Constructible]
|
||||
public LocalizedSign(int itemID, int labelNumber) : base(itemID) => _number = labelNumber;
|
||||
|
||||
public LocalizedSign(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => m_LabelNumber;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Number
|
||||
{
|
||||
get => m_LabelNumber;
|
||||
set
|
||||
{
|
||||
m_LabelNumber = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(m_LabelNumber);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_LabelNumber = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public override int LabelNumber => _number;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,104 +1,88 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
public enum SignFacing
|
||||
{
|
||||
public enum SignFacing
|
||||
North,
|
||||
West
|
||||
}
|
||||
|
||||
public enum SignType
|
||||
{
|
||||
Library,
|
||||
DarkWoodenPost,
|
||||
LightWoodenPost,
|
||||
MetalPostC,
|
||||
MetalPostB,
|
||||
MetalPostA,
|
||||
MetalPost,
|
||||
Bakery,
|
||||
Tailor,
|
||||
Tinker,
|
||||
Butcher,
|
||||
Healer,
|
||||
Mage,
|
||||
Woodworker,
|
||||
Customs,
|
||||
Inn,
|
||||
Shipwright,
|
||||
Stables,
|
||||
BarberShop,
|
||||
Bard,
|
||||
Fletcher,
|
||||
Armourer,
|
||||
Jeweler,
|
||||
Tavern,
|
||||
ReagentShop,
|
||||
Blacksmith,
|
||||
Painter,
|
||||
Provisioner,
|
||||
Bowyer,
|
||||
WoodenSign,
|
||||
BrassSign,
|
||||
ArmamentsGuild,
|
||||
ArmourersGuild,
|
||||
BlacksmithsGuild,
|
||||
WeaponsGuild,
|
||||
BardicGuild,
|
||||
BartersGuild,
|
||||
ProvisionersGuild,
|
||||
TradersGuild,
|
||||
CooksGuild,
|
||||
HealersGuild,
|
||||
MagesGuild,
|
||||
SorcerersGuild,
|
||||
IllusionistGuild,
|
||||
MinersGuild,
|
||||
ArchersGuild,
|
||||
SeamensGuild,
|
||||
FishermensGuild,
|
||||
SailorsGuild,
|
||||
ShipwrightsGuild,
|
||||
TailorsGuild,
|
||||
ThievesGuild,
|
||||
RoguesGuild,
|
||||
AssassinsGuild,
|
||||
TinkersGuild,
|
||||
WarriorsGuild,
|
||||
CavalryGuild,
|
||||
FightersGuild,
|
||||
MerchantsGuild,
|
||||
Bank,
|
||||
Theatre
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class Sign : BaseSign
|
||||
{
|
||||
[Constructible]
|
||||
public Sign(SignType type, SignFacing facing) : base(0xB95 + 2 * (int)type + (int)facing)
|
||||
{
|
||||
North,
|
||||
West
|
||||
}
|
||||
|
||||
public enum SignType
|
||||
[Constructible]
|
||||
public Sign(int itemID) : base(itemID)
|
||||
{
|
||||
Library,
|
||||
DarkWoodenPost,
|
||||
LightWoodenPost,
|
||||
MetalPostC,
|
||||
MetalPostB,
|
||||
MetalPostA,
|
||||
MetalPost,
|
||||
Bakery,
|
||||
Tailor,
|
||||
Tinker,
|
||||
Butcher,
|
||||
Healer,
|
||||
Mage,
|
||||
Woodworker,
|
||||
Customs,
|
||||
Inn,
|
||||
Shipwright,
|
||||
Stables,
|
||||
BarberShop,
|
||||
Bard,
|
||||
Fletcher,
|
||||
Armourer,
|
||||
Jeweler,
|
||||
Tavern,
|
||||
ReagentShop,
|
||||
Blacksmith,
|
||||
Painter,
|
||||
Provisioner,
|
||||
Bowyer,
|
||||
WoodenSign,
|
||||
BrassSign,
|
||||
ArmamentsGuild,
|
||||
ArmourersGuild,
|
||||
BlacksmithsGuild,
|
||||
WeaponsGuild,
|
||||
BardicGuild,
|
||||
BartersGuild,
|
||||
ProvisionersGuild,
|
||||
TradersGuild,
|
||||
CooksGuild,
|
||||
HealersGuild,
|
||||
MagesGuild,
|
||||
SorcerersGuild,
|
||||
IllusionistGuild,
|
||||
MinersGuild,
|
||||
ArchersGuild,
|
||||
SeamensGuild,
|
||||
FishermensGuild,
|
||||
SailorsGuild,
|
||||
ShipwrightsGuild,
|
||||
TailorsGuild,
|
||||
ThievesGuild,
|
||||
RoguesGuild,
|
||||
AssassinsGuild,
|
||||
TinkersGuild,
|
||||
WarriorsGuild,
|
||||
CavalryGuild,
|
||||
FightersGuild,
|
||||
MerchantsGuild,
|
||||
Bank,
|
||||
Theatre
|
||||
}
|
||||
|
||||
public class Sign : BaseSign
|
||||
{
|
||||
[Constructible]
|
||||
public Sign(SignType type, SignFacing facing) : base(0xB95 + 2 * (int)type + (int)facing)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public Sign(int itemID) : base(itemID)
|
||||
{
|
||||
}
|
||||
|
||||
public Sign(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,71 +1,38 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class SubtextSign : Sign
|
||||
{
|
||||
public class SubtextSign : Sign
|
||||
[InvalidateProperties]
|
||||
[SerializableField(0)]
|
||||
[SerializedCommandProperty(AccessLevel.GameMaster)]
|
||||
private string _subText;
|
||||
|
||||
[Constructible]
|
||||
public SubtextSign(SignType type, SignFacing facing, string subtext) : base(type, facing) => _subText = subtext;
|
||||
|
||||
[Constructible]
|
||||
public SubtextSign(int itemID, string subtext) : base(itemID) => _subText = subtext;
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
private string m_Subtext;
|
||||
base.OnSingleClick(from);
|
||||
|
||||
[Constructible]
|
||||
public SubtextSign(SignType type, SignFacing facing, string subtext)
|
||||
: base(type, facing) =>
|
||||
m_Subtext = subtext;
|
||||
|
||||
[Constructible]
|
||||
public SubtextSign(int itemID, string subtext)
|
||||
: base(itemID) =>
|
||||
m_Subtext = subtext;
|
||||
|
||||
public SubtextSign(Serial serial)
|
||||
: base(serial)
|
||||
if (!string.IsNullOrEmpty(_subText))
|
||||
{
|
||||
LabelTo(from, _subText);
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string Subtext
|
||||
public override void AddNameProperties(IPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
if (!string.IsNullOrEmpty(_subText))
|
||||
{
|
||||
get => m_Subtext;
|
||||
set
|
||||
{
|
||||
m_Subtext = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
if (!string.IsNullOrEmpty(m_Subtext))
|
||||
{
|
||||
LabelTo(from, m_Subtext);
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperties(IPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
if (!string.IsNullOrEmpty(m_Subtext))
|
||||
{
|
||||
list.Add(m_Subtext);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(m_Subtext);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
m_Subtext = reader.ReadString();
|
||||
list.Add(_subText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue