コード例 #1
0
ファイル: RPGUI.cs プロジェクト: jonnelfernandez/GTARPG
        public static void FormatMenu(MenuBase menu)
        {
            menu.HeaderFont = 0;
             menu.ItemFont = 0;
             menu.HeaderColor = Color.FromArgb(140,6,6,6);
             menu.HeaderTextColor = Color.White;
             menu.SelectedItemColor = Color.White;
             menu.SelectedTextColor = Color.Black;
             menu.UnselectedItemColor = Color.FromArgb(120, 8, 8, 8);
             menu.UnselectedTextColor = Color.White;
             menu.HeaderCentered = false;
             menu.ItemTextCentered = false;
             menu.ItemTextScale = 0.36f;
             menu.HeaderTextScale = 0.4f;

             var m = menu as Menu;
             if(m != null)
             {
                 m.ItemHeight = 25;
                 m.HeaderHeight = 28;
                 m.HasFooter = false;
                 m.Width = 300;
                 m.TextOffset = new Point(4,0);
                 m.HeaderHeight = 0;
             }

             var mb = menu as MessageBox;
             if(mb != null)
             {
                 mb.Width = 300;
                 mb.TextOffset = new Point(4, 0);
             }
        }
コード例 #2
0
ファイル: SubMenuBase.cs プロジェクト: Epervier/SIne
    public virtual void Initialize(MenuBase parent)
    {
        m_pParent = parent;

        MenuButton[] buttons = gameObject.GetComponentsInChildren<MenuButton>();
        for (int i = 0; i < buttons.Length; i++) {
            buttons[i].Initialize(ButtonClicked);
        }
    }
コード例 #3
0
ファイル: SpeedLimitScreen.cs プロジェクト: temur03/imBMW
 public override bool OnNavigatedFrom(MenuBase menu)
 {
     if (base.OnNavigatedFrom(menu))
     {
         InstrumentClusterElectronics.SpeedLimitChanged -= InstrumentClusterElectronics_SpeedLimitChanged;
         return true;
     }
     return false;
 }
コード例 #4
0
ファイル: SpeedLimitScreen.cs プロジェクト: temur03/imBMW
 public override bool OnNavigatedTo(MenuBase menu)
 {
     if (base.OnNavigatedTo(menu))
     {
         InstrumentClusterElectronics.SpeedLimitChanged += InstrumentClusterElectronics_SpeedLimitChanged;
         UpdateLimit();
         return true;
     }
     return false;
 }
コード例 #5
0
 public override bool OnNavigatedFrom(MenuBase menu)
 {
     if (base.OnNavigatedFrom(menu))
     {
         DigitalDieselElectronics.MessageReceived -= DigitalDieselElectronics_MessageReceived;
         //if (refreshTimer != null)
         //{
         //    refreshTimer.Dispose();
         //    refreshTimer = null;
         //}
         return(true);
     }
     return(false);
 }
コード例 #6
0
 public override bool OnNavigatedTo(MenuBase menu)
 {
     if (base.OnNavigatedTo(menu))
     {
         DigitalDieselElectronics.MessageReceived += DigitalDieselElectronics_MessageReceived;
         //refreshRate = 1000;
         //refreshTimer = new Timer(delegate
         //{
         //    DBusManager.Instance.EnqueueMessage(DigitalDieselElectronics.QueryMessage);
         //}, null, 500, refreshRate);
         return(true);
     }
     return(false);
 }
