Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: restyle and simplify implementation of ResurrectGump #1923

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 46 additions & 73 deletions Projects/UOContent/Gumps/ResurrectGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,89 +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.AddPage();

builder.AddBackground(0, 0, 400, 350, 2600);

builder.AddHtmlLocalized(0, 20, 400, 35, 1011022); // <center>Resurrection</center>

/* It is possible for you to be resurrected here by this healer. Do you wish to try?<br>
* CONTINUE - You chose to try to come back to life now.<br>
* CANCEL - You prefer to remain a ghost for now.
*/
builder.AddHtmlLocalized(50, 55, 300, 140, 1011023 + (int)_resurrectMessage, true, true);

builder.AddButton(200, 227, 4005, 4007, 0);
builder.AddHtmlLocalized(235, 230, 110, 35, 1011012); // CANCEL

builder.AddButton(65, 227, 4005, 4007, 1);
builder.AddHtmlLocalized(100, 230, 110, 35, 1011011); // CONTINUE
}

private void BuildPricedLayout(ref DynamicGumpBuilder builder)
{
builder.SetNoClose();
builder.SetNoResize();

builder.AddPage();
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, 0x122B);

if (_price <= 0)
{
/*
* It is possible for you to be resurrected here by this healer. Do you wish to try?<br>
* CONTINUE - You chose to try to come back to life now.<br>
* 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
);

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);

// 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)
Expand Down
Loading