Ejemplo n.º 1
0
        public static void LoadBackup(Mobile mobile, ArrayList ArgsList, string filePath)
        {
            ArrayList HideSpawnerList   = (ArrayList)ArgsList[6];
            ArrayList MSGCheckBoxesList = (ArrayList)ArgsList[13];

            MC.SetProcess(Process.LoadBackup);

            FileStream       fs;
            BinaryFileReader reader;

            mobile.SendMessage("Loading backup file...");

            try
            {
                fs     = new FileStream(filePath, (FileMode)3, (FileAccess)1, (FileShare)1);
                reader = new BinaryFileReader(new BinaryReader(fs));
            }
            catch (Exception ex)
            {
                MC.SetProcess(Process.None);

                ArgsList[2] = "Load Backup File";
                ArgsList[4] = String.Format("Exception caught:\n{0}", ex);

                mobile.SendGump(new FileBrowserGump(mobile, ArgsList));

                return;
            }

            int amountOfSpawners = reader.ReadInt();
            int cnt = 0;

            for (int i = 0; i < amountOfSpawners; i++)
            {
                if (Deserialize((GenericReader)reader))
                {
                    HideSpawnerList.Add((bool)false);
                    MSGCheckBoxesList.Add((bool)false);

                    cnt++;
                }
            }

            if (fs != null)
            {
                fs.Close();
            }

            MC.SetProcess(Process.None);

            ArgsList[2]  = "Load Backup File";
            ArgsList[4]  = String.Format("Loading of backup file complete. {0} Mega Spawner{1} been installed.", cnt, cnt == 1 ? " has" : "s have");
            ArgsList[6]  = HideSpawnerList;
            ArgsList[13] = MSGCheckBoxesList;

            mobile.SendGump(new FileMenuGump(mobile, ArgsList));
        }
Ejemplo n.º 2
0
        private void SetPage()
        {
            int listY     = 122;
            int spaceLeft = listSpace;

            if (totalPages > pg)
            {
                AddHtml(431, 431, 100, 20, MC.ColorText(defaultTextColor, String.Format("Page {0}", (pg + 1))), false, false);
                AddButton(380, 430, 4005, 4007, -3, GumpButtonType.Reply, 0);
            }

            if (pg > 1)
            {
                int length = ((pg - 1).ToString().Length - 1) * 10;

                int pageX = 280 - length;

                AddHtml(pageX + 1, 431, 100, 20, MC.ColorText(defaultTextColor, String.Format("Page {0}", (pg - 1))), false, false);
                AddButton(340, 430, 4014, 4016, -4, GumpButtonType.Reply, 0);
            }

            GetOffsets();

            for (int i = offsetMin; i <= offsetMax; i++)
            {
                MC.DisplayBackground(this, BackgroundTypeConfig, 100, listY, 198, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 300, listY, 53, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 355, listY, 113, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 470, listY, 168, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 640, listY, 20, 20);

                Item spawner = (Item)SpawnerList[i];

                if (spawner is Spawner)
                {
                    spawner = (Spawner)spawner;
                }

                AddButton(100, listY, 9904, 9905, i + numOffset, GumpButtonType.Reply, 0);
                AddHtml(141, listY + 1, 200, 20, MC.ColorText(defaultTextColor, spawner.Name), false, false);
                AddHtml(301, listY + 1, 55, 20, MC.ColorText(defaultTextColor, String.Format("<center>{0}</center>", spawner.Map.ToString())), false, false);
                AddHtml(356, listY + 1, 115, 20, MC.ColorText(defaultTextColor, String.Format("<center>{0}</center>", spawner.Location.ToString())), false, false);

                if (spawner is Spawner)
                {
                    AddHtml(471, listY + 1, 170, 20, MC.ColorText(defaultTextColor, "<center>Distro Spawner</center>"), false, false);
                }

                AddCheck(640, listY, 210, 211, (bool)CUGCheckBoxesList[i], i);

                listY     += 21;
                spaceLeft -= 21;
            }

            MC.DisplayBackground(this, BackgroundTypeConfig, 100, listY, 560, spaceLeft);
        }