コード例 #7
0
ファイル: SliderView.cs プロジェクト: tyljeff9408/Ensage.SDK
        public override void Draw(MenuBase context)
        {
            var item = (MenuItemEntry)context;

            var pos  = context.Position;
            var size = context.RenderSize;

            var activeStyle = context.MenuConfig.GeneralConfig.ActiveStyle.Value;
            var styleConfig = activeStyle.StyleConfig;
            var border      = styleConfig.Border;

            context.Renderer.DrawTexture(activeStyle.Item, new RectangleF(pos.X, pos.Y, size.X, size.Y));

            pos += new Vector2(border.Thickness[0], border.Thickness[1]);
            var font = styleConfig.Font;

            context.Renderer.DrawText(pos, context.Name, styleConfig.Font.Color, font.Size, font.Family);

            var propValue = item.ValueBinding.GetValue <ISlider>();

            var rightSide = (context.Position.X + size.X) - border.Thickness[2];

            pos.X = rightSide - item.ValueSize.X - styleConfig.TextSpacing;

            var rect = new RectangleF();

            rect.X      = pos.X;
            rect.Y      = pos.Y;
            rect.Right  = rightSide;
            rect.Bottom = context.Position.Y + size.Y;
            context.Renderer.DrawText(rect, propValue.ToString(), styleConfig.Font.Color, RendererFontFlags.Right, font.Size, font.Family);
            pos = context.Position;

            switch (propValue)
            {
            case ISlider <int> intSlider:
                pos.X += ((float)(intSlider.Value - intSlider.MinValue) / (intSlider.MaxValue - intSlider.MinValue)) * size.X;
                break;

            case ISlider <float> floatSlider:
                pos.X += ((floatSlider.Value - floatSlider.MinValue) / (floatSlider.MaxValue - floatSlider.MinValue)) * size.X;
                break;

            case ISlider <double> doubleSlider:
                pos.X += (float)((doubleSlider.Value - doubleSlider.MinValue) / (doubleSlider.MaxValue - doubleSlider.MinValue)) * size.X;
                break;
            }

            context.Renderer.DrawLine(pos, pos + new Vector2(0, size.Y), styleConfig.Slider.LineColor, styleConfig.Slider.LineWidth);
        }
コード例 #8
0
    public override void update(MenuBase m)
    {
        data.menu  = m;
        data.tarIP = ipNumber;

        foreach (Button b in buttons)
        {
            b.calculate(data);
        }
        if (Connections.GetInstance().isConnected)
        {
            m.setCurrent(MenuStates.LOBBY_CONNECTED);
        }
    }
コード例 #9
0
        public override Vector2 GetSize(MenuBase context)
        {
            var totalSize   = base.GetSize(context);
            var styleConfig = context.MenuConfig.GeneralConfig.ActiveStyle.Value.StyleConfig;

            var item = (MenuItemEntry)context;
            var font = styleConfig.Font;

            // get size of longest possible hotkey
            item.ValueSize = context.Renderer.MessureText(MouseButtons.XButton2Down.ToString(), font.Size, font.Family);
            totalSize.X   += styleConfig.TextSpacing + 10 + item.ValueSize.X + 10;

            return(totalSize);
        }
コード例 #10
0
    public void AddButton(MenuBase menu, string label)
    {
        var instance = UIUtility.Add <UIMenuButton>(transform, Prototype.gameObject);

        instance.Label    = label;
        instance.Pressed += Button_Pressed;

        if (_current == null)
        {
            _current = instance;
        }

        _buttons.Add(instance, menu);
    }
コード例 #11
0
ファイル: MenuManager.cs プロジェクト: Cesea/Sweeper
    public void CloseMenu(MenuBase menu)
    {
        if (_menuStack.Count == 0)
        {
            Debug.Log("MenuStack is empty");
            return;
        }

        if (_menuStack.Peek() != menu)
        {
            Debug.LogErrorFormat(menu, "{0} cannot be closed because it is not on top of stack", menu.GetType());
        }

        CloseTopMenu();
    }
コード例 #12
0
        public override Vector2 GetSize(MenuBase context)
        {
            var totalSize   = base.GetSize(context);
            var styleConfig = context.MenuConfig.GeneralConfig.ActiveStyle.Value.StyleConfig;

            var item      = (MenuItemEntry)context;
            var propValue = item.ValueBinding.GetValue <ISlider <Vector2> >();

            var font = styleConfig.Font;

            item.ValueSize = context.Renderer.MessureText($"<{(int)propValue.MaxValue.X}, {(int)propValue.MaxValue.Y}>", font.Size, font.Family);
            totalSize.X   += styleConfig.TextSpacing + item.ValueSize.X;

            return(totalSize);
        }
