Exemple #1
0
        private void InitMenuItems()
        {
            mnuEditMembers = new ToolStripMenuItem(Strings.MenuEditMembers,
                                                   Resources.EditMembers, mnuEditMembers_Click);
            mnuAutoSize = new ToolStripMenuItem(Strings.MenuAutoSize,
                                                null, mnuAutoSize_Click);
            mnuAutoWidth = new ToolStripMenuItem(Strings.MenuAutoWidth,
                                                 null, mnuAutoWidth_Click);
            mnuAutoHeight = new ToolStripMenuItem(Strings.MenuAutoHeight,
                                                  null, mnuAutoHeight_Click);
            mnuCollapseAllSelected = new ToolStripMenuItem(
                Strings.MenuCollapseAllSelected,
                null, mnuCollapseAllSelected_Click);
            mnuExpandAllSelected = new ToolStripMenuItem(
                Strings.MenuExpandAllSelected,
                null, mnuExpandAllSelected_Click);
            mnuSize = new ToolStripMenuItem(Strings.MenuSize, null,
                                            mnuAutoSize,
                                            mnuAutoWidth,
                                            mnuAutoHeight,
                                            new ToolStripSeparator(),
                                            mnuCollapseAllSelected,
                                            mnuExpandAllSelected
                                            );

            MenuList.AddRange(ShapeContextMenu.Default.MenuItems);
            MenuList.AddRange(new ToolStripItem[] {
                mnuSize,
                new ToolStripSeparator(),
                mnuEditMembers,
            });
        }
Exemple #2
0
 public MenuGuiScreen(InputHandler Input)
     : base(Input, true, false, true, true)
 {
     SetTitle("robots massacre");
     this.Menu = new MenuList(Input, new string[] { "create game", "join game", "map editor", "settings", "how to play", "credits", "quit" }, new int[] { 5, 1, 6, 11, 2, 3, -1 });
     Menu.SetStartY(60);
 }
Exemple #3
0
        public static async void EnterHouse(HouseInfoGlobalData h)
        {
            if ((int)await Client.Sync.Data.Get(100000 + h.id, "pin") > 0)
            {
                if (User.IsAdmin(4))
                {
                    Notification.SendWithTime($"~g~Пароль: ~s~{(int) await Client.Sync.Data.Get(100000 + h.id, "pin")}");
                }

                int pass = Convert.ToInt32(await Menu.GetUserInput("Пароль", null, 5));
                if (pass == h.pin)
                {
                    MenuList.HideMenu();
                    User.SetVirtualWorld(h.id);
                    User.Teleport(new Vector3(h.int_x, h.int_y, h.int_z));
                }
                else
                {
                    Notification.SendWithTime("~r~Вы не верно ввели пароль");
                }
            }
            else
            {
                MenuList.HideMenu();
                User.SetVirtualWorld(h.id);
                User.Teleport(new Vector3(h.int_x, h.int_y, h.int_z));
            }
            //SetEntityCoords(GetPlayerPed(-1), ToFloat(Convert.ToInt32(h.int_x)), ToFloat(Convert.ToInt32(h.int_y)), ToFloat(Convert.ToInt32(h.int_z)), true, false, false, true);
        }
Exemple #4
0
            static Hitchance()
            {
                Menu = Config.Menu.Add(new Menu("Hitchance", "Hitchance"));

                _QHitchance = Menu.Add(new MenuList <HitChance>("QHitchance", "Q Hitchance", new[] { HitChance.Medium, HitChance.High, HitChance.VeryHigh })
                {
                    SelectedValue = HitChance.High
                });
                _QHitchance.ValueChanged += (sender, args) =>
                {
                    SpellManager.Q.MinHitChance = _QHitchance.SelectedValue;
                };

                _WHitchance = Menu.Add(new MenuList <HitChance>("WHitchance", "W Hitchance", new[] { HitChance.Medium, HitChance.High, HitChance.VeryHigh })
                {
                    SelectedValue = HitChance.High
                });
                _WHitchance.ValueChanged += (sender, args) =>
                {
                    SpellManager.W.MinHitChance = _WHitchance.SelectedValue;
                };

                _RHitchance = Menu.Add(new MenuList <HitChance>("RHitchance", "R Hitchance", new[] { HitChance.Medium, HitChance.High, HitChance.VeryHigh })
                {
                    SelectedValue = HitChance.High
                });
                _RHitchance.ValueChanged += (sender, args) =>
                {
                    SpellManager.R.MinHitChance = _RHitchance.SelectedValue;
                };
            }
        protected void DropDownMenu()
        {
            Language language = (Language)Session["dil"];

            if (language == null)
            {
                MenuList.DataSource = (from s in db.SolutionCategory
                                       where s.LanguageID == 1
                                       select new
                {
                    ID = s.ID,
                    CategoryName = s.CategoryName
                }).ToList();
            }
            else
            {
                MenuList.DataSource = (from s in db.SolutionCategory
                                       where s.LanguageID == language.ID
                                       select new
                {
                    ID = s.ID,
                    CategoryName = s.CategoryName
                }).ToList();
            }

            MenuList.DataBind();
        }
 public ActionResult Index(int? pageNumber)
 {
     if (!pageNumber.HasValue) pageNumber = 1;
     if (pageNumber <= 0) pageNumber = 1;
     var model = new MenuList().GetAllItems(pageNumber.Value, 5);
     return JsonOrView(model);
 }
Exemple #7
0
 public static void ExitHouse(HouseInfoGlobalData h)
 {
     MenuList.HideMenu();
     User.SetVirtualWorld(0);
     User.Teleport(new Vector3(h.x, h.y, h.z));
     //SetEntityCoords(GetPlayerPed(-1), ToFloat(Convert.ToInt32(h.x)), ToFloat(Convert.ToInt32(h.y)), ToFloat(Convert.ToInt32(h.z)), true, false, false, true);
 }
Exemple #8
0
        public static void AddTargetSelectorMenu(this Menu menu)
        {
            ThisMenu = new Menu("FS_Check Target", "FS_Check Target (Beta)");
            var FirstMenu = new MenuSeparator("FS Target Selector", "FS Target Selector");

            ThisMenu.Add(FirstMenu);
            SecondMenu = new MenuList("FS Select Mode", "FS Select Mode", new string[] { "Selected", "Weight", "Priority" }, 1);
            ThisMenu.Add(SecondMenu);

            var Selected = new MenuSeparator("Selected", "Selected");
            var Weight   = new MenuSeparator("Weight", "Weight");
            var Priority = new MenuSeparator("Priority", "Priority");

            ThisMenu.Add(Selected);

            foreach (var t in GameObjects.EnemyHeroes.ToArray())
            {
                if (t is AIHeroClient && t.IsEnemy)
                {
                    GetPriority.Add(new MenuSlider("FS Priority " + t.CharacterName + t.NetworkId, (t as AIHeroClient).CharacterName, (t as AIHeroClient).IsRanged ? 5 : 1, 0, 10));
                }
            }

            ThisMenu.Add(Weight);
            ThisMenu.Add(GetWeight);

            ThisMenu.Add(Priority);
            ThisMenu.Add(GetPriority);

            ThisMenu.Add(DrawTarget);

            Drawing.OnDraw += Drawing_OnDraw;

            menu.Add(ThisMenu);
        }
