Пример #1
0
        private void InitializeItemsMenu(Workspace workspace)
        {
            var arrangeWindow = new Menu("ArrangeItems");

            arrangeWindow.LayoutType = LayoutType.SingleRow;
            arrangeWindow.Add("Arrange", () => ArrangeItems());
            arrangeWindow.Add("Rare", () => RareItems());

            itemsList         = new Menu("Items");
            itemsList.Cancel += cancel =>
            {
                workspace.ActivateWindow(arrangeWindow);
                cancel.Cancel = true;
            };

            arrangeWindow.Exit += () => desktop.PopWorkspace();

            itemTarget = new Menu("ItemTarget");
            itemTarget.Display.IsVisible = false;

            var layout = new FixedGridLayout(1, 8);

            layout.Add(arrangeWindow, new Rectangle(0, 0, 1, 1));
            layout.Add(itemsList, new Rectangle(0, 1, 1, 7));
            layout.Add(itemTarget, new Rectangle(0, 3, 1, 1));

            workspace.Layout = layout;
        }
Пример #2
0
        private void InitializeRelicMenu(Workspace workspace)
        {
            var relicMenu = new Menu("Relic");
            var slotsMenu = new Menu("Slots");
            var itemsMenu = new Menu("Items");

            Action <string> slotsFollowUp = null;

            void EquipMenuFor(string location)
            {
                workspace.ActivateWindow("Items");

                itemsMenu.Layout.Clear();

                foreach (var item in Model.Inventory)
                {
                    itemsMenu.Add(item.Name, () => Model.EquipPC(selectedPC, item, location));
                }
            }

            relicMenu.Add("Equip", () =>
            {
                slotsFollowUp = EquipMenuFor;
                workspace.ActivateWindow(slotsMenu);
            });

            relicMenu.Add("Remove", () =>
            {
                slotsFollowUp = location =>
                {
                    Model.EquipPC(selectedPC, null, location);
                };
                workspace.ActivateWindow(slotsMenu);
            });

            slotsMenu.Add("Relic 1", "Relic", () => slotsFollowUp("Relic 1"));
            slotsMenu.Add("Relic 2", "Relic", () => slotsFollowUp("Relic 2"));

            var layout = new FixedGridLayout(2, 6);

            layout.Add(relicMenu, new Rectangle(0, 0, 2, 1));
            layout.Add(slotsMenu, new Rectangle(0, 1, 2, 2));
            layout.Add(itemsMenu, new Rectangle(0, 3, 1, 3));

            workspace.Layout = layout;
        }
Пример #3
0
        private void InitializeSkillsMenu(Workspace workspace)
        {
            var layout = new FixedGridLayout(1, 1);

            workspace.Layout = layout;

            var menu = new Menu("SkillType");

            menu.Add("Magic", StartMagicMenu);
            menu.Add("Espers", StartEspersMenu);
            menu.Add("Blitz", () => RecordEvent("Blitz"));
            menu.Add("SwdTech", () => RecordEvent("SwdTech"));
            menu.Add("Blue", () => RecordEvent("Blue"));
            menu.Add("Rage", () => RecordEvent("Rage"));

            menu.Exit += ReturnToDesktop;

            layout.Add(menu, Point.Zero);
        }
Пример #4
0
        private void InitializeMainMenu(Workspace workspace)
        {
            var menu = new Menu("Main");

            menu.Add("Items", StartItemsMenu);
            menu.Add("Skills", StartSkillsMenu);
            menu.Add("Equip", StartEquipMenu);
            menu.Add("Relic", StartRelicMenu);
            menu.Add("Status", () => RecordEvent("Status"));
            menu.Add("Config", () => RecordEvent("Config"));
            menu.Add("Save", () => RecordEvent("Save"));

            pcMenu = new Menu("SelectPC");

            pcMenu.Exit += () => workspace.ActivateWindow(menu);

            var layout = new FixedGridLayout(8, 8);

            workspace.Layout = layout;

            layout.Add(pcMenu, new Rectangle(0, 0, 8, 8));
            layout.Add(menu, new Rectangle(7, 0, 1, 5));
        }
Пример #5
0
        private void InitializeEquipMenu(Workspace workspace)
        {
            var equipMenu = new Menu("Equip")
            {
                LayoutType = LayoutType.SingleRow
            };
            var slotsMenu = new Menu("Slots");
            var itemsMenu = new Menu("Items");

            Action <string> slotsFollowUp = null;

            void EquipMenuFor(string location)
            {
                workspace.ActivateWindow("Items");

                itemsMenu.Layout.Clear();

                foreach (var item in Model.ItemsForSlot(selectedPC, location))
                {
                    itemsMenu.Add(item.Name, () =>
                    {
                        Model.EquipPC(selectedPC, item, location);
                        workspace.ActivateWindow("Slots");

                        UpdateEquipmentSlots();

                        itemsMenu.Layout.Clear();
                    });
                }
            }

            equipMenu.Add("Equip", () =>
            {
                slotsFollowUp = EquipMenuFor;
                workspace.ActivateWindow("Slots");

                UpdateEquipmentSlots();
            });

            equipMenu.Add("Optimum", () =>
            {
                Model.EquipPC(selectedPC, BestItem("L-Hand"), "L-Hand");
                Model.EquipPC(selectedPC, BestItem("R-Hand"), "R-Hand");
                Model.EquipPC(selectedPC, BestItem("Head"), "Head");
                Model.EquipPC(selectedPC, BestItem("Body"), "Body");

                UpdateEquipmentSlots();
            });

            equipMenu.Add("Remove", () =>
            {
                slotsFollowUp = location =>
                {
                    Model.EquipPC(selectedPC, null, location);

                    UpdateEquipmentSlots();
                };

                workspace.ActivateWindow("Slots");
            });

            equipMenu.Add("Empty", () =>
            {
                Model.EquipPC(selectedPC, null, "L-Hand");
                Model.EquipPC(selectedPC, null, "R-Hand");
                Model.EquipPC(selectedPC, null, "Head");
                Model.EquipPC(selectedPC, null, "Body");

                UpdateEquipmentSlots();
            });

            equipMenu.Exit += () => desktop.PopWorkspace();

            slotsMenu.Add("L-Hand", () => slotsFollowUp("L-Hand"));
            slotsMenu.Add("R-Hand", () => slotsFollowUp("R-Hand"));
            slotsMenu.Add("Head", () => slotsFollowUp("Head"));
            slotsMenu.Add("Body", () => slotsFollowUp("Body"));

            slotsMenu.Exit += () => workspace.ActivateWindow(equipMenu);

            itemsMenu.Exit += () =>
            {
                itemsMenu.Layout.Clear();
                workspace.ActivateWindow(slotsMenu);
            };

            var layout = new FixedGridLayout(2, 6);

            layout.Add(equipMenu, new Rectangle(0, 0, 2, 1));
            layout.Add(slotsMenu, new Rectangle(0, 1, 2, 2));
            layout.Add(itemsMenu, new Rectangle(0, 3, 1, 3));

            workspace.Layout = layout;
        }