Skip to content

Commit

Permalink
Updates heritage items
Browse files Browse the repository at this point in the history
  • Loading branch information
kamronbatman committed Jun 17, 2024
1 parent 1875d60 commit c6d5a58
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 290 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public BrokenBedAddon(bool east)
}

[SerializationGenerator(0)]
public partial class BrokenBedDeed : BaseAddonDeed
public partial class BrokenBedDeed : BaseAddonDeed, IDirectionAddonDeed
{
private bool _east;
public bool East { get; set; }

[Constructible]
public BrokenBedDeed() => LootType = LootType.Blessed;

public override BaseAddon Addon => new BrokenBedAddon(_east);
public override BaseAddon Addon => new BrokenBedAddon(East);

public override int LabelNumber => 1076263; // Broken Bed

Expand All @@ -54,47 +54,17 @@ public override void OnDoubleClick(Mobile from)
}
}

private void SendTarget(Mobile m)
public void SendTarget(Mobile m)
{
base.OnDoubleClick(m);
}

private class InternalGump : Gump
private class InternalGump : SelectAddonDirectionGump<InternalGump>
{
private readonly BrokenBedDeed _deed;

public InternalGump(BrokenBedDeed deed) : base(60, 36)
public InternalGump(IDirectionAddonDeed deed) : base(deed)
{
_deed = deed;

AddPage(0);

AddBackground(0, 0, 273, 324, 0x13BE);
AddImageTiled(10, 10, 253, 20, 0xA40);
AddImageTiled(10, 40, 253, 244, 0xA40);
AddImageTiled(10, 294, 253, 20, 0xA40);
AddAlphaRegion(10, 10, 253, 304);
AddButton(10, 294, 0xFB1, 0xFB2, 0);
AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL
AddHtmlLocalized(14, 12, 273, 20, 1076749, 0x7FFF); // Please select your broken bed position

AddPage(1);

AddButton(19, 49, 0x845, 0x846, 1);
AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South
AddButton(19, 73, 0x845, 0x846, 2);
AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East
}

public override void OnResponse(NetState sender, in RelayInfo info)
{
if (_deed?.Deleted != false || info.ButtonID == 0)
{
return;
}

_deed._east = info.ButtonID != 1;
_deed.SendTarget(sender.Mobile);
}
public override int SelectionNumber => 1076749; // Please select your broken bed position
}
}
44 changes: 7 additions & 37 deletions Projects/UOContent/Items/Special/Heritage Items/Curtains.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ public CurtainsAddon(bool east)
}

[SerializationGenerator(0)]
public partial class CurtainsDeed : BaseAddonDeed
public partial class CurtainsDeed : BaseAddonDeed, IDirectionAddonDeed
{
private bool _east;
public bool East { get; set; }

[Constructible]
public CurtainsDeed() => LootType = LootType.Blessed;

public override BaseAddon Addon => new CurtainsAddon(_east);
public override BaseAddon Addon => new CurtainsAddon(East);
public override int LabelNumber => 1076280; // Curtains

public override void OnDoubleClick(Mobile from)
Expand All @@ -101,47 +101,17 @@ public override void OnDoubleClick(Mobile from)
}
}

private void SendTarget(Mobile m)
public void SendTarget(Mobile m)
{
base.OnDoubleClick(m);
}

private class InternalGump : Gump
private class InternalGump : SelectAddonDirectionGump<InternalGump>
{
private readonly CurtainsDeed _deed;

public InternalGump(CurtainsDeed deed) : base(60, 36)
public InternalGump(IDirectionAddonDeed deed) : base(deed)
{
_deed = deed;

AddPage(0);

AddBackground(0, 0, 273, 324, 0x13BE);
AddImageTiled(10, 10, 253, 20, 0xA40);
AddImageTiled(10, 40, 253, 244, 0xA40);
AddImageTiled(10, 294, 253, 20, 0xA40);
AddAlphaRegion(10, 10, 253, 304);
AddButton(10, 294, 0xFB1, 0xFB2, 0);
AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL
AddHtmlLocalized(14, 12, 273, 20, 1076581, 0x7FFF); // Please select your curtain position

AddPage(1);

AddButton(19, 49, 0x845, 0x846, 1);
AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South
AddButton(19, 73, 0x845, 0x846, 2);
AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East
}

public override void OnResponse(NetState sender, in RelayInfo info)
{
if (_deed?.Deleted != false || info.ButtonID == 0)
{
return;
}

_deed._east = info.ButtonID != 1;
_deed.SendTarget(sender.Mobile);
}
public override int SelectionNumber => 1076581; // Please select your curtain position
}
}
44 changes: 7 additions & 37 deletions Projects/UOContent/Items/Special/Heritage Items/HangingAxes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public HangingAxesAddon(bool east)
}