Exemple #9
0
        public static async void MenuEnterHouse(HouseInfoGlobalData h)
        {
            h = await GetAllData(h.id);

            if (h.id == 0)
            {
                Notification.SendWithTime("~r~Произошла ошибка, попробуйте еще раз");
                return;
            }

            if (h.is_buy)
            {
                if (h.int_x == 0)
                {
                    MenuList.ShowHouseOutExMenu(h);
                }
                else
                {
                    MenuList.ShowHouseOutMenu(h);
                }
            }
            else
            {
                MenuList.ShowHouseBuyMenu(h);
            }
        }
Exemple #10
0
        private static void LoadMenu()
        {
            MenuList menuHeaders = new MenuList();
            int      index       = 1;

            displayingReport = cr.Printer.GetReports(ejOnly);

            foreach (IReport report in displayingReport.Subreports)
            {
                if (ejOnly || cr.CurrentCashier.AuthorizationLevel >= report.Authorization || cr.RegisterAuthorizationLevel >= report.Authorization)
                {
                    menuHeaders.Add(new MenuLabel(String.Format("{0}\t{1,2}\n{2}", PosMessage.REPORT, index++, report.Name)));
                }
            }

            if (menuHeaders.IsEmpty)
            {
                if (displayingReport.Subreports.Count > 0)
                {
                    throw new CashierAutorizeException();
                }
                else
                {
                    throw new Exception(PosMessage.NO_SUPPORTED_REPORT);
                }
            }

            List.Instance(menuHeaders);

            //:to do: think EJ_LIMIT_SETTING
            //menuHeaders.Add(new MenuLabel(String.Format("RAPOR             {0,2}\n{1}", index++, PosMessage.EJ_LIMIT_SETTING)));
        }
Exemple #11
0
 public static void Stop()
 {
     IsStart = false;
     User.PlayScenario("PROP_HUMAN_SEAT_BENCH");
     User.StopScenario();
     MenuList.HideMenu();
 }
        private void SetArea(string key)
        {
            try
            {
                MenuList.Clear();
                for (int i = 0; i < 3; i++)
                {
                    var menu = new MenuMap3FModel();
                    if (Convert.ToString(i) == key)
                    {
                        menu.ButtonShow = true;
                    }
                    else
                    {
                        menu.ButtonShow = false;
                    }

                    MenuList.Add(menu);
                }
            }
            catch (Exception e)
            {
                WriteLog.WriteLogger(e.ToString());
            }
        }
        public static void Initialize()
        {
            string[] hitchance =
            {
                "Medium",
                "High",
                "Very High"
            };
            _menu = new Menu("Prediction", "FS Prediction Hitchance", true);
            item  = new MenuSlider("PredMaxRange", "Max Range %", 100, 0, 100);
            var QHitChance = new MenuList("QHitChance", "Q Hit Chance", hitchance, 1);
            var WHitChance = new MenuList("WHitChance", "W Hit Chance", hitchance, 1);
            var EHitChance = new MenuList("EHitChance", "E Hit Chance", hitchance, 1);
            var RHitChance = new MenuList("RHitChance", "R Hit Chance", hitchance, 1);

            _menu.Add(QHitChance);
            _menu.Add(WHitChance);
            _menu.Add(EHitChance);
            _menu.Add(RHitChance);

            _menu.Add(item);
            _menu.Attach();

            AIHeroClient.OnProcessSpellCast += AIHeroClient_OnProcessSpellCast;
        }
Exemple #14
0
        public async Task <ActionResult> MenuEdit(Guid menuGuid)
        {
            MenuModule modMenu = (MenuModule)await ModuleDefinition.LoadAsync(menuGuid);

            if (modMenu == null)
            {
                throw new InternalError("Can't find menu module {0}", menuGuid);
            }

            MenuList origMenu = await modMenu.GetMenuAsync();

            MenuEditModel model = new MenuEditModel {
                Menu     = GetMenuEntries(origMenu),
                NewEntry = GetMenuEntry(new ModuleAction(Module)
                {
                    Url = ""
                }),

                MenuGuid    = menuGuid,
                ModEntry    = new MenuEntry(),
                MenuVersion = modMenu.MenuVersion,
            };

            return(View(model));
        }
Exemple #15
0
        public async Task <ActionResult> EntireMenu(string entireMenu, Guid menuGuid, long menuVersion)
        {
            MenuModule modMenu = (MenuModule)await ModuleDefinition.LoadAsync(menuGuid);

            if (modMenu == null)
            {
                throw new InternalError("Can't find menu module {0}", menuGuid);
            }
            if (menuVersion != modMenu.MenuVersion)
            {
                throw new Error(this.__ResStr("menuChanged", "The menu has been changed by someone else - Your changes can't be saved - Please refresh the current page before proceeding"));
            }

            MenuList origMenu = await modMenu.GetMenuAsync();

            MenuList menu = DeserializeFromJSON(entireMenu);
            await modMenu.SaveMenuAsync(menu);

            return(new YJsonResult()
            {
                Data = new EntireMenuResult {
                    NewVersion = modMenu.MenuVersion
                }
            });
        }
Exemple #16
0
        public override void Command()
        {
            MenuList commandMenu = new MenuList();

            commandMenu.Clear();

            int index = 1;

            if (cr.IsAuthorisedFor(Authorizations.VoidDocument) ||
                !DisplayAdapter.Both.HasAttribute(DisplayAttribute.CashierKey))
            {
                commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.VOID_DOCUMENT));

                if (cr.Document is Receipt && cr.Printer.CanPrint(cr.Document))
                {
                    commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.SUSPEND_DOCUMENT));
                }
            }
            if ((cr.Document is Receipt) && cr.Printer.CanPrint(new Invoice()))
            {
                commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.TRANSFER_DOCUMENT));
            }

            if (cr.DataConnector.CurrentSettings.GetProgramOption(Setting.AssingCustomerInSelling) == PosConfiguration.ON)
            {
                commandMenu.Add(CommandMenu.AddLabel(index++, PosMessage.CUSTOMER_ENTRY));
            }

            cr.State = CommandMenu.Instance(commandMenu);
        }
 /// <summary>
 ///     Deletes the user list.
 /// </summary>
 private void DeleteUserList()
 {
     //liuyahua
     // var userSeleted = UserList.Where(e => e.IsSelected == true);
     MenuList.Remove(e => e.IsSelected);
     //UserList.Remove()
 }