コード例 #13
0
ファイル: MusicListScreen.cs プロジェクト: OlegPalchyk/imBMW
        public override bool OnNavigatedTo(MenuBase menu)
        {
            if (base.OnNavigatedTo(menu))
            {
                if (VolumeInfo.GetVolumes().Length > 0 && VolumeInfo.GetVolumes()[0].IsFormatted)
                {
                    InitFilesEnumerator();

                    GeneratePage();
                }

                return(true);
            }
            return(false);
        }
コード例 #14
0
 public override bool OnNavigatedFrom(MenuBase menu)
 {
     if (base.OnNavigatedFrom(menu))
     {
         BodyModule.BatteryVoltageChanged                 -= BodyModule_BatteryVoltageChanged;
         InstrumentClusterElectronics.SpeedRPMChanged     -= InstrumentClusterElectronics_SpeedRPMChanged;
         InstrumentClusterElectronics.TemperatureChanged  -= InstrumentClusterElectronics_TemperatureChanged;
         InstrumentClusterElectronics.AverageSpeedChanged -= InstrumentClusterElectronics_AverageSpeedChanged;
         InstrumentClusterElectronics.Consumption1Changed -= InstrumentClusterElectronics_Consumption1Changed;
         InstrumentClusterElectronics.Consumption2Changed -= InstrumentClusterElectronics_Consumption2Changed;
         InstrumentClusterElectronics.RangeChanged        -= InstrumentClusterElectronics_RangeChanged;
         InstrumentClusterElectronics.SpeedLimitChanged   -= InstrumentClusterElectronics_SpeedLimitChanged;
         return(true);
     }
     return(false);
 }
コード例 #15
0
        public override bool OnNavigatedFrom(MenuBase menu)
        {
            if (base.OnNavigatedFrom(menu))
            {
                ClearItems();

                NavigationModule.BatteryVoltageChanged -= NavigationModule_BatteryVoltageChanged;
                IntegratedHeatingAndAirConditioning.AirConditioningCompressorStatusChanged -= IntegratedHeatingAndAirConditioning_AirConditioningCompressorStatusChanged;

                //HeadlightVerticalAimControl.FrontSensorVoltageChanged -= HeadlightVerticalAimControl_SensorsVoltageChanged;
                //HeadlightVerticalAimControl.RearSensorVoltageChanged -= HeadlightVerticalAimControl_SensorsVoltageChanged;
                //DigitalDieselElectronics.MessageReceived -= DigitalDieselElectronics_MessageReceived;
                return(true);
            }
            return(false);
        }
コード例 #16
0
ファイル: MenuUI.cs プロジェクト: slient13/CapstoneDesign
    // Start is called before the first frame update
    void Start()
    {
        playerUI     = transform.GetChild(6).gameObject;
        menuBase     = new MenuBase(this, transform.GetChild(2).gameObject);
        confirmSave  = new ConfirmSave(this, transform.GetChild(4).gameObject);
        confirmClose = new ConfirmClose(this, transform.GetChild(3).gameObject);
        optionMenu   = new OptionMenu(this, transform.GetChild(5).gameObject);
        menuBase.lootPanel.SetActive(false);
        confirmSave.lootPanel.SetActive(false);
        confirmClose.lootPanel.SetActive(false);
        optionMenu.lootPanel.SetActive(false);
        // 레이어용.
        MappingInfo mapping = new MappingInfo("MenuUI");

        mapping.Enroll("MenuUI");
    }
コード例 #17
0
        public override bool OnClick(MenuBase context, MouseButtons buttons, Vector2 clickPosition)
        {
            if ((buttons & MouseButtons.LeftUp) == MouseButtons.LeftUp)
            {
                var state = this.GetItemUnderMouse(context, clickPosition);
                if (state.HasValue)
                {
                    var item      = (MenuItemEntry)context;
                    var propValue = item.ValueBinding.GetValue <ImageToggler>();
                    propValue.PictureStates[state.Value.Key] = !state.Value.Value;
                    return(true);
                }
            }

            return(false);
        }