Ejemplo n.º 3
0
        private void SetPage()
        {
            int listY     = 122;
            int spaceLeft = listSpace;

            if (totalPages > pg)
            {
                AddHtml(431, 431, 100, 20, MC.ColorText(defaultTextColor, String.Format("Page {0}", (pg + 1))), false, false);
                AddButton(380, 430, 4005, 4007, -3, GumpButtonType.Reply, 0);
            }

            if (pg > 1)
            {
                int length = ((pg - 1).ToString().Length - 1) * 10;

                int pageX = 280 - length;

                AddHtml(pageX + 1, 431, 100, 20, MC.ColorText(defaultTextColor, String.Format("Page {0}", (pg - 1))), false, false);
                AddButton(340, 430, 4014, 4016, -4, GumpButtonType.Reply, 0);
            }

            GetOffsets();

            for (int i = offsetMin; i <= offsetMax; i++)
            {
                ArrayList List = (ArrayList)InsideItemList[i];
                itemToAdd      = (string)List[0];
                minStackAmount = (int)List[1];
                maxStackAmount = (int)List[2];

                MC.DisplayBackground(this, BackgroundTypeConfig, 100, listY, 228, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 330, listY, 118, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 450, listY, 118, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 570, listY, 68, 20);

                AddButton(100, listY, 9904, 9905, i + numOffset, GumpButtonType.Reply, 0);
                MC.DisplayBackground(this, ActiveTEBGTypeConfig, 140, listY + 1, 188, 18);
                AddTextEntry(140, listY + 1, 188, 15, ActiveTextEntryTextColor, (i * 3) + 1, itemToAdd);

                MC.DisplayBackground(this, ActiveTEBGTypeConfig, 330, listY + 1, 118, 18);
                AddTextEntry(330, listY + 1, 118, 15, ActiveTextEntryTextColor, (i * 3) + 2, minStackAmount.ToString());

                MC.DisplayBackground(this, ActiveTEBGTypeConfig, 450, listY + 1, 118, 18);
                AddTextEntry(450, listY + 1, 118, 15, ActiveTextEntryTextColor, (i * 3) + 3, maxStackAmount.ToString());

                AddHtml(571, listY + 1, 68, 20, MC.ColorText(defaultTextColor, String.Format("<center>{0}</center>", i)), false, false);

                AddCheck(640, listY, 210, 211, (bool)AITCCheckBoxesList[i], i);

                listY     += 21;
                spaceLeft -= 21;
            }

            MC.DisplayBackground(this, BackgroundTypeConfig, 100, listY, 560, spaceLeft);
        }
Ejemplo n.º 4
0
        public static void SaveBackup(Mobile mobile, ArrayList ArgsList)
        {
            MC.SetProcess(Process.SaveBackup);

            if (!Directory.Exists(MC.BackupDirectory))
            {
                Directory.CreateDirectory(MC.BackupDirectory);
            }

            string path = Path.Combine(MC.BackupDirectory, "Backup.mbk");

            mobile.SendMessage("Creating backup file...");

            MC.CheckSpawners();

            ArrayList SpawnerList = CompileSpawnerList();

            GenericWriter writer;

            try
            {
                writer = new BinaryFileWriter(path, true);
            }
            catch (Exception ex)
            {
                MC.SetProcess(Process.None);

                ArgsList[2] = "Create Backup File";
                ArgsList[4] = String.Format("Exception caught:\n{0}", ex);

                mobile.SendGump(new FileMenuGump(mobile, ArgsList));

                return;
            }

            writer.Write(SpawnerList.Count);

            try
            {
                foreach (MegaSpawner megaSpawner in SpawnerList)
                {
                    Serialize(megaSpawner, writer);
                }
            }
            catch {}

            writer.Close();

            MC.SetProcess(Process.None);

            ArgsList[2] = "Create Backup File";
            ArgsList[4] = "All Mega Spawners have now been backed up to the backup file.";

            mobile.SendGump(new FileMenuGump(mobile, ArgsList));
        }
Ejemplo n.º 5
0
        private void SetNewSpawnerWorkspaceList()
        {
            MC.CheckSpawners();

            for (int i = 0; i < MC.SpawnerList.Count; i++)
            {
                MegaSpawner megaSpawner = (MegaSpawner)MC.SpawnerList[i];

                HideSpawnerList[i] = (bool)true;
            }
        }
Ejemplo n.º 6
0
        private void ResetHideSpawnerList()
        {
            MC.CheckSpawners();

            for (int i = 0; i < MC.SpawnerList.Count; i++)
            {
                MegaSpawner megaSpawner = (MegaSpawner)MC.SpawnerList[i];

                HideSpawnerList[i] = (bool)false;
            }
        }
Ejemplo n.º 7
0
        private void SetPage()
        {
            int listY     = 100;
            int spaceLeft = listSpace;

            if (totalPages > pg)
            {
                AddHtml(431, 431, 100, 20, MC.ColorText(defaultTextColor, String.Format("Page {0}", (pg + 1))), false, false);
                AddButton(380, 430, 4005, 4007, -3, GumpButtonType.Reply, 0);
            }

            if (pg > 1)
            {
                int length = ((pg - 1).ToString().Length - 1) * 10;

                int pageX = 280 - length;

                AddHtml(pageX + 1, 431, 100, 20, MC.ColorText(defaultTextColor, String.Format("Page {0}", (pg - 1))), false, false);
                AddButton(340, 430, 4014, 4016, -4, GumpButtonType.Reply, 0);
            }

            GetOffsets();

            for (int i = offsetMin; i <= offsetMax; i++)
            {
                MC.DisplayBackground(this, BackgroundTypeConfig, 100, listY, 560, 20);

                int option = (int)MenuSwitchList[i];

                switch (option)
                {
                case 0:
                {
                    AddHtml(141, listY + 1, 520, 20, MC.ColorText(commandButtonsTextColor, "Accounts Management Menu"), false, false);
                    AddButton(100, listY, 9904, 9905, 101, GumpButtonType.Reply, 0);

                    break;
                }

                case 1:
                {
                    AddHtml(141, listY + 1, 520, 20, MC.ColorText(commandButtonsTextColor, "Edit System Configuration"), false, false);
                    AddButton(100, listY, 9904, 9905, 102, GumpButtonType.Reply, 0);

                    break;
                }
                }

                listY     += 21;
                spaceLeft -= 21;
            }

            MC.DisplayBackground(this, BackgroundTypeConfig, 100, listY, 560, spaceLeft);
        }
