protected override void SetupInputReceivers(IGetReceiverFunctionality inputReceivers, UI_DisplayTransitions transitions)
    {
        IReceiverDirectTransitionHandler directTransitionHandler = inputReceivers.GetDirectTransitionReceiver;

        directTransitionHandler.SetGameMenuTransitionStrategy   = new Strategy_GameMenuTransitionGoTo(transitions);
        directTransitionHandler.SetPlayerMenuTransitionStrategy = new Strategy_PlayerMenuTransitionGoTo(transitions);
    }
 public UI_Hud(GameObject display, ISwapperMediator inputSwapper, IGetReceiverFunctionality inputReceivers, UI_DisplayTransitions transitions)
 {
     _HudDisplay    = display;
     _InputSwapper  = inputSwapper;
     _InputReceiver = inputReceivers;
     SetupInputReceivers(inputReceivers, transitions);
 }
    protected override void SetupInputReceivers(IGetReceiverFunctionality inputReceivers, UI_DisplayTransitions transitions)
    {
        IReceiverDirectTransitionHandler directTransitions = inputReceivers.GetDirectTransitionReceiver;

        directTransitions.SetBackTransitionStrategy       = new Strategy_TransitionToPreviousDisplayToGameMenu(transitions);
        directTransitions.SetGameMenuTransitionStrategy   = new Strategy_GameMenuTransitionGoTo(transitions);
        directTransitions.SetPlayerMenuTransitionStrategy = new Strategy_PlayerMenuTransitionIgnore();
    }
 public UI_DisplayTransitions(GameObject display, ISwapperMediator inputSwapper, IGetReceiverFunctionality inputReceivers)
 {
     _MainDisplay    = display;
     _InputSwapper   = inputSwapper;
     _InputReceivers = inputReceivers;
     ResetInputReceiverReferences(); //On first load, setup the input receivers to not interact with the UI
     ShowDefaultDisplay();
 }
