public static void AddHtmlText(Gump g, int x, int y, int width, int height, TextDefinition def, bool back, bool scroll, int numberColor, int stringColor) { if (def == null) { return; } if (def.m_Number > 0) { if (numberColor >= 0) { g.AddHtmlLocalized(x, y, width, height, def.m_Number, numberColor, back, scroll); } else { g.AddHtmlLocalized(x, y, width, height, def.m_Number, back, scroll); } } else if (def.m_String != null) { if (stringColor >= 0) { g.AddHtml(x, y, width, height, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", stringColor, def.m_String), back, scroll); } else { g.AddHtml(x, y, width, height, def.m_String, back, scroll); } } }
public void AddToGump(Gump gump, int x, int y, bool forStaff, int buttonID, bool addDescription, bool requiresRestart) { gump.AddHtml(x, y, 145, 20, String.Format("<basefont color=#111111>{0}:</font>", Name), false, false); if (forStaff) { gump.AddButton(155 + x, y, 2511, 2510, buttonID, GumpButtonType.Reply, 0); } if (Setting == true) { gump.AddHtml(175 + x, y, 145, 20, String.Format("<basefont color=#008800>Currently enabled.</font>"), false, false); } else { gump.AddHtml(175 + x, y, 145, 20, String.Format("<basefont color=#ff0000>Currently disabled.</font>"), false, false); } if (requiresRestart) { gump.AddHtml(x, y + 20, 285, 20, String.Format("<basefont color=#ff0000>Require server restart.</font>"), false, false); } if (addDescription) { gump.AddHtml(x, y + 20 + (requiresRestart ? 20 : 0), 285, 200, String.Format("<basefont color=#0000ff>{0}</font>", Description), false, false); } }
public static void AddHtmlText(Gump g, int x, int y, int width, int height, TextDefinition def, bool back, bool scroll, int numberColor, int stringColor) { if (def == null) { return; } if (def.m_Number > 0) { if (numberColor >= 0) // 5 bits per RGB component (15 bit RGB) { g.AddHtmlLocalized(x, y, width, height, def.m_Number, numberColor, back, scroll); } else { g.AddHtmlLocalized(x, y, width, height, def.m_Number, back, scroll); } } else if (def.m_String != null) { if (stringColor >= 0) // 8 bits per RGB component (24 bit RGB) { g.AddHtml(x, y, width, height, $"<BASEFONT COLOR=#{stringColor:X6}>{def.m_String}</BASEFONT>", back, scroll); } else { g.AddHtml(x, y, width, height, def.m_String, back, scroll); } } }
public void OnForensicEval(Mobile m) { if (!m.Player) { return; } var quest = QuestHelper.GetQuest <GoingGumshoeQuest2>((PlayerMobile)m); if (quest != null) { if (HasFoundClue1(quest)) { m.SendLocalizedMessage(1158613); // You have already documented this clue. } else { m.PrivateOverheadMessage(MessageType.Regular, 0x47E, 1157722, "Forensics", m.NetState); // *Your proficiency in ~1_SKILL~ reveals more about the item* m.SendLocalizedMessage(1158612, null, 0x23); // You have identified a clue! This item seems pertinent to the investigation! m.SendSound(quest.UpdateSound); var gump = new Gump(50, 50); gump.AddBackground(0, 0, 500, 500, 9380); gump.AddItem(84, 130, ItemID, Hue); gump.AddHtml(167, 50, 310, 20, "<center><basefont color=#B22222>Book</center>", false, false); gump.AddHtmlLocalized(167, 70, 310, 380, 1158577, true, false); m.SendGump(gump); SetFoundClue1(quest); } } }
public static void SendGump(Mobile m, string message) { Gump g = new Gump(10, 10); int xo = (640 - 340) / 2, yo = (480 - 180) / 2; g.Closable = false; g.AddPage(0); g.AddPage(1); g.AddBackground(0, 0, 92, 75, 0xA3C); g.AddImageTiled(5, 7, 82, 61, 0xA40); g.AddAlphaRegion(5, 7, 82, 61); g.AddImageTiled(9, 11, 21, 53, 0xBBC); g.AddButton(10, 12, 0x7D2, 0x7D2, 2, GumpButtonType.Page, 2); g.AddHtmlLocalized(34, 28, 65, 24, 3001002, 0xFFFFFF, false, false); // Message g.AddPage(2); g.AddBackground(xo + 0, yo + 0, 340, 180, 5054); g.AddImageTiled(xo + 10, yo + 10, 340 - 20, 20, 2624); g.AddAlphaRegion(xo + 10, yo + 10, 340 - 20, 20); g.AddHtmlLocalized(xo + 10, yo + 10, 340 - 20, 20, 1074862, 0xffffff, false, false); g.AddImageTiled(xo + 10, yo + 40, 340 - 20, 180 - 80, 2624); g.AddAlphaRegion(xo + 10, yo + 40, 340 - 20, 180 - 80); g.AddHtml(xo + 10, yo + 40, 340 - 20, 180 - 80, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", 0xffffff, message), false, true); g.AddImageTiled(xo + 10, yo + 180 - 30, 340 - 20, 20, 2624); g.AddAlphaRegion(xo + 10, yo + 180 - 30, 340 - 20, 20); g.AddButton(xo + 10, yo + 180 - 30, 4005, 4007, 1, GumpButtonType.Reply, 0); g.AddHtmlLocalized(xo + 40, yo + 180 - 30, 120, 20, 1011036, 32767, false, false); // OKAY m.SendGump(g); }
internal void BaseSkinByType(Gump g) { if (relplug == null) { SkillSettings.DoTell("Base Type is invalid. Cannot skin."); } g.AddPage(0); string switchby = relplug.getGumpType(); if (switchby == "Control") { //this.X = sk.GetCoord("Control", "X", sk ); this.Y = sk.SelectionY; g.X = 0; g.Y = 0; if (!Skin.WindowInfo.ContainsKey("Control")) { SkillSettings.DoTell("No key for Control gump skin."); return; } WindowInfo inf = Skin.WindowInfo["Control"]; g.X = inf.X; g.Y = inf.Y; //this.AddBackground(sk.GetCoord("Control", "X", sk ), sk.SelectionY, sk.GetCoord("Control", "W", sk ), sk.GetCoord("Control", "H", sk ), sk.SelectBGID); g.AddBackground(0, 0, inf.W, inf.H, inf.bgID); g.AddImageTiled(Skin.BarSHX, Skin.BarSHY, Skin.BarSHW, Skin.BarSHH, Skin.SelectLineH); g.AddHtml(Skin.TMSSX, Skin.TMSSY, 140, 20, "<basefont size=5 face=1 color=#CC0000><Center>TMSS - //4// -</center></basefont>", false, false); //<basefont size=5 face=1 color=#CC0000><Center>TM Skill & Stat System v3.0</center></basefont> } else if (switchby == "Master") { g.X = 0; g.Y = 0; if (!Skin.WindowInfo.ContainsKey("Master")) { SkillSettings.DoTell("No key for Master gump skin."); return; } WindowInfo inf = Skin.WindowInfo["Master"]; //this.AddBackground(sk.MasterX, sk.MasterY, sk.MasterW, sk.MasterH, sk.MasterBGID); g.X = inf.X; g.Y = inf.Y; g.AddBackground(0, 0, inf.W, inf.H, inf.bgID); g.AddImageTiled(Skin.BarMHX, Skin.BarMHY, Skin.BarMHW, Skin.BarMHH, Skin.MasterLineH); g.AddImageTiled(Skin.BarMVX, Skin.BarMVY, Skin.BarMVW, Skin.BarMVH, Skin.MasterLineV); g.AddItem(Skin.IconMX, Skin.IconMY, Skin.IconMID, Skin.IconMColor); } else if (switchby == "Underbar") { g.X = 0; g.Y = 0; if (!Skin.WindowInfo.ContainsKey("Underbar")) { SkillSettings.DoTell("No key for Underbar gump skin."); return; } WindowInfo inf = Skin.WindowInfo["Underbar"]; g.X = inf.X; g.Y = inf.Y; g.AddBackground(0, 0, inf.W, inf.H, inf.bgID); //this.AddBackground(sk.sk.GetCoord("Underbar", "X", );, sk.sk.GetCoord("Underbar", "Y", );, sk.HelpW, sk.HelpH, sk.HelpBGID); } else { SkillSettings.DoTell("Unknown Gump Type. Cannot apply base skin."); } }
public void OnForensicEval(Mobile m) { if (!m.Player) { return; } var quest = QuestHelper.GetQuest <GoingGumshoeQuest2>((PlayerMobile)m); if (quest != null) { if (HasFoundClue(quest)) { m.SendLocalizedMessage(1158613); // You have already documented this clue. } else { m.PrivateOverheadMessage(MessageType.Regular, 0x47E, 1157722, "Forensics", m.NetState); // *Your proficiency in ~1_SKILL~ reveals more about the item* m.SendLocalizedMessage(1158612, null, 0x23); // You have identified a clue! This item seems pertinent to the investigation! m.SendSound(quest.UpdateSound); var gump = new Gump(50, 50); gump.AddBackground(0, 0, 500, 500, 9380); gump.AddItem(84, 130, ItemID, Hue); gump.AddHtml(167, 50, 310, 20, "<center><basefont color=#B22222>a dust pile</center>", false, false); gump.AddHtmlLocalized(167, 70, 310, 380, 1158617, true, false); m.SendGump(gump); /*The dust seems to have have settled in a distinct pattern around whatever once was placed at this location. * Whatever it was, it was certainly small enough to be taken away in a hurry.*/ SetFoundClue(quest); } } }
public override void Gump(Mobile from, Gump gump, ACCGumpParams subParams) { gump.AddButton(190, 40, 2445, 2445, 101, GumpButtonType.Reply, 0); gump.AddLabel(204, 42, 1153, "List Mobiles"); gump.AddButton(310, 40, 2445, 2445, 102, GumpButtonType.Reply, 0); gump.AddLabel(331, 42, 1153, "List Items"); gump.AddButton(430, 40, 2445, 2445, 103, GumpButtonType.Reply, 0); gump.AddLabel(450, 42, 1153, "List Types"); // gump.AddButton( 190, 70, 2445, 2445, 104, GumpButtonType.Reply, 0 ); // gump.AddLabel( 208, 72, 1153, "Add Module" ); // gump.AddButton( 310, 70, 2445, 2445, 105, GumpButtonType.Reply, 0 ); // gump.AddLabel( 326, 72, 1153, "Edit Module" ); // gump.AddButton( 430, 70, 2445, 2445, 106, GumpButtonType.Reply, 0 ); // gump.AddLabel( 439, 72, 1153, "Delete Module" ); if (subParams == null || !(subParams is CMGumpParams)) { gump.AddHtml(215, 15, 300, 25, "<basefont size=7 color=white><center>Central Memory</center></font>", false, false); gump.AddHtml(140, 95, 450, 250, "<basefont color=white><center>Welcome to the Central Memory Admin Gump!</center><br>With this gump, you can see a list of all entries that the CM contains. You can add new Modules or modify or delete existing Modules.<br><br>Make your selection from the top buttons, either List Mobiles or Items. This will bring up a list of all Mobiles or Items that the CM is keeping track of.<br><br>You may then select one of the entries to list the Modules that are stored to that entry. You can then add, modify or remove modules to that entry.</font>", false, false); return; } Params = subParams as CMGumpParams; switch ((int)Params.PageName) { #region ListMobiles case (int)Pages.ListMobiles: gump.AddLabel(120, 95, 1153, "Listing all Mobiles:"); m_MobileList = GetMobiles(); if (m_MobileList == null || m_MobileList.Count == 0) { return; } if (Params.PageIndex < 0) { Params.PageIndex = 0; } if (Params.PageIndex > 0) { gump.AddButton(120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0); } if ((Params.PageIndex + 1) * 21 <= m_MobileList.Count) { gump.AddButton(540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0); } for (int i = Params.PageIndex * 21, r = 0, c = 0; i < m_MobileList.Count; i++) { if (m_MobileList[i] == null) { continue; } gump.AddButton(120 + c * 155, 125 + r * 30, 2501, 2501, 1000 + i, GumpButtonType.Reply, 0); gump.AddLabel(130 + c * 155, 126 + r * 30, 1153, (m_MobileList[i].Name == null ? m_MobileList[i].Serial.ToString() : m_MobileList[i].Name)); } break; #endregion //ListMobiles #region ListItems case (int)Pages.ListItems: gump.AddLabel(120, 95, 1153, "Listing all Items:"); m_ItemList = GetItems(); if (m_ItemList == null || m_ItemList.Count == 0) { return; } if (Params.PageIndex < 0) { Params.PageIndex = 0; } if (Params.PageIndex > 0) { gump.AddButton(120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0); } if ((Params.PageIndex + 1) * 21 <= m_ItemList.Count) { gump.AddButton(540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0); } for (int i = Params.PageIndex * 21, r = 0, c = 0; i < m_ItemList.Count; i++) { if (m_ItemList[i] == null) { continue; } gump.AddButton(120 + c * 155, 125 + r * 30, 2501, 2501, 1000 + i, GumpButtonType.Reply, 0); gump.AddLabel(130 + c * 155, 126 + r * 30, 1153, (m_ItemList[i].Name == null ? m_ItemList[i].Serial.ToString() : m_ItemList[i].Name)); } break; #endregion //ListItems #region ListModulesFor case (int)Pages.ListModulesFor: if (!m_DictionaryOfModuleLists.ContainsKey(Params.SelectedSerial)) { gump.AddLabel(120, 95, 1153, "This entity no longer exists in the Central Memory!"); return; } if (m_DictionaryOfModuleLists[Params.SelectedSerial] == null || m_DictionaryOfModuleLists[Params.SelectedSerial].Count == 0) { gump.AddLabel(120, 95, 1153, "This entity has no Modules!"); Remove(Params.SelectedSerial); return; } string name = ""; if (Params.SelectedSerial.IsMobile) { name = World.FindMobile(Params.SelectedSerial).Name; } else if (Params.SelectedSerial.IsItem) { name = World.FindItem(Params.SelectedSerial).Name; } if (name == null || name.Length == 0) { name = Params.SelectedSerial.ToString(); } gump.AddLabel(120, 95, 1153, String.Format("Listing all Modules for {0}:", name)); m_ModuleList = m_DictionaryOfModuleLists[Params.SelectedSerial].GetListOfModules(); if (m_ModuleList == null || m_ModuleList.Count == 0) { return; } if (Params.PageIndex < 0) { Params.PageIndex = 0; } if (Params.PageIndex * 21 >= m_ModuleList.Count) { Params.PageIndex = m_ModuleList.Count - 21; } if (Params.PageIndex > 0) { gump.AddButton(120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0); } if ((Params.PageIndex + 1) * 21 <= m_ModuleList.Count) { gump.AddButton(540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0); } gump.AddButton(331, 332, 4008, 4009, 106, GumpButtonType.Reply, 0); for (int i = Params.PageIndex * 21, r = 0, c = 0; i < m_ModuleList.Count; i++) { if (m_ModuleList[i] == null) { continue; } gump.AddButton(120 + c * 155, 125 + r * 30, 2501, 2501, 1000 + i, GumpButtonType.Reply, 0); gump.AddLabel(130 + c * 155, 126 + r * 30, 1153, (m_ModuleList[i].Name().Length == 0 ? m_ModuleList[i].Owner.ToString() : m_ModuleList[i].Name())); } break; #endregion //ListModulesFor } }
public override void Gump(Mobile from, Gump gump, ACCGumpParams subParams) { gump.AddButton(195, 40, 2445, 2445, 101, GumpButtonType.Reply, 0); gump.AddLabel(200, 41, 1153, "Manage System"); gump.AddButton(310, 40, 2445, 2445, 102, GumpButtonType.Reply, 0); gump.AddLabel(342, 41, 1153, "Import"); if (subParams == null || !(subParams is PGGumpParams)) { gump.AddHtml(215, 65, 300, 25, "<basefont size=7 color=white><center>Public Gates</center></font>", false, false); gump.AddHtml(140, 95, 450, 250, "<basefont color=white><center>Welcome to the Public Gate Admin Gump!</center><br>With this gump, you can manage the entire system and import and export locations or full categories. Please choose an option from the top bar.<br><br>Manage System allows you to add/change/delete locations and categories from anywhere in the world.<br><br>Im/Ex port allows you to import or export categories and locations to files that you can distribute to other servers that use this system.</font>", false, false); return; } Params = subParams as PGGumpParams; switch ((int)Params.Page) { #region Manage Gump Code case (int)Pages.Manage: { gump.AddBackground(640, 0, 160, 400, 5120); gump.AddButton(425, 40, 2445, 2445, 123, GumpButtonType.Reply, 0); gump.AddLabel(456, 41, 1153, "Export"); for (int i = 0; i < m_CategoryList.Count && i < 50; i++) { PGCategory PGC = m_CategoryList[i]; if (PGC != null) { gump.AddButton(650, 10 + i * 30, 2501, 2501, 150 + i, GumpButtonType.Reply, 0); gump.AddButton(655, 12 + i * 30, (Params.SelectedCategory.Key == PGC ? 5401 : 5402), (Params.SelectedCategory.Key == PGC ? 5402 : 5401), 150 + i, GumpButtonType.Reply, 0); gump.AddLabel(675, 10 + i * 30, 1153, PGC.Name); } } if (Params.SelectedCategory.Key != null) { gump.AddBackground(425, 75, 170, 285, 5120); gump.AddButton(195, 65, 2445, 2445, 121, GumpButtonType.Reply, 0); gump.AddLabel(206, 66, 1153, "Add Category"); gump.AddButton(310, 65, 2445, 2445, 122, GumpButtonType.Reply, 0); gump.AddLabel(322, 66, 1153, "Add Location"); for (int i = 0, c = 0, r = 0; i < Params.SelectedCategory.Key.Locations.Count; i++) { PGLocation PGL = Params.SelectedCategory.Key.Locations[i]; if (PGL != null) { gump.AddButton(120 + c * 150, 100 + r * 30, 2501, 2501, 200 + i, GumpButtonType.Reply, 0); gump.AddButton(125 + c * 150, 102 + r * 30, (Params.SelectedLocation.Key == PGL ? 5401 : 5402), (Params.SelectedLocation.Key == PGL ? 5402 : 5401), 200 + i, GumpButtonType.Reply, 0); gump.AddLabel(145 + c * 150, 100 + r * 30, 1153, PGL.Name); r += (c == 1 ? 1 : 0); c += (c == 1 ? -1 : 1); } } if (Params.SelectedLocation.Key != null) { gump.AddButton(550, 265, 2642, 2643, 103, GumpButtonType.Reply, 0); //Apply Location gump.AddImage(440, 85, 2501); gump.AddTextEntry(446, 85, 130, 20, 0, 105, Params.SelectedLocation.Key.Name); gump.AddImage(445, 110, 2443); gump.AddImage(513, 110, 2443); gump.AddImage(445, 135, 2443); gump.AddImage(513, 135, 2443); gump.AddImage(445, 160, 2443); gump.AddTextEntry(450, 110, 53, 20, 0, 106, Params.SelectedLocation.Key.Location.X.ToString()); gump.AddTextEntry(518, 110, 53, 20, 0, 107, Params.SelectedLocation.Key.Location.Y.ToString()); gump.AddTextEntry(450, 135, 53, 20, 0, 108, Params.SelectedLocation.Key.Location.Z.ToString()); gump.AddTextEntry(518, 135, 53, 20, 0, 109, Params.SelectedLocation.Key.Hue.ToString()); gump.AddTextEntry(450, 160, 53, 20, 0, 110, Params.SelectedLocation.Key.Cost.ToString()); gump.AddLabel(435, 112, 1153, "X"); gump.AddLabel(578, 112, 1153, "Y"); gump.AddLabel(435, 137, 1153, "Z"); gump.AddLabel(578, 137, 1153, "H"); gump.AddLabel(435, 162, 1153, "C"); gump.AddRadio(435, 190, 208, 209, (Params.SelectedLocation.Key.Map == Map.Trammel), 111); gump.AddRadio(570, 190, 208, 209, (Params.SelectedLocation.Key.Map == Map.Malas), 112); gump.AddRadio(435, 215, 208, 209, (Params.SelectedLocation.Key.Map == Map.Felucca), 113); gump.AddRadio(570, 215, 208, 209, (Params.SelectedLocation.Key.Map == Map.Ilshenar), 114); gump.AddRadio(435, 240, 208, 209, (Params.SelectedLocation.Key.Map == Map.Tokuno), 115); gump.AddLabel(460, 192, 1153, "Tram"); gump.AddLabel(530, 192, 1153, "Malas"); gump.AddLabel(460, 217, 1153, "Fel"); gump.AddLabel(542, 217, 1153, "Ilsh"); gump.AddLabel(460, 242, 1153, "Tokuno"); gump.AddLabel(465, 282, 1153, "Young?"); gump.AddCheck(440, 280, 210, 211, Params.SelectedLocation.Key.GetFlag(EntryFlag.Young), 120); gump.AddLabel(465, 307, 1153, "Gen?"); gump.AddCheck(440, 305, 210, 211, Params.SelectedLocation.Key.GetFlag(EntryFlag.Generate), 116); gump.AddLabel(515, 307, 1153, "Staff?"); gump.AddCheck(565, 305, 210, 211, Params.SelectedLocation.Key.GetFlag(EntryFlag.StaffOnly), 117); gump.AddLabel(465, 332, 1153, "Reds?"); gump.AddCheck(440, 330, 210, 211, Params.SelectedLocation.Key.GetFlag(EntryFlag.Reds), 118); gump.AddLabel(522, 332, 1153, "Chrg?"); gump.AddCheck(565, 330, 210, 211, Params.SelectedLocation.Key.GetFlag(EntryFlag.Charge), 119); } else { gump.AddButton(550, 265, 2642, 2643, 104, GumpButtonType.Reply, 0); //Apply Category gump.AddImage(440, 110, 2501); gump.AddTextEntry(446, 110, 130, 20, 0, 105, Params.SelectedCategory.Key.Name); gump.AddImage(445, 160, 2443); gump.AddTextEntry(450, 160, 53, 20, 0, 110, Params.SelectedCategory.Key.Cost.ToString()); gump.AddLabel(435, 162, 1153, "C"); gump.AddLabel(465, 282, 1153, "Young?"); gump.AddCheck(440, 280, 210, 211, Params.SelectedCategory.Key.GetFlag(EntryFlag.Young), 120); gump.AddLabel(465, 307, 1153, "Gen?"); gump.AddCheck(440, 305, 210, 211, Params.SelectedCategory.Key.GetFlag(EntryFlag.Generate), 116); gump.AddLabel(515, 307, 1153, "Staff?"); gump.AddCheck(565, 305, 210, 211, Params.SelectedCategory.Key.GetFlag(EntryFlag.StaffOnly), 117); gump.AddLabel(465, 332, 1153, "Reds?"); gump.AddCheck(440, 330, 210, 211, Params.SelectedCategory.Key.GetFlag(EntryFlag.Reds), 118); gump.AddLabel(522, 332, 1153, "Chrg?"); gump.AddCheck(565, 330, 210, 211, Params.SelectedCategory.Key.GetFlag(EntryFlag.Charge), 119); } } break; } #endregion //Manage Gump Code #region Import Gump Code case (int)Pages.Import: { //Import if (!Directory.Exists("Data/ACC Exports")) { from.SendMessage("There are no files to import!"); return; } gump.AddButton(195, 65, 2445, 2445, 124, GumpButtonType.Reply, 0); //Switch to Systems gump.AddLabel(220, 66, 1153, "Systems"); gump.AddButton(310, 65, 2445, 2445, 125, GumpButtonType.Reply, 0); //Switch to Categories gump.AddLabel(328, 66, 1153, "Categories"); gump.AddButton(425, 65, 2445, 2445, 126, GumpButtonType.Reply, 0); //Switch to Locations gump.AddLabel(447, 66, 1153, "Locations"); switch ((int)Params.ImportSelection) { case (int)ImportSelections.Systems: { Dirs = Directory.GetFiles("Data/ACC Exports/", "*.pgs"); break; } case (int)ImportSelections.Categories: { Dirs = Directory.GetFiles("Data/ACC Exports/", "*.pgc"); break; } case (int)ImportSelections.Locations: { Dirs = Directory.GetFiles("Data/ACC Exports/", "*.pgl"); break; } default: { return; } } if (Dirs == null || Dirs.Length == 0) { from.SendMessage("There are no files of that type!"); return; } for (int i = 0, r = 0, c = 0; i < Dirs.Length && c < 3; i++) { string s = Dirs[i]; s = s.Remove(0, 12); s = s.Remove(s.Length - 4, 4); if (Params.ImportSelection == ImportSelections.Systems) { s = s.Remove(0, 9); } gump.AddButton(120 + c * 150, 100 + r * 30, 2501, 2501, 300 + i, GumpButtonType.Reply, 0); gump.AddLabelCropped(125 + c * 150, 101 + r * 30, 140, 30, 1153, s); c += (r == 7 ? 1 : 0); r += (r == 7 ? -7 : 1); } break; } #endregion //Import Gump Code } }
public override void Gump(Mobile from, Gump gump, object[] subParams) { gump.AddButton(190, 40, 2445, 2445, 101, GumpButtonType.Reply, 0); gump.AddLabel(204, 42, 1153, "List Mobiles"); gump.AddButton(310, 40, 2445, 2445, 102, GumpButtonType.Reply, 0); gump.AddLabel(331, 42, 1153, "List Items"); gump.AddButton(430, 40, 2445, 2445, 103, GumpButtonType.Reply, 0); gump.AddLabel(450, 42, 1153, "List Types"); // gump.AddButton( 190, 70, 2445, 2445, 104, GumpButtonType.Reply, 0 ); // gump.AddLabel( 208, 72, 1153, "Add Module" ); // gump.AddButton( 310, 70, 2445, 2445, 105, GumpButtonType.Reply, 0 ); // gump.AddLabel( 326, 72, 1153, "Edit Module" ); // gump.AddButton( 430, 70, 2445, 2445, 106, GumpButtonType.Reply, 0 ); // gump.AddLabel( 439, 72, 1153, "Delete Module" ); if (subParams == null) { gump.AddHtml(215, 15, 300, 25, "<basefont size=7 color=white><center>Central Memory</center></font>", false, false); gump.AddHtml(140, 95, 450, 250, "<basefont color=white><center>Welcome to the Central Memory Admin Gump!</center><br>With this gump, you can see a list of all entries that the CM contains. You can add new Modules or modify or delete existing Modules.<br><br>Make your selection from the top buttons, either List Mobiles or Items. This will bring up a list of all Mobiles or Items that the CM is keeping track of.<br><br>You may then select one of the entries to list the Modules that are stored to that entry. You can then add, modify or remove modules to that entry.</font>", false, false); return; } Params = subParams; if (subParams[0] is int && (int)subParams[0] == -2) { //Mobiles gump.AddLabel(120, 95, 1153, "Listing all Mobiles:"); e_List = GetMobiles(); if (e_List == null || e_List.Count == 0) { return; } int p = 0; if (subParams.Length == 2 && subParams[1] is int) { p = (int)subParams[1]; } if (p < 0) { p = 0; } if (p > 0) { gump.AddButton(120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0); } if ((p + 1) * 21 <= e_List.Count) { gump.AddButton(540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0); } for (int i = p * 21, r = 0, c = 0; i < e_List.Count; i++) { Mobile m = (Mobile)e_List[i]; if (m == null) { continue; } gump.AddButton(120 + c * 155, 125 + r * 30, 2501, 2501, 1000 + i, GumpButtonType.Reply, 0); gump.AddLabel(130 + c * 155, 126 + r * 30, 1153, (m.Name == null?m.Serial.ToString():m.Name)); } } else if (subParams[0] is int && (int)subParams[0] == -3) { //Items gump.AddLabel(120, 95, 1153, "Listing all Items:"); e_List = GetItems(); if (e_List == null || e_List.Count == 0) { return; } int p = 0; if (subParams.Length == 2 && subParams[1] is int) { p = (int)subParams[1]; } if (p < 0) { p = 0; } if (p > 0) { gump.AddButton(120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0); } if ((p + 1) * 21 <= e_List.Count) { gump.AddButton(540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0); } for (int i = p * 21, r = 0, c = 0; i < e_List.Count; i++) { Item m = (Item)e_List[i]; if (m == null) { continue; } gump.AddButton(120 + c * 155, 125 + r * 30, 2501, 2501, 1000 + i, GumpButtonType.Reply, 0); gump.AddLabel(130 + c * 155, 126 + r * 30, 1153, (m.Name == null?m.Serial.ToString():m.Name)); } } else if (subParams[0] is Serial) { //List the Modules for that serial Serial s = (Serial)subParams[0]; if (!m_Modules.Contains(s)) { gump.AddLabel(120, 95, 1153, "This entity no longer exists in the Central Memory!"); return; } ModuleList ml = (ModuleList)m_Modules[s]; if (ml == null || ml.Count == 0) { gump.AddLabel(120, 95, 1153, "This entity has no Modules!"); Remove(s); return; } string name = ""; if (s.IsMobile) { name = World.FindMobile(s).Name; } else if (s.IsItem) { name = World.FindItem(s).Name; } if (name == null || name.Length == 0) { name = s.ToString(); } gump.AddLabel(120, 95, 1153, String.Format("Listing all Modules for {0}:", name)); m_List = new ArrayList(ml.Values); if (m_List == null || m_List.Count == 0) { return; } int p = 0; if (subParams.Length == 3 && subParams[2] is int) { p = (int)subParams[2]; } if (p < 0) { p = 0; } if (p * 21 >= m_List.Count) { p = m_List.Count - 21; } if (p > 0) { gump.AddButton(120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0); } if ((p + 1) * 21 <= m_List.Count) { gump.AddButton(540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0); } gump.AddButton(331, 332, 4008, 4009, 106, GumpButtonType.Reply, 0); for (int i = p * 21, r = 0, c = 0; i < m_List.Count; i++) { Module m = (Module)m_List[i]; if (m == null) { continue; } gump.AddButton(120 + c * 155, 125 + r * 30, 2501, 2501, 1000 + i, GumpButtonType.Reply, 0); gump.AddLabel(130 + c * 155, 126 + r * 30, 1153, (m.Name().Length == 0?m.Owner.ToString():m.Name())); } } }