Ejemplo n.º 8
0
        private void CompileSpawnerList()
        {
            MC.CheckSpawners();

            for (int i = 0; i < MC.SpawnerList.Count; i++)
            {
                if ((bool)MSGCheckBoxesList[i])
                {
                    SpawnerList.Add((MegaSpawner)MC.SpawnerList[i]);
                }
            }
        }
Ejemplo n.º 9
0
        private void AddButtonsPageOne()
        {
            AddHtml(141, 451, 300, 20, MC.ColorText(commandButtonsTextColor, "Convert Selected Spawners"), false, false);
            AddButton(100, 450, 9904, 9905, 1, GumpButtonType.Reply, 0);

            AddHtml(141, 471, 300, 20, MC.ColorText(commandButtonsTextColor, "Convert All Spawners"), false, false);
            AddButton(100, 470, 9904, 9905, 2, GumpButtonType.Reply, 0);

            AddHtml(391, 451, 300, 20, MC.ColorText(commandButtonsTextColor, "Select All Spawners"), false, false);
            AddButton(350, 450, 9904, 9905, 3, GumpButtonType.Reply, 0);

            AddHtml(391, 471, 300, 20, MC.ColorText(commandButtonsTextColor, "Deselect All Spawners"), false, false);
            AddButton(350, 470, 9904, 9905, 4, GumpButtonType.Reply, 0);
        }
Ejemplo n.º 10
0
        public SaveFileGump(Mobile mobile, ArrayList argsList, SaveType savetype, string filename) : base(0, 0)
        {
            gumpMobile = mobile;

            ArgsList = argsList;
            GetArgsList();

            GetTextColors();

            saveType = savetype;
            FileName = filename;

            AddPage(0);             // Page 0

            MC.DisplayStyle(this, StyleTypeConfig, 180, 180, 340, 120);

            MC.DisplayBackground(this, BackgroundTypeConfig, 200, 200, 300, 40);
            MC.DisplayBackground(this, BackgroundTypeConfig, 200, 260, 300, 20);

            AddHtml(221, 181, 280, 20, MC.ColorText(titleTextColor, "Save File"), false, false);

            switch (saveType)
            {
            case SaveType.FileEdit:
            {
                AddHtml(201, 201, 280, 20, MC.ColorText(defaultTextColor, "Are you sure you want to save file:"), false, false);
                AddHtml(201, 221, 280, 20, MC.ColorText(defaultTextColor, FileName), false, false);

                break;
            }

            default:
            {
                AddHtml(201, 201, 280, 20, MC.ColorText(defaultTextColor, "Type in a filename without an extension:"), false, false);
                MC.DisplayBackground(this, ActiveTEBGTypeConfig, 200, 220, 300, 18);
                AddTextEntry(200, 220, 300, 15, ActiveTextEntryTextColor, 0, "");

                break;
            }
            }

            AddHtml(441, 261, 60, 20, MC.ColorText(defaultTextColor, "Cancel"), false, false);
            AddButton(400, 260, 4017, 4019, 0, GumpButtonType.Reply, 0);

            AddHtml(241, 261, 60, 20, MC.ColorText(defaultTextColor, "Ok"), false, false);
            AddButton(200, 260, 4023, 4025, 1, GumpButtonType.Reply, 0);

            CompileSpawnerList();
        }
Ejemplo n.º 11
0
        private void CompileSpawnerList()
        {
            SpawnerList.Clear();
            MC.CheckSpawners();

            for (int i = 0; i < MC.SpawnerList.Count; i++)
            {
                MegaSpawner megaSpawner = (MegaSpawner)MC.SpawnerList[i];

                if (!(bool)HideSpawnerList[i])
                {
                    SpawnerList.Add(megaSpawner);
                }
            }
        }
