Fix menu sensitivity when using a gamepad

This commit is contained in:
Llennpie 2021-07-06 20:02:32 -04:00
parent fa71b56cb0
commit afa3b92fe9
5 changed files with 10 additions and 10 deletions

View File

@ -99,7 +99,7 @@ void MoonScreen::Update(){
widgets[i]->Update();
}
float yStick = GetStickValue(MoonButtons::U_STICK, false);
if(yStick > 0) {
if(yStick > 5) {
if(stickExecuted) return;
if(this->selected != NULL) return;
this->widgets[this->scrollIndex]->selected = false;
@ -109,7 +109,7 @@ void MoonScreen::Update(){
this->widgets[this->scrollIndex]->selected = true;
stickExecuted = true;
}
if(yStick < 0) {
if(yStick < -5) {
if(stickExecuted) return;
if(this->selected != NULL) return;
this->widgets[this->scrollIndex]->selected = false;

View File

@ -64,12 +64,12 @@ void MoonAchievementsScreen::changeScroll(int idx){
void MoonAchievementsScreen::Update(){
float yStick = GetStickValue(MoonButtons::U_STICK, false);
if(yStick > 0) {
if(yStick > 5) {
if(dispatched) return;
MoonAchievementsScreen::changeScroll(-1);
dispatched = true;
}
if(yStick < 0) {
if(yStick < -5) {
if(dispatched) return;
MoonAchievementsScreen::changeScroll(1);
dispatched = true;

View File

@ -83,7 +83,7 @@ void MoonAddonsScreen::changeScroll(int idx){
void MoonAddonsScreen::Update(){
float yStick = GetStickValue(MoonButtons::U_STICK, false);
if(yStick > 0) {
if(yStick > 5) {
if(dispatched) return;
if(currentPack != NULL){
if(currentSubItem > 0)
@ -96,7 +96,7 @@ void MoonAddonsScreen::Update(){
MoonAddonsScreen::changeScroll(-1);
dispatched = true;
}
if(yStick < 0) {
if(yStick < -5) {
if(dispatched) return;
if(currentPack != NULL){
if(currentSubItem < 2)

View File

@ -81,7 +81,7 @@ void MoonOptMain::Update(){
isOpen = false;
}
float xStick = GetStickValue(MoonButtons::L_STICK, false);
if(xStick < 0) {
if(xStick < -50) {
if(cswStickExecuted) return;
if(categoryIndex > 0)
categoryIndex -= 1;
@ -90,7 +90,7 @@ void MoonOptMain::Update(){
this->setCategory(categoryIndex);
cswStickExecuted = true;
}
if(xStick > 0) {
if(xStick > 50) {
if(cswStickExecuted) return;
if(categoryIndex < categories.size() - 1)
categoryIndex += 1;

View File

@ -80,7 +80,7 @@ void MoonStoreScreen::changeScroll(int idx){
void MoonStoreScreen::Update(){
float yStick = GetStickValue(MoonButtons::U_STICK, false);
if(yStick > 0) {
if(yStick > 5) {
if(dispatched) return;
if(currentPack != NULL){
if(currentSubItem > 0)
@ -93,7 +93,7 @@ void MoonStoreScreen::Update(){
MoonStoreScreen::changeScroll(-1);
dispatched = true;
}
if(yStick < 0) {
if(yStick < -5) {
if(dispatched) return;
if(currentPack != NULL){
if(currentSubItem < 2)