fix: Fixes [spawn gump for older clients (#1108)

This commit is contained in:
nullptr-w8 2022-07-04 19:20:20 +05:00 committed by GitHub
parent 8303c74379
commit ad0e1702a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,15 +42,19 @@ public class SpawnerControllerGump : GumpGrid
e.Mobile.SendGump(new SpawnerControllerGump(e.Mobile));
}
public void AddBlackAlpha(int x, int y, int width, int height)
{
AddImageTiled(x, y, width, height, 2624);
AddAlphaRegion(x, y, width, height);
}
public void DrawBorder(ListView list)
{
AddBackground(0, 0, _main.Width, _main.Height, 1755);
var row1Y = _main.Rows[1].Y;
AddImageTiled(0, row1Y, _main.Width, 3, 1756);
AddImageTiled(0, row1Y, _main.Width, 3, 9357);
AddAlphaRegion(0, row1Y, _main.Width, 3);
AddImageTiled(0, row1Y + 21, _main.Width, 3, 1756);
AddImageTiled(0, row1Y + 21, _main.Width, 3, 9357);
AddAlphaRegion(0, row1Y + 21, _main.Width, 3);
for (int i = 0; i < list.ColsCount - 1; i++)
@ -58,12 +62,14 @@ public class SpawnerControllerGump : GumpGrid
var x = list.Header.Cols[i].HEnd - 8;
var y = list.Header.Y + 10;
var height = 20;
AddImageTiled(x, y, 3, height, 1758);
AddImageTiled(x, y, 3, height, 9355);
AddAlphaRegion(x, y, 3, height);
}
AddImageTiled(0, _main.Rows[2].Y - 11, _main.Width, 6, 1756);
AddImageTiled(0, _main.Rows[2].Y + 55, _main.Width, 6, 1756);
AddImageTiled(0, _main.Rows[2].Y - 11, _main.Width, 6, 9357);
AddAlphaRegion(0, _main.Rows[2].Y - 11, _main.Width, 6);
AddImageTiled(0, _main.Rows[2].Y + 55, _main.Width, 6, 9357);
AddAlphaRegion(0, _main.Rows[2].Y + 55, _main.Width, 6);
}
private static string ExtractCoords(Point3D cord) => $"X {cord.X} Y {cord.Y}";
@ -82,8 +88,11 @@ public class SpawnerControllerGump : GumpGrid
AddLabelHtml(col0X, row0Y + 8, col1X, 30, "Search type", GridColors.Gold);
AddLabelHtml(col1X, row0Y + 8, col1X, 30, "Search Match", GridColors.Gold);
AddImageTiled(0, row0Y + 30, _main.Width, 3, 1756);
AddImageTiled(col1X, row0Y, 3, search.Height, 1758);
AddImageTiled(0, row0Y + 30, _main.Width, 3, 9357);
AddAlphaRegion(0, row0Y + 30, _main.Width, 3);
AddImageTiled(col1X, row0Y, 3, search.Height, 9355);
AddAlphaRegion(col1X, row0Y, 3, search.Height);
var creature = _search.Type == SpawnSearchType.Creature ? 9021 : 9020;
var cords = _search.Type == SpawnSearchType.Coords ? 9021 : 9020;
@ -250,11 +259,9 @@ public class SpawnerControllerGump : GumpGrid
AddLabelHtml(item.Cols[3].X, list.Items[i].Y + vCenter, list.Header.Cols[3].Width, 30, spawner.Map.ToString(), GridColors.White);
//teleport button
AddButton(item.Cols[4].X, list.Items[i].Y + vCenter - 4, 0x10, 0x10, GetButtonID(5, item.Index));
AddButton(item.Cols[4].X + 20, list.Items[i].Y + vCenter - 4, 0x10, 0x10, GetButtonID(5, item.Index));
AddImage(item.Cols[4].X, list.Items[i].Y + vCenter - 5, 0x638, 936);
AddImage(item.Cols[4].X + 50, list.Items[i].Y + vCenter - 5, 0x638, 936);
AddLabelHtml(item.Cols[4].X, list.Items[i].Y + vCenter, list.Header.Cols[4].Width, 30, ExtractCoords(spawner.Location), GridColors.White);
AddButton(item.Cols[4].X - 5, list.Items[i].Y + vCenter, 2062, 2062, GetButtonID(5, item.Index));
AddImage(item.Cols[4].X - 5, list.Items[i].Y + vCenter, 2062, 936);
AddLabelHtml(item.Cols[4].X - 7, list.Items[i].Y + vCenter, list.Header.Cols[4].Width, 30, ExtractCoords(spawner.Location), GridColors.White);
//open entry button
AddButton(item.Cols[5].X + 6, list.Items[i].Y + vCenter - 4, 0x2635, 0x2635, GetButtonID(7, item.Index));
@ -290,7 +297,7 @@ public class SpawnerControllerGump : GumpGrid
AddButton(item.Cols[11].X + perItem, list.Items[i].Y + 5, 4017, 4018, GetButtonID(9, item.Index));
AddLabelHtml(item.Cols[11].X + perItem, list.Items[i].Y + 26, 55, 30, "delete", GridColors.White, 3, false);
AddImageTiled(0, list.Items[i].Y + list.ColHeight, _main.Width, 1, 1756);
AddImageTiled(0, list.Items[i].Y + list.ColHeight, _main.Width, 1, 9357);
AddAlphaRegion(0, list.Items[i].Y + list.ColHeight, _main.Width, 1);
}
}
@ -314,6 +321,10 @@ public class SpawnerControllerGump : GumpGrid
public SpawnerControllerGump(Mobile mobile, int page = 0, BaseSpawner copy = null, SpawnSearch search = null) : base(20, 30)
{
_main = Grid("main", 1000, 800, 1, 3, rowSize: "10* * 100");
AddBackground(0, 0, 1000, 800, 5054);
AddBlackAlpha(0, 0, 1000, 800);
_mobile = mobile;
_page = page;
_copy = copy;