From f858b6c61322f107f9b4041b1078cecf62f81f18 Mon Sep 17 00:00:00 2001 From: Leath Cooper Date: Sat, 10 Aug 2024 17:13:45 -0400 Subject: [PATCH 1/3] res gump testing --- Projects/UOContent/Gumps/CustomGump.cs | 50 +++++++++++++++++++++++ Projects/UOContent/Gumps/ResurrectGump.cs | 28 ++++++++----- 2 files changed, 67 insertions(+), 11 deletions(-) create mode 100644 Projects/UOContent/Gumps/CustomGump.cs diff --git a/Projects/UOContent/Gumps/CustomGump.cs b/Projects/UOContent/Gumps/CustomGump.cs new file mode 100644 index 0000000000..85c07d0cef --- /dev/null +++ b/Projects/UOContent/Gumps/CustomGump.cs @@ -0,0 +1,50 @@ +namespace Server.Gumps; + +public class CustomGump : DynamicGump +{ + public static void Configure() + { + CommandSystem.Register("CustomGump", AccessLevel.Administrator, e => DisplayTo(e.Mobile)); + } + + public static void DisplayTo(Mobile user) + { + if (user == null || user.Deleted || !user.Player || user.NetState == null) + return; + + user.CloseGump(); + user.SendGump(new CustomGump()); + } + + public CustomGump() + : base(150, 150) + { + } + + protected override void BuildLayout(ref DynamicGumpBuilder builder) + { + builder.SetNoClose(); + builder.SetNoResize(); + + builder.AddPage(); + builder.AddBackground(0, 0, 330, 255, 2620); + builder.AddItem(20, 80, 4650); + builder.AddItem(30, 60, 4653); + builder.AddItem(20, 20, 3); + builder.AddItem(0, 20, 2); + builder.AddItem(40, 90, 4651); + + /* + * It is possible for you to be resurrected here by this healer. Do you wish to try?
+ * CONTINUE - You chose to try to come back to life now.
+ * CANCEL - You prefer to remain a ghost for now. + */ + builder.AddHtmlLocalized(90, 20, 220, 200, 1011023 + (int)2, 0x7FFF); + + builder.AddButton(280, 180, 4005, 4007, 0); + builder.AddHtmlLocalized(220, 182, 110, 35, 1011012, 0x7FFF); // CANCEL + + builder.AddButton(280, 210, 4005, 4007, 1); + builder.AddHtmlLocalized(210, 212, 110, 35, 1011011, 0x7FFF); // CONTINUE + } +} diff --git a/Projects/UOContent/Gumps/ResurrectGump.cs b/Projects/UOContent/Gumps/ResurrectGump.cs index 6612db956b..93137351cf 100644 --- a/Projects/UOContent/Gumps/ResurrectGump.cs +++ b/Projects/UOContent/Gumps/ResurrectGump.cs @@ -101,23 +101,29 @@ protected override void BuildLayout(ref DynamicGumpBuilder builder) private void BuildDefaultLayout(ref DynamicGumpBuilder builder) { - builder.AddPage(); - - builder.AddBackground(0, 0, 400, 350, 2600); - - builder.AddHtmlLocalized(0, 20, 400, 35, 1011022); //
Resurrection
+ builder.SetNoClose(); + builder.SetNoResize(); - /* It is possible for you to be resurrected here by this healer. Do you wish to try?
+ builder.AddPage(); + builder.AddBackground(0, 0, 330, 255, 2620); + builder.AddItem(20, 80, 4650); + builder.AddItem(30, 60, 4653); + builder.AddItem(20, 20, 3); + builder.AddItem(0, 20, 2); + builder.AddItem(40, 90, 4651); + + /* + * It is possible for you to be resurrected here by this healer. Do you wish to try?
* CONTINUE - You chose to try to come back to life now.
* CANCEL - You prefer to remain a ghost for now. */ - builder.AddHtmlLocalized(50, 55, 300, 140, 1011023 + (int)_resurrectMessage, true, true); + builder.AddHtmlLocalized(90, 20, 220, 200, 1011023 + (int)_resurrectMessage, 0x7FFF); - builder.AddButton(200, 227, 4005, 4007, 0); - builder.AddHtmlLocalized(235, 230, 110, 35, 1011012); // CANCEL + builder.AddButton(280, 180, 4005, 4007, 0); + builder.AddHtmlLocalized(220, 182, 110, 35, 1011012, 0x7FFF); // CANCEL - builder.AddButton(65, 227, 4005, 4007, 1); - builder.AddHtmlLocalized(100, 230, 110, 35, 1011011); // CONTINUE + builder.AddButton(280, 210, 4005, 4007, 1); + builder.AddHtmlLocalized(210, 212, 110, 35, 1011011, 0x7FFF); // CONTINUE } private void BuildPricedLayout(ref DynamicGumpBuilder builder) From a62ef5970c73d47f91bf20ca1d5406e32761dffd Mon Sep 17 00:00:00 2001 From: Leath Cooper Date: Sun, 11 Aug 2024 15:19:14 -0400 Subject: [PATCH 2/3] simplify ResurrectGump implementation --- Projects/UOContent/Gumps/ResurrectGump.cs | 117 ++++++++-------------- 1 file changed, 42 insertions(+), 75 deletions(-) diff --git a/Projects/UOContent/Gumps/ResurrectGump.cs b/Projects/UOContent/Gumps/ResurrectGump.cs index 93137351cf..d5861e1536 100644 --- a/Projects/UOContent/Gumps/ResurrectGump.cs +++ b/Projects/UOContent/Gumps/ResurrectGump.cs @@ -89,95 +89,62 @@ public ResurrectGump( } protected override void BuildLayout(ref DynamicGumpBuilder builder) - { - if (_price > 0) - { - BuildPricedLayout(ref builder); - return; - } - - BuildDefaultLayout(ref builder); - } - - private void BuildDefaultLayout(ref DynamicGumpBuilder builder) { builder.SetNoClose(); builder.SetNoResize(); builder.AddPage(); - builder.AddBackground(0, 0, 330, 255, 2620); - builder.AddItem(20, 80, 4650); - builder.AddItem(30, 60, 4653); + builder.AddBackground(0, 0, 330, 265, 0x1400); + builder.AddItem(20, 80, 0x122A); + builder.AddItem(30, 60, 0x122D); builder.AddItem(20, 20, 3); builder.AddItem(0, 20, 2); - builder.AddItem(40, 90, 4651); - - /* - * It is possible for you to be resurrected here by this healer. Do you wish to try?
- * CONTINUE - You chose to try to come back to life now.
- * CANCEL - You prefer to remain a ghost for now. - */ - builder.AddHtmlLocalized(90, 20, 220, 200, 1011023 + (int)_resurrectMessage, 0x7FFF); - - builder.AddButton(280, 180, 4005, 4007, 0); - builder.AddHtmlLocalized(220, 182, 110, 35, 1011012, 0x7FFF); // CANCEL - - builder.AddButton(280, 210, 4005, 4007, 1); - builder.AddHtmlLocalized(210, 212, 110, 35, 1011011, 0x7FFF); // CONTINUE - } - - private void BuildPricedLayout(ref DynamicGumpBuilder builder) - { - builder.SetNoClose(); + builder.AddItem(40, 90, 0x122B); - builder.AddPage(); - - builder.AddImage(0, 0, 3600); - - builder.AddImageTiled(0, 14, 15, 200, 3603); - builder.AddImageTiled(380, 14, 14, 200, 3605); - - builder.AddImage(0, 201, 3606); - - builder.AddImageTiled(15, 201, 370, 16, 3607); - builder.AddImageTiled(15, 0, 370, 16, 3601); - - builder.AddImage(380, 0, 3602); - - builder.AddImage(380, 201, 3608); - - builder.AddImageTiled(15, 15, 365, 190, 2624); - - builder.AddRadio(30, 140, 9727, 9730, true, 1); - builder.AddHtmlLocalized(65, 145, 300, 25, 1060015, 0x7FFF); // Grudgingly pay the money - - builder.AddRadio(30, 175, 9727, 9730, false, 0); - builder.AddHtmlLocalized(65, 178, 300, 25, 1060016, 0x7FFF); // I'd rather stay dead, you scoundrel!!! - - // Wishing to rejoin the living, are you? I can restore your body... for a price of course... - builder.AddHtmlLocalized(30, 20, 360, 35, 1060017, 0x7FFF); + if (_price <= 0) + { + /* + * It is possible for you to be resurrected here by this healer. Do you wish to try?
+ * CONTINUE - You chose to try to come back to life now.
+ * CANCEL - You prefer to remain a ghost for now. + */ + builder.AddHtmlLocalized(90, 20, 220, 200, 1011023 + (int)_resurrectMessage, 0x7FFF); + + builder.AddButton(280, 220, 0xFB7, 0xFB9, 1); + builder.AddHtmlLocalized(210, 222, 110, 35, 1011011, 0x7FFF); // CONTINUE + + builder.AddButton(280, 190, 0xFAE, 0xFB0, 0); + builder.AddHtmlLocalized(220, 192, 110, 35, 1011012, 0x7FFF); // CANCEL + } + else + { + // Wishing to rejoin the living are you? I can restore your body... for a price of course... + builder.AddHtmlLocalized( + 90, + 20, + 220, + 200, + 1060017, + 0x7FFF + ); - // Do you accept the fee, which will be withdrawn from your bank? - builder.AddHtmlLocalized(30, 105, 345, 40, 1060018, 0x5B2D); + // Do you accept the fee, which will be withdrawn from your bank? + builder.AddHtmlLocalized(30, 120, 220, 40, 1060018, 0x5B2D); - builder.AddImage(65, 72, 5605); + builder.AddRadio(30, 160, 0x25FF, 0x2602, true, 1); + builder.AddHtmlLocalized(65, 163, 300, 25, 1060015, 0x7FFF); // Grudgingly pay the money - builder.AddImageTiled(80, 90, 200, 1, 9107); - builder.AddImageTiled(95, 92, 200, 1, 9157); + builder.AddRadio(30, 195, 0x25FF, 0x2602, false, 0); + builder.AddHtmlLocalized(65, 198, 300, 25, 1060016, 0x7FFF); // I'd rather stay dead, you scoundrel!!! - builder.AddLabel(90, 70, 1645, $"{_price}"); - builder.AddHtmlLocalized(140, 70, 100, 25, 1023823, 0x7FFF); // gold coins + builder.AddImageTiled(85, 105, 195, 1, 0x2393); // Two dumb lines below the price + builder.AddImageTiled(100, 107, 195, 1, 0x23C5); - builder.AddButton(290, 175, 247, 248, 2); + builder.AddLabel(95, 80, 1645, $"{_price}"); + builder.AddHtmlLocalized(145, 80, 100, 25, 1023823, 0x7FFF); // gold coins - builder.AddImageTiled(15, 14, 365, 1, 9107); - builder.AddImageTiled(380, 14, 1, 190, 9105); - builder.AddImageTiled(15, 205, 365, 1, 9107); - builder.AddImageTiled(15, 14, 1, 190, 9105); - builder.AddImageTiled(0, 0, 395, 1, 9157); - builder.AddImageTiled(394, 0, 1, 217, 9155); - builder.AddImageTiled(0, 216, 395, 1, 9157); - builder.AddImageTiled(0, 0, 1, 217, 9155); + builder.AddButton(255, 230, 0xF7, 0xF8, 2); + } } public override void OnResponse(NetState state, in RelayInfo info) From c9940a992725115815d1e7b387054d95987efaa9 Mon Sep 17 00:00:00 2001 From: Leath Cooper Date: Sun, 11 Aug 2024 20:50:29 -0400 Subject: [PATCH 3/3] remove temp CustomGump export from GumpStudio hehe --- Projects/UOContent/Gumps/CustomGump.cs | 50 -------------------------- 1 file changed, 50 deletions(-) delete mode 100644 Projects/UOContent/Gumps/CustomGump.cs diff --git a/Projects/UOContent/Gumps/CustomGump.cs b/Projects/UOContent/Gumps/CustomGump.cs deleted file mode 100644 index 85c07d0cef..0000000000 --- a/Projects/UOContent/Gumps/CustomGump.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace Server.Gumps; - -public class CustomGump : DynamicGump -{ - public static void Configure() - { - CommandSystem.Register("CustomGump", AccessLevel.Administrator, e => DisplayTo(e.Mobile)); - } - - public static void DisplayTo(Mobile user) - { - if (user == null || user.Deleted || !user.Player || user.NetState == null) - return; - - user.CloseGump(); - user.SendGump(new CustomGump()); - } - - public CustomGump() - : base(150, 150) - { - } - - protected override void BuildLayout(ref DynamicGumpBuilder builder) - { - builder.SetNoClose(); - builder.SetNoResize(); - - builder.AddPage(); - builder.AddBackground(0, 0, 330, 255, 2620); - builder.AddItem(20, 80, 4650); - builder.AddItem(30, 60, 4653); - builder.AddItem(20, 20, 3); - builder.AddItem(0, 20, 2); - builder.AddItem(40, 90, 4651); - - /* - * It is possible for you to be resurrected here by this healer. Do you wish to try?
- * CONTINUE - You chose to try to come back to life now.
- * CANCEL - You prefer to remain a ghost for now. - */ - builder.AddHtmlLocalized(90, 20, 220, 200, 1011023 + (int)2, 0x7FFF); - - builder.AddButton(280, 180, 4005, 4007, 0); - builder.AddHtmlLocalized(220, 182, 110, 35, 1011012, 0x7FFF); // CANCEL - - builder.AddButton(280, 210, 4005, 4007, 1); - builder.AddHtmlLocalized(210, 212, 110, 35, 1011011, 0x7FFF); // CONTINUE - } -}