Ejemplo n.º 12
0
        private void AddPages()
        {
            AddCommandButtons();

            totalPages = (int)((SpawnerList.Count - 1) / amtPerPg) + 1;

            string pageNum = String.Format("{0}/{1}", pg, totalPages);

            AddLabel(540, 80, PageNumberTextColor, "Page:");
            AddTextEntry(580, 80, 90, 20, PageNumberTextColor, 0, pageNum);

            if (Help)
            {
                AddButton(529, 85, 2104, 2103, -100, GumpButtonType.Reply, 0);
            }

            if (SpawnerList.Count == 0)
            {
                MC.DisplayBackground(this, BackgroundTypeConfig, 100, 100, 560, 330);

                AddHtml(100, 100, 560, 330, MC.ColorText(defaultTextColor, "There are no spawners on the entire server that are not Mega Spawners."), false, false);
            }
            else
            {
                MC.DisplayBackground(this, BackgroundTypeConfig, 100, 100, 198, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 300, 100, 53, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 355, 100, 113, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 470, 100, 168, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 640, 100, 20, 20);

                AddButton(640, 100, 211, 210, -9, GumpButtonType.Reply, 0);

                if (Help)
                {
                    AddButton(193, 100, 2104, 2103, -101, GumpButtonType.Reply, 0);
                    AddButton(321, 100, 2104, 2103, -102, GumpButtonType.Reply, 0);
                    AddButton(406, 100, 2104, 2103, -103, GumpButtonType.Reply, 0);
                    AddButton(548, 100, 2104, 2103, -104, GumpButtonType.Reply, 0);
                }

                AddHtml(100, 100, 200, 20, MC.ColorText(defaultTextColor, "<center>Name</center>"), false, false);
                AddHtml(300, 100, 55, 20, MC.ColorText(defaultTextColor, "<center>Facet</center>"), false, false);
                AddHtml(355, 100, 115, 20, MC.ColorText(defaultTextColor, "<center>Location</center>"), false, false);
                AddHtml(470, 100, 170, 20, MC.ColorText(defaultTextColor, "<center>Spawner Type</center>"), false, false);

                SetPage();
            }
        }
Ejemplo n.º 13
0
        private void SetPage()
        {
            int listY     = 122;
            int spaceLeft = listSpace;

            if (totalPages > pg)
            {
                AddHtml(431, 431, 100, 20, MC.ColorText(defaultTextColor, String.Format("Page {0}", (pg + 1))), false, false);
                AddButton(380, 430, 4005, 4007, -3, GumpButtonType.Reply, 0);
            }

            if (pg > 1)
            {
                int length = ((pg - 1).ToString().Length - 1) * 10;

                int pageX = 280 - length;

                AddHtml(pageX + 1, 431, 100, 20, MC.ColorText(defaultTextColor, String.Format("Page {0}", (pg - 1))), false, false);
                AddButton(340, 430, 4014, 4016, -4, GumpButtonType.Reply, 0);
            }

            GetOffsets();

            for (int i = offsetMin; i <= offsetMax; i++)
            {
                MC.DisplayBackground(this, BackgroundTypeConfig, 100, listY, 438, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 540, listY, 98, 20);

                string fileName    = (string)MC.FileImportList[i];
                string fileVersion = (string)MC.FileImportVersionList[i];

                if (fileName == "" || fileName == null)
                {
                    fileName = "Bad FileName";
                }

                AddButton(100, listY, 9904, 9905, i + numOffset, GumpButtonType.Reply, 0);
                AddHtml(141, listY + 1, 440, 20, MC.ColorText(defaultTextColor, fileName), false, false);
                AddHtml(541, listY + 1, 100, 20, MC.ColorText(defaultTextColor, String.Format("<center>{0}</center>", fileVersion)), false, false);

                AddCheck(640, listY, 210, 211, (bool)FMCheckBoxesList[i], i);

                listY     += 21;
                spaceLeft -= 21;
            }

            MC.DisplayBackground(this, BackgroundTypeConfig, 100, listY, 560, spaceLeft);
        }
Ejemplo n.º 14
0
        private void AddButtonsPageOne()
        {
            if (!AddAccount)
            {
                AddHtml(141, 471, 300, 20, MC.ColorText(commandButtonsTextColor, "Delete Account"), false, false);
                AddButton(100, 470, 9904, 9905, 2, GumpButtonType.Reply, 0);

                AddHtml(141, 491, 300, 20, MC.ColorText(commandButtonsTextColor, "Update Account"), false, false);
            }
            else
            {
                AddHtml(141, 491, 300, 20, MC.ColorText(commandButtonsTextColor, "Submit Account"), false, false);
            }

            AddButton(100, 490, 9904, 9905, 3, GumpButtonType.Reply, 0);
        }