コード例 #18
0
        public override Vector2 GetSize(MenuBase context)
        {
            var totalSize   = base.GetSize(context);
            var styleConfig = context.MenuConfig.GeneralConfig.ActiveStyle.Value.StyleConfig;

            totalSize.X += styleConfig.TextSpacing + styleConfig.ArrowSize.X + (styleConfig.TextSpacing * 2);
            totalSize.Y  = Math.Max(Math.Max(totalSize.Y, styleConfig.ArrowSize.Y), styleConfig.PicturePicker.PictureSize.Y);

            var item               = (MenuItemEntry)context;
            var propValue          = item.ValueBinding.GetValue <ImageToggler>();
            var picturePickerStyle = styleConfig.PicturePicker;

            totalSize.X += propValue.PictureStates.Count * (styleConfig.PicturePicker.PictureSize.X + (2 * picturePickerStyle.LineWidth));

            return(totalSize);
        }
コード例 #19
0
 public override bool OnNavigatedFrom(MenuBase menu)
 {
     if (base.OnNavigatedFrom(menu))
     {
         BodyModule.BatteryVoltageChanged -= BodyModule_BatteryVoltageChanged;
         InstrumentClusterElectronics.SpeedRPMChanged -= InstrumentClusterElectronics_SpeedRPMChanged;
         InstrumentClusterElectronics.TemperatureChanged -= InstrumentClusterElectronics_TemperatureChanged;
         InstrumentClusterElectronics.AverageSpeedChanged -= InstrumentClusterElectronics_AverageSpeedChanged;
         InstrumentClusterElectronics.Consumption1Changed -= InstrumentClusterElectronics_Consumption1Changed;
         InstrumentClusterElectronics.Consumption2Changed -= InstrumentClusterElectronics_Consumption2Changed;
         InstrumentClusterElectronics.RangeChanged -= InstrumentClusterElectronics_RangeChanged;
         InstrumentClusterElectronics.SpeedLimitChanged -= InstrumentClusterElectronics_SpeedLimitChanged;
         return true;
     }
     return false;
 }
コード例 #20
0
    public void OnRightButtonPressed()
    {
        this.m_SelectionIdx++;
        if (this.m_Cyclic && this.m_SelectionIdx >= this.m_Options.Count)
        {
            this.m_SelectionIdx = 0;
        }
        this.m_SelectionIdx = Mathf.Clamp(this.m_SelectionIdx, 0, this.m_Options.Count - 1);
        this.UpdateEverything();
        MenuBase target = this.m_Target;

        if (target != null)
        {
            target.OnSelectionChanged(this, this.m_Options.Keys.ElementAt(this.m_SelectionIdx));
        }
        this.PlaySound();
    }
コード例 #21
0
ファイル: RPGUI.cs プロジェクト: tuita520/GTARPG
        public static void FormatMenuFooter(MenuBase menu)
        {
            var m = menu as Menu;

            if (m != null)
            {
                m.HasFooter    = true;
                m.FooterHeight = 25;
            }

            menu.FooterCentered  = true;
            menu.FooterColor     = Color.FromArgb(120, 25, 25, 25);
            menu.FooterFont      = 0;
            menu.FooterCentered  = false;
            menu.FooterTextColor = Color.White;
            menu.FooterTextScale = 0.25f;
        }
コード例 #22
0
        public override Vector2 GetSize(MenuBase context)
        {
            var totalSize   = base.GetSize(context);
            var styleConfig = context.MenuConfig.GeneralConfig.ActiveStyle.Value.StyleConfig;

            totalSize.X += styleConfig.TextSpacing + (styleConfig.ArrowSize.X * 2); // TODO: use own bool view style options
            totalSize.Y  = Math.Max(totalSize.Y, styleConfig.ArrowSize.Y);          // border missing for y

            if (!string.IsNullOrEmpty(context.TextureKey))
            {
                var textureSize = context.Renderer.GetTextureSize(context.TextureKey);
                var scale       = totalSize.Y / textureSize.Y;
                totalSize.X += styleConfig.TextSpacing + (textureSize.X * scale);
            }

            return(totalSize);
        }
コード例 #23
0
        public void UpdateMenu() //更新预设体实例
        {
            if (obj == null)
            {
                return;
            }
            MenuBase iMenu = obj.GetComponent <MenuBase>();

            if (iMenu != null)
            {
                iMenu.UpdateMenu();
            }
            else
            {
                Debug.LogWarningFormat("not found IMenu componet.({0})", obj);
            }
        }