[SerializationGenerator(0)]
public partial class HangingAxesDeed : BaseAddonDeed
public partial class HangingAxesDeed : BaseAddonDeed, IDirectionAddonDeed
{
private bool m_East;
public bool East { get; set; }

[Constructible]
public HangingAxesDeed() => LootType = LootType.Blessed;

public override BaseAddon Addon => new HangingAxesAddon(m_East);
public override BaseAddon Addon => new HangingAxesAddon(East);
public override int LabelNumber => 1076271; // Hanging Axes

public override void OnDoubleClick(Mobile from)
Expand All @@ -49,47 +49,17 @@ public override void OnDoubleClick(Mobile from)
}
}

private void SendTarget(Mobile m)
public void SendTarget(Mobile m)
{
base.OnDoubleClick(m);
}

private class InternalGump : Gump
private class InternalGump : SelectAddonDirectionGump<InternalGump>
{
private readonly HangingAxesDeed m_Deed;

public InternalGump(HangingAxesDeed deed) : base(60, 36)
public InternalGump(IDirectionAddonDeed deed) : base(deed)
{
m_Deed = deed;

AddPage(0);

AddBackground(0, 0, 273, 324, 0x13BE);
AddImageTiled(10, 10, 253, 20, 0xA40);
AddImageTiled(10, 40, 253, 244, 0xA40);
AddImageTiled(10, 294, 253, 20, 0xA40);
AddAlphaRegion(10, 10, 253, 304);
AddButton(10, 294, 0xFB1, 0xFB2, 0);
AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL
AddHtmlLocalized(14, 12, 273, 20, 1076745, 0x7FFF); // Please select your hanging axe position

AddPage(1);

AddButton(19, 49, 0x845, 0x846, 1);
AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South
AddButton(19, 73, 0x845, 0x846, 2);
AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East
}

public override void OnResponse(NetState sender, in RelayInfo info)
{
if (m_Deed?.Deleted != false || info.ButtonID == 0)
{
return;
}

m_Deed.m_East = info.ButtonID != 1;
m_Deed.SendTarget(sender.Mobile);
}
public override int SelectionNumber => 1076745; // Please select your hanging axe position
}
}
44 changes: 7 additions & 37 deletions Projects/UOContent/Items/Special/Heritage Items/HangingSwords.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public HangingSwordsAddon(bool east)
}

[SerializationGenerator(0)]
public partial class HangingSwordsDeed : BaseAddonDeed
public partial class HangingSwordsDeed : BaseAddonDeed, IDirectionAddonDeed
{
private bool _east;
public bool East { get; set; }

[Constructible]
public HangingSwordsDeed() => LootType = LootType.Blessed;

public override BaseAddon Addon => new HangingSwordsAddon(_east);
public override BaseAddon Addon => new HangingSwordsAddon(East);
public override int LabelNumber => 1076272; // Hanging Swords

public override void OnDoubleClick(Mobile from)
Expand All @@ -49,47 +49,17 @@ public override void OnDoubleClick(Mobile from)
}
}

private void SendTarget(Mobile m)
public void SendTarget(Mobile m)
{
base.OnDoubleClick(m);
}

private class InternalGump : Gump
private class InternalGump : SelectAddonDirectionGump<InternalGump>
{
private readonly HangingSwordsDeed m_Deed;

public InternalGump(HangingSwordsDeed deed) : base(60, 36)
public InternalGump(IDirectionAddonDeed deed) : base(deed)
{
m_Deed = deed;

AddPage(0);

AddBackground(0, 0, 273, 324, 0x13BE);
AddImageTiled(10, 10, 253, 20, 0xA40);
AddImageTiled(10, 40, 253, 244, 0xA40);
AddImageTiled(10, 294, 253, 20, 0xA40);
AddAlphaRegion(10, 10, 253, 304);
AddButton(10, 294, 0xFB1, 0xFB2, 0);
AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL
AddHtmlLocalized(14, 12, 273, 20, 1076746, 0x7FFF); // Please select your hanging sword position

AddPage(1);

AddButton(19, 49, 0x845, 0x846, 1);
AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South
AddButton(19, 73, 0x845, 0x846, 2);
AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East
}

public override void OnResponse(NetState sender, in RelayInfo info)
{
if (m_Deed?.Deleted != false || info.ButtonID == 0)
{
return;
}

m_Deed._east = info.ButtonID != 1;
m_Deed.SendTarget(sender.Mobile);
}
public override int SelectionNumber => 1076746; // Please select your hanging sword position
}
}
63 changes: 32 additions & 31 deletions Projects/UOContent/Items/Special/Heritage Items/HouseLadder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,44 +95,45 @@ private void SendTarget(Mobile m)
base.OnDoubleClick(m);
}