Exemple #18
0
        protected override MenuList OnGetMenuItems()
        {
            MenuList list = base.OnGetMenuItems();

            list[MenuListContainer.Actions].Add(new IconMenuItem(Catalog.GetString("Di_gital Clock"), ShowDigital ? "gtk-apply" : "gtk-remove", (o, a) =>
            {
                ShowDigital = !ShowDigital;
                QueueRedraw();
            }));

            list[MenuListContainer.Actions].Add(new IconMenuItem(Catalog.GetString("24-Hour _Clock"), ShowMilitary ? "gtk-apply" : "gtk-remove", (o, a) =>
            {
                ShowMilitary = !ShowMilitary;
                QueueRedraw();
            }, !ShowDigital));

            list[MenuListContainer.Actions].Add(new IconMenuItem(Catalog.GetString("Show _Date"), ShowDate ? "gtk-apply" : "gtk-remove", (o, a) =>
            {
                ShowDate = !ShowDate;
                QueueRedraw();
            }, !ShowDigital));

            list[MenuListContainer.Actions].Add(new MenuItem(Catalog.GetString("Select _Theme"), "preferences-desktop-theme", (o, a) =>
            {
                ShowSettings();
            }, ShowDigital));
            return(list);
        }
        public MainMenuScreen(ScreenComponent manager) : base(manager, new Point(400, 360))
        {
            Controls.Add(new Panel(manager) { Position = new Rectangle(20, 20, 360, 40) });
            Controls.Add(new Label(manager) { Text = "Hauptmenue", Position = new Rectangle(40, 30, 0, 0) });
            Controls.Add(menu = new MenuList(manager) { Position = new Rectangle(20, 70, 360, 200) });

            // Sichtbarkeiten anhand der Server/Client Stati ermitteln
            newGameItem.Visible = manager.Game.Server.State == ServerState.Closed && manager.Game.Client.State == ClientState.Closed;
            networkItem.Visible = manager.Game.Server.State == ServerState.Closed && manager.Game.Client.State == ClientState.Closed;
            stopServerItem.Visible = manager.Game.Server.State != ServerState.Closed;
            stopClientItem.Visible = manager.Game.Client.State != ClientState.Closed;

            menu.Items.Add(newGameItem);
            if (manager.Game.Server.ServerFeatureAvailable || manager.Game.Client.ClientFeatureAvailable)
                menu.Items.Add(networkItem);
            menu.Items.Add(stopServerItem);
            menu.Items.Add(stopClientItem);
            menu.Items.Add(optionsItem);
            menu.Items.Add(creditsItem);
            menu.Items.Add(exitItem);

            menu.SelectedItem = menu.Items.First(i => i.Visible && i.Enabled);

            menu.OnInteract += OnInteract;
        }
Exemple #20
0
        public static async void Start()
        {
            if (IsStart && IsCasino())
            {
                Stop();
                return;
            }

            var playerPos = GetEntityCoords(GetPlayerPed(-1), true);

            for (int i = 0; i < Markers.Length / 6; i++)
            {
                Vector3 gumPos = new Vector3((float)Markers[i, 0], (float)Markers[i, 1], (float)Markers[i, 2]);
                if (Main.GetDistanceToSquared(playerPos, gumPos) > 1.2f)
                {
                    continue;
                }

                IsStart = true;
                User.PedRotation((float)Markers[i, 3]);
                SetEntityCoords(GetPlayerPed(-1), gumPos.X, gumPos.Y, gumPos.Z, true, false, false, true);

                await Delay(1000);

                User.PlayScenario("PROP_HUMAN_SEAT_BENCH");
                MenuList.ShowCasinoRateMenu(Convert.ToInt32(Markers[i, 4]), Convert.ToInt32(Markers[i, 5]));
            }
        }
        // Vessel Menu
        private void TargetVessel(int index, TextMenu.Item ti)
        {
            if (selectedVessel == vesselsList[index].vessel)
            {
                // Already selected.  Are there ports?
                if (UpdatePortsList() > 0)
                {
                    currentMenu = MenuList.Ports;

                    activeMenu = new TextMenu();
                    activeMenu.rightColumnWidth = 7;

                    activeMenu.labelColor     = nameColorTag;
                    activeMenu.selectedColor  = selectedColorTag;
                    activeMenu.disabledColor  = unavailableColorTag;
                    activeMenu.rightTextColor = distanceColorTag;

                    UpdateLists();

                    if (selectedPort != null)
                    {
                        int idx = portsList.FindIndex(x => x == selectedPort);
                        activeMenu.currentSelection = idx;
                    }
                }
            }
            else
            {
                vesselsList[index].SetTarget();
                selectedCelestial = null;
                selectedPort      = null;

                activeMenu.SetSelected(index, true);
            }
        }
Exemple #22
0
        private void InitMenuItems( )
        {
            mnuEditComment = new ToolStripMenuItem(Strings.MenuEditComment, Resources.EditComment, mnuEditComment_Click);

            MenuList.AddRange(ShapeContextMenu.Default.MenuItems);
            MenuList.AddRange(new ToolStripItem[] { new ToolStripSeparator( ), mnuEditComment });
        }
Exemple #23
0
        //--- Menu item callbacks
        // Root menu:
        private void ShowCelestialMenu(int index, TextMenu.Item ti)
        {
            currentMenu = MenuList.Celestials;

            // MOARdV: Bug warning: rightColumnWidth for ShowCelestialMenu and
            // ShowVesselMenu is hard-coded to 8, which fits the default format
            // string.  It really needs to be sized appropriately, which isn't
            // easy if the format string is configured with non-fixed size.
            // Maybe the format string should be non-configurable?
            //
            // Mihara: Well, why not make it another module parameter then and
            // let the modder who uses it worry about that? Most won't change it.
            activeMenu = new TextMenu();
            activeMenu.rightColumnWidth = distanceColumnWidth;

            activeMenu.labelColor     = nameColorTag;
            activeMenu.selectedColor  = selectedColorTag;
            activeMenu.disabledColor  = unavailableColorTag;
            activeMenu.rightTextColor = distanceColorTag;

            UpdateLists();

            if (selectedCelestial != null)
            {
                int idx = celestialsList.FindIndex(x => x.body == selectedCelestial);
                activeMenu.currentSelection = idx;
            }
        }
