From f76b0e89a8a8920918a282021c028b877389cf30 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Mon, 15 Aug 2016 16:56:56 +0200 Subject: [PATCH] working Wii U Pro Controller support --- installer/wad.vwii/0001000154484246.tmd | Bin 592 -> 592 bytes main/source/Menus/menu_main.cpp | 32 ++++++++++++---- main/source/Menus/menu_settings_file.cpp | 9 +++-- main/source/Menus/menu_settings_font.cpp | 3 +- main/source/Menus/menu_settings_language.cpp | 3 +- main/source/Menus/menu_settings_network.cpp | 9 +++-- main/source/Menus/menu_settings_theme.cpp | 3 +- main/source/Prompts/prompt_add_app.cpp | 6 ++- main/source/Prompts/prompt_app_info.cpp | 12 ++++-- main/source/Prompts/prompt_edit.cpp | 6 ++- main/source/Prompts/prompt_erase_category.cpp | 6 ++- main/source/Prompts/prompt_font_download.cpp | 12 ++++-- .../Prompts/prompt_language_download.cpp | 12 ++++-- main/source/Prompts/prompt_move_category.cpp | 14 ++++--- main/source/Prompts/prompt_revtext.cpp | 6 ++- main/source/Prompts/prompt_theme_download.cpp | 12 ++++-- main/source/Prompts/prompt_update.cpp | 12 ++++-- main/source/libwiigui/gui.h | 1 + main/source/libwiigui/gui_button.cpp | 16 ++++---- main/source/libwiigui/gui_trigger.cpp | 36 +++++++++--------- 20 files changed, 134 insertions(+), 76 deletions(-) diff --git a/installer/wad.vwii/0001000154484246.tmd b/installer/wad.vwii/0001000154484246.tmd index cd2042c9001385a22086f4530aa3c5fa6f041a67..5ca2248dd1b9e4425b90bd10443a2fd29ed515f3 100644 GIT binary patch delta 30 mcmcb>a)D)o6_Z%%fouEgQ(m~q{8`I2$>0Xd#s8C~vKj!^J`PF% delta 30 mcmcb>a)D)o6_Z%v1O1xU{)w?-mak>v9q)XZbs#Y!&K>~4Zw&GetState() == STATE_CLICKED && button == "B" && !grab) { AppsBtn[i]->ResetState(); - if(Settings.current_category != 0 && strcasecmp(Settings.code,"NULL") == 0 && WPAD_ButtonsDown(0) & WPAD_BUTTON_B) + if(Settings.current_category != 0 && strcasecmp(Settings.code,"NULL") == 0 && (WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B)) { pointer = new GuiImageData(Theme.player_grab); grab = true; @@ -1191,7 +1207,7 @@ int MenuMain() } // wenn b losgelassen wurde - if(WPAD_ButtonsUp(0) & WPAD_BUTTON_B) + if(WPAD_ButtonsUp(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || WUPC_ButtonsUp(0) & WPAD_CLASSIC_BUTTON_B) { grab = false; pointer = new GuiImageData(Theme.player_point); diff --git a/main/source/Menus/menu_settings_file.cpp b/main/source/Menus/menu_settings_file.cpp index 6a109ae..baf539c 100644 --- a/main/source/Menus/menu_settings_file.cpp +++ b/main/source/Menus/menu_settings_file.cpp @@ -150,7 +150,8 @@ int MenuSettingsFile() ret = optionBrowser.GetChangedOption(); ret2 = optionBrowser.GetClickedOption(); - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) || PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) || PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_RIGHT) { change = 0; switch (ret) @@ -236,7 +237,8 @@ int MenuSettingsFile() optionBrowser.TriggerUpdate(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) || PAD_ButtonsDown(0) & PAD_BUTTON_LEFT) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) || PAD_ButtonsDown(0) & PAD_BUTTON_LEFT + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_LEFT) { change = 0; switch (ret) @@ -478,7 +480,8 @@ int MenuSettingsFile() optionBrowser.TriggerUpdate(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B) { if(focus == 0) { diff --git a/main/source/Menus/menu_settings_font.cpp b/main/source/Menus/menu_settings_font.cpp index e331011..d39a97f 100644 --- a/main/source/Menus/menu_settings_font.cpp +++ b/main/source/Menus/menu_settings_font.cpp @@ -162,7 +162,8 @@ int MenuSettingsFont() optionBrowser.TriggerUpdate(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B) { if(focus == 0) { diff --git a/main/source/Menus/menu_settings_language.cpp b/main/source/Menus/menu_settings_language.cpp index be93d4c..7b64845 100644 --- a/main/source/Menus/menu_settings_language.cpp +++ b/main/source/Menus/menu_settings_language.cpp @@ -164,7 +164,8 @@ int MenuSettingsLanguage() optionBrowser.TriggerUpdate(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B) { if(focus == 0) { diff --git a/main/source/Menus/menu_settings_network.cpp b/main/source/Menus/menu_settings_network.cpp index 866fd72..aa38a48 100644 --- a/main/source/Menus/menu_settings_network.cpp +++ b/main/source/Menus/menu_settings_network.cpp @@ -100,7 +100,8 @@ int MenuSettingsNetwork() ret = optionBrowser.GetChangedOption(); - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) || PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) || PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_RIGHT) { change = 0; switch (ret) @@ -132,7 +133,8 @@ int MenuSettingsNetwork() HaltResumeGui(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) || PAD_ButtonsDown(0) & PAD_BUTTON_LEFT) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) || PAD_ButtonsDown(0) & PAD_BUTTON_LEFT + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_LEFT) { change = 0; switch (ret) @@ -189,7 +191,8 @@ int MenuSettingsNetwork() if(optionBrowser.GetClickedOption() != -1) optionBrowser.TriggerUpdate(); - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B) { if(focus == 0) { diff --git a/main/source/Menus/menu_settings_theme.cpp b/main/source/Menus/menu_settings_theme.cpp index 839409b..67ce4af 100644 --- a/main/source/Menus/menu_settings_theme.cpp +++ b/main/source/Menus/menu_settings_theme.cpp @@ -159,7 +159,8 @@ int MenuSettingsTheme() optionBrowser.TriggerUpdate(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B) { if(focus == 0) { diff --git a/main/source/Prompts/prompt_add_app.cpp b/main/source/Prompts/prompt_add_app.cpp index 090b57b..7f67220 100644 --- a/main/source/Prompts/prompt_add_app.cpp +++ b/main/source/Prompts/prompt_add_app.cpp @@ -94,7 +94,8 @@ string AddApp(const char *AppName) { usleep(100); - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_PLUS) { kategorieInt++; if ( kategorieInt >= (signed)AvailableCategory.categories.size() ) @@ -105,7 +106,8 @@ string AddApp(const char *AppName) HaltResumeGui(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_MINUS) { kategorieInt--; if ( kategorieInt < 1 ) diff --git a/main/source/Prompts/prompt_app_info.cpp b/main/source/Prompts/prompt_app_info.cpp index dbf7a5c..6404c20 100644 --- a/main/source/Prompts/prompt_app_info.cpp +++ b/main/source/Prompts/prompt_app_info.cpp @@ -283,7 +283,8 @@ AppInfo(const char *title, string dir, u8* icon) { usleep(100); - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_UP) { int z = description.text_up(); @@ -294,7 +295,8 @@ AppInfo(const char *title, string dir, u8* icon) HaltResumeGui(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_DOWN) { int z = description.text_down(number); @@ -305,14 +307,16 @@ AppInfo(const char *title, string dir, u8* icon) HaltResumeGui(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_PLUS) { sprintf(SelectIos, tr("Start with IOS %i (-/+)"), nextIos()); SelectIosTxt.SetText(SelectIos); HaltResumeGui(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_MINUS) { sprintf(SelectIos, tr("Start with IOS %i (-/+)"), previousIos()); SelectIosTxt.SetText(SelectIos); diff --git a/main/source/Prompts/prompt_edit.cpp b/main/source/Prompts/prompt_edit.cpp index 5aeae34..f2f4588 100644 --- a/main/source/Prompts/prompt_edit.cpp +++ b/main/source/Prompts/prompt_edit.cpp @@ -121,7 +121,8 @@ MetaEdit(string dir) { usleep(100); - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_UP) { startline = meta.text_up(); @@ -131,7 +132,8 @@ MetaEdit(string dir) HaltResumeGui(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_DOWN) { startline = meta.text_down(number); diff --git a/main/source/Prompts/prompt_erase_category.cpp b/main/source/Prompts/prompt_erase_category.cpp index 2c5afc7..8fcbdff 100644 --- a/main/source/Prompts/prompt_erase_category.cpp +++ b/main/source/Prompts/prompt_erase_category.cpp @@ -88,7 +88,8 @@ string eraseCategory() { usleep(100); - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_PLUS) { kategorieInt++; if ( kategorieInt >= (signed)AvailableCategory.categories.size() ) @@ -99,7 +100,8 @@ string eraseCategory() HaltResumeGui(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_MINUS) { kategorieInt--; if ( kategorieInt < 1 ) diff --git a/main/source/Prompts/prompt_font_download.cpp b/main/source/Prompts/prompt_font_download.cpp index 3f436dc..da2e2f6 100644 --- a/main/source/Prompts/prompt_font_download.cpp +++ b/main/source/Prompts/prompt_font_download.cpp @@ -219,7 +219,8 @@ string FontList() { usleep(100); - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_UP) { selection--; if(selection < 0) @@ -237,7 +238,8 @@ string FontList() HaltResumeGui(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_DOWN) { selection++; if(selection == (signed)fonts.size()) @@ -257,13 +259,15 @@ string FontList() HaltResumeGui(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_A) { downloadfont = fonts[selection + textScrollPos]; stop = true; } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B) { downloadfont = "NULL"; stop = true; diff --git a/main/source/Prompts/prompt_language_download.cpp b/main/source/Prompts/prompt_language_download.cpp index df3defc..b1cdca8 100644 --- a/main/source/Prompts/prompt_language_download.cpp +++ b/main/source/Prompts/prompt_language_download.cpp @@ -220,7 +220,8 @@ string LanguageList() { usleep(100); - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_UP) { selection--; if(selection < 0) @@ -238,7 +239,8 @@ string LanguageList() HaltResumeGui(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_DOWN) { selection++; if(selection == (signed)languages.size()) @@ -258,13 +260,15 @@ string LanguageList() HaltResumeGui(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_A) { downloadlanguage = languages[selection + textScrollPos]; stop = true; } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B) { downloadlanguage = "NULL"; stop = true; diff --git a/main/source/Prompts/prompt_move_category.cpp b/main/source/Prompts/prompt_move_category.cpp index c62a625..cdabdc5 100644 --- a/main/source/Prompts/prompt_move_category.cpp +++ b/main/source/Prompts/prompt_move_category.cpp @@ -111,19 +111,22 @@ void MoveCategory(int moveCategoryNr, string &Kategorie1, bool &vor, string &Kat { usleep(100); - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_R + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_PLUS) { vor = false; zeile3_2Txt.SetText(tr("after")); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) || PAD_ButtonsDown(0) & PAD_TRIGGER_L + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_MINUS) { vor = true; zeile3_2Txt.SetText(tr("before")); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_UP) { CategoryInt--; @@ -134,7 +137,8 @@ void MoveCategory(int moveCategoryNr, string &Kategorie1, bool &vor, string &Kat HaltResumeGui(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_DOWN) { CategoryInt++; @@ -160,4 +164,4 @@ void MoveCategory(int moveCategoryNr, string &Kategorie1, bool &vor, string &Kat mainWindow->Remove(&promptWindow); mainWindow->SetState(STATE_DEFAULT); ResumeGui(); -} \ No newline at end of file +} diff --git a/main/source/Prompts/prompt_revtext.cpp b/main/source/Prompts/prompt_revtext.cpp index 3fceb5a..f883e39 100644 --- a/main/source/Prompts/prompt_revtext.cpp +++ b/main/source/Prompts/prompt_revtext.cpp @@ -106,7 +106,8 @@ revtext(const char *msg) { usleep(100); - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_UP) { int z = revtext.text_up(); @@ -117,7 +118,8 @@ revtext(const char *msg) HaltResumeGui(); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_DOWN) { int z = revtext.text_down(number); diff --git a/main/source/Prompts/prompt_theme_download.cpp b/main/source/Prompts/prompt_theme_download.cpp index a398e5e..45d1688 100644 --- a/main/source/Prompts/prompt_theme_download.cpp +++ b/main/source/Prompts/prompt_theme_download.cpp @@ -238,7 +238,8 @@ string ThemeList() { usleep(100); - if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP) + if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP + || WUPC_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_UP) { selection--; if(selection < 0) @@ -258,7 +259,8 @@ string ThemeList() usleep(100000); } - if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN) + if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN + || WUPC_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_DOWN) { selection++; if(selection == (signed)themes.size()) @@ -279,13 +281,15 @@ string ThemeList() usleep(100000); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_A) { downloadtheme = themes[selection + textScrollPos]; stop = true; } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B) { downloadtheme = "NULL"; stop = true; diff --git a/main/source/Prompts/prompt_update.cpp b/main/source/Prompts/prompt_update.cpp index 722ca28..a35002b 100644 --- a/main/source/Prompts/prompt_update.cpp +++ b/main/source/Prompts/prompt_update.cpp @@ -281,7 +281,8 @@ string choiceRev(string revs) { usleep(100); - if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP) + if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP) || PAD_ButtonsDown(0) & PAD_BUTTON_UP + || WUPC_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_UP) { selection--; @@ -299,7 +300,8 @@ string choiceRev(string revs) usleep(100000); } - if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN) + if(WPAD_ButtonsHeld(0) & (WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN) || PAD_ButtonsDown(0) & PAD_BUTTON_DOWN + || WUPC_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_DOWN) { selection++; @@ -317,13 +319,15 @@ string choiceRev(string revs) usleep(100000); } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A) || PAD_ButtonsDown(0) & PAD_BUTTON_A + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_A) { rev = versions.line[selection + versions.textScrollPos]; stop = true; } - if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B) + if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B + || WUPC_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B) stop = true; } diff --git a/main/source/libwiigui/gui.h b/main/source/libwiigui/gui.h index 0f1ad30..1f2571a 100644 --- a/main/source/libwiigui/gui.h +++ b/main/source/libwiigui/gui.h @@ -41,6 +41,7 @@ #include #include #include +#include #include "pngu.h" #include "FreeTypeGX.h" #include "video.h" diff --git a/main/source/libwiigui/gui_button.cpp b/main/source/libwiigui/gui_button.cpp index ca0c418..14553ab 100644 --- a/main/source/libwiigui/gui_button.cpp +++ b/main/source/libwiigui/gui_button.cpp @@ -202,13 +202,13 @@ void GuiButton::Update(GuiTrigger * t) cc_btns_trig = trigger[i]->wpad->btns_d >> 16; // lower 16 bits only (WiiU Pro controller) - wupc_btns = t->wupad->btns_d >> 16; - wupc_btns_trig = trigger[i]->wupad->btns_d >> 16; + wupc_btns = t->wupcdata.btns_d >> 16; + wupc_btns_trig = trigger[i]->wupcdata.btns_d >> 16; if( ((t->wpad->btns_d > 0 && wm_btns == wm_btns_trig) || (t->wpad->exp.type == WPAD_EXP_CLASSIC && cc_btns == cc_btns_trig)) || (t->pad.btns_d > 0 && t->pad.btns_d == trigger[i]->pad.btns_d) - || (t->wupad->btns_d > 0 && wupc_btns == wupc_btns_trig)) + || (t->wupcdata.btns_d > 0 && wupc_btns == wupc_btns_trig)) { if (t->chan == stateChan || stateChan == -1) { @@ -254,14 +254,14 @@ void GuiButton::Update(GuiTrigger * t) cc_btns_trig = trigger[i]->wpad->btns_h >> 16; // lower 16 bits only (WiiU Pro controller) - wupc_btns = t->wupad->btns_d >> 16; - wupc_btns_h = t->wupad->btns_h >> 16; - wupc_btns_trig = trigger[i]->wupad->btns_h >> 16; + wupc_btns = t->wupcdata.btns_d >> 16; + wupc_btns_h = t->wupcdata.btns_h >> 16; + wupc_btns_trig = trigger[i]->wupcdata.btns_h >> 16; if( (t->wpad->btns_d > 0 && wm_btns == wm_btns_trig) || (t->wpad->exp.type == WPAD_EXP_CLASSIC && cc_btns == cc_btns_trig) || (t->pad.btns_d > 0 && t->pad.btns_d == trigger[i]->pad.btns_d) - || (t->wupad->btns_d > 0 && wupc_btns == wupc_btns_trig)) + || (t->wupcdata.btns_d > 0 && wupc_btns == wupc_btns_trig)) { if (trigger[i]->type == TRIGGER_HELD && state == STATE_SELECTED && (t->chan == stateChan || stateChan == -1)) @@ -271,7 +271,7 @@ void GuiButton::Update(GuiTrigger * t) if( (t->wpad->btns_h > 0 && wm_btns_h == wm_btns_trig) || (t->wpad->exp.type == WPAD_EXP_CLASSIC && cc_btns_h == cc_btns_trig) || (t->pad.btns_h > 0 && t->pad.btns_h == trigger[i]->pad.btns_h) - || (t->wupad->btns_h > 0 && wupc_btns_h == wupc_btns_trig) + || (t->wupcdata.btns_h > 0 && wupc_btns_h == wupc_btns_trig) ) { if (trigger[i]->type == TRIGGER_HELD) diff --git a/main/source/libwiigui/gui_trigger.cpp b/main/source/libwiigui/gui_trigger.cpp index a3c9d95..36d3124 100644 --- a/main/source/libwiigui/gui_trigger.cpp +++ b/main/source/libwiigui/gui_trigger.cpp @@ -41,7 +41,7 @@ void GuiTrigger::SetSimpleTrigger(s32 ch, u32 wiibtns, u16 gcbtns) { type = TRIGGER_SIMPLE; chan = ch; - wupad->btns_d = wiibtns; + wupcdata.btns_d = wiibtns; wpaddata.btns_d = wiibtns; pad.btns_d = gcbtns; } @@ -55,7 +55,7 @@ void GuiTrigger::SetHeldTrigger(s32 ch, u32 wiibtns, u16 gcbtns) { type = TRIGGER_HELD; chan = ch; - wupad->btns_h = wiibtns; + wupcdata.btns_h = wiibtns; wpaddata.btns_h = wiibtns; pad.btns_h = gcbtns; } @@ -67,8 +67,8 @@ void GuiTrigger::SetButtonOnlyHeldTrigger(s32 ch, u32 wiibtns, u16 gcbtns) { type = TRIGGER_BUTTON_ONLY_HELD; chan = ch; - wupad->btns_d = wiibtns; - wupad->btns_h = wiibtns; + wupcdata.btns_d = wiibtns; + wupcdata.btns_h = wiibtns; wpaddata.btns_d = wiibtns; wpaddata.btns_h = wiibtns; pad.btns_d = gcbtns; @@ -83,7 +83,7 @@ void GuiTrigger::SetButtonOnlyTrigger(s32 ch, u32 wiibtns, u16 gcbtns) { type = TRIGGER_BUTTON_ONLY; chan = ch; - wupad->btns_d = wiibtns; + wupcdata.btns_d = wiibtns; wpaddata.btns_d = wiibtns; pad.btns_d = gcbtns; } @@ -97,7 +97,7 @@ void GuiTrigger::SetButtonOnlyInFocusTrigger(s32 ch, u32 wiibtns, u16 gcbtns) { type = TRIGGER_BUTTON_ONLY_IN_FOCUS; chan = ch; - wupad->btns_d = wiibtns; + wupcdata.btns_d = wiibtns; wpaddata.btns_d = wiibtns; pad.btns_d = gcbtns; } @@ -157,15 +157,15 @@ s8 GuiTrigger::WPAD_Stick(u8 right, int axis) bool GuiTrigger::Left() { u32 wiibtn = WPAD_BUTTON_LEFT; - if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupad->btns_d | wupad->btns_h) > 0) + if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupcdata.btns_d | wupcdata.btns_h) > 0) wiibtn |= WPAD_CLASSIC_BUTTON_LEFT; if( ((wpad->btns_d | wpad->btns_h) & wiibtn) - || ((wupad->btns_d | wupad->btns_h) & wiibtn) + || ((wupcdata.btns_d | wupcdata.btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h) & PAD_BUTTON_LEFT)) { if( (wpad->btns_d & wiibtn) - || (wupad->btns_d & wiibtn) + || (wupcdata.btns_d & wiibtn) || (pad.btns_d & PAD_BUTTON_LEFT)) { scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay. @@ -183,16 +183,16 @@ bool GuiTrigger::Left() bool GuiTrigger::Right() { u32 wiibtn = WPAD_BUTTON_RIGHT; - if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupad->btns_d | wupad->btns_h)) + if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupcdata.btns_d | wupcdata.btns_h)) wiibtn |= WPAD_CLASSIC_BUTTON_RIGHT; if( ((wpad->btns_d | wpad->btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h) & PAD_BUTTON_RIGHT) - || ((wupad->btns_d | wupad->btns_h) & wiibtn)) + || ((wupcdata.btns_d | wupcdata.btns_h) & wiibtn)) { if( (wpad->btns_d & wiibtn) || (pad.btns_d & PAD_BUTTON_RIGHT) - || (wupad->btns_d & wiibtn)) + || (wupcdata.btns_d & wiibtn)) { scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay. return true; @@ -209,15 +209,15 @@ bool GuiTrigger::Right() bool GuiTrigger::Up() { u32 wiibtn = WPAD_BUTTON_UP; - if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupad->btns_d | wupad->btns_h)) + if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupcdata.btns_d | wupcdata.btns_h)) wiibtn |= WPAD_CLASSIC_BUTTON_UP; if( ((wpad->btns_d | wpad->btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h) & PAD_BUTTON_UP) - || ((wupad->btns_d | wupad->btns_h) & wiibtn)) + || ((wupcdata.btns_d | wupcdata.btns_h) & wiibtn)) { if( (wpad->btns_d & wiibtn) - || (wupad->btns_d & wiibtn) + || (wupcdata.btns_d & wiibtn) || (pad.btns_d & PAD_BUTTON_UP)) { scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay. @@ -235,16 +235,16 @@ bool GuiTrigger::Up() bool GuiTrigger::Down() { u32 wiibtn = WPAD_BUTTON_DOWN; - if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupad->btns_d | wupad->btns_h)) + if(wpad->exp.type == WPAD_EXP_CLASSIC || (wupcdata.btns_d | wupcdata.btns_h)) wiibtn |= WPAD_CLASSIC_BUTTON_DOWN; if( ((wpad->btns_d | wpad->btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h) & PAD_BUTTON_DOWN) - || ((wupad->btns_d | wupad->btns_h) & wiibtn)) + || ((wupcdata.btns_d | wupcdata.btns_h) & wiibtn)) { if( (wpad->btns_d & wiibtn) || (pad.btns_d & PAD_BUTTON_DOWN) - || (wupad->btns_d & wiibtn)) + || (wupcdata.btns_d & wiibtn)) { scrollDelay = SCROLL_INITIAL_DELAY; // reset scroll delay. return true;