Esempio n. 5
0
 public Strategy_NavigateSubWindowBasic(Animator subWindowAnimator, IGetReceiverFunctionality inputReceivers, Action transitionEvent)
 {
     _SubWindowAnimator             = subWindowAnimator;
     _UISubWindowNavigationReceiver = inputReceivers.GetSubWindowNavigation;
     _TransitionEvent = transitionEvent;
     _LeftSubWindow   = null;
     _RightSubWindow  = null;
 }
 public Strategy_NavigateElementBasic(Animator buttonAnimator, IGetReceiverFunctionality inputReceivers, IElementSubmissionTypeSetup submissionSetup)
 {
     _ButtonAnimator = buttonAnimator;
     _UIElementNavigationReceiver = inputReceivers.GetUIElementNavigationReceiver;
     _UIElementSubmissionSetup    = submissionSetup;
     _UpElement    = null;
     _DownElement  = null;
     _LeftElement  = null;
     _RightElement = null;
 }
    public UI_OptionsMenu(GameObject display, IGetReceiverFunctionality inputReceivers, UI_DisplayTransitions transitions)
    {
        _OptionsMenuDisplay = display;
        _InputReceiver      = inputReceivers;
        GameObject tempBackground = _OptionsMenuDisplay.transform.Find("Background").gameObject;
        GameObject tempMenuBar    = tempBackground.transform.Find("Menu Bar").gameObject;

        _OptionsMenuSubWindowTransitions = new UI_OptionMenuSubWindowTransitions(tempBackground, tempMenuBar, inputReceivers);

        SetupInputReceivers(inputReceivers, transitions);
    }
    protected override void SetupInputReceivers(IGetReceiverFunctionality inputReceivers, UI_DisplayTransitions transitions)
    {
        IReceiverDirectTransitionHandler directTransitions = inputReceivers.GetDirectTransitionReceiver;

        directTransitions.SetBackTransitionStrategy       = new Strategy_TransitionToPreviousDisplayToHud(transitions);
        directTransitions.SetGameMenuTransitionStrategy   = new Strategy_GameMenuTransitionToHud(transitions);
        directTransitions.SetPlayerMenuTransitionStrategy = new Strategy_PlayerMenuTransitionIgnore();

        IReceiverHandleElementNavigation elementNavigation = inputReceivers.GetUIElementNavigationReceiver;

        elementNavigation.SetUIElementNavigationStrategy = _ResumeButton.ButtonNavigationStrategy;
    }
    public UI_GameMenu(GameObject display, IGetReceiverFunctionality inputReceivers, UI_DisplayTransitions transitions)
    {
        _GameMenuDisplay = display;
        _InputReceiver   = inputReceivers;
        GameObject tempBackground = _GameMenuDisplay.transform.Find("Background").gameObject;

        _ResumeButton  = new UIElement_ResumeButton(tempBackground, inputReceivers, transitions);
        _OptionsButton = new UIElement_OptionsButton(tempBackground, inputReceivers, transitions);
        _QuitButton    = new UIElement_QuitButton(tempBackground, inputReceivers, transitions);

        _ResumeButton.ButtonNavigationStrategy.SetupElementNavigation(downElement: _OptionsButton.ButtonNavigationStrategy);
        _OptionsButton.ButtonNavigationStrategy.SetupElementNavigation(upElement: _ResumeButton.ButtonNavigationStrategy, downElement: _QuitButton.ButtonNavigationStrategy);
        _QuitButton.ButtonNavigationStrategy.SetupElementNavigation(upElement: _OptionsButton.ButtonNavigationStrategy);

        SetupInputReceivers(inputReceivers, transitions);
    }
 protected abstract void SetupInputReceivers(IGetReceiverFunctionality inputReceivers, UI_DisplayTransitions transitions);
    public UI_OptionMenuSubWindowTransitions(GameObject optionsDisplay, GameObject optionsDisplayMenuBar, IGetReceiverFunctionality inputReceivers)
    {
        _SubWindowGameplay = new OptionsGameplaySubWindow(optionsDisplay.transform.Find("Gameplay Window").gameObject, optionsDisplayMenuBar.transform.Find("Gameplay").gameObject, inputReceivers, this);
        _SubWindowVideo    = new OptionsVideoSubWindow(optionsDisplay.transform.Find("Video Window").gameObject, optionsDisplayMenuBar.transform.Find("Video").gameObject, inputReceivers, this);
        _SubWindowSound    = new OptionsSoundSubWindow(optionsDisplay.transform.Find("Sound Window").gameObject, optionsDisplayMenuBar.transform.Find("Sound").gameObject, inputReceivers, this);
        _SubWindowControls = new OptionsControlsSubWindow(optionsDisplay.transform.Find("Controls Window").gameObject, optionsDisplayMenuBar.transform.Find("Controls").gameObject, inputReceivers, this);

        _SubWindowGameplay.SubWindowNavigationStrategy.SetupElementNavigation(leftElement: _SubWindowControls.SubWindowNavigationStrategy, rightElement: _SubWindowVideo.SubWindowNavigationStrategy);
        _SubWindowVideo.SubWindowNavigationStrategy.SetupElementNavigation(leftElement: _SubWindowGameplay.SubWindowNavigationStrategy, rightElement: _SubWindowSound.SubWindowNavigationStrategy);
        _SubWindowSound.SubWindowNavigationStrategy.SetupElementNavigation(leftElement: _SubWindowVideo.SubWindowNavigationStrategy, rightElement: _SubWindowControls.SubWindowNavigationStrategy);
        _SubWindowControls.SubWindowNavigationStrategy.SetupElementNavigation(leftElement: _SubWindowSound.SubWindowNavigationStrategy, rightElement: _SubWindowGameplay.SubWindowNavigationStrategy);

        SetupInputReceiver(inputReceivers);

        _ActiveSubWindowDisplay = _SubWindowGameplay;   //When the options menu is displayed, the gameplay sub window will always be the default selected sub window
        _ActiveSubWindowDisplay.ShowSubWindowDisplay(); //When fully load, show the default display to the user
    }
    private void SetupInputReceiver(IGetReceiverFunctionality inputReceivers)
    {
        IReceiverHandlerSubWindowNavigation subWindowReceiver = inputReceivers.GetSubWindowNavigation;

        subWindowReceiver.SetUISubWindowNavigationStrategy = _SubWindowGameplay.SubWindowNavigationStrategy;
    }