diff --git a/classes/UIComponents/ButtonTray.as b/classes/UIComponents/ButtonTray.as index d37d982db..7ee503b52 100644 --- a/classes/UIComponents/ButtonTray.as +++ b/classes/UIComponents/ButtonTray.as @@ -186,24 +186,16 @@ { if (!(e.currentTarget as SquareButton).isActive) return; var forward:Boolean = ((e.currentTarget as SquareButton).name == "buttonPageNext"); - if (forward) { - buttonPage++; + buttonPageGoNext(); } else { - buttonPage--; + buttonPageGoPrev(); } - - if (buttonPage < 1) buttonPage = 1; - if (buttonPage > 4) buttonPage = 4; - - resetButtons(); - - CheckPages(); } - + private function CheckPages():void { var lastButtonIndex:int = 0; @@ -507,6 +499,27 @@ { return _buttonData[arg].arg; } + /** + * Publicly callable function to change to next button page, for use by hotkeys + */ + public function buttonPageGoNext():void + { + if (!(_buttonPageNext).isActive) return; + buttonPage++; + // I don't agree that this needs to be a thing, but since it's already here I'll follow it. + if(buttonPage > 4) buttonPage = 4; + resetButtons(); + CheckPages(); + } + public function buttonPageGoPrev():void + { + if (!(_buttonPagePrev).isActive) return; + buttonPage--; + // I don't agree that this needs to be a thing, but since it's already here I'll follow it. + if(buttonPage < 1) buttonPage = 1; + resetButtons(); + CheckPages(); + } } } \ No newline at end of file diff --git a/includes/ControlBindings.as b/includes/ControlBindings.as index 29bbb335e..f4fe0378f 100644 --- a/includes/ControlBindings.as +++ b/includes/ControlBindings.as @@ -174,6 +174,19 @@ function(inThis:*):Function { return function():void { inThis.prevOutputPage(); }; }(this)); + inputManager.AddBindableControl( + "Buttons Previous Page", + "Go to previous page of buttons", + function(inThis:*):Function { + return function():void { inThis.userInterface.buttonTray.buttonPageGoPrev(); }; + + }(this)); + inputManager.AddBindableControl( + "Buttons Next Page", + "Go to previous page of buttons", + function(inThis:*):Function { + return function():void { inThis.userInterface.buttonTray.buttonPageGoNext(); }; + }(this)); import classes.Cheats; @@ -391,6 +404,8 @@ inputManager.BindKeyToControl(35, "Scroll To End"); // case 35: this.endButtonScroll() inputManager.BindKeyToControl(54, "Next Page"); // case 54: this.pageNextButtonKeyEvt() inputManager.BindKeyToControl(89, "Previous Page"); // case 89: this.pagePrevButtonKeyEvt() + inputManager.BindKeyToControl(190,"Buttons Next Page"); // case 190: this.userInterface.buttonTray.buttonPageGoNext(); + inputManager.BindKeyToControl(188,"Buttons Previous Page");// case 188: this.userInterface.buttonTray.buttonPageGoPrev(); inputManager.BindKeyToControl(80, "Debug Menu"); // case 80: this.userInterface.debugmm();