Ejemplo n.º 15
0
        private void SetPage()
        {
            int listY     = 122;
            int spaceLeft = listSpace;

            if (totalPages > pg)
            {
                AddHtml(431, 431, 100, 20, MC.ColorText(defaultTextColor, String.Format("Page {0}", (pg + 1))), false, false);
                AddButton(380, 430, 4005, 4007, -3, GumpButtonType.Reply, 0);
            }

            if (pg > 1)
            {
                int length = ((pg - 1).ToString().Length - 1) * 10;

                int pageX = 280 - length;

                AddHtml(pageX + 1, 431, 100, 20, MC.ColorText(defaultTextColor, String.Format("Page {0}", (pg - 1))), false, false);
                AddButton(340, 430, 4014, 4016, -4, GumpButtonType.Reply, 0);
            }

            GetOffsets();

            for (int i = offsetMin; i <= offsetMax; i++)
            {
                string textColor = defaultTextColor;

                MC.DisplayBackground(this, BackgroundTypeConfig, 100, listY, 560, 20);

                ArrayList setting = (ArrayList)megaSpawner.SettingsList[i];

                if (!MC.VerifySetting(setting))
                {
                    textColor = flagTextColor;
                }

                AddButton(100, listY, 9904, 9905, i + numOffset, GumpButtonType.Reply, 0);
                AddHtml(141, listY + 1, 520, 20, MC.ColorText(textColor, MC.GetSettingInfo(megaSpawner, setting)), false, false);

                AddCheck(640, listY, 210, 211, (bool)SettingsCheckBoxesList[i], i);

                listY     += 21;
                spaceLeft -= 21;
            }

            MC.DisplayBackground(this, BackgroundTypeConfig, 100, listY, 560, spaceLeft);
        }
Ejemplo n.º 16
0
        private void AddPages()
        {
            AddCommandButtons();

            totalPages = (int)((InsideItemList.Count - 1) / amtPerPg) + 1;

            string pageNum = String.Format("{0}/{1}", pg, totalPages);

            AddLabel(540, 80, PageNumberTextColor, "Page:");
            AddTextEntry(580, 80, 90, 20, PageNumberTextColor, 0, pageNum);

            if (Help)
            {
                AddButton(529, 85, 2104, 2103, -100, GumpButtonType.Reply, 0);
            }

            if (InsideItemList.Count == 0)
            {
                MC.DisplayBackground(this, BackgroundTypeConfig, 100, 100, 560, 330);

                AddHtml(100, 100, 560, 330, MC.ColorText(defaultTextColor, "There are no items on the item list."), false, false);
            }
            else
            {
                MC.DisplayBackground(this, BackgroundTypeConfig, 100, 100, 228, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 330, 100, 118, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 450, 100, 118, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 570, 100, 68, 20);

                AddButton(640, 100, 211, 210, -9, GumpButtonType.Reply, 0);

                if (Help)
                {
                    AddButton(209, 100, 2104, 2103, -101, GumpButtonType.Reply, 0);
                    AddButton(384, 100, 2104, 2103, -102, GumpButtonType.Reply, 0);
                    AddButton(504, 100, 2104, 2103, -103, GumpButtonType.Reply, 0);
                    AddButton(599, 100, 2104, 2103, -104, GumpButtonType.Reply, 0);
                }

                AddHtml(101, 101, 230, 20, MC.ColorText(defaultTextColor, "<center>Item</center>"), false, false);
                AddHtml(331, 101, 120, 20, MC.ColorText(defaultTextColor, "<center>Min Stack Amount</center>"), false, false);
                AddHtml(451, 101, 120, 20, MC.ColorText(defaultTextColor, "<center>Max Stack Amount</center>"), false, false);
                AddHtml(571, 101, 70, 20, MC.ColorText(defaultTextColor, "<center>Entry #</center>"), false, false);

                SetPage();
            }
        }
Ejemplo n.º 17
0
        public static void DeleteEntries(MegaSpawner megaSpawner)
        {
            for (int i = 0; i < megaSpawner.OverrideSpawnedEntries.Count; i++)
            {
                object o = megaSpawner.OverrideSpawnedEntries[i];

                MC.DeleteObject(o);

                if (megaSpawner.OverrideRespawnEntryList.Count == megaSpawner.OverrideSpawnedEntries.Count)
                {
                    megaSpawner.OverrideRespawnEntryList[i] = "";
                }
            }

            megaSpawner.OverrideSpawnedEntries.Clear();
            megaSpawner.OverrideLastMovedList.Clear();
        }
Ejemplo n.º 18
0
        private void AddButtonsPageOne()
        {
            AddHtml(141, 451, 300, 20, MC.ColorText(commandButtonsTextColor, "Delete Selected Settings"), false, false);
            AddButton(100, 450, 9904, 9905, 1, GumpButtonType.Reply, 0);

            AddHtml(141, 471, 300, 20, MC.ColorText(commandButtonsTextColor, "Delete All Settings"), false, false);
            AddButton(100, 470, 9904, 9905, 2, GumpButtonType.Reply, 0);

            AddHtml(141, 491, 300, 20, MC.ColorText(commandButtonsTextColor, "Add New Setting"), false, false);
            AddButton(100, 490, 9904, 9905, 3, GumpButtonType.Reply, 0);

            AddHtml(391, 451, 300, 20, MC.ColorText(commandButtonsTextColor, "Select All Settings"), false, false);
            AddButton(350, 450, 9904, 9905, 4, GumpButtonType.Reply, 0);

            AddHtml(391, 471, 300, 20, MC.ColorText(commandButtonsTextColor, "Deselect All Settings"), false, false);
            AddButton(350, 470, 9904, 9905, 5, GumpButtonType.Reply, 0);
        }