Exemple #24
0
        private static void Game_OnGameLoad(object sender, EventArgs e)
        {
            try
            {
                MainMenu      = new Menu("IHateSkillshots", "IHateSkillshots", true).Attach();
                HitChanceList = MainMenu.Add(new MenuList <string>("HitChance", "Hitchance", new[] { "Low", "Medium", "High", "VeryHigh" }));
                DrawMenu      = MainMenu.Add(new Menu("Drawings", "Drawings Settings"));

                foreach (var spell in SpellDatabase.Spells)
                {
                    if (spell.ChampionName == ObjectManager.Player.ChampionName)
                    {
                        Game.PrintChat(spell.Slot + " LOADED");
                        if (spell.Slot == SpellSlot.Q)
                        {
                            Q = new Spell(spell.Slot, spell.Range);
                            Q.SetSkillshot(spell.Delay / 1000, spell.Radius, spell.MissileSpeed, spell.CanBeRemoved, spell.Type);

                            MainMenu.Add(new MenuKeyBind("Spell1", "Use Q", System.Windows.Forms.Keys.Z, KeyBindType.Press));
                            DrawMenu.Add(new MenuBool("QRange", "Q range"));
                            DrawMenu.Add(new MenuColor("QRangeC", "Q range", SharpDX.Color.Aqua));
                            SpellList.Add(Q);
                        }
                        if (spell.Slot == SpellSlot.W)
                        {
                            W = new Spell(spell.Slot, spell.Range);
                            W.SetSkillshot(spell.Delay / 1000, spell.Radius, spell.MissileSpeed, spell.CanBeRemoved, spell.Type);
                            MainMenu.Add(new MenuKeyBind("Spell2", "Use W", System.Windows.Forms.Keys.Z, KeyBindType.Press));
                            DrawMenu.Add(new MenuBool("WRange", "W range"));
                            DrawMenu.Add(new MenuColor("WRangeC", "W range", SharpDX.Color.Black));
                            SpellList.Add(W);
                        }
                        if (spell.Slot == SpellSlot.E)
                        {
                            E = new Spell(spell.Slot, spell.Range);
                            E.SetSkillshot(spell.Delay / 1000, spell.Radius, spell.MissileSpeed, spell.CanBeRemoved, spell.Type);
                            MainMenu.Add(new MenuKeyBind("Spell3", "Use E", System.Windows.Forms.Keys.Z, KeyBindType.Press));
                            DrawMenu.Add(new MenuBool("ERange", "E range"));
                            DrawMenu.Add(new MenuColor("ERangeC", "E range", SharpDX.Color.Coral));
                            SpellList.Add(E);
                        }
                        if (spell.Slot == SpellSlot.R)
                        {
                            R = new Spell(spell.Slot, spell.Range);
                            R.SetSkillshot(spell.Delay / 1000, spell.Radius, spell.MissileSpeed, spell.CanBeRemoved, spell.Type);
                            MainMenu.Add(new MenuKeyBind("Spell4", "Use R", System.Windows.Forms.Keys.Z, KeyBindType.Press));
                            DrawMenu.Add(new MenuBool("RRange", "R range"));
                            DrawMenu.Add(new MenuColor("RRangeC", "R range", SharpDX.ColorBGRA.FromRgba(0)));
                            SpellList.Add(R);
                        }
                    }
                }
            }
            catch (Exception)
            {
                Game.PrintChat("Error found in skillshots. Refused to load.");
            }
            Drawing.OnDraw += Drawing_OnDraw;
            Game.OnUpdate  += Game_OnGameUpdate;
        }
Exemple #25
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="BlueList" /> class.
        /// </summary>
        /// <param name="component">
        ///     The component.
        /// </param>
        public BlueList2(MenuList component)
            : base(component)
        {
            var arrowSize = MenuSettings.Font.MeasureText(null, "V", 0);

            this.dropDownButtonWidth = arrowSize.Width + (2 * ArrowSpacing);
        }
Exemple #26
0
 private void LoadMenu()
 {
     MenuList.Add(new MenuItem()
     {
         Icon     = "\uf0e4",
         Title    = "Dashboard",
         PageName = MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <DashBoardPage>())
     });
     MenuList.Add(new MenuItem()
     {
         Icon     = "\uf073",
         Title    = "Timesheet",
         PageName = MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <TimesheetPage>())
     });
     MenuList.Add(new MenuItem()
     {
         Icon     = "\uf06e",
         Title    = "Review",
         PageName = MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <ReviewPage>())
     });
     MenuList.Add(new MenuItem()
     {
         Icon     = "\uf085",
         Title    = "Configuration",
         PageName = MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <ConfigurationPage>())
     });
 }
Exemple #27
0
 public void ButtonProcessor(int buttonID)
 {
     if (buttonID == buttonUp)
     {
         activeMenu.PreviousItem();
     }
     if (buttonID == buttonDown)
     {
         activeMenu.NextItem();
     }
     if (buttonID == buttonEnter)
     {
         activeMenu.SelectItem();
     }
     if (buttonID == buttonEsc)
     {
         if (currentMenu == MenuList.Ports)
         {
             // Take advantage of the fact that ShowVesselMenu does not
             // care about the parameters.
             ShowVesselMenu(0, null);
         }
         else
         {
             activeMenu  = topMenu;
             currentMenu = MenuList.Root;
         }
     }
     if (buttonID == buttonHome)
     {
         sortMode = sortMode == SortMode.Alphabetic ? SortMode.Distance : SortMode.Alphabetic;
         UpdateLists();
     }
 }
Exemple #28
0
        // Decouple port menu...
        private void DecouplePort(int index, TextMenu.Item ti)
        {
            var thatPort = undockablesList[index] as ModuleDockingNode;
            var thatClaw = undockablesList[index] as ModuleGrappleNode;

            if (thatPort != null)
            {
                switch (thatPort.state)
                {
                case "Docked (docker)":
                    thatPort.Undock();
                    break;

                case "PreAttached":
                    thatPort.Decouple();
                    break;
                }
            }
            // Mihara: Claws require multiple different calls depending on state --
            // Release releases the claw that grabbed something else, while Decouple releases the claw that grabbed your own vessel.
            // FIXME: This needs further research.
            if (thatClaw != null)
            {
                thatClaw.Release();
            }
            UpdateUndockablesList();
            activeMenu  = topMenu;
            currentMenu = MenuList.Root;
            UpdateLists();
        }
Exemple #29
0
        private void ShowCrewEVA(int index, TextMenu.Item ti)
        {
            currentMenu = MenuList.CrewEVA;

            activeMenu                = new TextMenu();
            activeMenu.labelColor     = nameColorTag;
            activeMenu.selectedColor  = selectedColorTag;
            activeMenu.disabledColor  = unavailableColorTag;
            activeMenu.rightTextColor = distanceColorTag;

            var vesselCrew = vessel.GetVesselCrew();

            for (int crewIdx = 0; crewIdx < vesselCrew.Count; ++crewIdx)
            {
                if (vesselCrew[crewIdx] != null)
                {
                    var tmi = new TextMenu.Item();
                    tmi.action     = CrewEVA;
                    tmi.labelText  = vesselCrew[crewIdx].name;
                    tmi.rightText  = vesselCrew[crewIdx].experienceTrait.Title;
                    tmi.isSelected = false;
                    tmi.id         = crewIdx;
                    activeMenu.Add(tmi);
                }
            }
        }
