mirror of
https://github.com/hax4dazy/TinWoo.git
synced 2025-02-09 19:25:05 +01:00
fix exit button main menu
This commit is contained in:
parent
632150f0d0
commit
7085cc79ac
@ -23,7 +23,7 @@ void MainApplication::OnLoad() {
|
||||
// You can use member functions via std::bind() C++ wrapper
|
||||
this->SetOnInput([&](const u64 keys_down, const u64 keys_up, const u64 keys_held, const pu::ui::TouchPoint touch_pos) {
|
||||
// If X is pressed, start with our dialog questions!
|
||||
if(keys_down & HidNpadButton_X) {
|
||||
if(keys_held & HidNpadButton_X) {
|
||||
int opt = this->CreateShowDialog("Question", "Do you like apples?", { "Yes!", "No...", "Cancel" }, true); // (using latest option as cancel option)
|
||||
// -1 and -2 are similar, but if the user cancels manually -1 is set, other types or cancel should be -2.
|
||||
if((opt == -1) || (opt == -2)) {
|
||||
|
@ -14,7 +14,7 @@ namespace inst::ui {
|
||||
void HdInstallMenuItem_Click();
|
||||
void settingsMenuItem_Click();
|
||||
void exitMenuItem_Click();
|
||||
void onInput(u64 Down, u64 Up, u64 Held, pu::ui::TouchPoint touch_pos);
|
||||
void onInput(u64 Down, u64 Up, const u64 Held, pu::ui::TouchPoint touch_pos);
|
||||
Image::Ref awooImage;
|
||||
|
||||
private:
|
||||
|
@ -257,9 +257,9 @@ namespace inst::ui {
|
||||
mainApp->LoadLayout(mainApp->optionspage);
|
||||
}
|
||||
|
||||
void MainPage::onInput(u64 Down, u64 Up, u64 Held, pu::ui::TouchPoint touch_pos) { //some issue with held - fix later....27/4/22
|
||||
void MainPage::onInput(u64 Down, u64 Up, u64 Held, pu::ui::TouchPoint touch_pos) {
|
||||
|
||||
if (((Down & HidNpadButton_Plus) || (Down & HidNpadButton_Minus) || ((Down & HidNpadButton_L) && ( Down & HidNpadButton_R))) && mainApp->IsShown()) {
|
||||
if (((Down & HidNpadButton_Plus) || (Down & HidNpadButton_Minus) || ((Held & HidNpadButton_L) && ( Down & HidNpadButton_R)) || ((Down & HidNpadButton_L) && ( Held & HidNpadButton_R))) && mainApp->IsShown()) {
|
||||
mainApp->FadeOut();
|
||||
mainApp->Close();
|
||||
}
|
||||
@ -301,7 +301,6 @@ namespace inst::ui {
|
||||
|
||||
if (Down & HidNpadButton_Y) {
|
||||
mathstuff();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user