Ejemplo n.º 19
0
        private void AddPages()
        {
            AddCommandButtons();

            totalPages = (int)((MC.AccountsList.Count - 1) / amtPerPg) + 1;

            if (pg > totalPages)
            {
                pg = totalPages;
            }

            string pageNum = String.Format("{0}/{1}", pg, totalPages);

            AddLabel(540, 80, PageNumberTextColor, "Page:");
            AddTextEntry(580, 80, 90, 20, PageNumberTextColor, 0, pageNum);

            if (Help)
            {
                AddButton(529, 85, 2104, 2103, -100, GumpButtonType.Reply, 0);
            }

            if (MC.AccountsList.Count == 0)
            {
                MC.DisplayBackground(this, BackgroundTypeConfig, 100, 100, 560, 330);

                AddHtml(100, 100, 560, 330, MC.ColorText(defaultTextColor, "There are no accounts to display."), false, false);
            }
            else
            {
                MC.DisplayBackground(this, BackgroundTypeConfig, 100, 100, 338, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 440, 100, 200, 20);

                AddButton(640, 100, 211, 210, -9, GumpButtonType.Reply, 0);

                if (Help)
                {
//					AddButton( 193, 100, 2104, 2103, -101, GumpButtonType.Reply, 0 );
                }

                AddHtml(101, 101, 340, 20, MC.ColorText(defaultTextColor, "<center>Account Name</center>"), false, false);
                AddHtml(441, 101, 200, 20, MC.ColorText(defaultTextColor, "<center>Access Level</center>"), false, false);
            }

            SetPage();
        }
Ejemplo n.º 20
0
        private ArrayList GetMenuAccess()
        {
            ArrayList List = new ArrayList();

            MenuAccessList = MC.GetMenuAccess(gumpMobile);

            for (int i = 0; i < MenuAccessList.Count; i++)
            {
                bool access = (bool)MenuAccessList[i];

                if (access)
                {
                    List.Add(i);
                }
            }

            return(List);
        }
Ejemplo n.º 21
0
        private bool CheckAccess()
        {
            MenuAccessList = MC.GetMenuAccess(gumpMobile);

            bool access = (bool)MenuAccessList[0];

            if (!access)
            {
                MessagesTitle = "Access Denied";
                Messages      = "You no longer have access to that option.";

                SetArgsList();

                gumpMobile.SendGump(new AdminMenuGump(gumpMobile, ArgsList));
            }

            return(access);
        }
Ejemplo n.º 22
0
        private void AddButtonsPageOne()
        {
            AddHtml(141, 451, 300, 20, MC.ColorText(commandButtonsTextColor, "Manual Load File"), false, false);
            AddButton(100, 450, 9904, 9905, 1, GumpButtonType.Reply, 0);

            AddHtml(141, 471, 300, 20, MC.ColorText(commandButtonsTextColor, "Unload Selected Files"), false, false);
            AddButton(100, 470, 9904, 9905, 2, GumpButtonType.Reply, 0);

            AddHtml(141, 491, 300, 20, MC.ColorText(commandButtonsTextColor, "Unload All Files"), false, false);
            AddButton(100, 490, 9904, 9905, 3, GumpButtonType.Reply, 0);

            AddHtml(391, 451, 300, 20, MC.ColorText(commandButtonsTextColor, "Open File Browser"), false, false);
            AddButton(350, 450, 9904, 9905, 4, GumpButtonType.Reply, 0);

            AddHtml(391, 471, 300, 20, MC.ColorText(commandButtonsTextColor, "Save Selected From Spawner List"), false, false);
            AddButton(350, 470, 9904, 9905, 5, GumpButtonType.Reply, 0);

            AddHtml(391, 491, 300, 20, MC.ColorText(commandButtonsTextColor, "Save All Spawners"), false, false);
            AddButton(350, 490, 9904, 9905, 6, GumpButtonType.Reply, 0);
        }