Exemple #30
0
        /// <summary>
        /// Builds the current site from the template file
        /// </summary>
        /// <returns></returns>
        public async Task BuildSiteUsingTemplateAsync(string template, bool build = true)
        {
            Logging.AddLog("Running site template {0}", template);
            // Get the current site menu
            ModuleDefinition menuServices = await ModuleDefinition.LoadAsync(Manager.CurrentSite.MenuServices, AllowNone : true);

            if (menuServices == null)
            {
                throw TemplateError("No menu services available - no module has been defined in Site Settings");
            }
            IModuleMenuAsync iModMenu = (IModuleMenuAsync)menuServices;

            if (iModMenu == null)
            {
                throw TemplateError($"Menu services module doesn't implement {nameof(IModuleMenuAsync)} interface");
            }

            _SiteMenu = await iModMenu.GetMenuAsync();

            Manager.SiteCreationTemplateActive = true;
            await BuildSiteAsync(template, build);

            Manager.SiteCreationTemplateActive = false;

            // Save the new site menu
            await iModMenu.SaveMenuAsync(_SiteMenu);
        }
        public void TestAddContentManually()
        {
            MenuList pumpkin  = new MenuList(1, "Cheeseburger", "A burger with cheese", 3.50, "Buns, meat, cheese.");
            bool     wasAdded = _repo.AddMenuChoice(pumpkin);

            Assert.IsTrue(wasAdded);
        }
Exemple #32
0
        private void Refresh(bool rmodule, bool rmenu, bool rmenudtl, bool rrole, bool ruser)
        {
            if (rmodule)
            {
                ModuleList.Clear();
                ModuleList.AddRange(PubMaster.Mod.RoleSql.QueryWcsModuleList());
            }

            if (rmenu)
            {
                MenuList.Clear();
                MenuList.AddRange(PubMaster.Mod.RoleSql.QueryWcsMenuList());
            }

            if (rmenudtl)
            {
                MenuDtlList.Clear();
                MenuDtlList.AddRange(PubMaster.Mod.RoleSql.QueryWcsMenuDtlList());
            }

            if (rrole)
            {
                RoleList.Clear();
                RoleList.AddRange(PubMaster.Mod.RoleSql.QueryWcsRoleList());
            }

            if (ruser)
            {
                UserList.Clear();
                UserList.AddRange(PubMaster.Mod.RoleSql.QueryWcsUserList());
            }
        }
 public MenuListTest()
 {
     List<string> testStringList = new List<string>();
     testStringList.Add("test");
     testStringList.Add("test");
     testStringList.Add("test");
     testMenuList_ = new MenuList(testStringList, Vector2.Zero);
 }
 // Use this for initialization
 void Start()
 {
     optionsCanvas.enabled = false;
     creditsCanvas.enabled = false;
     menuCanvas.enabled = true;
     currentMenu = MenuList.MENU;
     menuCanvas.sortingOrder = 1;
     screenWidth = Screen.width / 2;
     canSwapMenus = true;
 }
Exemple #35
0
 public void InitMenu()
 {
     UseQ = MainMenu.Add(new MenuBool("Ezrealq", "Use Q", true));
     QFarm = MainMenu.Add(new MenuBool("Ezrealqfarm", "Use Q Farm", true));
     QMana = MainMenu.Add(new MenuSlider("Ezrealqfarmmana", "Q Farm Mana", 80, 0, 100));
     UseWMode = MainMenu.Add(new MenuList<string>("Ezrealw", "Use W", new [] {"COMBO", "ALWAYS", "NEVER"}));
     SemiAutoRKey = MainMenu.Add(new MenuKeyBind("Ezrealr", "Use R Key: ", Keys.R, KeyBindType.Press));
     BlockManualR = MainMenu.Add(new MenuBool("Ezrealblockmanualr", "Block manual R", true));
     UseSheenCombo = MainMenu.Add(new MenuBool("Ezrealsheencombo", "Use SHEEN Combo", true));
     MainMenu.Attach();
 }
        public OptionsScreen(ScreenComponent manager) :
            base(manager, new Point(400, 360))
        {
            Controls.Add(new Panel(manager) { Position = new Rectangle(20, 20, 360, 40) });
            Controls.Add(new Label(manager) { Text = "Optionen", Position = new Rectangle(40, 30, 0, 0) });
            Controls.Add(menu = new MenuList(manager) { Position = new Rectangle(20, 70, 360, 200) });

            menu.Items.Add(musicVolumeItem);
            menu.Items.Add(soundVolumeItem);
            menu.SelectedItem = menu.Items.First();
            RefreshText();
        }
Exemple #37
0
        public NewGame(Microsoft.Xna.Framework.Game game)
            : base(game)
        {
            this.game = game;
            this.playing = false;
            this.ship = new Ship.Ship();
            this.planets = new Planets();

            this.world = new World(this.game.GraphicsDevice.Viewport.AspectRatio);
            this.network = new Network();
            this.time = 0.0f;

            this.currentItem = MenuList.game;
            this.exitMenu = new ExitMenu.ExitMenu();
        }
Exemple #38
0
        public HostScreen(String ipstring)
        {
            ip = IPAddress.Parse(ipstring);
            end = new IPEndPoint(ip, 6113);
            listensocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

            chatlist = new MenuList(new Rectangle(50, 50, 350, 450));
            components.Add(new TextInput(new Rectangle(50, 500, 350, 40), ChatSend));
            components.Add(new MenuButton(new Rectangle(450, 200, 150, 40), "Start Game", StartGame));
            components.Add(chatlist);

            HostThread ht = new HostThread(listensocket, end, chatlist);
            Thread t2 = new Thread(new ThreadStart(ht.SendRecieve));
            t2.Start();
        }
        public GlobalLobbyScreen(SpriteBatch sb, SpriteFont sf)
        {
            chatClient = new GlobalChatClient("http://openportone.appspot.com/");
            buttons = new List<MenuComponent>();
            ipbox = new TextInput(new Rectangle(Game1.x / 2 + 50, Game1.y / 2 - 200, 150, 40), Nothing); //not addded to the list

            buttons.Add(new MenuButton(new Rectangle(Game1.x / 2 + 50, Game1.y / 2 - 150, 150, 40), "Join Game", JoinGame));
            buttons.Add(new MenuButton(new Rectangle(Game1.x / 2 + 50, Game1.y / 2 - 100, 150, 40), "Host Game", HostGame));
            buttons.Add(new MenuButton(new Rectangle(Game1.x / 2 + 50, Game1.y / 2 - 50, 150, 40), "Quit", MenuManager.ClickTitle));

            //buttons.Add(new TextInput(new Rectangle(50,500,350,40), ChatSend));
            chatlist = new MenuList(new Rectangle(Game1.x / 2 - 350, Game1.y / 2 - 250, 350, 500));
            chatlist.padding = 0;
            buttons.Add(chatlist);
        }
