예제 #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        internal void UpdateAfterInput(IInputMenu pInputMenu, ICursorState[] pCursors)
        {
            vCurrentCursors = pCursors;

            IsInputAvailable = pInputMenu.IsAvailable;
            IsOnLeftSide     = pInputMenu.IsLeft;
            Center           = pInputMenu.Position;
            Rotation         = pInputMenu.Rotation;
            Size             = pInputMenu.Radius;
            DisplayStrength  = pInputMenu.DisplayStrength;
            NavBackStrength  = pInputMenu.NavigateBackStrength;

            CheckNavigateBackAction(pInputMenu);

            foreach (BaseItemState item in vAllItems)
            {
                item.UpdateBeforeCursors();
            }

            foreach (ICursorState cursor in vCurrentCursors)
            {
                UpdateWithCursor(cursor);
            }

            foreach (BaseItemState item in vAllItems)
            {
                if (item.UpdateSelectionProcess()) //returns true if selection occurred
                {
                    break;                         //exit loop, since the items list changes after a selection
                }
            }
        }
        /*--------------------------------------------------------------------------------------------*/
        public void UpdateAfterInput()
        {
            var        isMenuOnLeft = vInteractSettings.IsMenuOnLeftSide;
            IInputMenu inputMenu    = vInput.GetMenu(isMenuOnLeft);

            IDictionary <HovercastCursorType, CursorType> convertMap =
                (vInteractSettings.IsMenuOnLeftSide ? vRightCursorConvertMap : vLeftCursorConvertMap);

            ActiveCursorTypes = vInteractSettings.Cursors
                                .Select(x => convertMap[x])
                                .ToArray();

            vActiveCursorInteractions = FullMenu.GetItems()
                                        .Cast <IBaseItemInteractionState>()
                                        .ToArray();

            ICursorState[] cursors = ActiveCursorTypes
                                     .Select(x => vHovercursorSetup.State.GetCursorState(x))
                                     .ToArray();

            FullMenu.UpdateAfterInput(inputMenu, cursors);

            if (isMenuOnLeft != vCurrIsMenuOnLeftSide)
            {
                vCurrIsMenuOnLeftSide = isMenuOnLeft;
                FullMenu.ResetAllItemCursorInteractions();
                OnSideChange();
            }
        }
예제 #3
0
		/*--------------------------------------------------------------------------------------------*/
		public void UpdateAfterInput() {
			var isMenuOnLeft = vInteractSettings.IsMenuOnLeftSide;
			IInputMenu inputMenu = vInput.GetMenu(isMenuOnLeft);
			HovercastCursorType[] cursorTypes = vInteractSettings.Cursors;
			ReadOnlyCollection<BaseItemState> items = FullMenu.GetItems();

			Dictionary<HovercastCursorType, CursorType> convertMap = 
				(vInteractSettings.IsMenuOnLeftSide ? vRightCursorConvertMap : vLeftCursorConvertMap);

			vActiveCursorTypes.Clear();
			vActiveCursorInteractions.Clear();
			FullMenu.ClearCursors();

			foreach ( HovercastCursorType unsidedCursorType in cursorTypes ) {
				CursorType cursorType = convertMap[unsidedCursorType];
				ICursorState cursor = vHovercursorSetup.State.GetCursorState(cursorType);

				vActiveCursorTypes.Add(cursorType);
				FullMenu.AddCursor(cursor);
			}

			for ( int i = 0 ; i < items.Count ; i++ ) {
				vActiveCursorInteractions.Add(items[i]);
			}

			FullMenu.UpdateAfterInput(inputMenu);

			if ( isMenuOnLeft != vCurrIsMenuOnLeftSide ) {
				vCurrIsMenuOnLeftSide = isMenuOnLeft;
				FullMenu.ResetAllItemCursorInteractions();
				OnSideChange();
			}
		}
예제 #4
0
 private void CheckInputs(IInputMenu keys)
 {
     keys.ReadInput();
     if (keys.Esc && currGameState == GameLoop.Play)
     {
         currGameState = GameLoop.Pause;
     }
 }
예제 #5
0
		////////////////////////////////////////////////////////////////////////////////////////////////
		/*--------------------------------------------------------------------------------------------*/
		internal void UpdateAfterInput(IInputMenu pInputMenu) {
			IsInputAvailable = pInputMenu.IsAvailable;
			IsLeft = pInputMenu.IsLeft;
			Center = pInputMenu.Position;
			Rotation = pInputMenu.Rotation;
			Size = pInputMenu.Radius;
			DisplayStrength = pInputMenu.DisplayStrength;
			NavBackStrength = pInputMenu.NavigateBackStrength;

			CheckGrabGesture(pInputMenu);
		}
예제 #6
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        internal void UpdateAfterInput(IInputMenu pInputMenu)
        {
            IsActive        = pInputMenu.IsActive;
            IsLeft          = pInputMenu.IsLeft;
            Center          = pInputMenu.Position;
            Rotation        = pInputMenu.Rotation;
            Size            = pInputMenu.Radius;
            DisplayStrength = pInputMenu.DisplayStrength;
            NavBackStrength = pInputMenu.NavigateBackStrength;

            CheckGrabGesture(pInputMenu);
        }
        public AShowMenu(Dictionary <TextTypes, SpriteFont> spriteFonts, IInputMenu inputMenu, Vector2 position, List <string> text)
        {
            Input = inputMenu;
            spriteFonts.TryGetValue(TextTypes.Title, out this.title);
            spriteFonts.TryGetValue(TextTypes.Normal, out this.normal);
            spriteFonts.TryGetValue(TextTypes.Hint, out this.hint);
            spriteFonts.TryGetValue(TextTypes.Arrow, out this.arrow);
            this.position = new Vector2(32 * position.X, 32 * position.Y);

            this.text = text;

            cursor = new Cursor(new Vector2(this.position.X - 10, this.position.Y + 50), text.Count - 2, this.arrow, this.text[text.Count - 1]);
        }