Ejemplo n.º 23
0
        public ConfirmDeleteSpawnersGump(Mobile mobile, ArrayList argsList, int select) : base(0, 0)
        {
            gumpMobile = mobile;

            Select   = select;
            ArgsList = argsList;
            GetArgsList();

            GetTextColors();

            AddPage(0);             // Page 0

            MC.DisplayStyle(this, StyleTypeConfig, 180, 180, 380, 90);

            MC.DisplayBackground(this, BackgroundTypeConfig, 200, 200, 340, 20);
            MC.DisplayBackground(this, BackgroundTypeConfig, 200, 230, 340, 20);

            switch (Select)
            {
            case 1: { AddHtml(221, 181, 320, 20, MC.ColorText(titleTextColor, "Confirmation Of Deleting All Spawners"), false, false); break; }

            case 2: { AddHtml(221, 181, 320, 20, MC.ColorText(titleTextColor, "Confirmation Of Deleting Selected Spawners"), false, false); break; }

            case 3: { AddHtml(221, 181, 320, 20, MC.ColorText(titleTextColor, "Confirmation Of Deleting Imported Spawners"), false, false); break; }
            }

            switch (Select)
            {
            case 1: { AddHtml(201, 201, 340, 20, MC.ColorText(defaultTextColor, "Are you sure you want to delete all spawners?"), false, false); break; }

            case 2: { AddHtml(201, 201, 340, 20, MC.ColorText(defaultTextColor, "Are you sure you want to delete selected spawners?"), false, false); break; }

            case 3: { AddHtml(201, 201, 340, 20, MC.ColorText(defaultTextColor, "Are you sure you want to delete imported spawners?"), false, false); break; }
            }

            AddHtml(491, 231, 60, 20, MC.ColorText(defaultTextColor, "Cancel"), false, false);
            AddButton(450, 230, 4017, 4019, 0, GumpButtonType.Reply, 0);

            AddHtml(241, 231, 60, 20, MC.ColorText(defaultTextColor, "Ok"), false, false);
            AddButton(200, 230, 4023, 4025, 1, GumpButtonType.Reply, 0);
        }
Ejemplo n.º 24
0
        private void AddCommandButtons()
        {
            switch (cpg)
            {
            case 1: { AddButtonsPageOne(); break; }
            }

            if (cpg != 1)               // Next Command Page
            {
                AddHtml(441, 511, 150, 20, MC.ColorText(defaultTextColor, String.Format("Command Page {0}", ((int)cpg + 1))), false, false);
                AddButton(390, 510, 4005, 4007, -1, GumpButtonType.Reply, 0);
            }

            AddHtml(361, 511, 30, 20, MC.ColorText(defaultTextColor, String.Format("<center>{0}</center>", ((int)cpg))), false, false);

            if (cpg != 1)               // Previous Command Page
            {
                AddHtml(211, 511, 150, 20, MC.ColorText(defaultTextColor, String.Format("Command Page {0}", ((int)cpg - 1))), false, false);
                AddButton(330, 510, 4014, 4016, -2, GumpButtonType.Reply, 0);
            }
        }
Ejemplo n.º 25
0
        private bool CheckProcess()
        {
            string msgsTitle, msgs;

            if (MC.CheckProcess(out msgsTitle, out msgs))
            {
                if (msgsTitle != null)
                {
                    MessagesTitle = msgsTitle;
                }

                if (msgs != null)
                {
                    Messages = msgs;
                }

                OpenGump();
            }

            return(MC.CheckProcess());
        }
Ejemplo n.º 26
0
        private void AddPages()
        {
            AddCommandButtons();

            totalPages = (int)((MC.FileImportList.Count - 1) / amtPerPg) + 1;

            string pageNum = String.Format("{0}/{1}", pg, totalPages);

            AddLabel(540, 80, PageNumberTextColor, "Page:");
            AddTextEntry(580, 80, 90, 20, PageNumberTextColor, 0, pageNum);

            if (Help)
            {
                AddButton(529, 85, 2104, 2103, -100, GumpButtonType.Reply, 0);
            }

            if (MC.FileImportList.Count == 0)
            {
                MC.DisplayBackground(this, BackgroundTypeConfig, 100, 100, 560, 330);

                AddHtml(100, 100, 560, 330, MC.ColorText(defaultTextColor, "There are no files on the import file list."), false, false);
            }
            else
            {
                MC.DisplayBackground(this, BackgroundTypeConfig, 100, 100, 438, 20);
                MC.DisplayBackground(this, BackgroundTypeConfig, 540, 100, 98, 20);

                AddButton(640, 100, 211, 210, -9, GumpButtonType.Reply, 0);

                if (Help)
                {
                    AddButton(364, 100, 2104, 2103, -101, GumpButtonType.Reply, 0);
                }

                AddHtml(101, 101, 440, 20, MC.ColorText(defaultTextColor, "<center>File Name</center>"), false, false);
                AddHtml(541, 101, 100, 20, MC.ColorText(defaultTextColor, "<center>File Version</center>"), false, false);

                SetPage();
            }
        }
Ejemplo n.º 27
0
        private void CheckSettings()
        {
            bool found      = false;
            bool badSetting = false;

            for (int i = 0; i < megaSpawner.SettingsList.Count; i++)
            {
                ArrayList setting = (ArrayList)megaSpawner.SettingsList[i];

                if (!MC.VerifySetting(setting))
                {
                    if (!badSetting && OldMessages != Messages)
                    {
                        Messages = String.Format("{0}:\n{1}\n\nThe following settings have been detected as bad settings:\n{2}", MessagesTitle, Messages, MC.GetSettingInfo(megaSpawner, setting));
                    }
                    else if (!badSetting)
                    {
                        Messages = String.Format("The following settings have been detected as bad settings:\n{0}", MC.GetSettingInfo(megaSpawner, setting));
                    }
                    else
                    {
                        Messages = String.Format("{0}, {1}", Messages, MC.GetSettingInfo(megaSpawner, setting));
                    }

                    MessagesTitle = "Bad Settings Detected";

                    badSetting = true;
                    found      = true;
                }
            }

            if (found)
            {
                Messages = String.Format("{0}\n\nThose settings listed have been detected as bad settings. They have been flagged a different color.", Messages);
            }

            OldMessages = Messages;
        }