Exemple #40
0
 public void InitMenu()
 {
     ComboMenu = MainMenu.Add(new Menu("ashecombomenu", "Combo Settings: "));
     UseQCombo = ComboMenu.Add(new MenuBool("asheqcombo", "Use Q", true));
     UseWCombo = ComboMenu.Add(new MenuBool("ashewcombo", "Use W", true));
     UseRCombo = ComboMenu.Add(new MenuBool("ashercombo", "Use R", true));
     UseWHarass = MainMenu.Add(new MenuBool("ashewharass", "Use W Harass", true));
     UseRAntiGapclose = MainMenu.Add(new MenuBool("asherantigapclose", "Use R AntiGapclose", false));
     UseRInterrupt = MainMenu.Add(new MenuBool("asherinterrupt", "Use R Interrupt", true));
     DrawWRange = MainMenu.Add(new MenuBool("ashedraww", "Draw W Range?", false));
     ScoutMode =
         MainMenu.Add(new MenuList<string>("ashescoutmode", "Scout (E) Mode: ",
             new[] {"EnemyJungleClosest", "EnemyJungleFarthest", "DragonBaron", "Custom", "Disabled"}));
     MainMenu.Attach();
 }
        public NetworkScreen(ScreenComponent manager) : base(manager, new Point(400, 360))
        {
            Controls.Add(new Panel(manager) { Position = new Rectangle(20, 20, 360, 40) });
            Controls.Add(new Label(manager) { Text = "Netzwerk", Position = new Rectangle(40, 30, 0, 0) });
            Controls.Add(menu = new MenuList(manager) { Position = new Rectangle(20, 70, 360, 200) });

            if (manager.Game.Server.ServerFeatureAvailable)
                menu.Items.Add(serverItem);
            if (manager.Game.Client.ClientFeatureAvailable)
                menu.Items.Add(clientItem);
            menu.Items.Add(cancelItem);

            menu.SelectedItem = menu.Items.First();

            menu.OnInteract += OnInteract;
        }
Exemple #42
0
        public Menu(Microsoft.Xna.Framework.Game game)
            : base(game)
        {
            this.game = game;
            menuItems = new List<ManuItem>();

            for (int i = 0; i < 4; i++)
            {
                menuItems.Add(new ManuItem(new Vector2(330, 230 + i * 60)));
            }
            backButton = new ManuItem(new Vector2(340,500));
            currentItem = MenuList.mainMenu;

            newGame = new NewGame(game);
            game.Components.Add(this.newGame);
        }
        private void CreateSiteMapNodes()
        {
            MenuList menuList = new MenuList();
            menuList.GetAll();

            AddNode(new SiteMapNode(this, "AboutUs", "~/AboutUs.aspx", "About Us", "About Us"), _siteMapRoot);

            SiteMapNode nodeMenu = new SiteMapNode(this, "Menu", "~/Menu.aspx", "Menu", "Menu");
            menuList.ForEach(subMenu =>
                {
                    SiteMapNode node = new SiteMapNode(this, subMenu.Title, "~/Menu.aspx?Sub=" + subMenu.ID.ToString(), subMenu.Title, subMenu.Title);
                    AddNode(node, nodeMenu);
                });

            AddNode(nodeMenu, _siteMapRoot);
            AddNode(new SiteMapNode(this, "ContactUs", "~/ContactUs.aspx", "Contact Us", "Contact Us"), _siteMapRoot);
        }
        public MapSelectScreen(bool h)
        {
            host = h;
            components = new List<MenuComponent>();

            components.Add(new MenuButton(new Rectangle(Game1.x / 2 + 100, Game1.y / 2 - 100, 150, 40), "Load Map", ClickLoadMapStart));
            components.Add(new MenuButton(new Rectangle(Game1.x / 2 + 100, Game1.y / 2 - 50, 150, 40), "New Map", ClickNewGameStart));
            components.Add(new MenuButton(new Rectangle(Game1.x / 2 + 100, Game1.y / 2, 150, 40), "Quit", MenuManager.ClickTitle));

            MenuList maplist = new MenuList(new Rectangle(Game1.x / 2 - 350, Game1.y / 2 - 250, 400, 500));
            //maplist.AddNewButtonDefault(20, 200, "i am a map", delegate(Object o, EventArgs e) { ((MenuButton)o).selected = !((MenuButton)o).selected; });
            //maplist.AddNewButtonDefault(20, 200, "i am also a map", delegate(Object o, EventArgs e) { ((MenuButton)o).selected = !((MenuButton)o).selected; });

            string[] filepaths = Directory.GetFiles(@"Content/", "*.map", SearchOption.AllDirectories);
            foreach (String s in filepaths)
            {
                maplist.AddNewButtonDefault(20, 200, s, delegate(Object o, EventArgs e) { ((MenuButton)o).selected = !((MenuButton)o).selected; loadpath = ((MenuButton)o).text;});
            }

            components.Add(maplist);
        }
Exemple #45
0
 private void InitMenu()
 {
     UseQComboStringList = MainMenu.Add(new MenuList<string>("useqcombo", "Q Combo MODE: ", new [] {"CHALLENGER", "BRONZE", "NEVER"}));
     UseWComboBool = MainMenu.Add(new MenuBool("usewcombo", "Use W Combo", true));
     UseEComboStringList = MainMenu.Add(new MenuList<string>("useecombo", "Use E Combo", new [] {"CHALLENGER", "BRONZE", "NEVER"}));
     UseEKSBool = MainMenu.Add(new MenuBool("useeks", "Use E KS if Q on CD", true));
     UseRComboKeybind = MainMenu.Add(new MenuKeyBind("usercombo", "Use R Combo", Keys.R, KeyBindType.Press));
     QGapcloseModeStringList =
         MainMenu.Add(new MenuList<string>("qgc", "Q Gapcloser Mode",
             new[] {"ONLY-CLOSEST-TO-TARGET", "ALL-KILLABLE-MINIONS"}));
     MinDistForQGapcloser =
         MainMenu.Add(new MenuSlider("mindistqgapcloser", "Min Distance for Q Gapclose", 350, 325, 625));
     QFarmModeStringList = MainMenu.Add(new MenuList<string>("useqfarm", "Q Farm Mode: ", new[] { "ONLY-UNKILLABLE", "ALWAYS", "NEVER" }));
     MainMenu.Attach();
 }
        /// <summary>
        /// Creates an options state which allows the user to adjust game settings
        /// </summary>
        /// <param name="engine">Reference to the engine running the state</param>
        /// <param name="savedState">The state of play to return to once the user finishes</param>
        public EngineStateEditorOptions(Engine engine, EngineStateLevelEditor savedState)
        {
            engine_ = engine;
            savedState_ = savedState;

            List<string> menuString = new List<string>();

            if (Settings.getInstance().IsSoundAllowed_)
            {
                menuString.Add(STR_SOUND_ON);
            }
            else
            {
                menuString.Add(STR_SOUND_OFF);
            }
            menuString.Add(STR_RESOLUTION);
            if (Settings.getInstance().IsGamerServicesAllowed_)
            {
                menuString.Add(STR_CHANGE_STORAGE);
            }
            if (Settings.getInstance().IsInDebugMode_)
            {
                menuString.Add(STR_DEBUG_MODE_ON);
            }
            else
            {
                menuString.Add(STR_DEBUG_MODE_OFF);
            }
            menuString.Add(STR_SAVE_CONTINUE);
            menuString.Add(STR_SAVE_QUIT);
            menuString.Add(STR_QUIT_NOSAVE);
            menuString.Add(STR_RETURN);
            menuList_ = new MenuList(menuString, OPTIONS_MENU_POSITION);
            menuList_.Font_ = OPTIONS_FONT;
            menuList_.BaseColor_ = OPTIONS_MENU_UNSELECTED_COLOR;
            menuList_.SelectedColor_ = OPTIONS_MENU_SELECTED_COLOR;
            menuList_.Spacing_ = OPTIONS_MENU_SPACING;
            menuList_.CursorPos_ = OPTIONS_MENU_DEFAULT_SELECTED_ITEM;
        }
