ModernUO/Projects/UOContent/Engines/Advanced Search/AdvancedSearchWarningGump.cs
Kamron Batman fbbc407954
feat: Adds AdvancedSearch (XmlFind) (#1649)
### Summary

Adds Advanced Search (XmlFind) using `[AS` command.


Notable differences from XmlFind:
* No save to file.
* No "Display from" option (might add that later).
* No advanced XmlSpawner property test syntax. Only basic property operator comparisons.
* This version will freeze your shard, but fans out to all processors just like world saves. (So it should be stupid fast, especially if you have lots of cores)
* Does not support spawn entry/type/error searching. We have a spawn search command to do that already.
* I haven't set up correct "defaults" for the options when you first open it. I'll do that later.

### Screenshots
<img width="575" alt="image" src="https://github.com/modernuo/ModernUO/assets/3953314/2b08e586-0ea6-41c4-b7cd-f70e2ee62b86">

<img width="575" alt="image" src="https://github.com/modernuo/ModernUO/assets/3953314/da3f16b9-6a9e-4d2c-9d93-6cdfa67b4ddc">

<img width="572" alt="image" src="https://github.com/modernuo/ModernUO/assets/3953314/ae1d0a3f-a30d-497c-99ea-2cc988147f8f">
2023-12-28 18:55:47 -08:00

57 lines
1.7 KiB
C#

using Server.Gumps;
using Server.Network;
namespace Server.Engines.AdvancedSearch;
public abstract class AdvancedSearchWarningGump : Gump
{
public AdvancedSearchWarningGump(
string header, int headerColor, string content, int contentColor, int width, int height
) : base((640 - width) / 2, (480 - height) / 2)
{
Closable = false;
AddPage(0);
AddBackground(0, 0, width, height, 5054);
AddImageTiled(10, 10, width - 20, 20, 2624);
AddAlphaRegion(10, 10, width - 20, 20);
AddHtml(
10,
10,
width - 20,
20,
$"<BASEFONT COLOR=#{headerColor:X6}>{header}</BASEFONT>"
);
AddImageTiled(10, 40, width - 20, height - 80, 2624);
AddAlphaRegion(10, 40, width - 20, height - 80);
if (!string.IsNullOrWhiteSpace(content))
{
AddHtml(
10,
40,
width - 20,
height - 80,
$"<BASEFONT COLOR=#{contentColor:X6}>{content}</BASEFONT>",
false,
true
);
}
AddImageTiled(10, height - 30, width - 20, 20, 2624);
AddAlphaRegion(10, height - 30, width - 20, 20);
AddButton(10, height - 30, 4005, 4007, 1);
AddHtmlLocalized(40, height - 30, 170, 20, 1011036, 32767); // OKAY
AddButton(10 + (width - 20) / 2, height - 30, 4005, 4007, 0);
AddHtmlLocalized(40 + (width - 20) / 2, height - 30, 170, 20, 1011012, 32767); // CANCEL
}
public override void OnResponse(NetState sender, RelayInfo info) => OnClickResponse(sender, info.ButtonID == 1);
protected abstract void OnClickResponse(NetState sender, bool okay);
}