-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Converts ConfirmRelease, Tithing, Young gumps to static (#1854)
- Loading branch information
1 parent
8b1014f
commit ed0ce4a
Showing
5 changed files
with
217 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,52 @@ | ||
using Server.Mobiles; | ||
using Server.Network; | ||
|
||
namespace Server.Gumps | ||
namespace Server.Gumps; | ||
|
||
public class ConfirmReleaseGump : StaticGump<ConfirmReleaseGump> | ||
{ | ||
public class ConfirmReleaseGump : Gump | ||
{ | ||
private readonly Mobile m_From; | ||
private readonly BaseCreature m_Pet; | ||
private readonly Mobile _from; | ||
private readonly BaseCreature _pet; | ||
|
||
public ConfirmReleaseGump(Mobile from, BaseCreature pet) : base(50, 50) | ||
{ | ||
m_From = from; | ||
m_Pet = pet; | ||
public ConfirmReleaseGump(Mobile from, BaseCreature pet) : base(50, 50) | ||
{ | ||
_from = from; | ||
_pet = pet; | ||
} | ||
|
||
m_From.CloseGump<ConfirmReleaseGump>(); | ||
protected override void BuildLayout(ref StaticGumpBuilder builder) | ||
{ | ||
builder.AddPage(); | ||
|
||
AddPage(0); | ||
builder.AddBackground(0, 0, 270, 120, 5054); | ||
builder.AddBackground(10, 10, 250, 100, 3000); | ||
|
||
AddBackground(0, 0, 270, 120, 5054); | ||
AddBackground(10, 10, 250, 100, 3000); | ||
// Are you sure you want to release your pet? | ||
builder.AddHtmlLocalized(20, 15, 230, 60, 1046257, true, true); | ||
|
||
AddHtmlLocalized(20, 15, 230, 60, 1046257, true, true); // Are you sure you want to release your pet? | ||
builder.AddButton(20, 80, 4005, 4007, 2); | ||
builder.AddHtmlLocalized(55, 80, 75, 20, 1011011); // CONTINUE | ||
|
||
AddButton(20, 80, 4005, 4007, 2); | ||
AddHtmlLocalized(55, 80, 75, 20, 1011011); // CONTINUE | ||
builder.AddButton(135, 80, 4005, 4007, 1); | ||
builder.AddHtmlLocalized(170, 80, 75, 20, 1011012); // CANCEL | ||
} | ||
|
||
AddButton(135, 80, 4005, 4007, 1); | ||
AddHtmlLocalized(170, 80, 75, 20, 1011012); // CANCEL | ||
} | ||
public override void SendTo(NetState ns) | ||
{ | ||
_from.CloseGump<ConfirmReleaseGump>(); | ||
base.SendTo(ns); | ||
} | ||
|
||
public override void OnResponse(NetState sender, in RelayInfo info) | ||
public override void OnResponse(NetState sender, in RelayInfo info) | ||
{ | ||
if (info.ButtonID != 2 || _pet.Deleted || | ||
!(_pet.Controlled && _from == _pet.ControlMaster && | ||
_from.CheckAlive() && _pet.Map == _from.Map && _pet.InRange(_from, 14))) | ||
{ | ||
if (info.ButtonID != 2 || m_Pet.Deleted || | ||
!(m_Pet.Controlled && m_From == m_Pet.ControlMaster && | ||
m_From.CheckAlive() && m_Pet.Map == m_From.Map && m_Pet.InRange(m_From, 14))) | ||
{ | ||
return; | ||
} | ||
|
||
m_Pet.ControlTarget = null; | ||
m_Pet.ControlOrder = OrderType.Release; | ||
return; | ||
} | ||
|
||
_pet.ControlTarget = null; | ||
_pet.ControlOrder = OrderType.Release; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.