Exemple #47
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="LightList" /> class.
 /// </summary>
 /// <param name="component">
 ///     The component.
 /// </param>
 public LightList2(MenuList component)
     : base(component)
 {
     var arrowSize = MenuSettings.Font.MeasureText(null, "V", 0);
     this.dropDownButtonWidth = arrowSize.Width + (2 * ArrowSpacing);
 }
Exemple #48
0
        /// <summary>
        ///     Gets the list of dropdown item boundaries.
        /// </summary>
        /// <param name="component">The <see cref="MenuList" /></param>
        /// <returns>List of <see cref="Rectangle" /></returns>
        public List<Rectangle> DropDownListBoundaries(MenuList component)
        {
            var rectangles = new List<Rectangle>();
            for (var i = 0; i < component.Count; i++)
            {
                rectangles.Add(
                    new Rectangle(
                        (int)
                        (component.Position.X + component.MenuWidth - this.dropDownButtonWidth - (2 * TextSpacing)
                         - component.MaxStringWidth),
                        (int)(component.Position.Y + ((i + 1) * MenuSettings.ContainerHeight)),
                        this.dropDownButtonWidth + (2 * TextSpacing) + component.MaxStringWidth,
                        MenuSettings.ContainerHeight + 1));
            }

            return rectangles;
        }
Exemple #49
0
 /// <summary>
 ///     Gets the complete dropdown boundaries
 /// </summary>
 /// <param name="component">The <see cref="MenuList" /></param>
 /// <returns>The <see cref="Rectangle" /></returns>
 public Rectangle DropDownExpandedBoundaries(MenuList component)
 {
     return
         new Rectangle(
             (int)
             (component.Position.X + component.MenuWidth - this.dropDownButtonWidth - (2 * TextSpacing)
              - component.MaxStringWidth),
             (int)component.Position.Y,
             this.dropDownButtonWidth + (2 * TextSpacing) + component.MaxStringWidth,
             (component.Count + 1) * MenuSettings.ContainerHeight);
 }
        private void ShowVesselMenu(int index, TextMenu.Item ti)
        {
            currentMenu = MenuList.Vessels;

            activeMenu = new TextMenu();
            activeMenu.rightColumnWidth = distanceColumnWidth;

            activeMenu.labelColor = nameColorTag;
            activeMenu.selectedColor = selectedColorTag;
            activeMenu.disabledColor = unavailableColorTag;
            activeMenu.rightTextColor = distanceColorTag;

            UpdateLists();

            if (selectedVessel != null)
            {
                int idx = vesselsList.FindIndex(x => x.vessel == selectedVessel);
                activeMenu.currentSelection = idx;
            }
        }
Exemple #51
0
 protected override void InitializeMenu()
 {
     OptionsMenuPositions[] optionsButtons = (OptionsMenuPositions[])Enum.GetValues(typeof(OptionsMenuPositions));
     string[] buttons = new string[optionsButtons.Length];
     lists = new MenuList[1];
     lists[0] = new MenuList("Options", buttons);
     lists[0].SetActiveButton(0);
     tempRes = options.Resolution;
     tempDisplayMode = options.DisplayMode;
     options.DisplayModeChanged += new DisplayModeChangedEventHandler(options_DisplayModeChanged);
     options.ResolutionChanged += new ResolutionChangedEventHandler(options_ResolutionChanged);
     RecreateStrings();
 }
Exemple #52
0
 public void InitMenu()
 {
     ComboMenu = MainMenu.Add(new Menu("Xerathcombomenu", "Combo Settings: "));
     UseQCombo = ComboMenu.Add(new MenuBool("Xerathqcombo", "Use Q", true));
     QMode =
         ComboMenu.Add(new MenuList<string>("Xerathqmode", "Q Mode: ", new[] {"PREDICTION", "TARGETPOSITION"}));
     UseWCombo = ComboMenu.Add(new MenuBool("Xerathwcombo", "Use W", true));
     UseECombo = ComboMenu.Add(new MenuBool("Xerathecombo", "Use E", true));
     UseRCombo = ComboMenu.Add(new MenuBool("Xerathrcombo", "Use R", true));
     QHarass = MainMenu.Add(new MenuBool("Xerathqharass", "Use Q Harass", true));
     WHarass = MainMenu.Add(new MenuBool("Xerathwharass", "Use W Harass", false));
     EInterrupt = MainMenu.Add(new MenuBool("Xeratheinterrupt", "Use E Interrupt", true));
     EAntiGapcloser = MainMenu.Add(new MenuBool("Xerathegc", "Use E Anti-Gapcloser", true));
     MainMenu.Attach();
 }
 /// <summary>
 ///     Builds a new handler for the given <see cref="MenuList" />.
 /// </summary>
 /// <param name="component">The <see cref="MenuList" /> where this handler is responsible for.</param>
 /// <returns>The handler</returns>
 public ADrawable<MenuList> BuildListHandler(MenuList component)
 {
     return new LightList2(component);
 }