コード例 #24
0
ファイル: MenuBase.cs プロジェクト: alexander-smoktal/wereman
    public void Open(MenuBase _prevMenu = null)
    {
        Debug.Assert(m_PrevMenu == null, "The menu (" + gameObject.name + ") is already opened");

        if (m_PrevMenu != null)
        {
            return;
        }

        if (_prevMenu)
        {
            _prevMenu.Hide();
        }

        m_PrevMenu = _prevMenu;

        Show();
    }
コード例 #25
0
    // Use this for initialization
    void Start()
    {
        if (!Menu)
        {
            Menu = GetComponent <MenuBase>();
            if (!Menu)
            {
                print("I need a menu");
                return;
            }
        }

        for (int i = 0; i < InitialItems; i++)
        {
            Menu.AddToEnd(currentIndex.ToString());
            currentIndex++;
        }
    }
コード例 #26
0
ファイル: Menu.cs プロジェクト: Trainfire/SubtreeTesting
    public void SetMenu(MenuBase menu)
    {
        if (!_menuInput.InputEnabled)
        {
            return;
        }

        if (_menus.Contains(menu) && CurrentMenu != null && menu != CurrentMenu)
        {
            _menuButtons.Select(menu);
            _menuInput.InputEnabled = false;
            _menuTransitionAnimation.Transition(CurrentMenu, menu, (newMenu) =>
            {
                CurrentMenu             = newMenu;
                _menuInput.InputEnabled = true;
            });
        }
    }
コード例 #27
0
    public void SwitchToMenu(MenuBase baseMenu, bool playEffect = true)
    {
        if (NextMenu != null && NextMenu.Item1 != null)
        {
            Debug.LogWarningFormat
            (
                "Changed menu twice in this frame! From '{0}' to '{1}' and now to '{2}'",
                CurrentMenu, NextMenu.Item1, baseMenu
            );
        }

        if (Verbose)
        {
            Debug.LogFormat("{0}: Switch from '{1}' to '{2}'", this, CurrentMenu, baseMenu);
        }

        NextMenu = new Tuple <MenuBase, bool>(baseMenu, playEffect);
    }
コード例 #28
0
ファイル: MenuManager.cs プロジェクト: savik-games/Cave
    public void Show(MenuBase menu, bool hidePrev = true)
    {
        if (currMenu.Count > 0)
        {
            if (hidePrev)
            {
                currMenu.Pop().Hide(false);
            }
            else
            {
                currMenu.Peek().SaveLastButton();
                currMenu.Peek().DisableAllSelectable();
            }
        }

        currMenu.Push(menu);
        menu.Show(false);
    }
コード例 #29
0
ファイル: MenuManager.cs プロジェクト: Team-on/DTF-hackathon
    void Start()
    {
        currMenu = Menus[FirstMenuId];

        foreach (var menu in Menus)
        {
            if (menu != currMenu)
            {
                menu.Hide();
            }
            else
            {
                menu.Show();
            }

            menu.MenuManager = this;
        }
    }
コード例 #30
0
        public bool CheckBackMenuAvailable() //检查是否激活
        {
            if (obj == null)
            {
                return(true);
            }
            MenuBase iMenu = obj.GetComponent <MenuBase>();

            if (iMenu != null)
            {
                return(iMenu.CheckBackMenuAvailable());
            }
            else
            {
                Debug.LogWarningFormat("not found IMenu componet.({0})", obj);
            }
            return(true);
        }
コード例 #31
0
        public MenuBase Create(MenuData data, MenuBase parent)
        {
            var _mTypes = Assembly.GetExecutingAssembly().GetTypes().Where(
                t => {
                return(t != typeof(MenuBase) && typeof(MenuBase).IsAssignableFrom(t));
            }
                );

            foreach (var _mType in _mTypes)
            {
                if (_TypeReg.Match(_mType.ToString()).Value == "M" + data.Type.ToString())
                {
                    return((MenuBase)Activator.CreateInstance(_mType, data, parent));
                }
            }

            return(null);
        }
