Ejemplo n.º 1
0
        public static void Initialize()
        {
            if (!_HasRan)
            {
                CreateTable = new Dictionary <int, bool>();

                for (var index = 0; index < CreateWorld.Commands.Count; index++)
                {
                    CreateWorld.CommandEntry entry = CreateWorld.Commands[index];

                    CreateTable[entry.CheckID] = HasGenerated(entry.CheckID);
                }
            }
        }
Ejemplo n.º 2
0
        public CreateWorldGump(CommandEventArgs e, CreateWorld.GumpType type)
            : base(50, 50)
        {
            m_Type             = type;
            m_CommandEventArgs = e;
            Closable           = true;
            Dragable           = true;

            AddPage(1);

            int items = CreateWorld.Commands.Count;

            AddBackground(0, 0, 280, 75 + items * 25, 5054);
            switch (m_Type)
            {
            case CreateWorld.GumpType.Create:
                AddLabel(40, 2, 200, "CREATE WORLD GUMP");
                break;

            case CreateWorld.GumpType.Delete:
                AddLabel(40, 2, 200, "DELETE WORLD GUMP");
                break;

            case CreateWorld.GumpType.Recreate:
                AddLabel(40, 2, 200, "RECREATE WORLD GUMP");
                break;
            }

            AddImageTiled(10, 20, 220, 10 + items * 25, 3004);
            int y = 25;

            for (var index = 0; index < CreateWorld.Commands.Count; index++)
            {
                CreateWorld.CommandEntry entry = CreateWorld.Commands[index];

                bool created = CreateWorldData.CreateTable.ContainsKey(entry.CheckID) && CreateWorldData.CreateTable[entry.CheckID];

                AddLabel(20, y + 1, created ? 200 : 338, $"{entry.Name} {(created ? "[created]" : "[not created]")}");
                AddCheck(210, y - 2, 210, 211, m_Type == CreateWorld.GumpType.Create ? !created : created, entry.CheckID);

                y += 25;
            }

            y = 25 + (items * 25);

            AddButton(60, y + 15, 247, 249, 1, GumpButtonType.Reply, 0);
            AddButton(130, y + 15, 241, 243, 0, GumpButtonType.Reply, 0);
        }
Ejemplo n.º 3
0
        public override void AddGumpLayout()
        {
            AddBackground(0, 0, 640, 500, 5054);

            AddImageTiled(10, 10, 140, 28, 3004);
            AddImageTiled(152, 10, 478, 28, 3004);

            AddImageTiled(10, 40, 140, 430, 3004);
            AddImageTiled(152, 40, 478, 430, 3004);

            string label = GumpType == CreateWorld.GumpType.Create ? "CREATE WORLD GUMP" : "DELETE WORLD GUMP";

            switch (GumpType)
            {
            default:
            case CreateWorld.GumpType.Create:
                label = "CREATE WORLD GUMP";
                break;

            case CreateWorld.GumpType.Delete:
                label = "DELETE WORLD GUMP";
                break;
            }

            AddHtml(152, 15, 450, 20, ColorAndCenter("#00FFFF", label), false, false);
            AddHtml(12, 15, 140, 20, ColorAndCenter("#696969", String.Format("Your Expansion: {0}", Core.Expansion.ToString())), false, false);

            for (int i = 0; i < 6; i++)
            {
                CreateWorld.Category cat = (CreateWorld.Category)i;
                int id = CategoryFilter == cat || CategoryFilter == CreateWorld.Category.All ? 4030 : 4029;

                AddButton(12, 55 + (i * 25), id, id == 4030 ? 4029 : 4030, i + 500, GumpButtonType.Reply, 0);
                AddHtml(45, 55 + (i * 25), 100, 20, Color("#696969", cat.ToString()), false, false);
            }

            List <CreateWorld.CommandEntry> commands = new List <CreateWorld.CommandEntry>(CreateWorld.Commands.Where(c =>
                                                                                                                      CategoryFilter == CreateWorld.Category.All || CategoryFilter == c.Category));

            int perpage = CreateWorld.Commands.Count / 2;
            int x       = 154;
            int y       = 55;

            for (int i = 0; i < commands.Count; i++)
            {
                CreateWorld.CommandEntry entry = commands[i];
                bool created        = CreateWorldData.CreateTable[entry.CheckID];
                bool meetsExpansion = entry.RequiredExpansion <= Core.Expansion;

                bool check;

                if (CheckAll)
                {
                    check = true;
                }
                else if (UncheckAll)
                {
                    check = false;
                }
                else
                {
                    check = GumpType == CreateWorld.GumpType.Create ? !created : created;
                }

                if (meetsExpansion)
                {
                    AddLabel(x + 21, y, created ? 200 : 338, String.Format("{0} {1}", entry.Name, created ? "[created]" : "[not created]"));
                    AddCheck(x, y - 2, 210, 211, check, entry.CheckID);
                }
                else
                {
                    AddLabel(x + 21, y, created ? 200 : 33, String.Format("{0} {1}", entry.Name, "[Wrong Expansion]"));
                    AddImage(x, y - 2, 210);
                }

                y += 20;

                if (i == perpage)
                {
                    x = 382;
                    y = 55;
                }
            }

            AddButton(154, 426, 4005, 4007, 2500, GumpButtonType.Reply, 0);
            AddHtml(187, 426, 150, 20, Color("#696969", "Check All"), false, false);

            AddButton(154, 448, 4017, 4019, 2501, GumpButtonType.Reply, 0);
            AddHtml(187, 448, 150, 20, Color("#696969", "Uncheck All"), false, false);

            AddButton(260, 473, 247, 249, 1, GumpButtonType.Reply, 0);
            AddButton(323, 473, 241, 243, 0, GumpButtonType.Reply, 0);
        }