Exemplo n.º 1
0
    public PlayerMainFacade(GameObject userInterface)
    {
        _PlayerInputDevice             = new PlayerInputs();
        _InputSwapperController        = new Input_SwapperController(_PlayerInputDevice);
        _InputsGameplayController      = new Inputs_GameplayController(_PlayerInputDevice);
        _InputsGameplayAndUIController = new Inputs_GameplayAndUIController(_PlayerInputDevice);
        _InputsUserInterfaceController = new Inputs_UserInterfaceController(_PlayerInputDevice);

        _UIInputHandler       = new UI_InputHandler();
        _UIDisplayTransitions = new UI_DisplayTransitions(userInterface, _InputSwapperController.GetMediator, _UIInputHandler);

        _InputsGameplayAndUIController.GetInputGameMenu.SetUITransitionGameMenuCommand   = _UIInputHandler.GetGameMenuTransitionCommand;
        _InputsGameplayAndUIController.GetInputPlayMenu.SetUITransitionPlayerMenuCommand = _UIInputHandler.GetPlayerMenuTransitionCommand;
        _InputsUserInterfaceController.GetInputBack.SetUITransitionBackCommand           = _UIInputHandler.GetBackTransitionCommand;

        _InputsUserInterfaceController.GetInputUp.SetUINavigationUpCommand       = _UIInputHandler.GetUpCommand;
        _InputsUserInterfaceController.GetInputDown.SetUINavigationDownCommand   = _UIInputHandler.GetDownCommand;
        _InputsUserInterfaceController.GetInputLeft.SetUINavigationLeftCommand   = _UIInputHandler.GetLeftCommand;
        _InputsUserInterfaceController.GetInputRight.SetUINavigationRightCommand = _UIInputHandler.GetRightCommand;

        _InputsUserInterfaceController.GetInputSubmitTypeOne.SetSubmitTypeOneCommand     = _UIInputHandler.GetSubmissionTypeOneCommand;
        _InputsUserInterfaceController.GetInputSubmitTypeTwo.SetSubmitTypeTwoCommand     = _UIInputHandler.GetSubmissonTypeTwoCommand;
        _InputsUserInterfaceController.GetInputSubmitTypeThree.SetSubmitTypeThreeCommand = _UIInputHandler.GetSubmissionTypeThreeCommand;
        _InputsUserInterfaceController.GetInputSubmitTypeFour.SetSubmitTypeFourCommand   = _UIInputHandler.GetSubmissionTypeFourCommand;

        _InputsUserInterfaceController.GetInputShiftSubWindowLeft.SetSubWindowShiftLeftCommand   = _UIInputHandler.GetSubWindowShiftLeftCommand;
        _InputsUserInterfaceController.GetInputShiftSubWindowRight.SetSubWindowShiftRightCommand = _UIInputHandler.GetSubWindowShiftRightCommand;

        _InputSwapperController.ActivateOnlyGameplayActionMap(); //When the player gameobject fully loads in, the gameplay input action map will be monitoring the users inputs
    }
    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);
    }
 public Strategy_PlayerMenuTransitionGoTo(UI_DisplayTransitions displayTransitions)
 {
     _DisplayTransitions = displayTransitions;
 }
Exemplo n.º 4
0
 public Strategy_TransitionToPreviousDisplayToGameMenu(UI_DisplayTransitions displayTransitions)
 {
     _DisplayTransitions = displayTransitions;
 }
 protected abstract void SetupInputReceivers(IGetReceiverFunctionality inputReceivers, UI_DisplayTransitions transitions);
    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_TransitionToPreviousDisplayToGameMenu(transitions);
        directTransitions.SetGameMenuTransitionStrategy   = new Strategy_GameMenuTransitionGoTo(transitions);
        directTransitions.SetPlayerMenuTransitionStrategy = new Strategy_PlayerMenuTransitionIgnore();
    }
Exemplo n.º 8
0
 public UI_Hud(GameObject display, ISwapperMediator inputSwapper, IGetReceiverFunctionality inputReceivers, UI_DisplayTransitions transitions)
 {
     _HudDisplay    = display;
     _InputSwapper  = inputSwapper;
     _InputReceiver = inputReceivers;
     SetupInputReceivers(inputReceivers, transitions);
 }
Exemplo n.º 9
0
    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);
    }
    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;
    }
Exemplo n.º 11
0
 public Strategy_GameMenuTransitionToHud(UI_DisplayTransitions displayTransitions)
 {
     _DisplayTransitions = displayTransitions;
 }