コード例 #32
0
        public override void Draw(MenuBase context)
        {
            var item = (MenuItemEntry)context;

            var pos  = context.Position;
            var size = context.RenderSize;

            var activeStyle = context.MenuConfig.GeneralConfig.ActiveStyle.Value;
            var styleConfig = activeStyle.StyleConfig;
            var border      = styleConfig.Border;

            context.Renderer.DrawTexture(activeStyle.Item, new RectangleF(pos.X, pos.Y, size.X, size.Y));

            var sliderPos = Vector2.Zero;

            sliderPos.X = (pos.X + size.X) - border.Thickness[2] - (styleConfig.ArrowSize.X * 2);
            sliderPos.Y = pos.Y + border.Thickness[1];
            context.Renderer.DrawTexture(activeStyle.Slider, new RectangleF(sliderPos.X, sliderPos.Y, styleConfig.ArrowSize.X * 2, styleConfig.ArrowSize.Y));

            pos += new Vector2(border.Thickness[0] + styleConfig.LineWidth, border.Thickness[1]);
            if (!string.IsNullOrEmpty(context.TextureKey))
            {
                var textureSize = context.Renderer.GetTextureSize(context.TextureKey);
                var scale       = (size.Y - border.Thickness[1] - border.Thickness[3]) / textureSize.Y;
                textureSize *= scale;
                context.Renderer.DrawTexture(context.TextureKey, new RectangleF(pos.X, pos.Y, textureSize.X, textureSize.Y));
                pos.X += textureSize.X + styleConfig.TextSpacing;
            }

            var font = styleConfig.Font;

            context.Renderer.DrawText(pos, context.Name, font.Color, font.Size, font.Family);

            if (item.ValueBinding.GetValue <bool>())
            {
                sliderPos.X += styleConfig.ArrowSize.X;
                context.Renderer.DrawTexture(activeStyle.Checked, new RectangleF(sliderPos.X, sliderPos.Y, styleConfig.ArrowSize.X, styleConfig.ArrowSize.Y));
            }
            else
            {
                context.Renderer.DrawTexture(activeStyle.Unchecked, new RectangleF(sliderPos.X, sliderPos.Y, styleConfig.ArrowSize.X, styleConfig.ArrowSize.Y));
            }
        }
コード例 #33
0
    public void Transition(MenuBase from, MenuBase to, Action <MenuBase> onComplete)
    {
        _out = from;
        _in  = to;

        _in.SetVisibility(true);

        _outCanvas = from.gameObject.GetOrAddComponent <CanvasGroup>();
        _inCanvas  = to.gameObject.GetOrAddComponent <CanvasGroup>();

        _onComplete = onComplete;

        _tweenAlphaIn.Duration  = TransitionTime;
        _tweenAlphaOut.Duration = TransitionTime;
        _tweenAlphaIn.Play();
        _tweenAlphaOut.Play();

        _transitioning = true;
    }
コード例 #34
0
ファイル: MList.cs プロジェクト: JacKAsterisK/GavinCardGame
        public MList(MenuData data, MenuBase parent) : base(data, parent)
        {
            ItemHeight  = FloatFromString(data.GetDataProperty("ItemHeight").ToString(), false);
            ItemSpacing = FloatFromString(data.GetDataProperty("ItemSpacing").ToString(), false);

            ListItems = new List <MListItem>();
            for (int _index = 0; _index < Items.Count; _index++)
            {
                var _item = Items[_index];

                if (_item is MListItem)
                {
                    var _listItem = (MListItem)_item;
                    _listItem.Depth = Depth;
                    _listItem.SetList(this, _index);
                    ListItems.Add(_listItem);
                }
            }
        }
コード例 #35
0
ファイル: ShapeViewBase.cs プロジェクト: denis554/Edi-1
 /// <summary>
 /// Add standard application Cut, Copy, Paste, and Deleete menu entries.
 /// </summary>
 /// <param name="menu"></param>
 protected void AddCopyCutPasteMenuItems(MenuBase menu)
 {
     menu.Items.Add(new MenuItem()
     {
         Command = ApplicationCommands.Cut, Icon = IconImageFactory.Get(IconCommand.Cut)
     });
     menu.Items.Add(new MenuItem()
     {
         Command = ApplicationCommands.Copy, Icon = IconImageFactory.Get(IconCommand.Copy)
     });
     menu.Items.Add(new MenuItem()
     {
         Command = ApplicationCommands.Paste, Icon = IconImageFactory.Get(IconCommand.Paste)
     });
     menu.Items.Add(new MenuItem()
     {
         Command = ApplicationCommands.Delete, Icon = IconImageFactory.Get(IconCommand.Delete)
     });
 }
