mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2024-11-16 17:59:17 +01:00
Config: Implement "isMovementAllowed" callback
This commit is contained in:
parent
e7eeb10873
commit
4a2f60592e
@ -160,6 +160,8 @@ void ConfigUtils::displayMenu() {
|
|||||||
KPADStatus kpad_data{};
|
KPADStatus kpad_data{};
|
||||||
KPADError kpad_error;
|
KPADError kpad_error;
|
||||||
|
|
||||||
|
bool isItemMovementAllowed = true;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
buttonsTriggered = 0;
|
buttonsTriggered = 0;
|
||||||
buttonsReleased = 0;
|
buttonsReleased = 0;
|
||||||
@ -400,6 +402,7 @@ void ConfigUtils::displayMenu() {
|
|||||||
|
|
||||||
const std::vector<WUPSConfigItem *> config_items = currentCategory->getItems();
|
const std::vector<WUPSConfigItem *> config_items = currentCategory->getItems();
|
||||||
|
|
||||||
|
if (isItemMovementAllowed) {
|
||||||
if (buttonsTriggered & VPAD_BUTTON_DOWN) {
|
if (buttonsTriggered & VPAD_BUTTON_DOWN) {
|
||||||
if (selectedBtn < config_items.size() - 1) {
|
if (selectedBtn < config_items.size() - 1) {
|
||||||
selectedBtn++;
|
selectedBtn++;
|
||||||
@ -422,6 +425,7 @@ void ConfigUtils::displayMenu() {
|
|||||||
redraw = true;
|
redraw = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
WUPSConfigButtons pressedButtons = WUPS_CONFIG_BUTTON_NONE;
|
WUPSConfigButtons pressedButtons = WUPS_CONFIG_BUTTON_NONE;
|
||||||
if (buttonsTriggered & VPAD_BUTTON_A) {
|
if (buttonsTriggered & VPAD_BUTTON_A) {
|
||||||
@ -464,6 +468,18 @@ void ConfigUtils::displayMenu() {
|
|||||||
pressedButtons |= WUPS_CONFIG_BUTTON_MINUS;
|
pressedButtons |= WUPS_CONFIG_BUTTON_MINUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isItemMovementAllowed) {
|
||||||
|
if (buttonsTriggered & VPAD_BUTTON_B) {
|
||||||
|
pressedButtons |= WUPS_CONFIG_BUTTON_B;
|
||||||
|
}
|
||||||
|
if (buttonsTriggered & VPAD_BUTTON_UP) {
|
||||||
|
pressedButtons |= WUPS_CONFIG_BUTTON_UP;
|
||||||
|
}
|
||||||
|
if (buttonsTriggered & VPAD_BUTTON_DOWN) {
|
||||||
|
pressedButtons |= WUPS_CONFIG_BUTTON_UP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (pressedButtons != WUPS_CONFIG_BUTTON_NONE) {
|
if (pressedButtons != WUPS_CONFIG_BUTTON_NONE) {
|
||||||
redraw = true;
|
redraw = true;
|
||||||
}
|
}
|
||||||
@ -536,6 +552,8 @@ void ConfigUtils::displayMenu() {
|
|||||||
|
|
||||||
DrawUtils::endDraw();
|
DrawUtils::endDraw();
|
||||||
redraw = pressedButtons != WUPS_CONFIG_BUTTON_NONE;
|
redraw = pressedButtons != WUPS_CONFIG_BUTTON_NONE;
|
||||||
|
|
||||||
|
isItemMovementAllowed = config_items[selectedBtn]->isMovementAllowed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user