//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ 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(); } }
/*--------------------------------------------------------------------------------------------*/ 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(); } }
private void CheckInputs(IInputMenu keys) { keys.ReadInput(); if (keys.Esc && currGameState == GameLoop.Play) { currGameState = GameLoop.Pause; } }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ 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); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ 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]); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ 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; } }
/*--------------------------------------------------------------------------------------------*/ 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(); }
/*--------------------------------------------------------------------------------------------*/ 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); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ 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; }
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 } } }