コード例 #36
0
ファイル: MenuSystem.cs プロジェクト: Epervier/Sunday
	private void TransitionEnd()
	{
		if( nNextMenu >= 0 )
		{
			SetInput(false);
			MenuBase result = null;
			if( m_pMenus.TryGetValue(nNextMenu, out result) == true)
			{
				result.SetState(true, TransitionEnd);
				m_pCurrentMenu = result;
				
				m_pMenuList.Push(nNextMenu);
			}
			nNextMenu = -1;
		}
		else
		{
			SetInput(true);
		}
	}
コード例 #37
0
        internal static LUCAMenuStrip FindLUCAMenuStrip(MenuBase source)
        {
            if (source is LUCAMenuStrip)
            {
                return source as LUCAMenuStrip;
            }

            if (source.ParentMenuElement != null)
            {
                return FindLUCAMenuStrip(source.ParentMenuElement);
            }

            return null;
        }
コード例 #38
0
ファイル: MenuSystem.cs プロジェクト: Epervier/Sunday
	public void OpenMenuWithHeirarchy(MenuDefinitions.Menus[] menuList)
	{
		if( m_pCurrentMenu != null)
			m_pCurrentMenu.SetState(false);
		
		m_pCurrentMenu = null;
		m_pMenuList.Clear();
		
		for (int i = 0; i < menuList.Length; i++) {
			m_pMenuList.Push( (int)menuList[i] );
		}
		
		OpenMenu( (MenuDefinitions.Menus)m_pMenuList.Peek() );
	}
コード例 #39
0
 private void OnChangeMenuRequest(object s, MenuBase sm)
 {
     ChangeMenuRequestEvent?.Invoke(s, sm);
 }
コード例 #40
0
 public void Draw(MenuBase menuBase)
 {
     menuBase.ScreenManager.SpriteBatch.Draw(backgroundComponent.Background, new Vector2((int)Position.X, (int)Position.Y), backgroundComponent.Color);
     menuBase.ScreenManager.SpriteBatch.DrawString(SpriteFontHelper.GetMenuItemFont(menuBase.ScreenManager.Content), text, GetTextPosition(menuBase.ScreenManager.Content), ColorHelper.White);
 }
コード例 #41
0
ファイル: CharCreationNew.cs プロジェクト: logicspawn/GTARPG
 private bool IsOpen(MenuBase menu)
 {
     var items = (List<MenuBase>)typeof(Viewport).GetField("mMenuStack", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(View);
     return items.Contains(menu);
 }
コード例 #42
0
 /// <summary>
 /// Closes all menus currently open from the LUCAMenuStrip that the given source MenuBase is associated with.
 /// </summary>
 /// <param name="source"></param>
 internal static void ResetLUCAMenuStrip(MenuBase source)
 {
     var LUCAMenuStrip = FindLUCAMenuStrip(source);
     LUCAMenuStrip._hoverShow = false;
     LUCAMenuStrip.HideAllMenus();
 }
コード例 #43
0
ファイル: RPGUI.cs プロジェクト: jonnelfernandez/GTARPG
        public static void FormatMenuFooter(MenuBase menu)
        {
            var m = menu as Menu;
            if (m != null)
            {
                m.HasFooter = true;
                m.FooterHeight = 25;
            }

            menu.FooterCentered = true;
            menu.FooterColor = Color.FromArgb(120, 25, 25, 25);
            menu.FooterFont = 0;
            menu.FooterCentered = false;
            menu.FooterTextColor = Color.White;
            menu.FooterTextScale = 0.25f;
        }
コード例 #44
0
ファイル: RPGUI.cs プロジェクト: jonnelfernandez/GTARPG
 public static void FormatMenuWithFooter(MenuBase menuBase)
 {
     FormatMenu(menuBase);
     FormatMenuFooter(menuBase);
 }