Ejemplo n.º 28
0
        public ConfirmAbandonChangesGump(Mobile mobile, ArrayList argsList, ArrayList spawnerList, int select) : base(0, 0)
        {
            gumpMobile  = mobile;
            SpawnerList = spawnerList;

            Select   = select;
            ArgsList = argsList;
            GetArgsList();

            GetTextColors();

            AddPage(0);             // Page 0

            MC.DisplayStyle(this, StyleTypeConfig, 180, 180, 380, 90);

            MC.DisplayBackground(this, BackgroundTypeConfig, 200, 200, 340, 20);
            MC.DisplayBackground(this, BackgroundTypeConfig, 200, 230, 340, 20);

            switch (Select)
            {
            case 1: { AddHtml(221, 181, 320, 20, MC.ColorText(titleTextColor, "Confirmation Of Abandon Spawner Workspace"), false, false); break; }

            case 2: { AddHtml(221, 181, 320, 20, MC.ColorText(titleTextColor, String.Format("Confirmation Of Abandon Changes To File: {0}", FileName)), false, false); break; }
            }

            switch (Select)
            {
            case 1: { AddHtml(201, 201, 340, 20, MC.ColorText(defaultTextColor, "Are you sure you want to abandon Spawner Workspace?"), false, false); break; }

            case 2: { AddHtml(201, 201, 340, 20, MC.ColorText(defaultTextColor, "Are you sure you want to abandon changes to file?"), false, false); break; }
            }

            AddHtml(491, 231, 60, 20, MC.ColorText(defaultTextColor, "Cancel"), false, false);
            AddButton(450, 230, 4017, 4019, 0, GumpButtonType.Reply, 0);

            AddHtml(241, 231, 60, 20, MC.ColorText(defaultTextColor, "Ok"), false, false);
            AddButton(200, 230, 4023, 4025, 1, GumpButtonType.Reply, 0);
        }
Ejemplo n.º 29
0
        public static void AddToRespawnEntries(MegaSpawner megaSpawner, object o)
        {
            bool success = false;

            for (int i = 0; i < megaSpawner.OverrideRespawnEntryList.Count; i++)
            {
                int randomDespawnTime = Utility.Random(megaSpawner.OverrideMinDespawn, megaSpawner.OverrideMaxDespawn - megaSpawner.OverrideMinDespawn);

                if (megaSpawner.OverrideRespawnEntryList[i] is string)
                {
                    object respawnEntry = o;

                    if (o is Item)
                    {
                        respawnEntry = (Item)o;
                    }
                    else if (o is Mobile)
                    {
                        respawnEntry = (Mobile)o;
                    }

                    if ((string)megaSpawner.OverrideRespawnEntryList[i] == "" && ((int)megaSpawner.OverrideRespawnTimeList[i] <= MegaSpawner.tickOffset || megaSpawner.OverrideGroupSpawn))
                    {
                        success = true;

                        megaSpawner.OverrideRespawnEntryList[i] = respawnEntry;
                        megaSpawner.OverrideDespawnTimeList[i]  = randomDespawnTime;

                        break;
                    }
                }
            }

            if (!success)
            {
                MC.DeleteObject(o);
            }
        }
Ejemplo n.º 30
0
        private void SetPage()
        {
            int listY     = 122;
            int spaceLeft = listSpace;

            if (totalPages > pg)
            {
                AddHtml(431, 431, 100, 20, MC.ColorText(defaultTextColor, String.Format("Page {0}", (pg + 1))), false, false);
                AddButton(380, 430, 4005, 4007, -3, GumpButtonType.Reply, 0);
            }

            if (pg > 1)
            {
                int length = ((pg - 1).ToString().Length - 1) * 10;

                int pageX = 280 - length;

                AddHtml(pageX + 1, 431, 100, 20, MC.ColorText(defaultTextColor, String.Format("Page {0}", (pg - 1))), false, false);
                AddButton(340, 430, 4014, 4016, -4, GumpButtonType.Reply, 0);
            }

            GetOffsets();

            for (int i = offsetMin; i <= offsetMax; i++)
            {
                MC.DisplayBackground(this, BackgroundTypeConfig, 100, listY, 560, 20);

                string searchResult = (string)SearchResultsList[i];

                AddButton(100, listY, 9904, 9905, i + numOffset, GumpButtonType.Reply, 0);
                AddHtml(141, listY + 1, 520, 20, MC.ColorText(defaultTextColor, searchResult), false, false);

                listY     += 21;
                spaceLeft -= 21;
            }

            MC.DisplayBackground(this, BackgroundTypeConfig, 100, listY, 560, spaceLeft);
        }