private class InternalGump : Gump
private class InternalGump : StaticGump<InternalGump>
{
private readonly HouseLadderDeed _deed;

public InternalGump(HouseLadderDeed deed) : base(60, 36)
public InternalGump(HouseLadderDeed deed) : base(60, 36) => _deed = deed;

protected override void BuildLayout(ref StaticGumpBuilder builder)
{
_deed = deed;
builder.AddPage();

AddPage(0);
builder.AddBackground(0, 0, 273, 324, 0x13BE);
builder.AddImageTiled(10, 10, 253, 20, 0xA40);
builder.AddImageTiled(10, 40, 253, 244, 0xA40);
builder.AddImageTiled(10, 294, 253, 20, 0xA40);
builder.AddAlphaRegion(10, 10, 253, 304);
builder.AddButton(10, 294, 0xFB1, 0xFB2, 0);
builder.AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL

AddBackground(0, 0, 273, 324, 0x13BE);
AddImageTiled(10, 10, 253, 20, 0xA40);
AddImageTiled(10, 40, 253, 244, 0xA40);
AddImageTiled(10, 294, 253, 20, 0xA40);
AddAlphaRegion(10, 10, 253, 304);
AddButton(10, 294, 0xFB1, 0xFB2, 0);
AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL
// Please select your ladder position. <br>Use the ladders marked (castle) <br> for accessing the tops of keeps <br> and castles.
AddHtmlLocalized(14, 12, 273, 20, 1076780, 0x7FFF);

AddPage(1);

AddButton(19, 49, 0x845, 0x846, 1);
AddHtmlLocalized(44, 47, 213, 20, 1076794, 0x7FFF); // South (Castle)
AddButton(19, 73, 0x845, 0x846, 2);
AddHtmlLocalized(44, 71, 213, 20, 1076795, 0x7FFF); // East (Castle)
AddButton(19, 97, 0x845, 0x846, 3);
AddHtmlLocalized(44, 95, 213, 20, 1076792, 0x7FFF); // North (Castle)
AddButton(19, 121, 0x845, 0x846, 4);
AddHtmlLocalized(44, 119, 213, 20, 1076793, 0x7FFF); // West (Castle)
AddButton(19, 145, 0x845, 0x846, 5);
AddHtmlLocalized(44, 143, 213, 20, 1075386, 0x7FFF); // South
AddButton(19, 169, 0x845, 0x846, 6);
AddHtmlLocalized(44, 167, 213, 20, 1075387, 0x7FFF); // East
AddButton(19, 193, 0x845, 0x846, 7);
AddHtmlLocalized(44, 191, 213, 20, 1075389, 0x7FFF); // North
AddButton(19, 217, 0x845, 0x846, 8);
AddHtmlLocalized(44, 215, 213, 20, 1075390, 0x7FFF); // West
builder.AddHtmlLocalized(14, 12, 273, 20, 1076780, 0x7FFF);

builder.AddPage(1);

builder.AddButton(19, 49, 0x845, 0x846, 1);
builder.AddHtmlLocalized(44, 47, 213, 20, 1076794, 0x7FFF); // South (Castle)
builder.AddButton(19, 73, 0x845, 0x846, 2);
builder.AddHtmlLocalized(44, 71, 213, 20, 1076795, 0x7FFF); // East (Castle)
builder.AddButton(19, 97, 0x845, 0x846, 3);
builder.AddHtmlLocalized(44, 95, 213, 20, 1076792, 0x7FFF); // North (Castle)
builder.AddButton(19, 121, 0x845, 0x846, 4);
builder.AddHtmlLocalized(44, 119, 213, 20, 1076793, 0x7FFF); // West (Castle)
builder.AddButton(19, 145, 0x845, 0x846, 5);
builder.AddHtmlLocalized(44, 143, 213, 20, 1075386, 0x7FFF); // South
builder.AddButton(19, 169, 0x845, 0x846, 6);
builder.AddHtmlLocalized(44, 167, 213, 20, 1075387, 0x7FFF); // East
builder.AddButton(19, 193, 0x845, 0x846, 7);
builder.AddHtmlLocalized(44, 191, 213, 20, 1075389, 0x7FFF); // North
builder.AddButton(19, 217, 0x845, 0x846, 8);
builder.AddHtmlLocalized(44, 215, 213, 20, 1075390, 0x7FFF); // West
}

public override void OnResponse(NetState sender, in RelayInfo info)
Expand Down
Loading

0 comments on commit c6d5a58

Please sign in to comment.