예제 #8
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        private void CheckGrabGesture(IInputMenu pInputMenu)
        {
            if (pInputMenu == null)
            {
                vIsGrabbing = false;
                return;
            }

            if (vIsGrabbing && pInputMenu.NavigateBackStrength <= 0)
            {
                vIsGrabbing = false;
                return;
            }

            if (!vIsGrabbing && pInputMenu.NavigateBackStrength >= 1)
            {
                vIsGrabbing = true;
                vNavProv.Back();
                return;
            }
        }
예제 #9
0
        /*--------------------------------------------------------------------------------------------*/
        private void CheckNavigateBackAction(IInputMenu pInputMenu)
        {
            if (pInputMenu == null)
            {
                vIsNavigateBackStarted = false;
                return;
            }

            if (vIsNavigateBackStarted && pInputMenu.NavigateBackStrength <= 0)
            {
                vIsNavigateBackStarted = false;
                return;
            }

            if (vIsNavigateBackStarted || pInputMenu.NavigateBackStrength < 1)
            {
                return;
            }

            vIsNavigateBackStarted = true;
            vItemHierarchy.Back();
        }
예제 #10
0
        /*--------------------------------------------------------------------------------------------*/
        private void CheckGrabGesture(IInputMenu pInputMenu)
        {
            if (pInputMenu == null)
            {
                vIsGrabbing = false;
                return;
            }

            if (vIsGrabbing && pInputMenu.NavigateBackStrength <= 0)
            {
                vIsGrabbing = false;
                return;
            }

            if (vIsGrabbing || pInputMenu.NavigateBackStrength < 1)
            {
                return;
            }

            vIsGrabbing = true;
            vItemHierarchy.Back();
        }
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 public void SetOppositeHandMenu(IInputMenu pMenu)
 {
     vCursor.SetOppositeHandMenu(pMenu);
 }
예제 #12
0
		////////////////////////////////////////////////////////////////////////////////////////////////
		/*--------------------------------------------------------------------------------------------*/
		private void CheckGrabGesture(IInputMenu pInputMenu) {
			if ( pInputMenu == null ) {
				vIsGrabbing = false;
				return;
			}

			if ( vIsGrabbing && pInputMenu.NavigateBackStrength <= 0 ) {
				vIsGrabbing = false;
				return;
			}

			if ( !vIsGrabbing && pInputMenu.NavigateBackStrength >= 1 ) {
				vIsGrabbing = true;
				vNavRoot.Back();
				return;
			}
		}
        /*--------------------------------------------------------------------------------------------*/
        private void CheckNavigateBackAction(IInputMenu pInputMenu)
        {
            if ( pInputMenu == null ) {
                vIsNavigateBackStarted = false;
                return;
            }

            if ( vIsNavigateBackStarted && pInputMenu.NavigateBackStrength <= 0 ) {
                vIsNavigateBackStarted = false;
                return;
            }

            if ( vIsNavigateBackStarted || pInputMenu.NavigateBackStrength < 1 ) {
                return;
            }

            vIsNavigateBackStarted = true;
            vItemHierarchy.Back();
        }
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 public void SetOppositeHandMenu(IInputMenu pMenu)
 {
     vOppositeHandMenu = pMenu;
 }
		////////////////////////////////////////////////////////////////////////////////////////////////
		/*--------------------------------------------------------------------------------------------*/
		public void SetOppositeHandMenu(IInputMenu pMenu) {
			vCursor.SetOppositeHandMenu(pMenu);
		}
		////////////////////////////////////////////////////////////////////////////////////////////////
		/*--------------------------------------------------------------------------------------------*/
		public void SetOppositeHandMenu(IInputMenu pMenu) {
			vOppositeHandMenu = pMenu;
		}
예제 #17
0
 public StartMenu(Dictionary <TextTypes, SpriteFont> spriteFonts, IInputMenu inputMenu, Vector2 position, List <string> text) : base(spriteFonts, inputMenu, position, text)
 {
 }
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        internal void UpdateAfterInput(IInputMenu pInputMenu, ICursorState[] pCursors)
        {
            vCurrentCursors = pCursors;

            IsInputAvailable = pInputMenu.IsAvailable;
            IsOnLeftSide = pInputMenu.IsLeft;
            Center = pInputMenu.Position;
            Rotation = pInputMenu.Rotation;
            Size = pInputMenu.Radius;
            DisplayStrength = pInputMenu.DisplayStrength;
            NavBackStrength = pInputMenu.NavigateBackStrength;

            CheckNavigateBackAction(pInputMenu);

            foreach ( BaseItemState item in vAllItems ) {
                item.UpdateBeforeCursors();
            }

            foreach ( ICursorState cursor in vCurrentCursors ) {
                UpdateWithCursor(cursor);
            }

            foreach ( BaseItemState item in vAllItems ) {
                if ( item.UpdateSelectionProcess() ) { //returns true if selection occurred
                    break; //exit loop, since the items list changes after a selection
                }
            }
        }