Exemple #54
0
 /// <summary>
 ///     Builds a new handler for the given <see cref="MenuList" />.
 /// </summary>
 /// <param name="component">The <see cref="MenuList" /> where this handler is responsible for.</param>
 /// <returns>The handler</returns>
 public ADrawable<MenuList> BuildListHandler(MenuList component)
 {
     return new DefaultList(component);
 }
        /// <summary>
        /// Creates a pause state which waits for the user to resume play
        /// </summary>
        /// <param name="engine">Reference to the engine running the state</param>
        /// <param name="savedState">The state of play to return to once the user unpauses</param>
        public EngineStatePause(Engine engine, EngineStateInterface savedState)
        {
            engine_ = engine;
            savedState_ = savedState;

            List<string> menuString = new List<string>();
            menuString.Add(STR_RETURN_TO_GAME);
            menuString.Add(STR_CONTROLS);
            menuString.Add(STR_GAME_OPTIONS);
            menuString.Add(STR_QUIT_GAME);
            int cursor = (int)Settings.getInstance().getMovementType();
            menuList_ = new MenuList(menuString, PAUSE_MENU_POSITION);
            menuList_.Font_ = PAUSE_FONT;
            menuList_.BaseColor_ = PAUSE_MENU_UNSELECTED_COLOR;
            menuList_.SelectedColor_ = PAUSE_MENU_SELECTED_COLOR;
            menuList_.Spacing_ = PAUSE_MENU_SPACING;
            menuList_.CursorPos_ = PAUSE_MENU_DEFAULT_SELECTED_ITEM;
        }
        public EngineStateControls(Engine engine)
        {
            InputSet inputs = InputSet.getInstance();

            controlTitle_ = "CONTROLS";
            engine_ = engine;
            List<string> gameControlsString = new List<string>();
            gameControlsString.Add("GAMEPLAY CONTROLS");
            gameControlsString.Add("Move: " + inputs.getControlName(InputsEnum.LEFT_DIRECTIONAL));
            gameControlsString.Add("Rotate: " + inputs.getControlName(InputsEnum.RIGHT_DIRECTIONAL));
            gameControlsString.Add("Fire: " + inputs.getControlName(InputsEnum.RIGHT_TRIGGER));
            gameControlsString.Add("Pause: " + inputs.getControlName(InputsEnum.CANCEL_BUTTON));

            List<string> editorControlsString = new List<string>();
            editorControlsString.Add("EDITOR CONTROLS");
            editorControlsString.Add("Move Cursor: " + inputs.getControlName(InputsEnum.LEFT_DIRECTIONAL));
            editorControlsString.Add("Next Tile: " + inputs.getControlName(InputsEnum.BUTTON_1));
            editorControlsString.Add("Prev Tile: " + inputs.getControlName(InputsEnum.BUTTON_2));
            editorControlsString.Add("Next Palette: " + inputs.getControlName(InputsEnum.LEFT_BUMPER));
            editorControlsString.Add("Prev Palette: " + inputs.getControlName(InputsEnum.RIGHT_BUMPER));
            editorControlsString.Add("Place Tile: " + inputs.getControlName(InputsEnum.RIGHT_TRIGGER));
            editorControlsString.Add("Quit: " + inputs.getControlName(InputsEnum.CANCEL_BUTTON));

            Vector2 gameControlsMenuPos =
                new Vector2(engine_.GraphicsDevice.Viewport.Width / 2.0f - 200.0f,
                            engine_.GraphicsDevice.Viewport.Height / 2.0f - 125.0f);
            gameControlsMenuList_ =
                new MenuList(gameControlsString, gameControlsMenuPos);
            gameControlsMenuList_.Font_ = CONTROLS_FONT;
            gameControlsMenuList_.BaseColor_ = CONTROLS_COLOR;
            gameControlsMenuList_.SelectedColor_ = CONTROLS_TITLE_COLOR;
            gameControlsMenuList_.Spacing_ = CONTROLS_SPACING;

            Vector2 editorControlsMenuPos =
                new Vector2(engine_.GraphicsDevice.Viewport.Width / 2.0f + 200.0f,
                            engine_.GraphicsDevice.Viewport.Height / 2.0f - 125.0f);
            editorControlsMenuList_ = new MenuList(editorControlsString, editorControlsMenuPos);
            editorControlsMenuList_.BaseColor_ = CONTROLS_COLOR;
            editorControlsMenuList_.SelectedColor_ = CONTROLS_TITLE_COLOR;
            editorControlsMenuList_.Font_ = CONTROLS_FONT;
            editorControlsMenuList_.Spacing_ = CONTROLS_SPACING;
        }
        // Vessel Menu
        private void TargetVessel(int index, TextMenu.Item ti)
        {
            if (selectedVessel == vesselsList[index].vessel)
            {
                // Already selected.  Are there ports?
                UpdatePortsList();
                if (portsList.Count > 0)
                {
                    currentMenu = MenuList.Ports;

                    activeMenu = new TextMenu();
                    activeMenu.rightColumnWidth = 8;

                    activeMenu.labelColor = nameColorTag;
                    activeMenu.selectedColor = selectedColorTag;
                    activeMenu.disabledColor = unavailableColorTag;
                    activeMenu.rightTextColor = distanceColorTag;

                    UpdateLists();

                    if (selectedPort != null)
                    {
                        int idx = portsList.FindIndex(x => x == selectedPort);
                        activeMenu.currentSelection = idx;
                    }
                }
            }
            else
            {
                vesselsList[index].SetTarget();
                selectedCelestial = null;
                selectedPort = null;

                activeMenu.SetSelected(index, true);
            }
        }
Exemple #58
0
        public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
        {
            base.Update(gameTime);

            MouseState mouseState= Mouse.GetState();

            if (mouseState.LeftButton == ButtonState.Pressed && currentItem == MenuList.mainMenu)
            {
                for (int i = 0; i < 4; i++)
                {
                    if (menuItems[i].GetRectangle.Contains(mouseState.X, mouseState.Y) == true)
                    {
                        switch (i)
                        {
                            case 0: currentItem = MenuList.newGame; break;
                            case 2: currentItem = MenuList.authors; break;
                            case 3: game.Exit(); break;
                        }
                    }
                }
            }

            if (mouseState.LeftButton == ButtonState.Pressed && currentItem == MenuList.authors)
            {
                if (backButton.GetRectangle.Contains(mouseState.X, mouseState.Y) == true)
                {
                     currentItem = MenuList.mainMenu;
                }
            }

            foreach (var item in menuItems)
            {
                Rectangle buff = item.GetRectangle;
                if (buff.Contains(mouseState.X, mouseState.Y) == true && item.mouseOver == false)
                {
                    item.Transform(0);
                }
                buff.Y -= 5;
                if (!buff.Contains(mouseState.X, mouseState.Y) == true && item.mouseOver == true)
                {
                    item.Transform(1);
                }
            }

            Rectangle buff2 = backButton.GetRectangle;
            if (buff2.Contains(mouseState.X, mouseState.Y) == true && backButton.mouseOver == false)
            {
                backButton.Transform(0);
            }
            buff2.X -= 5;
            if (!buff2.Contains(mouseState.X, mouseState.Y) == true && backButton.mouseOver == true)
            {
                backButton.Transform(1);
            }

            if (currentItem == MenuList.newGame)
            {
                this.newGame.Playing = true;
            }

            modelRotation += 0.002f;
        }
        private void ShowReferenceMenu(int index, TextMenu.Item ti)
        {
            currentMenu = MenuList.Reference;

            activeMenu = new TextMenu();

            activeMenu.labelColor = nameColorTag;
            activeMenu.selectedColor = selectedColorTag;
            activeMenu.disabledColor = unavailableColorTag;
            activeMenu.rightTextColor = distanceColorTag;

            UpdateLists();

            activeMenu.currentSelection = referencePoints.FindIndex(x => x.part == vessel.GetReferenceTransformPart());
        }
        private void ShowUndockMenu(int index, TextMenu.Item ti)
        {
            currentMenu = MenuList.Undock;

            activeMenu = new TextMenu();

            activeMenu.labelColor = nameColorTag;
            activeMenu.selectedColor = selectedColorTag;
            activeMenu.disabledColor = unavailableColorTag;
            activeMenu.rightTextColor = distanceColorTag;
            UpdateLists();
        }