diff --git a/Projects/UOContent/Commands/Object Creation/CategorizedAddGump.cs b/Projects/UOContent/Commands/Object Creation/CategorizedAddGump.cs index d8ea63234..76b4b50af 100644 --- a/Projects/UOContent/Commands/Object Creation/CategorizedAddGump.cs +++ b/Projects/UOContent/Commands/Object Creation/CategorizedAddGump.cs @@ -8,26 +8,20 @@ namespace Server.Gumps { public class CategorizedAddGump : Gump { - private static readonly int EntryHeight = PropsConfig.EntryHeight + 4; + private const int EntryHeight = PropsConfig.EntryHeight + 4; - private static readonly int SetOffsetY = PropsConfig.SetOffsetY + (EntryHeight - 20) / 2 / 2; + private const int SetOffsetY = PropsConfig.SetOffsetY + (EntryHeight - 20) / 2 / 2; - private static readonly int PrevOffsetY = PropsConfig.PrevOffsetY + (EntryHeight - 20) / 2 / 2; + private const int PrevOffsetY = PropsConfig.PrevOffsetY + (EntryHeight - 20) / 2 / 2; - private static readonly int NextOffsetY = PropsConfig.NextOffsetY + (EntryHeight - 20) / 2 / 2; + private const int NextOffsetY = PropsConfig.NextOffsetY + (EntryHeight - 20) / 2 / 2; - private static readonly int PrevLabelOffsetX = PrevWidth + 1; - private static readonly int PrevLabelOffsetY = 0; + private const int EntryWidth = 180; + private const int EntryCount = 15; - private static readonly int NextLabelOffsetX = -29; - private static readonly int NextLabelOffsetY = 0; + private const int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; - private static readonly int EntryWidth = 180; - private static readonly int EntryCount = 15; - - private static readonly int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; - - private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize; + private const int BackWidth = BorderSize + TotalWidth + BorderSize; private readonly CAGCategory m_Category; @@ -64,7 +58,7 @@ namespace Server.Gumps AddImageTiled( BorderSize, BorderSize, - TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), + TotalWidth, totalHeight, OffsetGumpID ); @@ -72,40 +66,17 @@ namespace Server.Gumps var x = BorderSize + OffsetSize; var y = BorderSize + OffsetSize; - if (OldStyle) - { - AddImageTiled(x, y, TotalWidth - OffsetSize * 3 - SetWidth, EntryHeight, HeaderGumpID); - } - else - { - AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); - } + AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); if (m_Category.Parent != null) { AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1); - - if (PrevLabel) - { - AddLabel(x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous"); - } } x += PrevWidth + OffsetSize; - var emptyWidth = TotalWidth - PrevWidth * 2 - NextWidth - OffsetSize * 5 - - (OldStyle ? SetWidth + OffsetSize : 0); - - if (!OldStyle) - { - AddImageTiled( - x - (OldStyle ? OffsetSize : 0), - y, - emptyWidth + (OldStyle ? OffsetSize * 2 : 0), - EntryHeight, - EntryGumpID - ); - } + const int emptyWidth = TotalWidth - PrevWidth * 2 - NextWidth - OffsetSize * 5; + AddImageTiled(x, y, emptyWidth, EntryHeight, EntryGumpID); AddHtml( x + TextOffsetX, @@ -117,40 +88,20 @@ namespace Server.Gumps x += emptyWidth + OffsetSize; - if (OldStyle) - { - AddImageTiled(x, y, TotalWidth - OffsetSize * 3 - SetWidth, EntryHeight, HeaderGumpID); - } - else - { - AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); - } + AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); if (page > 0) { AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 2); - - if (PrevLabel) - { - AddLabel(x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous"); - } } x += PrevWidth + OffsetSize; - if (!OldStyle) - { - AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID); - } + AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID); if ((page + 1) * EntryCount < nodes.Length) { AddButton(x + NextOffsetX, y + NextOffsetY, NextButtonID1, NextButtonID2, 3, GumpButtonType.Reply, 1); - - if (NextLabel) - { - AddLabel(x + NextLabelOffsetX, y + NextLabelOffsetY, TextHue, "Next"); - } } for (int i = 0, index = page * EntryCount; i < EntryCount && index < nodes.Length; ++i, ++index) diff --git a/Projects/UOContent/Gumps/AdminGump.cs b/Projects/UOContent/Gumps/AdminGump.cs index 7e3b4043d..df72593c3 100644 --- a/Projects/UOContent/Gumps/AdminGump.cs +++ b/Projects/UOContent/Gumps/AdminGump.cs @@ -59,7 +59,7 @@ namespace Server.Gumps private const int RedHue = 0x20; private static readonly string[] m_AccessLevelStrings = - { + [ "Player", "Counselor", "Game Master", @@ -67,7 +67,7 @@ namespace Server.Gumps "Administrator", "Developer", "Owner" - }; + ]; private readonly Mobile m_From; private readonly List m_List; @@ -703,7 +703,7 @@ namespace Server.Gumps } case AdminGumpPage.Accounts: { - m_List ??= new List(); + m_List ??= []; var rads = state as List; @@ -1500,7 +1500,7 @@ namespace Server.Gumps // If we don't have a list, create one if (!acctExists) { - accts = new List(); + accts = []; } accts.Add(acct); @@ -1829,7 +1829,7 @@ namespace Server.Gumps --AccountHandler.IPTable[ips[0]]; } - a.LoginIPs = Array.Empty(); + a.LoginIPs = []; notice = "All addresses in the list have been removed."; } @@ -2772,7 +2772,7 @@ namespace Server.Gumps } else { - results = new List(); + results = []; foreach (var acct in Accounts.GetAccounts()) { if (acct.Username.InsensitiveContains(match)) diff --git a/Projects/UOContent/Gumps/BanDurationGump.cs b/Projects/UOContent/Gumps/BanDurationGump.cs index dc2bb9e3b..a23fd679d 100644 --- a/Projects/UOContent/Gumps/BanDurationGump.cs +++ b/Projects/UOContent/Gumps/BanDurationGump.cs @@ -9,7 +9,7 @@ namespace Server.Gumps { private readonly List m_List; - public BanDurationGump(Account a) : this(new List { a }) + public BanDurationGump(Account a) : this([a]) { } @@ -218,7 +218,10 @@ namespace Server.Gumps break; } - default: return; + default: + { + return; + } } if (shouldSet) diff --git a/Projects/UOContent/Gumps/ConfirmHeritageGump.cs b/Projects/UOContent/Gumps/ConfirmHeritageGump.cs index 470168e56..7f61f7fb5 100644 --- a/Projects/UOContent/Gumps/ConfirmHeritageGump.cs +++ b/Projects/UOContent/Gumps/ConfirmHeritageGump.cs @@ -39,32 +39,36 @@ namespace Server.Gumps switch (info.ButtonID) { case (int)Buttons.Okay: - - Item item = null; - - foreach (var type in m_Selected) { - try + Item item = null; + + foreach (var type in m_Selected) { - item = type.CreateInstance(); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - Console.WriteLine(ex.StackTrace); + try + { + item = type.CreateInstance(); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + Console.WriteLine(ex.StackTrace); + } + + if (item != null) + { + m_Token.Delete(); + sender.Mobile.AddToBackpack(item); + } } - if (item != null) - { - m_Token.Delete(); - sender.Mobile.AddToBackpack(item); - } + break; } - break; case (int)Buttons.Cancel: - sender.Mobile.SendGump(new HeritageTokenGump(m_Token)); - break; + { + sender.Mobile.SendGump(new HeritageTokenGump(m_Token)); + break; + } } } diff --git a/Projects/UOContent/Gumps/Go/GoGump.cs b/Projects/UOContent/Gumps/Go/GoGump.cs index 44b1d1f33..c658dadf8 100644 --- a/Projects/UOContent/Gumps/Go/GoGump.cs +++ b/Projects/UOContent/Gumps/Go/GoGump.cs @@ -7,12 +7,6 @@ namespace Server.Gumps; public class GoGump : Gump { - private const int PrevLabelOffsetX = PrevWidth + 1; - private const int PrevLabelOffsetY = 0; - - private const int NextLabelOffsetX = -29; - private const int NextLabelOffsetY = 0; - private const int EntryWidth = 180; private const int EntryCount = 15; @@ -52,87 +46,38 @@ public class GoGump : Gump AddPage(0); AddBackground(0, 0, BackWidth, BorderSize + totalHeight + BorderSize, BackGumpID); - AddImageTiled( - BorderSize, - BorderSize, - TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), - totalHeight, - OffsetGumpID - ); + AddImageTiled(BorderSize, BorderSize, TotalWidth, totalHeight, OffsetGumpID); - if (OldStyle) - { - AddImageTiled(x, y, TotalWidth - OffsetSize * 3 - SetWidth, EntryHeight, HeaderGumpID); - } - else - { - AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); - } + AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); if (node.Parent != null) { AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1); - - if (PrevLabel) - { - AddLabel(x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous"); - } } x += PrevWidth + OffsetSize; - var emptyWidth = TotalWidth - PrevWidth * 2 - NextWidth - OffsetSize * 5 - - (OldStyle ? SetWidth + OffsetSize : 0); - - if (!OldStyle) - { - AddImageTiled( - x - (OldStyle ? OffsetSize : 0), - y, - emptyWidth + (OldStyle ? OffsetSize * 2 : 0), - EntryHeight, - EntryGumpID - ); - } + const int emptyWidth = TotalWidth - PrevWidth * 2 - NextWidth - OffsetSize * 5; + AddImageTiled(x, y, emptyWidth, EntryHeight, EntryGumpID); AddHtml(x + TextOffsetX, y, emptyWidth - TextOffsetX, EntryHeight, $"
{node.Name}
"); x += emptyWidth + OffsetSize; - if (OldStyle) - { - AddImageTiled(x, y, TotalWidth - OffsetSize * 3 - SetWidth, EntryHeight, HeaderGumpID); - } - else - { - AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); - } + AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); if (page > 0) { AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 2); - - if (PrevLabel) - { - AddLabel(x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous"); - } } x += PrevWidth + OffsetSize; - if (!OldStyle) - { - AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID); - } + AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID); if ((page + 1) * EntryCount < node.Categories.Length + node.Locations.Length) { AddButton(x + NextOffsetX, y + NextOffsetY, NextButtonID1, NextButtonID2, 3, GumpButtonType.Reply, 1); - - if (NextLabel) - { - AddLabel(x + NextLabelOffsetX, y + NextLabelOffsetY, TextHue, "Next"); - } } var totalEntryCount = node.Categories.Length + node.Locations.Length; diff --git a/Projects/UOContent/Gumps/Guilds/GuildCharterGump.cs b/Projects/UOContent/Gumps/Guilds/GuildCharterGump.cs index ee197c41f..a1ba5cc96 100644 --- a/Projects/UOContent/Gumps/Guilds/GuildCharterGump.cs +++ b/Projects/UOContent/Gumps/Guilds/GuildCharterGump.cs @@ -56,8 +56,14 @@ namespace Server.Gumps switch (info.ButtonID) { - case 0: return; // Close - case 1: break; // Return to main menu + case 0: + { + return; // Close + } + case 1: + { + break; // Return to main menu + } case 2: { string website; diff --git a/Projects/UOContent/Gumps/Guilds/GuildmasterGump.cs b/Projects/UOContent/Gumps/Guilds/GuildmasterGump.cs index 332a3d396..28efb29fe 100644 --- a/Projects/UOContent/Gumps/Guilds/GuildmasterGump.cs +++ b/Projects/UOContent/Gumps/Guilds/GuildmasterGump.cs @@ -35,14 +35,20 @@ namespace Server.Gumps switch (m_Guild.Type) { case GuildType.Regular: - AddHtmlLocalized(55, 100, 470, 30, 1013059); // Change guild type: Currently Standard - break; + { + AddHtmlLocalized(55, 100, 470, 30, 1013059); // Change guild type: Currently Standard + break; + } case GuildType.Order: - AddHtmlLocalized(55, 100, 470, 30, 1013057); // Change guild type: Currently Order - break; + { + AddHtmlLocalized(55, 100, 470, 30, 1013057); // Change guild type: Currently Order + break; + } case GuildType.Chaos: - AddHtmlLocalized(55, 100, 470, 30, 1013058); // Change guild type: Currently Chaos - break; + { + AddHtmlLocalized(55, 100, 470, 30, 1013058); // Change guild type: Currently Chaos + break; + } } } diff --git a/Projects/UOContent/Gumps/Guilds/New Guild System/BaseGuildListGump.cs b/Projects/UOContent/Gumps/Guilds/New Guild System/BaseGuildListGump.cs index 8affb0cad..35af040b7 100644 --- a/Projects/UOContent/Gumps/Guilds/New Guild System/BaseGuildListGump.cs +++ b/Projects/UOContent/Gumps/Guilds/New Guild System/BaseGuildListGump.cs @@ -40,7 +40,7 @@ namespace Server.Guilds var list = m_List; if (WillFilter) { - m_List = new List(); + m_List = []; for (var i = 0; i < list.Count; i++) { if (!IsFiltered(list[i], m_Filter)) diff --git a/Projects/UOContent/Gumps/Guilds/New Guild System/DiplomacyGump.cs b/Projects/UOContent/Gumps/Guilds/New Guild System/DiplomacyGump.cs index 65a924461..8fafc228d 100644 --- a/Projects/UOContent/Gumps/Guilds/New Guild System/DiplomacyGump.cs +++ b/Projects/UOContent/Gumps/Guilds/New Guild System/DiplomacyGump.cs @@ -78,12 +78,11 @@ namespace Server.Guilds ascending, filter, startNumber, - new[] - { + [ new InfoField(1062954, 280, NameComparer.Instance), // Guild Name new InfoField(1062957, 50, AbbrevComparer.Instance), // Abbrev new InfoField(1062958, 120, new StatusComparer(g)) // Guild Title - } + ] ) { m_Display = display; diff --git a/Projects/UOContent/Gumps/Guilds/New Guild System/GuildRosterGump.cs b/Projects/UOContent/Gumps/Guilds/New Guild System/GuildRosterGump.cs index ede71d4d8..240ad3110 100644 --- a/Projects/UOContent/Gumps/Guilds/New Guild System/GuildRosterGump.cs +++ b/Projects/UOContent/Gumps/Guilds/New Guild System/GuildRosterGump.cs @@ -10,12 +10,12 @@ namespace Server.Guilds public class GuildRosterGump : BaseGuildListGump { private static readonly InfoField[] m_Fields = - { + [ new(1062955, 130, NameComparer.Instance), // Name new(1062956, 80, RankComparer.Instance), // Rank new(1062952, 80, LastOnComparer.Instance), // Last On new(1062953, 150, TitleComparer.Instance) // Guild Title - }; + ]; public GuildRosterGump(PlayerMobile pm, Guild g) : this(pm, g, LastOnComparer.Instance) { diff --git a/Projects/UOContent/Gumps/HeritageTokenGump.cs b/Projects/UOContent/Gumps/HeritageTokenGump.cs index 685959bf9..dfad1946b 100644 --- a/Projects/UOContent/Gumps/HeritageTokenGump.cs +++ b/Projects/UOContent/Gumps/HeritageTokenGump.cs @@ -291,43 +291,43 @@ namespace Server.Gumps // 7th anniversary case 0x64: { - types = new [] { typeof(LeggingsOfEmbers) }; + types = [typeof(LeggingsOfEmbers)]; cliloc = 1078147; break; } case 0x65: { - types = new [] { typeof(RoseOfTrinsic) }; + types = [typeof(RoseOfTrinsic)]; cliloc = 1062913; break; } case 0x66: { - types = new [] { typeof(ShaminoCrossbow) }; + types = [typeof(ShaminoCrossbow)]; cliloc = 1062915; break; } case 0x67: { - types = new [] { typeof(TapestryOfSosaria) }; + types = [typeof(TapestryOfSosaria)]; cliloc = 1062917; break; } case 0x68: { - types = new [] { typeof(HearthOfHomeFireDeed) }; + types = [typeof(HearthOfHomeFireDeed)]; cliloc = 1062919; break; } case 0x69: { - types = new [] { typeof(HolySword) }; + types = [typeof(HolySword)]; cliloc = 1062921; break; } case 0x6A: { - types = new [] { typeof(SamuraiHelm) }; + types = [typeof(SamuraiHelm)]; cliloc = 1062923; break; } @@ -337,55 +337,55 @@ namespace Server.Gumps case 0x6C: types = new [] { typeof( ValorGauntlets ) }; cliloc = 1075192; break;*/ case 0x6D: { - types = new [] { typeof(DupresShield) }; + types = [typeof(DupresShield)]; cliloc = 1075196; break; } case 0x6E: { - types = new [] { typeof(FountainOfLifeDeed) }; + types = [typeof(FountainOfLifeDeed)]; cliloc = 1075197; break; } case 0x6F: { - types = new [] { typeof(DawnsMusicBox) }; + types = [typeof(DawnsMusicBox)]; cliloc = 1075198; break; } case 0x70: { - types = new [] { typeof(OssianGrimoire) }; + types = [typeof(OssianGrimoire)]; cliloc = 1078148; break; } case 0x71: { - types = new [] { typeof(FerretFormTalisman) }; + types = [typeof(FerretFormTalisman)]; cliloc = 1078142; break; } case 0x72: { - types = new [] { typeof(SquirrelFormTalisman) }; + types = [typeof(SquirrelFormTalisman)]; cliloc = 1078143; break; } case 0x73: { - types = new [] { typeof(CuSidheFormTalisman) }; + types = [typeof(CuSidheFormTalisman)]; cliloc = 1078144; break; } case 0x74: { - types = new [] { typeof(ReptalonFormTalisman) }; + types = [typeof(ReptalonFormTalisman)]; cliloc = 1078145; break; } case 0x75: { - types = new [] { typeof(QuiverOfInfinity) }; + types = [typeof(QuiverOfInfinity)]; cliloc = 1075201; break; } @@ -393,49 +393,49 @@ namespace Server.Gumps // evil home decor case 0x76: { - types = new [] { typeof(BoneThroneDeed), typeof(BoneCouchDeed), typeof(BoneTableDeed) }; + types = [typeof(BoneThroneDeed), typeof(BoneCouchDeed), typeof(BoneTableDeed)]; cliloc = 1074797; break; } case 0x77: { - types = new [] - { + types = + [ typeof(CreepyPortraitDeed), typeof(DisturbingPortraitDeed), typeof(UnsettlingPortraitDeed) - }; + ]; cliloc = 1078146; break; } case 0x78: { - types = new [] - { + types = + [ typeof(MountedPixieBlueDeed), typeof(MountedPixieGreenDeed), typeof(MountedPixieLimeDeed), typeof(MountedPixieOrangeDeed), typeof(MountedPixieWhiteDeed) - }; + ]; cliloc = 1074799; break; } case 0x79: { - types = new [] { typeof(HaunterMirrorDeed) }; + types = [typeof(HaunterMirrorDeed)]; cliloc = 1074800; break; } case 0x7A: { - types = new [] { typeof(BedOfNailsDeed) }; + types = [typeof(BedOfNailsDeed)]; cliloc = 1074801; break; } case 0x7B: { - types = new [] { typeof(SacrificialAltarDeed) }; + types = [typeof(SacrificialAltarDeed)]; cliloc = 1074818; break; } @@ -443,49 +443,49 @@ namespace Server.Gumps // broken furniture case 0x7C: { - types = new [] { typeof(BrokenCoveredChairDeed) }; + types = [typeof(BrokenCoveredChairDeed)]; cliloc = 1076257; break; } case 0x7D: { - types = new [] { typeof(BrokenBookcaseDeed) }; + types = [typeof(BrokenBookcaseDeed)]; cliloc = 1076258; break; } case 0x7E: { - types = new [] { typeof(StandingBrokenChairDeed) }; + types = [typeof(StandingBrokenChairDeed)]; cliloc = 1076259; break; } case 0x7F: { - types = new [] { typeof(BrokenVanityDeed) }; + types = [typeof(BrokenVanityDeed)]; cliloc = 1076260; break; } case 0x80: { - types = new [] { typeof(BrokenChestOfDrawersDeed) }; + types = [typeof(BrokenChestOfDrawersDeed)]; cliloc = 1076261; break; } case 0x81: { - types = new [] { typeof(BrokenArmoireDeed) }; + types = [typeof(BrokenArmoireDeed)]; cliloc = 1076262; break; } case 0x82: { - types = new [] { typeof(BrokenBedDeed) }; + types = [typeof(BrokenBedDeed)]; cliloc = 1076263; break; } case 0x83: { - types = new [] { typeof(BrokenFallenChairDeed) }; + types = [typeof(BrokenFallenChairDeed)]; cliloc = 1076264; break; } @@ -493,211 +493,211 @@ namespace Server.Gumps // other case 0x84: { - types = new [] { typeof(SuitOfGoldArmorDeed) }; + types = [typeof(SuitOfGoldArmorDeed)]; cliloc = 1076265; break; } case 0x85: { - types = new [] { typeof(SuitOfSilverArmorDeed) }; + types = [typeof(SuitOfSilverArmorDeed)]; cliloc = 1076266; break; } case 0x86: { - types = new [] { typeof(BoilingCauldronDeed) }; + types = [typeof(BoilingCauldronDeed)]; cliloc = 1076267; break; } case 0x87: { - types = new [] { typeof(GuillotineDeed) }; + types = [typeof(GuillotineDeed)]; cliloc = 1024656; break; } case 0x88: { - types = new [] { typeof(CherryBlossomTreeDeed) }; + types = [typeof(CherryBlossomTreeDeed)]; cliloc = 1076268; break; } case 0x89: { - types = new [] { typeof(AppleTreeDeed) }; + types = [typeof(AppleTreeDeed)]; cliloc = 1076269; break; } case 0x8A: { - types = new [] { typeof(PeachTreeDeed) }; + types = [typeof(PeachTreeDeed)]; cliloc = 1076270; break; } case 0x8B: { - types = new [] { typeof(HangingAxesDeed) }; + types = [typeof(HangingAxesDeed)]; cliloc = 1076271; break; } case 0x8C: { - types = new [] { typeof(HangingSwordsDeed) }; + types = [typeof(HangingSwordsDeed)]; cliloc = 1076272; break; } case 0x8D: { - types = new [] { typeof(BlueFancyRugDeed) }; + types = [typeof(BlueFancyRugDeed)]; cliloc = 1076273; break; } case 0x8E: { - types = new [] { typeof(WoodenCoffinDeed) }; + types = [typeof(WoodenCoffinDeed)]; cliloc = 1076274; break; } case 0x8F: { - types = new [] { typeof(VanityDeed) }; + types = [typeof(VanityDeed)]; cliloc = 1074027; break; } case 0x90: { - types = new [] { typeof(TableWithPurpleClothDeed) }; + types = [typeof(TableWithPurpleClothDeed)]; cliloc = 1076635; break; } case 0x91: { - types = new [] { typeof(TableWithBlueClothDeed) }; + types = [typeof(TableWithBlueClothDeed)]; cliloc = 1076636; break; } case 0x92: { - types = new [] { typeof(TableWithRedClothDeed) }; + types = [typeof(TableWithRedClothDeed)]; cliloc = 1076637; break; } case 0x93: { - types = new [] { typeof(TableWithOrangeClothDeed) }; + types = [typeof(TableWithOrangeClothDeed)]; cliloc = 1076638; break; } case 0x94: { - types = new [] { typeof(UnmadeBedDeed) }; + types = [typeof(UnmadeBedDeed)]; cliloc = 1076279; break; } case 0x95: { - types = new [] { typeof(CurtainsDeed) }; + types = [typeof(CurtainsDeed)]; cliloc = 1076280; break; } case 0x96: { - types = new [] { typeof(ScarecrowDeed) }; + types = [typeof(ScarecrowDeed)]; cliloc = 1076281; break; } case 0x97: { - types = new [] { typeof(WallTorchDeed) }; + types = [typeof(WallTorchDeed)]; cliloc = 1076282; break; } case 0x98: { - types = new [] { typeof(FountainDeed) }; + types = [typeof(FountainDeed)]; cliloc = 1076283; break; } case 0x99: { - types = new [] { typeof(StoneStatueDeed) }; + types = [typeof(StoneStatueDeed)]; cliloc = 1076284; break; } case 0x9A: { - types = new [] { typeof(LargeFishingNetDeed) }; + types = [typeof(LargeFishingNetDeed)]; cliloc = 1076285; break; } case 0x9B: { - types = new [] { typeof(SmallFishingNetDeed) }; + types = [typeof(SmallFishingNetDeed)]; cliloc = 1076286; break; } case 0x9C: { - types = new [] { typeof(HouseLadderDeed) }; + types = [typeof(HouseLadderDeed)]; cliloc = 1076287; break; } case 0x9D: { - types = new [] { typeof(IronMaidenDeed) }; + types = [typeof(IronMaidenDeed)]; cliloc = 1076288; break; } case 0x9E: { - types = new [] { typeof(BluePlainRugDeed) }; + types = [typeof(BluePlainRugDeed)]; cliloc = 1076585; break; } case 0x9F: { - types = new [] { typeof(GoldenDecorativeRugDeed) }; + types = [typeof(GoldenDecorativeRugDeed)]; cliloc = 1076586; break; } case 0xA0: { - types = new [] { typeof(CinnamonFancyRugDeed) }; + types = [typeof(CinnamonFancyRugDeed)]; cliloc = 1076587; break; } case 0xA1: { - types = new [] { typeof(RedPlainRugDeed) }; + types = [typeof(RedPlainRugDeed)]; cliloc = 1076588; break; } case 0xA2: { - types = new [] { typeof(BlueDecorativeRugDeed) }; + types = [typeof(BlueDecorativeRugDeed)]; cliloc = 1076589; break; } case 0xA3: { - types = new [] { typeof(PinkFancyRugDeed) }; + types = [typeof(PinkFancyRugDeed)]; cliloc = 1076590; break; } case 0xA4: { - types = new [] { typeof(CherryBlossomTrunkDeed) }; + types = [typeof(CherryBlossomTrunkDeed)]; cliloc = 1076784; break; } case 0xA5: { - types = new [] { typeof(AppleTrunkDeed) }; + types = [typeof(AppleTrunkDeed)]; cliloc = 1076785; break; } case 0xA6: { - types = new [] { typeof(PeachTrunkDeed) }; + types = [typeof(PeachTrunkDeed)]; cliloc = 1076786; break; } diff --git a/Projects/UOContent/Gumps/Houses/HouseGumpAOS.cs b/Projects/UOContent/Gumps/Houses/HouseGumpAOS.cs index bd4a6ce7b..ec0db850d 100644 --- a/Projects/UOContent/Gumps/Houses/HouseGumpAOS.cs +++ b/Projects/UOContent/Gumps/Houses/HouseGumpAOS.cs @@ -42,32 +42,32 @@ namespace Server.Gumps private const int HighlightedLabelHue = 0x64; private static readonly int[] m_HangerNumbers = - { + [ 2968, 2970, 2972, 2974, 2976, 2978 - }; + ]; private static readonly int[] m_FoundationNumbers = Core.ML - ? new[] - { + ? + [ 20, 189, 765, 65, 101, 0x2DF7, 0x2DFB, 0x3672, 0x3676 - } - : new[] - { + ] + : + [ 20, 189, 765, 65, 101 - }; + ]; private static readonly int[] m_PostNumbers = - { + [ 9, 29, 54, 90, 147, 169, 177, 204, 251, 257, 263, 298, 347, 424, 441, 466, 514, 600, 601, 602, 603, 660, 666, 672, 898, 970, 974, 982 - }; + ]; - private static readonly List _HouseSigns = new(); + private static readonly List _HouseSigns = []; private readonly BaseHouse m_House; private readonly HouseGumpPageAOS m_Page; @@ -1046,21 +1046,34 @@ namespace Server.Gumps switch (index) { case 0: - page = HouseGumpPageAOS.Information; - break; + { + page = HouseGumpPageAOS.Information; + break; + } case 1: - page = HouseGumpPageAOS.Security; - break; + { + page = HouseGumpPageAOS.Security; + break; + } case 2: - page = HouseGumpPageAOS.Storage; - break; + { + page = HouseGumpPageAOS.Storage; + break; + } case 3: - page = HouseGumpPageAOS.Customize; - break; + { + page = HouseGumpPageAOS.Customize; + break; + } case 4: - page = HouseGumpPageAOS.Ownership; - break; - default: return; + { + page = HouseGumpPageAOS.Ownership; + break; + } + default: + { + return; + } } from.SendGump(new HouseGumpAOS(page, from, m_House)); @@ -1459,7 +1472,9 @@ namespace Server.Gumps break; } case 2: // Make Primary - break; + { + break; + } } break; @@ -1491,18 +1506,29 @@ namespace Server.Gumps switch (index) { case 5: - newType = FoundationType.ElvenGrey; - break; + { + newType = FoundationType.ElvenGrey; + break; + } case 6: - newType = FoundationType.ElvenNatural; - break; + { + newType = FoundationType.ElvenNatural; + break; + } case 7: - newType = FoundationType.Crystal; - break; + { + newType = FoundationType.Crystal; + break; + } case 8: - newType = FoundationType.Shadow; - break; - default: return; + { + newType = FoundationType.Shadow; + break; + } + default: + { + return; + } } } else @@ -1510,21 +1536,34 @@ namespace Server.Gumps switch (index) { case 0: - newType = FoundationType.DarkWood; - break; + { + newType = FoundationType.DarkWood; + break; + } case 1: - newType = FoundationType.LightWood; - break; + { + newType = FoundationType.LightWood; + break; + } case 2: - newType = FoundationType.Dungeon; - break; + { + newType = FoundationType.Dungeon; + break; + } case 3: - newType = FoundationType.Brick; - break; + { + newType = FoundationType.Brick; + break; + } case 4: - newType = FoundationType.Stone; - break; - default: return; + { + newType = FoundationType.Stone; + break; + } + default: + { + return; + } } } diff --git a/Projects/UOContent/Gumps/PlayerVendorGumps.cs b/Projects/UOContent/Gumps/PlayerVendorGumps.cs index df081ab12..9b8d7f635 100644 --- a/Projects/UOContent/Gumps/PlayerVendorGumps.cs +++ b/Projects/UOContent/Gumps/PlayerVendorGumps.cs @@ -322,28 +322,26 @@ namespace Server.Gumps public class PlayerVendorCustomizeGump : Gump { private static readonly CustomCategory[] Categories = - { + [ new( Layer.InnerTorso, 1011357, true, - new[] - { + [ // Upper Torso new CustomItem(typeof(Shirt), 1011359, 5399), new CustomItem(typeof(FancyShirt), 1011360, 7933), new CustomItem(typeof(PlainDress), 1011363, 7937), new CustomItem(typeof(FancyDress), 1011364, 7935), new CustomItem(typeof(Robe), 1011365, 7939) - } + ] ), new( Layer.MiddleTorso, 1011371, true, - new[] - { + [ // Over chest new CustomItem(typeof(Doublet), 1011358, 8059), new CustomItem(typeof(Tunic), 1011361, 8097), @@ -352,29 +350,27 @@ namespace Server.Gumps new CustomItem(typeof(Surcoat), 1011362, 8189), new CustomItem(typeof(HalfApron), 1011373, 5435), new CustomItem(typeof(FullApron), 1011374, 5437) - } + ] ), new( Layer.Shoes, 1011388, true, - new[] - { + [ // Footwear new CustomItem(typeof(Sandals), 1011389, 5901), new CustomItem(typeof(Shoes), 1011390, 5904), new CustomItem(typeof(Boots), 1011391, 5899), new CustomItem(typeof(ThighBoots), 1011392, 5906) - } + ] ), new( Layer.Helm, 1011375, true, - new[] - { + [ // Hats new CustomItem(typeof(SkullCap), 1011376, 5444), new CustomItem(typeof(Bandana), 1011377, 5440), @@ -382,15 +378,14 @@ namespace Server.Gumps new CustomItem(typeof(WideBrimHat), 1011379, 5908), new CustomItem(typeof(Cap), 1011380, 5909), new CustomItem(typeof(TallStrawHat), 1011382, 5910) - } + ] ), new( Layer.Helm, 1015319, true, - new[] - { + [ // More Hats new CustomItem(typeof(StrawHat), 1011382, 5911), new CustomItem(typeof(WizardsHat), 1011383, 5912), @@ -398,39 +393,36 @@ namespace Server.Gumps new CustomItem(typeof(FeatheredHat), 1011385, 5914), new CustomItem(typeof(TricorneHat), 1011386, 5915), new CustomItem(typeof(JesterHat), 1011387, 5916) - } + ] ), new( Layer.Pants, 1011367, true, - new[] - { + [ // Lower Torso new CustomItem(typeof(LongPants), 1011368, 5433), new CustomItem(typeof(Kilt), 1011369, 5431), new CustomItem(typeof(Skirt), 1011370, 5398) - } + ] ), new( Layer.Cloak, 1011393, true, - new[] - { + [ // Back new CustomItem(typeof(Cloak), 1011394, 5397) - } + ] ), new( Layer.Hair, 1011395, true, - new[] - { + [ // Hair new CustomItem(0x203B, 1011052), new CustomItem(0x203C, 1011053), @@ -441,15 +433,14 @@ namespace Server.Gumps new CustomItem(0x2047, 1011396), new CustomItem(0x2048, 1011048), new CustomItem(0x2049, 1011049) - } + ] ), new( Layer.FacialHair, 1015320, true, - new[] - { + [ // Facial Hair new CustomItem(0x2041, 1011062), new CustomItem(0x203F, 1011060), @@ -458,15 +449,14 @@ namespace Server.Gumps new CustomItem(0x204C, 1015322, true), new CustomItem(0x2040, 1015323), new CustomItem(0x204D, 1011401) - } + ] ), new( Layer.FirstValid, 1011397, false, - new[] - { + [ // Held items new CustomItem(typeof(FishingPole), 1011406, 3520), new CustomItem(typeof(Pickaxe), 1011407, 3717), @@ -477,15 +467,14 @@ namespace Server.Gumps new CustomItem(typeof(Hammer), 1011411, 4020), new CustomItem(typeof(Longsword), 1011412, 3936), new CustomItem(typeof(GnarledStaff), 1011413, 5113) - } + ] ), new( Layer.FirstValid, 1015325, false, - new[] - { + [ // More held items new CustomItem(typeof(Crossbow), 1011414, 3920), new CustomItem(typeof(WarMace), 1011415, 5126), @@ -493,9 +482,9 @@ namespace Server.Gumps new CustomItem(typeof(Spear), 1011417, 3939), new CustomItem(typeof(Katana), 1011418, 5118), new CustomItem(typeof(Spellbook), 1011419, 3834) - } + ] ) - }; + ]; private readonly Mobile m_Vendor; @@ -913,7 +902,7 @@ namespace Server.Gumps public class NewPlayerVendorCustomizeGump : Gump { private static readonly HairOrBeard[] m_HairStyles = - { + [ new(0x203B, 1011052), // Short new(0x203C, 1011053), // Long new(0x203D, 1011054), // Ponytail @@ -923,10 +912,10 @@ namespace Server.Gumps new(0x2047, 1011396), // Curly new(0x2048, 1011048), // Receding new(0x2049, 1011049) // 2-tails - }; + ]; private static readonly HairOrBeard[] m_BeardStyles = - { + [ new(0x2041, 1011062), // Mustache new(0x203F, 1011060), // Short beard new(0x204B, 1015321), // Short Beard & Moustache @@ -934,7 +923,7 @@ namespace Server.Gumps new(0x204C, 1015322), // Long Beard & Moustache new(0x2040, 1015323), // Goatee new(0x204D, 1011401) // Vandyke - }; + ]; private readonly PlayerVendor m_Vendor; diff --git a/Projects/UOContent/Gumps/PolymorphGump.cs b/Projects/UOContent/Gumps/PolymorphGump.cs index 4a148785a..d2a286ad1 100644 --- a/Projects/UOContent/Gumps/PolymorphGump.cs +++ b/Projects/UOContent/Gumps/PolymorphGump.cs @@ -49,7 +49,7 @@ namespace Server.Gumps public class PolymorphGump : StaticGump { private static readonly PolymorphCategory[] Categories = - { + [ new( 1015235, // Animals PolymorphEntry.Chicken, @@ -75,7 +75,7 @@ namespace Server.Gumps PolymorphEntry.Daemon, PolymorphEntry.HumanFemale ) - }; + ]; private readonly Item _scroll; @@ -161,7 +161,7 @@ namespace Server.Gumps public class NewPolymorphGump : StaticGump { private static readonly PolymorphEntry[] _entries = - { + [ PolymorphEntry.Chicken, PolymorphEntry.Dog, PolymorphEntry.Wolf, @@ -180,7 +180,7 @@ namespace Server.Gumps PolymorphEntry.Troll, PolymorphEntry.Ettin, PolymorphEntry.Daemon - }; + ]; private readonly Item _scroll; diff --git a/Projects/UOContent/Gumps/Props/Exceptions.cs b/Projects/UOContent/Gumps/Props/Exceptions.cs index d1eccab10..a881fd17c 100644 --- a/Projects/UOContent/Gumps/Props/Exceptions.cs +++ b/Projects/UOContent/Gumps/Props/Exceptions.cs @@ -6,33 +6,28 @@ namespace Server.Gumps { protected Property m_Property; - public PropertyException(Property property, string message) - : base(message) => - m_Property = property; + public PropertyException(Property property, string message) : base(message) => m_Property = property; public Property Property => m_Property; } public abstract class BindingException : PropertyException { - public BindingException(Property property, string message) - : base(property, message) + public BindingException(Property property, string message) : base(property, message) { } } public sealed class NotYetBoundException : BindingException { - public NotYetBoundException(Property property) - : base(property, "Property has not yet been bound.") + public NotYetBoundException(Property property) : base(property, "Property has not yet been bound.") { } } public sealed class AlreadyBoundException : BindingException { - public AlreadyBoundException(Property property) - : base(property, "Property has already been bound.") + public AlreadyBoundException(Property property) : base(property, "Property has already been bound.") { } } @@ -47,32 +42,28 @@ namespace Server.Gumps public sealed class ReadOnlyException : BindingException { - public ReadOnlyException(Property property) - : base(property, "Property is read-only.") + public ReadOnlyException(Property property) : base(property, "Property is read-only.") { } } public sealed class WriteOnlyException : BindingException { - public WriteOnlyException(Property property) - : base(property, "Property is write-only.") + public WriteOnlyException(Property property) : base(property, "Property is write-only.") { } } public abstract class AccessException : PropertyException { - public AccessException(Property property, string message) - : base(property, message) + public AccessException(Property property, string message) : base(property, message) { } } public sealed class InternalAccessException : AccessException { - public InternalAccessException(Property property) - : base(property, "Property is internal.") + public InternalAccessException(Property property) : base(property, "Property is internal.") { } } diff --git a/Projects/UOContent/Gumps/Props/PropsConfig.cs b/Projects/UOContent/Gumps/Props/PropsConfig.cs index 4f525bc74..61737f85f 100644 --- a/Projects/UOContent/Gumps/Props/PropsConfig.cs +++ b/Projects/UOContent/Gumps/Props/PropsConfig.cs @@ -2,8 +2,6 @@ namespace Server.Gumps; public static class PropsConfig { - public const bool OldStyle = false; - public const int GumpOffsetX = 30; public const int GumpOffsetY = 30; @@ -13,14 +11,15 @@ public static class PropsConfig public const int OffsetGumpID = 0x0A40; // Pure black // Light off-white, textured : Dark navy blue, textured - public const int HeaderGumpID = OldStyle ? 0x0BBC : 0x0E14; + public const int HeaderGumpID = 0x0E14; public const int EntryGumpID = 0x0BBC; // Light offwhite, textured public const int BackGumpID = 0x13BE; // Gray slate/stoney - public const int SetGumpID = OldStyle ? 0x0000 : 0x0E14; // Empty : Dark navy blue, textured + public const int SetGumpID = 0x0E14; // Empty : Dark navy blue, textured public const int SetWidth = 20; - public const int SetOffsetX = OldStyle ? 4 : 2, SetOffsetY = 2; + public const int SetOffsetX = 2; + public const int SetOffsetY = 2; public const int SetButtonID1 = 0x15E1; // Arrow pointing right public const int SetButtonID2 = 0x15E5; // " pressed @@ -39,7 +38,4 @@ public static class PropsConfig public const int EntryHeight = 20; public const int BorderSize = 10; public const int ApplySize = 30; - - public const bool PrevLabel = false; - public const bool NextLabel = false; } diff --git a/Projects/UOContent/Gumps/Props/PropsGump.cs b/Projects/UOContent/Gumps/Props/PropsGump.cs index 8f7d31119..0d8d656c1 100644 --- a/Projects/UOContent/Gumps/Props/PropsGump.cs +++ b/Projects/UOContent/Gumps/Props/PropsGump.cs @@ -24,27 +24,16 @@ namespace Server.Gumps public class PropertiesGump : Gump { - private static readonly bool PrevLabel = OldStyle; - private static readonly bool NextLabel = OldStyle; - private static readonly bool TypeLabel = !OldStyle; + private const int NameWidth = 107; + private const int ValueWidth = 128; - public static readonly int PrevLabelOffsetX = PrevWidth + 1; - private static readonly int PrevLabelOffsetY = 0; + private const int MaxEntriesPerPage = 15; - private static readonly int NextLabelOffsetX = -29; - private static readonly int NextLabelOffsetY = 0; + private const int TypeWidth = NameWidth + OffsetSize + ValueWidth; - private static readonly int NameWidth = 107; - private static readonly int ValueWidth = 128; + private const int TotalWidth = OffsetSize + NameWidth + OffsetSize + ValueWidth + OffsetSize + SetWidth + OffsetSize; - public static readonly int MaxEntriesPerPage = 15; - - private static readonly int TypeWidth = NameWidth + OffsetSize + ValueWidth; - - private static readonly int TotalWidth = - OffsetSize + NameWidth + OffsetSize + ValueWidth + OffsetSize + SetWidth + OffsetSize; - - protected static readonly int BackWidth = BorderSize + TotalWidth + BorderSize; + protected const int BackWidth = BorderSize + TotalWidth + BorderSize; protected readonly List m_List; protected readonly Mobile m_Mobile; @@ -125,7 +114,7 @@ namespace Server.Gumps AddImageTiled( BorderSize, BorderSize, - TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), + TotalWidth, OffsetSize + (EntryHeight + OffsetSize) * (m_EntryCount + 1), OffsetGumpID ); @@ -133,60 +122,30 @@ namespace Server.Gumps var x = BorderSize + OffsetSize; var y = BorderSize + OffsetSize; - var emptyWidth = TotalWidth - PrevWidth - NextWidth - OffsetSize * 4 - (OldStyle ? SetWidth + OffsetSize : 0); - - if (OldStyle) - { - AddImageTiled(x, y, TotalWidth - OffsetSize * 3 - SetWidth, EntryHeight, HeaderGumpID); - } - else - { - AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); - } + const int emptyWidth = TotalWidth - PrevWidth - NextWidth - OffsetSize * 4; + AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); if (page > 0) { AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1); - - if (PrevLabel) - { - AddLabel(x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous"); - } } x += PrevWidth + OffsetSize; - if (!OldStyle) - { - AddImageTiled(x, y, emptyWidth, EntryHeight, HeaderGumpID); - } + AddImageTiled(x, y, emptyWidth, EntryHeight, HeaderGumpID); - if (TypeLabel && m_Type != null) + if (m_Type != null) { - AddHtml( - x, - y, - emptyWidth, - EntryHeight, - m_Type.Name.Center(0xFAFAFA) - ); + AddHtml(x, y, emptyWidth, EntryHeight, m_Type.Name.Center(0xFAFAFA)); } x += emptyWidth + OffsetSize; - if (!OldStyle) - { - AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID); - } + AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID); if ((page + 1) * MaxEntriesPerPage < m_List.Count) { AddButton(x + NextOffsetX, y + NextOffsetY, NextButtonID1, NextButtonID2, 2, GumpButtonType.Reply, 1); - - if (NextLabel) - { - AddLabel(x + NextLabelOffsetX, y + NextLabelOffsetY, TextHue, "Next"); - } } for (int i = 0, index = page * MaxEntriesPerPage; i < m_EntryCount && index < m_List.Count; ++i, ++index) @@ -452,12 +411,12 @@ namespace Server.Gumps if (attrs.Length == 0) { - return Array.Empty(); + return []; } if (attrs[0] is not CustomEnumAttribute ce) { - return Array.Empty(); + return []; } return ce.Names; @@ -627,7 +586,7 @@ namespace Server.Gumps } else { - groups[type] = new List { prop }; + groups[type] = [prop]; } } } diff --git a/Projects/UOContent/Gumps/Props/SetCustomEnumGump.cs b/Projects/UOContent/Gumps/Props/SetCustomEnumGump.cs index fdae82471..313eeee10 100644 --- a/Projects/UOContent/Gumps/Props/SetCustomEnumGump.cs +++ b/Projects/UOContent/Gumps/Props/SetCustomEnumGump.cs @@ -31,7 +31,7 @@ namespace Server.Gumps { try { - var info = m_Property.PropertyType.GetMethod("Parse", new[] { typeof(string) }); + var info = m_Property.PropertyType.GetMethod("Parse", [typeof(string)]); string result; @@ -43,7 +43,7 @@ namespace Server.Gumps m_Object, m_Property, m_Property.Name, - info.Invoke(null, new object[] { m_Names[index] }), + info.Invoke(null, [m_Names[index]]), true ); } diff --git a/Projects/UOContent/Gumps/Props/SetGump.cs b/Projects/UOContent/Gumps/Props/SetGump.cs index dfe6a57b6..721019321 100644 --- a/Projects/UOContent/Gumps/Props/SetGump.cs +++ b/Projects/UOContent/Gumps/Props/SetGump.cs @@ -9,13 +9,14 @@ namespace Server.Gumps { public class SetGump : Gump { - private static readonly int EntryWidth = 212; + private const int EntryWidth = 212; - private static readonly int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; - private static readonly int TotalHeight = OffsetSize + 2 * (EntryHeight + OffsetSize); + private const int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; + private const int TotalHeight = OffsetSize + 2 * (EntryHeight + OffsetSize); + + private const int BackWidth = BorderSize + TotalWidth + BorderSize; + private const int BackHeight = BorderSize + TotalHeight + BorderSize; - private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize; - private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize; private readonly Mobile m_Mobile; private readonly object m_Object; private readonly PropertyInfo m_Property; @@ -51,7 +52,7 @@ namespace Server.Gumps AddImageTiled( BorderSize, BorderSize, - TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), + TotalWidth, TotalHeight + (canNull ? EntryHeight + OffsetSize : 0) + (canDye ? EntryHeight + OffsetSize : 0), OffsetGumpID ); @@ -144,7 +145,6 @@ namespace Server.Gumps } else { - toSet = null; shouldSet = false; } @@ -202,8 +202,8 @@ namespace Server.Gumps private readonly PropertyInfo m_Property; private readonly PropertiesGump m_PropertiesGump; - public InternalPicker( - PropertyInfo prop, Mobile mobile, object o, PropertiesGump propertiesGump) : base(((IHued)o).HuedItemID) + public InternalPicker(PropertyInfo prop, Mobile mobile, object o, PropertiesGump propertiesGump) + : base(((IHued)o).HuedItemID) { m_Property = prop; m_Mobile = mobile; diff --git a/Projects/UOContent/Gumps/Props/SetListOptionGump.cs b/Projects/UOContent/Gumps/Props/SetListOptionGump.cs index 2203a5bfc..f65eb79d5 100644 --- a/Projects/UOContent/Gumps/Props/SetListOptionGump.cs +++ b/Projects/UOContent/Gumps/Props/SetListOptionGump.cs @@ -9,21 +9,12 @@ namespace Server.Gumps { public class SetListOptionGump : Gump { - private static readonly int EntryWidth = 212; - private static readonly int EntryCount = 13; + private const int EntryWidth = 212; + private const int EntryCount = 13; - private static readonly int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; + private const int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; - private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize; - - private static readonly bool PrevLabel = OldStyle; - private static readonly bool NextLabel = OldStyle; - - private static readonly int PrevLabelOffsetX = PrevWidth + 1; - private static readonly int PrevLabelOffsetY = 0; - - private static readonly int NextLabelOffsetX = -29; - private static readonly int NextLabelOffsetY = 0; + private const int BackWidth = BorderSize + TotalWidth + BorderSize; private readonly object[] m_Values; protected Mobile m_Mobile; @@ -61,19 +52,12 @@ namespace Server.Gumps var backHeight = BorderSize + totalHeight + BorderSize; AddBackground(0, 0, BackWidth, backHeight, BackGumpID); - AddImageTiled( - BorderSize, - BorderSize, - TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), - totalHeight, - OffsetGumpID - ); + AddImageTiled(BorderSize, BorderSize, TotalWidth, totalHeight, OffsetGumpID); var x = BorderSize + OffsetSize; - var y = BorderSize + OffsetSize; + const int y = BorderSize + OffsetSize; - var emptyWidth = TotalWidth - PrevWidth - NextWidth - OffsetSize * 4 - - (OldStyle ? SetWidth + OffsetSize : 0); + const int emptyWidth = TotalWidth - PrevWidth - NextWidth - OffsetSize * 4; AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); @@ -88,32 +72,15 @@ namespace Server.Gumps GumpButtonType.Page, page - 1 ); - - if (PrevLabel) - { - AddLabel(x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous"); - } } x += PrevWidth + OffsetSize; - if (!OldStyle) - { - AddImageTiled( - x - (OldStyle ? OffsetSize : 0), - y, - emptyWidth + (OldStyle ? OffsetSize * 2 : 0), - EntryHeight, - HeaderGumpID - ); - } + AddImageTiled(x, y, emptyWidth, EntryHeight, HeaderGumpID); x += emptyWidth + OffsetSize; - if (!OldStyle) - { - AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID); - } + AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID); if (page < pages) { @@ -126,11 +93,6 @@ namespace Server.Gumps GumpButtonType.Page, page + 1 ); - - if (NextLabel) - { - AddLabel(x + NextLabelOffsetX, y + NextLabelOffsetY, TextHue, "Next"); - } } AddRect(0, prop.Name, 0); diff --git a/Projects/UOContent/Gumps/Props/SetObjectGump.cs b/Projects/UOContent/Gumps/Props/SetObjectGump.cs index 326370aec..d634d80e1 100644 --- a/Projects/UOContent/Gumps/Props/SetObjectGump.cs +++ b/Projects/UOContent/Gumps/Props/SetObjectGump.cs @@ -11,13 +11,13 @@ namespace Server.Gumps { public class SetObjectGump : Gump { - private static readonly int EntryWidth = 212; + private const int EntryWidth = 212; - private static readonly int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; - private static readonly int TotalHeight = OffsetSize + 5 * (EntryHeight + OffsetSize); + private const int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; + private const int TotalHeight = OffsetSize + 5 * (EntryHeight + OffsetSize); - private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize; - private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize; + private const int BackWidth = BorderSize + TotalWidth + BorderSize; + private const int BackHeight = BorderSize + TotalHeight + BorderSize; private readonly Mobile m_Mobile; private readonly object m_Object; private readonly PropertyInfo m_Property; @@ -39,13 +39,7 @@ namespace Server.Gumps AddPage(0); AddBackground(0, 0, BackWidth, BackHeight, BackGumpID); - AddImageTiled( - BorderSize, - BorderSize, - TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), - TotalHeight, - OffsetGumpID - ); + AddImageTiled(BorderSize, BorderSize, TotalWidth, TotalHeight, OffsetGumpID); var x = BorderSize + OffsetSize; var y = BorderSize + OffsetSize; diff --git a/Projects/UOContent/Gumps/Props/SetPoint2DGump.cs b/Projects/UOContent/Gumps/Props/SetPoint2DGump.cs index a9703fe1e..7ee4bb2c8 100644 --- a/Projects/UOContent/Gumps/Props/SetPoint2DGump.cs +++ b/Projects/UOContent/Gumps/Props/SetPoint2DGump.cs @@ -9,22 +9,20 @@ namespace Server.Gumps { public class SetPoint2DGump : Gump { - private static readonly int CoordWidth = 105; - private static readonly int EntryWidth = CoordWidth + OffsetSize + CoordWidth; + private const int CoordWidth = 105; + private const int EntryWidth = CoordWidth + OffsetSize + CoordWidth; - private static readonly int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; - private static readonly int TotalHeight = OffsetSize + 4 * (EntryHeight + OffsetSize); + private const int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; + private const int TotalHeight = OffsetSize + 4 * (EntryHeight + OffsetSize); - private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize; - private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize; + private const int BackWidth = BorderSize + TotalWidth + BorderSize; + private const int BackHeight = BorderSize + TotalHeight + BorderSize; private readonly Mobile m_Mobile; private readonly object m_Object; private readonly PropertyInfo m_Property; private readonly PropertiesGump m_PropertiesGump; - public SetPoint2DGump( - PropertyInfo prop, Mobile mobile, object o, PropertiesGump propertiesGump - ) + public SetPoint2DGump(PropertyInfo prop, Mobile mobile, object o, PropertiesGump propertiesGump) : base(GumpOffsetX, GumpOffsetY) { m_PropertiesGump = propertiesGump; @@ -37,13 +35,7 @@ namespace Server.Gumps AddPage(0); AddBackground(0, 0, BackWidth, BackHeight, BackGumpID); - AddImageTiled( - BorderSize, - BorderSize, - TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), - TotalHeight, - OffsetGumpID - ); + AddImageTiled(BorderSize, BorderSize, TotalWidth, TotalHeight, OffsetGumpID); var x = BorderSize + OffsetSize; var y = BorderSize + OffsetSize; @@ -179,9 +171,8 @@ namespace Server.Gumps private readonly PropertyInfo m_Property; private readonly PropertiesGump m_PropertiesGump; - public InternalTarget( - PropertyInfo prop, Mobile mobile, object o, PropertiesGump propertiesGump - ) : base(-1, true, TargetFlags.None) + public InternalTarget(PropertyInfo prop, Mobile mobile, object o, PropertiesGump propertiesGump) + : base(-1, true, TargetFlags.None) { m_Property = prop; m_Mobile = mobile; diff --git a/Projects/UOContent/Gumps/Props/SetPoint3DGump.cs b/Projects/UOContent/Gumps/Props/SetPoint3DGump.cs index fed371935..297f4e36a 100644 --- a/Projects/UOContent/Gumps/Props/SetPoint3DGump.cs +++ b/Projects/UOContent/Gumps/Props/SetPoint3DGump.cs @@ -9,23 +9,21 @@ namespace Server.Gumps { public class SetPoint3DGump : Gump { - private static readonly int CoordWidth = 70; - private static readonly int EntryWidth = CoordWidth + OffsetSize + CoordWidth + OffsetSize + CoordWidth; + private const int CoordWidth = 70; + private const int EntryWidth = CoordWidth + OffsetSize + CoordWidth + OffsetSize + CoordWidth; - private static readonly int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; - private static readonly int TotalHeight = OffsetSize + 4 * (EntryHeight + OffsetSize); + private const int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; + private const int TotalHeight = OffsetSize + 4 * (EntryHeight + OffsetSize); - private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize; - private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize; + private const int BackWidth = BorderSize + TotalWidth + BorderSize; + private const int BackHeight = BorderSize + TotalHeight + BorderSize; private readonly Mobile m_Mobile; private readonly object m_Object; private readonly PropertyInfo m_Property; private readonly PropertiesGump m_PropertiesGump; - public SetPoint3DGump( - PropertyInfo prop, Mobile mobile, object o, PropertiesGump propertiesGump - ) + public SetPoint3DGump(PropertyInfo prop, Mobile mobile, object o, PropertiesGump propertiesGump) : base(GumpOffsetX, GumpOffsetY) { m_PropertiesGump = propertiesGump; @@ -38,13 +36,7 @@ namespace Server.Gumps AddPage(0); AddBackground(0, 0, BackWidth, BackHeight, BackGumpID); - AddImageTiled( - BorderSize, - BorderSize, - TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), - TotalHeight, - OffsetGumpID - ); + AddImageTiled(BorderSize, BorderSize, TotalWidth, TotalHeight, OffsetGumpID); var x = BorderSize + OffsetSize; var y = BorderSize + OffsetSize; @@ -186,9 +178,8 @@ namespace Server.Gumps private readonly PropertyInfo m_Property; private readonly PropertiesGump m_PropertiesGump; - public InternalTarget( - PropertyInfo prop, Mobile mobile, object o, PropertiesGump propertiesGump - ) : base(-1, true, TargetFlags.None) + public InternalTarget(PropertyInfo prop, Mobile mobile, object o, PropertiesGump propertiesGump) + : base(-1, true, TargetFlags.None) { m_PropertiesGump = propertiesGump; m_Property = prop; diff --git a/Projects/UOContent/Gumps/Props/SetTimeSpanGump.cs b/Projects/UOContent/Gumps/Props/SetTimeSpanGump.cs index e45a1eae5..19114f57b 100644 --- a/Projects/UOContent/Gumps/Props/SetTimeSpanGump.cs +++ b/Projects/UOContent/Gumps/Props/SetTimeSpanGump.cs @@ -9,13 +9,13 @@ namespace Server.Gumps { public class SetTimeSpanGump : Gump { - private static readonly int EntryWidth = 212; + private const int EntryWidth = 212; - private static readonly int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; - private static readonly int TotalHeight = OffsetSize + 7 * (EntryHeight + OffsetSize); + private const int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; + private const int TotalHeight = OffsetSize + 7 * (EntryHeight + OffsetSize); - private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize; - private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize; + private const int BackWidth = BorderSize + TotalWidth + BorderSize; + private const int BackHeight = BorderSize + TotalHeight + BorderSize; private readonly Mobile m_Mobile; private readonly object m_Object; private readonly PropertyInfo m_Property; @@ -36,13 +36,7 @@ namespace Server.Gumps AddPage(0); AddBackground(0, 0, BackWidth, BackHeight, BackGumpID); - AddImageTiled( - BorderSize, - BorderSize, - TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), - TotalHeight, - OffsetGumpID - ); + AddImageTiled(BorderSize, BorderSize, TotalWidth, TotalHeight, OffsetGumpID); AddRect(0, prop?.Name, 0, -1); AddRect(1, ts.ToString(), 0, -1); diff --git a/Projects/UOContent/Gumps/SkillsGump.cs b/Projects/UOContent/Gumps/SkillsGump.cs index c152a1e82..c08df2948 100644 --- a/Projects/UOContent/Gumps/SkillsGump.cs +++ b/Projects/UOContent/Gumps/SkillsGump.cs @@ -9,13 +9,13 @@ namespace Server.Gumps { public class EditSkillGump : Gump { - private static readonly int EntryWidth = 160; + private const int EntryWidth = 160; - private static readonly int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; - private static readonly int TotalHeight = OffsetSize + 2 * (EntryHeight + OffsetSize); + private const int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; + private const int TotalHeight = OffsetSize + 2 * (EntryHeight + OffsetSize); - private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize; - private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize; + private const int BackWidth = BorderSize + TotalWidth + BorderSize; + private const int BackHeight = BorderSize + TotalHeight + BorderSize; private readonly Mobile m_From; @@ -38,13 +38,7 @@ namespace Server.Gumps AddPage(0); AddBackground(0, 0, BackWidth, BackHeight, BackGumpID); - AddImageTiled( - BorderSize, - BorderSize, - TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), - TotalHeight, - OffsetGumpID - ); + AddImageTiled(BorderSize, BorderSize, TotalWidth, TotalHeight, OffsetGumpID); var x = BorderSize + OffsetSize; var y = BorderSize + OffsetSize; @@ -111,22 +105,10 @@ namespace Server.Gumps public class SkillsGump : Gump { - /* - private static bool PrevLabel = OldStyle, NextLabel = OldStyle; + private const int NameWidth = 107; + private const int ValueWidth = 128; - private static readonly int PrevLabelOffsetX = PrevWidth + 1; - - private static readonly int PrevLabelOffsetY = 0; - - private static readonly int NextLabelOffsetX = -29; - private static readonly int NextLabelOffsetY = 0; - * */ - - private static readonly int NameWidth = 107; - private static readonly int ValueWidth = 128; - - private static readonly int TotalWidth = - OffsetSize + NameWidth + OffsetSize + ValueWidth + OffsetSize + SetWidth + OffsetSize; + private const int TotalWidth = OffsetSize + NameWidth + OffsetSize + ValueWidth + OffsetSize + SetWidth + OffsetSize; private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize; @@ -158,47 +140,21 @@ namespace Server.Gumps AddPage(0); AddBackground(0, 0, BackWidth, BorderSize + totalHeight + BorderSize, BackGumpID); - AddImageTiled( - BorderSize, - BorderSize, - TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), - totalHeight, - OffsetGumpID - ); + AddImageTiled(BorderSize, BorderSize, TotalWidth, totalHeight, OffsetGumpID); var x = BorderSize + OffsetSize; var y = BorderSize + OffsetSize; - var emptyWidth = TotalWidth - PrevWidth - NextWidth - OffsetSize * 4 - (OldStyle ? SetWidth + OffsetSize : 0); - - if (OldStyle) - { - AddImageTiled(x, y, TotalWidth - OffsetSize * 3 - SetWidth, EntryHeight, HeaderGumpID); - } - else - { - AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); - } + const int emptyWidth = TotalWidth - PrevWidth - NextWidth - OffsetSize * 4; + AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); x += PrevWidth + OffsetSize; - if (!OldStyle) - { - AddImageTiled( - x - (OldStyle ? OffsetSize : 0), - y, - emptyWidth + (OldStyle ? OffsetSize * 2 : 0), - EntryHeight, - HeaderGumpID - ); - } + AddImageTiled(x, y, emptyWidth, EntryHeight, HeaderGumpID); x += emptyWidth + OffsetSize; - if (!OldStyle) - { - AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID); - } + AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID); for (var i = 0; i < m_Groups.Length; ++i) { @@ -220,12 +176,10 @@ namespace Server.Gumps x += PrevWidth + OffsetSize; - x -= OldStyle ? OffsetSize : 0; - - AddImageTiled(x, y, emptyWidth + (OldStyle ? OffsetSize * 2 : 0), EntryHeight, EntryGumpID); + AddImageTiled(x, y, emptyWidth, EntryHeight, EntryGumpID); AddLabel(x + TextOffsetX, y, TextHue, group?.Name ?? ""); - x += emptyWidth + (OldStyle ? OffsetSize * 2 : 0); + x += emptyWidth; x += OffsetSize; if (SetGumpID != 0) @@ -238,7 +192,6 @@ namespace Server.Gumps continue; } - var indentMaskX = BorderSize; var indentMaskY = y + EntryHeight + OffsetSize; for (var j = 0; j < group!.Skills.Length; ++j) @@ -257,18 +210,10 @@ namespace Server.Gumps x += PrevWidth + OffsetSize; - x -= OldStyle ? OffsetSize : 0; - - AddImageTiled( - x, - y, - emptyWidth + (OldStyle ? OffsetSize * 2 : 0) - OffsetSize - IndentWidth, - EntryHeight, - EntryGumpID - ); + AddImageTiled(x, y, emptyWidth - OffsetSize - IndentWidth, EntryHeight, EntryGumpID); AddLabel(x + TextOffsetX, y, TextHue, sk == null ? "(null)" : sk.Name); - x += emptyWidth + (OldStyle ? OffsetSize * 2 : 0) - OffsetSize - IndentWidth; + x += emptyWidth - OffsetSize - IndentWidth; x += OffsetSize; if (SetGumpID != 0) @@ -284,23 +229,29 @@ namespace Server.Gumps switch (sk.Lock) { default: - buttonID1 = 0x983; - buttonID2 = 0x983; - xOffset = 6; - yOffset = 4; - break; + { + buttonID1 = 0x983; + buttonID2 = 0x983; + xOffset = 6; + yOffset = 4; + break; + } case SkillLock.Down: - buttonID1 = 0x985; - buttonID2 = 0x985; - xOffset = 6; - yOffset = 4; - break; + { + buttonID1 = 0x985; + buttonID2 = 0x985; + xOffset = 6; + yOffset = 4; + break; + } case SkillLock.Locked: - buttonID1 = 0x82C; - buttonID2 = 0x82C; - xOffset = 5; - yOffset = 2; - break; + { + buttonID1 = 0x82C; + buttonID2 = 0x82C; + xOffset = 5; + yOffset = 2; + break; + } } AddButton(x + xOffset, y + yOffset, buttonID1, buttonID2, GetButtonID(2, j)); @@ -331,7 +282,7 @@ namespace Server.Gumps } AddImageTiled( - indentMaskX, + BorderSize, indentMaskY, IndentWidth + OffsetSize, group.Skills.Length * (EntryHeight + OffsetSize) - (i < m_Groups.Length - 1 ? OffsetSize : 0), @@ -406,17 +357,23 @@ namespace Server.Gumps switch (sk.Lock) { case SkillLock.Up: - sk.SetLockNoRelay(SkillLock.Down); - sk.Update(); - break; + { + sk.SetLockNoRelay(SkillLock.Down); + sk.Update(); + break; + } case SkillLock.Down: - sk.SetLockNoRelay(SkillLock.Locked); - sk.Update(); - break; + { + sk.SetLockNoRelay(SkillLock.Locked); + sk.Update(); + break; + } case SkillLock.Locked: - sk.SetLockNoRelay(SkillLock.Up); - sk.Update(); - break; + { + sk.SetLockNoRelay(SkillLock.Up); + sk.Update(); + break; + } } } else @@ -451,11 +408,10 @@ namespace Server.Gumps public SkillName[] Skills { get; } public static SkillsGumpGroup[] Groups { get; } = - { + [ new( "Crafting", - new[] - { + [ SkillName.Alchemy, SkillName.Blacksmith, SkillName.Cartography, @@ -466,22 +422,20 @@ namespace Server.Gumps SkillName.Tailoring, SkillName.Tinkering, SkillName.Imbuing - } + ] ), new( "Bardic", - new[] - { + [ SkillName.Discordance, SkillName.Musicianship, SkillName.Peacemaking, SkillName.Provocation - } + ] ), new( "Magical", - new[] - { + [ SkillName.Chivalry, SkillName.EvalInt, SkillName.Magery, @@ -493,12 +447,11 @@ namespace Server.Gumps SkillName.Bushido, SkillName.Spellweaving, SkillName.Mysticism - } + ] ), new( "Miscellaneous", - new[] - { + [ SkillName.Camping, SkillName.Fishing, SkillName.Focus, @@ -509,12 +462,11 @@ namespace Server.Gumps SkillName.Mining, SkillName.Snooping, SkillName.Veterinary - } + ] ), new( "Combat Ratings", - new[] - { + [ SkillName.Archery, SkillName.Fencing, SkillName.Macing, @@ -523,12 +475,11 @@ namespace Server.Gumps SkillName.Tactics, SkillName.Wrestling, SkillName.Throwing - } + ] ), new( "Actions", - new[] - { + [ SkillName.AnimalTaming, SkillName.Begging, SkillName.DetectHidden, @@ -538,21 +489,20 @@ namespace Server.Gumps SkillName.Stealing, SkillName.Stealth, SkillName.Tracking - } + ] ), new( "Lore & Knowledge", - new[] - { + [ SkillName.Anatomy, SkillName.AnimalLore, SkillName.ArmsLore, SkillName.Forensics, SkillName.ItemID, SkillName.TasteID - } + ] ) - }; + ]; private class SkillNameComparer : IComparer { diff --git a/Projects/UOContent/Gumps/ToTAdminGump.cs b/Projects/UOContent/Gumps/ToTAdminGump.cs index 10ea5b6b0..6efbf2650 100644 --- a/Projects/UOContent/Gumps/ToTAdminGump.cs +++ b/Projects/UOContent/Gumps/ToTAdminGump.cs @@ -7,7 +7,7 @@ namespace Server.Gumps public class ToTAdminGump : Gump { private static readonly string[] m_ToTInfo = - { + [ // Opening Message "
Treasures of Tokuno Admin

" + "-Use the gems to switch eras
" + @@ -27,7 +27,7 @@ namespace Server.Gumps "-10 types of 1 charge Fresh Pigments drop as Lesser Artifacts
" + "-1 charge Bleach Pigment can drop as a Lesser Artifact
" + "-Leurocian's Mempo Of Fortune can drop as a Lesser Artifact" - }; + ]; private readonly int m_ToTEras; diff --git a/Projects/UOContent/Gumps/VendorRentalGumps.cs b/Projects/UOContent/Gumps/VendorRentalGumps.cs index 8b519b5f7..82710f662 100644 --- a/Projects/UOContent/Gumps/VendorRentalGumps.cs +++ b/Projects/UOContent/Gumps/VendorRentalGumps.cs @@ -164,32 +164,46 @@ namespace Server.Gumps switch (info.ButtonID) { case 1: // Price Per Rental - SetPricePerRental(from); - break; + { + SetPricePerRental(from); + break; + } case 2: // Accept offer - AcceptOffer(from); - break; + { + AcceptOffer(from); + break; + } case 3: // Renew on expiration - landlord - LandlordRenewOnExpiration(from); - break; + { + LandlordRenewOnExpiration(from); + break; + } case 4: // Renew on expiration - renter - RenterRenewOnExpiration(from); - break; + { + RenterRenewOnExpiration(from); + break; + } case 5: // Offer Contract To Someone - OfferContract(from); - break; + { + OfferContract(from); + break; + } case 6: // Renewal price - SetRenewalPrice(from); - break; + { + SetRenewalPrice(from); + break; + } default: - Cancel(from); - break; + { + Cancel(from); + break; + } } } } diff --git a/Projects/UOContent/Gumps/WhoGump.cs b/Projects/UOContent/Gumps/WhoGump.cs index 27971f83e..405f5299d 100644 --- a/Projects/UOContent/Gumps/WhoGump.cs +++ b/Projects/UOContent/Gumps/WhoGump.cs @@ -9,18 +9,12 @@ using static Server.Gumps.PropsConfig; namespace Server.Gumps; public class WhoGump : DynamicGump { - private static readonly int PrevLabelOffsetX = PrevWidth + 1; - private static readonly int PrevLabelOffsetY = 0; + private const int EntryWidth = 180; + private const int EntryCount = 15; - private static readonly int NextLabelOffsetX = -29; - private static readonly int NextLabelOffsetY = 0; + private const int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; - private static readonly int EntryWidth = 180; - private static readonly int EntryCount = 15; - - private static readonly int TotalWidth = OffsetSize + EntryWidth + OffsetSize + SetWidth + OffsetSize; - - private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize; + private const int BackWidth = BorderSize + TotalWidth + BorderSize; private readonly List _mobiles; private readonly int _page; @@ -88,29 +82,14 @@ public class WhoGump : DynamicGump builder.AddPage(); builder.AddBackground(0, 0, BackWidth, BorderSize + totalHeight + BorderSize, BackGumpID); - builder.AddImageTiled( - BorderSize, - BorderSize, - TotalWidth - (OldStyle ? SetWidth + OffsetSize : 0), - totalHeight, - OffsetGumpID - ); + builder.AddImageTiled(BorderSize, BorderSize, TotalWidth, totalHeight, OffsetGumpID); var x = BorderSize + OffsetSize; var y = BorderSize + OffsetSize; - var emptyWidth = TotalWidth - PrevWidth - NextWidth - OffsetSize * 4 - (OldStyle ? SetWidth + OffsetSize : 0); + const int emptyWidth = TotalWidth - PrevWidth - NextWidth - OffsetSize * 4; - if (!OldStyle) - { - builder.AddImageTiled( - x - (OldStyle ? OffsetSize : 0), - y, - emptyWidth + (OldStyle ? OffsetSize * 2 : 0), - EntryHeight, - EntryGumpID - ); - } + builder.AddImageTiled(x, y, emptyWidth, EntryHeight, EntryGumpID); builder.AddLabel( x + TextOffsetX, @@ -121,40 +100,20 @@ public class WhoGump : DynamicGump x += emptyWidth + OffsetSize; - if (OldStyle) - { - builder.AddImageTiled(x, y, TotalWidth - OffsetSize * 3 - SetWidth, EntryHeight, HeaderGumpID); - } - else - { - builder.AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); - } + builder.AddImageTiled(x, y, PrevWidth, EntryHeight, HeaderGumpID); if (_page > 0) { builder.AddButton(x + PrevOffsetX, y + PrevOffsetY, PrevButtonID1, PrevButtonID2, 1); - - if (PrevLabel) - { - builder.AddLabel(x + PrevLabelOffsetX, y + PrevLabelOffsetY, TextHue, "Previous"); - } } x += PrevWidth + OffsetSize; - if (!OldStyle) - { - builder.AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID); - } + builder.AddImageTiled(x, y, NextWidth, EntryHeight, HeaderGumpID); if ((_page + 1) * EntryCount < _mobiles.Count) { builder.AddButton(x + NextOffsetX, y + NextOffsetY, NextButtonID1, NextButtonID2, 2, GumpButtonType.Reply, 1); - - if (NextLabel) - { - builder.AddLabel(x + NextLabelOffsetX, y + NextLabelOffsetY, TextHue, "Next"); - } } for (int i = 0, index = _page * EntryCount; i < EntryCount && index < _mobiles.Count; ++i, ++index) @@ -193,12 +152,12 @@ public class WhoGump : DynamicGump m.AccessLevel switch { >= AccessLevel.Administrator => 0x516, - AccessLevel.Seer => 0x144, - AccessLevel.GameMaster => 0x21, - AccessLevel.Counselor => 0x2, - _ when m.Murderer => 0x21, - _ when m.Criminal => 0x3B1, - _ => 0x58 + AccessLevel.Seer => 0x144, + AccessLevel.GameMaster => 0x21, + AccessLevel.Counselor => 0x2, + _ when m.Murderer => 0x21, + _ when m.Criminal => 0x3B1, + _ => 0x58 }; public override void OnResponse(NetState state, in RelayInfo info) @@ -270,15 +229,8 @@ public class WhoGump : DynamicGump public int Compare(Mobile x, Mobile y) { - if (x == null) - { - throw new ArgumentNullException(nameof(x)); - } - - if (y == null) - { - throw new ArgumentNullException(nameof(y)); - } + ArgumentNullException.ThrowIfNull(x); + ArgumentNullException.ThrowIfNull(y); if (x.AccessLevel > y.AccessLevel) {