From d0912cca26e3d00b9c618ee79f4391720048e3b7 Mon Sep 17 00:00:00 2001 From: dborth Date: Tue, 13 Apr 2010 06:50:43 +0000 Subject: [PATCH] Add both A and 2 triggers to all buttons. That too way too long. --- source/gui/gui.h | 6 +- source/gui/gui_button.cpp | 4 +- source/gui/gui_element.cpp | 5 +- source/gui/gui_filebrowser.cpp | 9 +- source/gui/gui_keyboard.cpp | 14 +- source/gui/gui_optionbrowser.cpp | 9 +- source/gui/gui_savebrowser.cpp | 10 +- source/menu.cpp | 369 ++++++++++++++----------------- source/video.cpp | 7 - 9 files changed, 206 insertions(+), 227 deletions(-) diff --git a/source/gui/gui.h b/source/gui/gui.h index cf3a03b..e0c159b 100644 --- a/source/gui/gui.h +++ b/source/gui/gui.h @@ -404,7 +404,7 @@ class GuiElement //!Called constantly to redraw the element's tooltip virtual void DrawTooltip(); protected: - GuiTrigger * trigger[2]; //!< GuiTriggers (input actions) that this element responds to + GuiTrigger * trigger[3]; //!< GuiTriggers (input actions) that this element responds to UpdateCallback updateCB; //!< Callback function to call when this element is updated GuiElement * parentElement; //!< Parent element int focus; //!< Element focus (-1 = focus disabled, 0 = not focused, 1 = focused) @@ -839,6 +839,7 @@ class GuiKeyboard : public GuiWindow GuiSound * keySoundOver; GuiSound * keySoundClick; GuiTrigger * trigA; + GuiTrigger * trig2; Key keys[4][11]; // two chars = less space than one pointer }; @@ -896,6 +897,7 @@ class GuiOptionBrowser : public GuiElement GuiSound * btnSoundOver; GuiSound * btnSoundClick; GuiTrigger * trigA; + GuiTrigger * trig2; bool listChanged; }; @@ -956,6 +958,7 @@ class GuiSaveBrowser : public GuiElement GuiSound * btnSoundOver; GuiSound * btnSoundClick; GuiTrigger * trigA; + GuiTrigger * trig2; bool saveBtnLastOver[SAVELISTSIZE]; }; @@ -1009,6 +1012,7 @@ class GuiFileBrowser : public GuiElement GuiSound * btnSoundOver; GuiSound * btnSoundClick; GuiTrigger * trigA; + GuiTrigger * trig2; GuiTrigger * trigHeldA; int selectedItem; diff --git a/source/gui/gui_button.cpp b/source/gui/gui_button.cpp index 3ae6023..a6941e5 100644 --- a/source/gui/gui_button.cpp +++ b/source/gui/gui_button.cpp @@ -255,7 +255,7 @@ void GuiButton::Update(GuiTrigger * t) if(this->IsClickable()) { s32 wm_btns, wm_btns_trig, cc_btns, cc_btns_trig; - for(int i=0; i<2; i++) + for(int i=0; i<3; i++) { if(trigger[i] && (trigger[i]->chan == -1 || trigger[i]->chan == t->chan)) { @@ -305,7 +305,7 @@ void GuiButton::Update(GuiTrigger * t) bool held = false; s32 wm_btns, wm_btns_h, wm_btns_trig, cc_btns, cc_btns_h, cc_btns_trig; - for(int i=0; i<2; i++) + for(int i=0; i<3; i++) { if(trigger[i] && (trigger[i]->chan == -1 || trigger[i]->chan == t->chan)) { diff --git a/source/gui/gui_element.cpp b/source/gui/gui_element.cpp index 09f3725..4378324 100644 --- a/source/gui/gui_element.cpp +++ b/source/gui/gui_element.cpp @@ -29,6 +29,7 @@ GuiElement::GuiElement() stateChan = -1; trigger[0] = NULL; trigger[1] = NULL; + trigger[2] = NULL; parentElement = NULL; rumble = true; selectable = false; @@ -312,7 +313,9 @@ void GuiElement::SetTrigger(GuiTrigger * t) trigger[0] = t; else if(!trigger[1]) trigger[1] = t; - else // both were assigned, so we'll just overwrite the first one + else if(!trigger[2]) + trigger[2] = t; + else // all were assigned, so we'll just overwrite the first one trigger[0] = t; } diff --git a/source/gui/gui_filebrowser.cpp b/source/gui/gui_filebrowser.cpp index 3c28fcc..3a0bd3b 100644 --- a/source/gui/gui_filebrowser.cpp +++ b/source/gui/gui_filebrowser.cpp @@ -25,10 +25,9 @@ GuiFileBrowser::GuiFileBrowser(int w, int h) focus = 0; // allow focus trigA = new GuiTrigger; - if(GCSettings.WiimoteOrientation) - trigA->SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); + trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); + trig2 = new GuiTrigger; + trig2->SetSimpleTrigger(-1, WPAD_BUTTON_2, 0); trigHeldA = new GuiTrigger; trigHeldA->SetHeldTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); @@ -120,6 +119,7 @@ GuiFileBrowser::GuiFileBrowser(int w, int h) fileList[i]->SetImageOver(fileListBg[i]); fileList[i]->SetPosition(2,26*i+3); fileList[i]->SetTrigger(trigA); + fileList[i]->SetTrigger(trig2); fileList[i]->SetSoundClick(btnSoundClick); } } @@ -161,6 +161,7 @@ GuiFileBrowser::~GuiFileBrowser() delete btnSoundClick; delete trigHeldA; delete trigA; + delete trig2; for(int i=0; iSetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); + trigA = new GuiTrigger; + trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); + trig2 = new GuiTrigger; + trig2->SetSimpleTrigger(-1, WPAD_BUTTON_2, 0); keyBackImg = new GuiImage(keyMedium); keyBackOverImg = new GuiImage(keyMediumOver); @@ -139,6 +139,7 @@ GuiKeyboard::GuiKeyboard(char * t, u32 max) keyBack->SetSoundOver(keySoundOver); keyBack->SetSoundClick(keySoundClick); keyBack->SetTrigger(trigA); + keyBack->SetTrigger(trig2); keyBack->SetPosition(10*42+40, 0*42+80); keyBack->SetEffectGrow(); this->Append(keyBack); @@ -153,6 +154,7 @@ GuiKeyboard::GuiKeyboard(char * t, u32 max) keyCaps->SetSoundOver(keySoundOver); keyCaps->SetSoundClick(keySoundClick); keyCaps->SetTrigger(trigA); + keyCaps->SetTrigger(trig2); keyCaps->SetPosition(0, 2*42+80); keyCaps->SetEffectGrow(); this->Append(keyCaps); @@ -167,6 +169,7 @@ GuiKeyboard::GuiKeyboard(char * t, u32 max) keyShift->SetSoundOver(keySoundOver); keyShift->SetSoundClick(keySoundClick); keyShift->SetTrigger(trigA); + keyShift->SetTrigger(trig2); keyShift->SetPosition(21, 3*42+80); keyShift->SetEffectGrow(); this->Append(keyShift); @@ -179,6 +182,7 @@ GuiKeyboard::GuiKeyboard(char * t, u32 max) keySpace->SetSoundOver(keySoundOver); keySpace->SetSoundClick(keySoundClick); keySpace->SetTrigger(trigA); + keySpace->SetTrigger(trig2); keySpace->SetPosition(0, 4*42+80); keySpace->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); keySpace->SetEffectGrow(); @@ -204,6 +208,7 @@ GuiKeyboard::GuiKeyboard(char * t, u32 max) keyBtn[i][j]->SetSoundOver(keySoundOver); keyBtn[i][j]->SetSoundClick(keySoundClick); keyBtn[i][j]->SetTrigger(trigA); + keyBtn[i][j]->SetTrigger(trig2); keyBtn[i][j]->SetLabel(keyTxt[i][j]); keyBtn[i][j]->SetPosition(j*42+21*i+40, i*42+80); keyBtn[i][j]->SetEffectGrow(); @@ -245,6 +250,7 @@ GuiKeyboard::~GuiKeyboard() delete keySoundOver; delete keySoundClick; delete trigA; + delete trig2; for(int i=0; i<4; i++) { diff --git a/source/gui/gui_optionbrowser.cpp b/source/gui/gui_optionbrowser.cpp index 7dbeb2e..027fbfb 100644 --- a/source/gui/gui_optionbrowser.cpp +++ b/source/gui/gui_optionbrowser.cpp @@ -25,10 +25,9 @@ GuiOptionBrowser::GuiOptionBrowser(int w, int h, OptionList * l) focus = 0; // allow focus trigA = new GuiTrigger; - if(GCSettings.WiimoteOrientation) - trigA->SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); + trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); + trig2 = new GuiTrigger; + trig2->SetSimpleTrigger(-1, WPAD_BUTTON_2, 0); btnSoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM); btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM); @@ -94,6 +93,7 @@ GuiOptionBrowser::GuiOptionBrowser(int w, int h, OptionList * l) optionBtn[i]->SetImageOver(optionBg[i]); optionBtn[i]->SetPosition(0,30*i+3); optionBtn[i]->SetTrigger(trigA); + optionBtn[i]->SetTrigger(trig2); optionBtn[i]->SetSoundClick(btnSoundClick); } } @@ -122,6 +122,7 @@ GuiOptionBrowser::~GuiOptionBrowser() delete arrowUpOver; delete trigA; + delete trig2; delete btnSoundOver; delete btnSoundClick; diff --git a/source/gui/gui_savebrowser.cpp b/source/gui/gui_savebrowser.cpp index 3824948..5cbf7e4 100644 --- a/source/gui/gui_savebrowser.cpp +++ b/source/gui/gui_savebrowser.cpp @@ -31,11 +31,9 @@ GuiSaveBrowser::GuiSaveBrowser(int w, int h, SaveList * s, int a) focus = 0; // allow focus trigA = new GuiTrigger; - - if(GCSettings.WiimoteOrientation) - trigA->SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); + trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); + trig2 = new GuiTrigger; + trig2->SetSimpleTrigger(-1, WPAD_BUTTON_2, 0); btnSoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM); btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM); @@ -109,6 +107,7 @@ GuiSaveBrowser::GuiSaveBrowser(int w, int h, SaveList * s, int a) saveBtn[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); saveBtn[i]->SetPosition(257*(i % 2),87*(i>>1)); saveBtn[i]->SetTrigger(trigA); + saveBtn[i]->SetTrigger(trig2); saveBtn[i]->SetState(STATE_DISABLED); saveBtn[i]->SetEffectGrow(); saveBtn[i]->SetVisible(false); @@ -146,6 +145,7 @@ GuiSaveBrowser::~GuiSaveBrowser() delete btnSoundOver; delete btnSoundClick; delete trigA; + delete trig2; for(int i=0; iSetImageOver(sunBtnImgOver); sunBtn->SetSoundOver(&btnSoundOver); sunBtn->SetSoundClick(&btnSoundClick); - sunBtn->SetTrigger(&trigA); + sunBtn->SetTrigger(trigA); + sunBtn->SetTrigger(trig2); sunBtn->SetEffectGrow(); } @@ -1156,7 +1140,8 @@ static int MenuGame() resetBtn.SetIcon(&resetBtnIcon); resetBtn.SetSoundOver(&btnSoundOver); resetBtn.SetSoundClick(&btnSoundClick); - resetBtn.SetTrigger(&trigA); + resetBtn.SetTrigger(trigA); + resetBtn.SetTrigger(trig2); resetBtn.SetEffectGrow(); GuiText gameSettingsBtnTxt("Game Settings", 22, (GXColor){0, 0, 0, 255}); @@ -1173,7 +1158,8 @@ static int MenuGame() gameSettingsBtn.SetIcon(&gameSettingsBtnIcon); gameSettingsBtn.SetSoundOver(&btnSoundOver); gameSettingsBtn.SetSoundClick(&btnSoundClick); - gameSettingsBtn.SetTrigger(&trigA); + gameSettingsBtn.SetTrigger(trigA); + gameSettingsBtn.SetTrigger(trig2); gameSettingsBtn.SetEffectGrow(); GuiText mainmenuBtnTxt("Main Menu", 22, (GXColor){0, 0, 0, 255}); @@ -1187,7 +1173,8 @@ static int MenuGame() mainmenuBtn.SetImageOver(&mainmenuBtnImgOver); mainmenuBtn.SetSoundOver(&btnSoundOver); mainmenuBtn.SetSoundClick(&btnSoundClick); - mainmenuBtn.SetTrigger(&trigA); + mainmenuBtn.SetTrigger(trigA); + mainmenuBtn.SetTrigger(trig2); mainmenuBtn.SetEffectGrow(); GuiText closeBtnTxt("Close", 20, (GXColor){0, 0, 0, 255}); @@ -1201,7 +1188,8 @@ static int MenuGame() closeBtn.SetImageOver(&closeBtnImgOver); closeBtn.SetSoundOver(&btnSoundOver); closeBtn.SetSoundClick(&btnSoundClick); - closeBtn.SetTrigger(&trigA); + closeBtn.SetTrigger(trigA); + closeBtn.SetTrigger(trig2); closeBtn.SetTrigger(&trigHome); closeBtn.SetEffectGrow(); @@ -1530,12 +1518,6 @@ static int MenuGameSaves(int action) GuiImageData btnCloseOutline(button_small_png); GuiImageData btnCloseOutlineOver(button_small_over_png); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiTrigger trigHome; trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0); @@ -1550,7 +1532,8 @@ static int MenuGameSaves(int action) backBtn.SetImageOver(&backBtnImgOver); backBtn.SetSoundOver(&btnSoundOver); backBtn.SetSoundClick(&btnSoundClick); - backBtn.SetTrigger(&trigA); + backBtn.SetTrigger(trigA); + backBtn.SetTrigger(trig2); backBtn.SetEffectGrow(); GuiText closeBtnTxt("Close", 20, (GXColor){0, 0, 0, 255}); @@ -1564,7 +1547,8 @@ static int MenuGameSaves(int action) closeBtn.SetImageOver(&closeBtnImgOver); closeBtn.SetSoundOver(&btnSoundOver); closeBtn.SetSoundClick(&btnSoundClick); - closeBtn.SetTrigger(&trigA); + closeBtn.SetTrigger(trigA); + closeBtn.SetTrigger(trig2); closeBtn.SetTrigger(&trigHome); closeBtn.SetEffectGrow(); @@ -1784,12 +1768,6 @@ static int MenuGameSettings() GuiImageData btnCloseOutline(button_small_png); GuiImageData btnCloseOutlineOver(button_small_over_png); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiTrigger trigHome; trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0); @@ -1807,7 +1785,8 @@ static int MenuGameSettings() mappingBtn.SetIcon(&mappingBtnIcon); mappingBtn.SetSoundOver(&btnSoundOver); mappingBtn.SetSoundClick(&btnSoundClick); - mappingBtn.SetTrigger(&trigA); + mappingBtn.SetTrigger(trigA); + mappingBtn.SetTrigger(trig2); mappingBtn.SetEffectGrow(); GuiText videoBtnTxt("Video", 22, (GXColor){0, 0, 0, 255}); @@ -1824,7 +1803,8 @@ static int MenuGameSettings() videoBtn.SetIcon(&videoBtnIcon); videoBtn.SetSoundOver(&btnSoundOver); videoBtn.SetSoundClick(&btnSoundClick); - videoBtn.SetTrigger(&trigA); + videoBtn.SetTrigger(trigA); + videoBtn.SetTrigger(trig2); videoBtn.SetEffectGrow(); #ifdef HW_RVL @@ -1851,7 +1831,8 @@ static int MenuGameSettings() wiiControlsBtn.SetIcon(&wiiControlsBtnIcon); wiiControlsBtn.SetSoundOver(&btnSoundOver); wiiControlsBtn.SetSoundClick(&btnSoundClick); - wiiControlsBtn.SetTrigger(&trigA); + wiiControlsBtn.SetTrigger(trigA); + wiiControlsBtn.SetTrigger(trig2); wiiControlsBtn.SetEffectGrow(); /*GuiText cheatsBtnTxt("Cheats", 22, (GXColor){0, 0, 0, 255}); @@ -1867,7 +1848,7 @@ static int MenuGameSettings() cheatsBtn.SetIcon(&cheatsBtnIcon); cheatsBtn.SetSoundOver(&btnSoundOver); cheatsBtn.SetSoundClick(&btnSoundClick); - cheatsBtn.SetTrigger(&trigA); + cheatsBtn.SetTrigger(trigA); cheatsBtn.SetEffectGrow();*/ GuiText closeBtnTxt("Close", 20, (GXColor){0, 0, 0, 255}); @@ -1881,7 +1862,8 @@ static int MenuGameSettings() closeBtn.SetImageOver(&closeBtnImgOver); closeBtn.SetSoundOver(&btnSoundOver); closeBtn.SetSoundClick(&btnSoundClick); - closeBtn.SetTrigger(&trigA); + closeBtn.SetTrigger(trigA); + closeBtn.SetTrigger(trig2); closeBtn.SetTrigger(&trigHome); closeBtn.SetEffectGrow(); @@ -1896,7 +1878,8 @@ static int MenuGameSettings() backBtn.SetImageOver(&backBtnImgOver); backBtn.SetSoundOver(&btnSoundOver); backBtn.SetSoundClick(&btnSoundClick); - backBtn.SetTrigger(&trigA); + backBtn.SetTrigger(trigA); + backBtn.SetTrigger(trig2); backBtn.SetEffectGrow(); HaltGui(); @@ -1990,12 +1973,6 @@ static int MenuSettingsMappings() GuiImageData iconGamecube(icon_settings_gamecube_png); GuiImageData iconNunchuk(icon_settings_nunchuk_png); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiText gamecubeBtnTxt("GameCube Controller", 22, (GXColor){0, 0, 0, 255}); gamecubeBtnTxt.SetWrap(true, btnLargeOutline.GetWidth()-30); GuiImage gamecubeBtnImg(&btnLargeOutline); @@ -2010,7 +1987,8 @@ static int MenuSettingsMappings() gamecubeBtn.SetIcon(&gamecubeBtnIcon); gamecubeBtn.SetSoundOver(&btnSoundOver); gamecubeBtn.SetSoundClick(&btnSoundClick); - gamecubeBtn.SetTrigger(&trigA); + gamecubeBtn.SetTrigger(trigA); + gamecubeBtn.SetTrigger(trig2); gamecubeBtn.SetEffectGrow(); GuiText wiimoteBtnTxt("Wiimote", 22, (GXColor){0, 0, 0, 255}); @@ -2026,7 +2004,8 @@ static int MenuSettingsMappings() wiimoteBtn.SetIcon(&wiimoteBtnIcon); wiimoteBtn.SetSoundOver(&btnSoundOver); wiimoteBtn.SetSoundClick(&btnSoundClick); - wiimoteBtn.SetTrigger(&trigA); + wiimoteBtn.SetTrigger(trigA); + wiimoteBtn.SetTrigger(trig2); wiimoteBtn.SetEffectGrow(); GuiText classicBtnTxt("Classic Controller", 22, (GXColor){0, 0, 0, 255}); @@ -2043,7 +2022,8 @@ static int MenuSettingsMappings() classicBtn.SetIcon(&classicBtnIcon); classicBtn.SetSoundOver(&btnSoundOver); classicBtn.SetSoundClick(&btnSoundClick); - classicBtn.SetTrigger(&trigA); + classicBtn.SetTrigger(trigA); + classicBtn.SetTrigger(trig2); classicBtn.SetEffectGrow(); GuiText nunchukBtnTxt1("Wiimote", 22, (GXColor){0, 0, 0, 255}); @@ -2065,7 +2045,8 @@ static int MenuSettingsMappings() nunchukBtn.SetIcon(&nunchukBtnIcon); nunchukBtn.SetSoundOver(&btnSoundOver); nunchukBtn.SetSoundClick(&btnSoundClick); - nunchukBtn.SetTrigger(&trigA); + nunchukBtn.SetTrigger(trigA); + nunchukBtn.SetTrigger(trig2); nunchukBtn.SetEffectGrow(); GuiText backBtnTxt("Go Back", 22, (GXColor){0, 0, 0, 255}); @@ -2079,7 +2060,8 @@ static int MenuSettingsMappings() backBtn.SetImageOver(&backBtnImgOver); backBtn.SetSoundOver(&btnSoundOver); backBtn.SetSoundClick(&btnSoundClick); - backBtn.SetTrigger(&trigA); + backBtn.SetTrigger(trigA); + backBtn.SetTrigger(trig2); backBtn.SetEffectGrow(); HaltGui(); @@ -2145,11 +2127,6 @@ ButtonMappingWindow() GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM); GuiImageData btnOutline(button_png); GuiImageData btnOutlineOver(button_over_png); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); GuiImageData dialogBox(dialogue_box_png); GuiImage dialogBoxImg(&dialogBox); @@ -2283,12 +2260,6 @@ static int MenuSettingsMappingsMap() GuiImageData btnShortOutline(button_short_png); GuiImageData btnShortOutlineOver(button_short_over_png); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiText backBtnTxt("Go Back", 22, (GXColor){0, 0, 0, 255}); GuiImage backBtnImg(&btnOutline); GuiImage backBtnImgOver(&btnOutlineOver); @@ -2300,7 +2271,8 @@ static int MenuSettingsMappingsMap() backBtn.SetImageOver(&backBtnImgOver); backBtn.SetSoundOver(&btnSoundOver); backBtn.SetSoundClick(&btnSoundClick); - backBtn.SetTrigger(&trigA); + backBtn.SetTrigger(trigA); + backBtn.SetTrigger(trig2); backBtn.SetEffectGrow(); GuiText resetBtnTxt("Reset", 22, (GXColor){0, 0, 0, 255}); @@ -2314,7 +2286,8 @@ static int MenuSettingsMappingsMap() resetBtn.SetImageOver(&resetBtnImgOver); resetBtn.SetSoundOver(&btnSoundOver); resetBtn.SetSoundClick(&btnSoundClick); - resetBtn.SetTrigger(&trigA); + resetBtn.SetTrigger(trigA); + resetBtn.SetTrigger(trig2); resetBtn.SetEffectGrow(); i=0; @@ -2455,12 +2428,6 @@ static void ScreenZoomWindow() GuiWindow * w = new GuiWindow(200,200); w->SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiTrigger trigLeft; trigLeft.SetButtonOnlyInFocusTrigger(-1, WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT, PAD_BUTTON_LEFT); @@ -2482,8 +2449,9 @@ static void ScreenZoomWindow() arrowLeftBtn.SetImageOver(&arrowLeftOverImg); arrowLeftBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); arrowLeftBtn.SetPosition(50, 0); - arrowLeftBtn.SetTrigger(0, &trigA); - arrowLeftBtn.SetTrigger(1, &trigLeft); + arrowLeftBtn.SetTrigger(trigA); + arrowLeftBtn.SetTrigger(trig2); + arrowLeftBtn.SetTrigger(&trigLeft); arrowLeftBtn.SetSelectable(false); arrowLeftBtn.SetUpdateCallback(ScreenZoomWindowLeftClick); @@ -2496,8 +2464,9 @@ static void ScreenZoomWindow() arrowRightBtn.SetImageOver(&arrowRightOverImg); arrowRightBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); arrowRightBtn.SetPosition(164, 0); - arrowRightBtn.SetTrigger(0, &trigA); - arrowRightBtn.SetTrigger(1, &trigRight); + arrowRightBtn.SetTrigger(trigA); + arrowRightBtn.SetTrigger(trig2); + arrowRightBtn.SetTrigger(&trigRight); arrowRightBtn.SetSelectable(false); arrowRightBtn.SetUpdateCallback(ScreenZoomWindowRightClick); @@ -2510,8 +2479,9 @@ static void ScreenZoomWindow() arrowUpBtn.SetImageOver(&arrowUpOverImg); arrowUpBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); arrowUpBtn.SetPosition(-76, -27); - arrowUpBtn.SetTrigger(0, &trigA); - arrowUpBtn.SetTrigger(1, &trigUp); + arrowUpBtn.SetTrigger(trigA); + arrowUpBtn.SetTrigger(trig2); + arrowUpBtn.SetTrigger(&trigUp); arrowUpBtn.SetSelectable(false); arrowUpBtn.SetUpdateCallback(ScreenZoomWindowUpClick); @@ -2524,8 +2494,9 @@ static void ScreenZoomWindow() arrowDownBtn.SetImageOver(&arrowDownOverImg); arrowDownBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); arrowDownBtn.SetPosition(-76, 27); - arrowDownBtn.SetTrigger(0, &trigA); - arrowDownBtn.SetTrigger(1, &trigDown); + arrowDownBtn.SetTrigger(trigA); + arrowDownBtn.SetTrigger(trig2); + arrowDownBtn.SetTrigger(&trigDown); arrowDownBtn.SetSelectable(false); arrowDownBtn.SetUpdateCallback(ScreenZoomWindowDownClick); @@ -2619,12 +2590,6 @@ static void ScreenPositionWindow() w->SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); w->SetPosition(0, -10); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiTrigger trigLeft; trigLeft.SetButtonOnlyInFocusTrigger(-1, WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT, PAD_BUTTON_LEFT); @@ -2645,8 +2610,9 @@ static void ScreenPositionWindow() arrowLeftBtn.SetImage(&arrowLeftImg); arrowLeftBtn.SetImageOver(&arrowLeftOverImg); arrowLeftBtn.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); - arrowLeftBtn.SetTrigger(0, &trigA); - arrowLeftBtn.SetTrigger(1, &trigLeft); + arrowLeftBtn.SetTrigger(trigA); + arrowLeftBtn.SetTrigger(trig2); + arrowLeftBtn.SetTrigger(&trigLeft); arrowLeftBtn.SetSelectable(false); arrowLeftBtn.SetUpdateCallback(ScreenPositionWindowLeftClick); @@ -2658,8 +2624,9 @@ static void ScreenPositionWindow() arrowRightBtn.SetImage(&arrowRightImg); arrowRightBtn.SetImageOver(&arrowRightOverImg); arrowRightBtn.SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE); - arrowRightBtn.SetTrigger(0, &trigA); - arrowRightBtn.SetTrigger(1, &trigRight); + arrowRightBtn.SetTrigger(trigA); + arrowRightBtn.SetTrigger(trig2); + arrowRightBtn.SetTrigger(&trigRight); arrowRightBtn.SetSelectable(false); arrowRightBtn.SetUpdateCallback(ScreenPositionWindowRightClick); @@ -2671,8 +2638,9 @@ static void ScreenPositionWindow() arrowUpBtn.SetImage(&arrowUpImg); arrowUpBtn.SetImageOver(&arrowUpOverImg); arrowUpBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - arrowUpBtn.SetTrigger(0, &trigA); - arrowUpBtn.SetTrigger(1, &trigUp); + arrowUpBtn.SetTrigger(trigA); + arrowUpBtn.SetTrigger(trig2); + arrowUpBtn.SetTrigger(&trigUp); arrowUpBtn.SetSelectable(false); arrowUpBtn.SetUpdateCallback(ScreenPositionWindowUpClick); @@ -2684,8 +2652,9 @@ static void ScreenPositionWindow() arrowDownBtn.SetImage(&arrowDownImg); arrowDownBtn.SetImageOver(&arrowDownOverImg); arrowDownBtn.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM); - arrowDownBtn.SetTrigger(0, &trigA); - arrowDownBtn.SetTrigger(1, &trigDown); + arrowDownBtn.SetTrigger(trigA); + arrowDownBtn.SetTrigger(trig2); + arrowDownBtn.SetTrigger(&trigDown); arrowDownBtn.SetSelectable(false); arrowDownBtn.SetUpdateCallback(ScreenPositionWindowDownClick); @@ -2757,12 +2726,6 @@ static int MenuSettingsVideo() GuiImageData btnOutline(button_png); GuiImageData btnOutlineOver(button_over_png); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiText backBtnTxt("Go Back", 22, (GXColor){0, 0, 0, 255}); GuiImage backBtnImg(&btnOutline); GuiImage backBtnImgOver(&btnOutlineOver); @@ -2774,7 +2737,8 @@ static int MenuSettingsVideo() backBtn.SetImageOver(&backBtnImgOver); backBtn.SetSoundOver(&btnSoundOver); backBtn.SetSoundClick(&btnSoundClick); - backBtn.SetTrigger(&trigA); + backBtn.SetTrigger(trigA); + backBtn.SetTrigger(trig2); backBtn.SetEffectGrow(); GuiOptionBrowser optionBrowser(552, 248, &options); @@ -2924,12 +2888,6 @@ static int MenuSettings() GuiImageData iconMenu(icon_settings_menu_png); GuiImageData iconNetwork(icon_settings_network_png); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiText savingBtnTxt1("Saving", 22, (GXColor){0, 0, 0, 255}); GuiText savingBtnTxt2("&", 18, (GXColor){0, 0, 0, 255}); GuiText savingBtnTxt3("Loading", 22, (GXColor){0, 0, 0, 255}); @@ -2949,7 +2907,8 @@ static int MenuSettings() savingBtn.SetIcon(&fileBtnIcon); savingBtn.SetSoundOver(&btnSoundOver); savingBtn.SetSoundClick(&btnSoundClick); - savingBtn.SetTrigger(&trigA); + savingBtn.SetTrigger(trigA); + savingBtn.SetTrigger(trig2); savingBtn.SetEffectGrow(); GuiText menuBtnTxt("Menu", 22, (GXColor){0, 0, 0, 255}); @@ -2966,7 +2925,8 @@ static int MenuSettings() menuBtn.SetIcon(&menuBtnIcon); menuBtn.SetSoundOver(&btnSoundOver); menuBtn.SetSoundClick(&btnSoundClick); - menuBtn.SetTrigger(&trigA); + menuBtn.SetTrigger(trigA); + menuBtn.SetTrigger(trig2); menuBtn.SetEffectGrow(); GuiText networkBtnTxt("Network", 22, (GXColor){0, 0, 0, 255}); @@ -2983,7 +2943,8 @@ static int MenuSettings() networkBtn.SetIcon(&networkBtnIcon); networkBtn.SetSoundOver(&btnSoundOver); networkBtn.SetSoundClick(&btnSoundClick); - networkBtn.SetTrigger(&trigA); + networkBtn.SetTrigger(trigA); + networkBtn.SetTrigger(trig2); networkBtn.SetEffectGrow(); GuiText backBtnTxt("Go Back", 22, (GXColor){0, 0, 0, 255}); @@ -2997,7 +2958,8 @@ static int MenuSettings() backBtn.SetImageOver(&backBtnImgOver); backBtn.SetSoundOver(&btnSoundOver); backBtn.SetSoundClick(&btnSoundClick); - backBtn.SetTrigger(&trigA); + backBtn.SetTrigger(trigA); + backBtn.SetTrigger(trig2); backBtn.SetEffectGrow(); GuiText resetBtnTxt("Reset Settings", 22, (GXColor){0, 0, 0, 255}); @@ -3011,7 +2973,8 @@ static int MenuSettings() resetBtn.SetImageOver(&resetBtnImgOver); resetBtn.SetSoundOver(&btnSoundOver); resetBtn.SetSoundClick(&btnSoundClick); - resetBtn.SetTrigger(&trigA); + resetBtn.SetTrigger(trigA); + resetBtn.SetTrigger(trig2); resetBtn.SetEffectGrow(); HaltGui(); @@ -3104,12 +3067,6 @@ static int MenuSettingsFile() GuiImageData btnOutline(button_long_png); GuiImageData btnOutlineOver(button_long_over_png); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiText backBtnTxt("Go Back", 22, (GXColor){0, 0, 0, 255}); GuiImage backBtnImg(&btnOutline); GuiImage backBtnImgOver(&btnOutlineOver); @@ -3121,7 +3078,8 @@ static int MenuSettingsFile() backBtn.SetImageOver(&backBtnImgOver); backBtn.SetSoundOver(&btnSoundOver); backBtn.SetSoundClick(&btnSoundClick); - backBtn.SetTrigger(&trigA); + backBtn.SetTrigger(trigA); + backBtn.SetTrigger(trig2); backBtn.SetEffectGrow(); GuiOptionBrowser optionBrowser(552, 248, &options); @@ -3281,12 +3239,6 @@ static int MenuSettingsMenu() GuiImageData btnOutline(button_long_png); GuiImageData btnOutlineOver(button_long_over_png); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiText backBtnTxt("Go Back", 22, (GXColor){0, 0, 0, 255}); GuiImage backBtnImg(&btnOutline); GuiImage backBtnImgOver(&btnOutlineOver); @@ -3298,7 +3250,8 @@ static int MenuSettingsMenu() backBtn.SetImageOver(&backBtnImgOver); backBtn.SetSoundOver(&btnSoundOver); backBtn.SetSoundClick(&btnSoundClick); - backBtn.SetTrigger(&trigA); + backBtn.SetTrigger(trigA); + backBtn.SetTrigger(trig2); backBtn.SetEffectGrow(); GuiOptionBrowser optionBrowser(552, 248, &options); @@ -3460,12 +3413,6 @@ static int MenuSettingsNetwork() GuiImageData btnOutline(button_long_png); GuiImageData btnOutlineOver(button_long_over_png); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiText backBtnTxt("Go Back", 22, (GXColor){0, 0, 0, 255}); GuiImage backBtnImg(&btnOutline); GuiImage backBtnImgOver(&btnOutlineOver); @@ -3477,7 +3424,8 @@ static int MenuSettingsNetwork() backBtn.SetImageOver(&backBtnImgOver); backBtn.SetSoundOver(&btnSoundOver); backBtn.SetSoundClick(&btnSoundClick); - backBtn.SetTrigger(&trigA); + backBtn.SetTrigger(trigA); + backBtn.SetTrigger(trig2); backBtn.SetEffectGrow(); GuiOptionBrowser optionBrowser(552, 248, &options); @@ -3595,12 +3543,6 @@ static void PaletteWindow(const char *name) w->SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); w->SetPosition(0, -10); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiImageData arrowUp(button_arrow_up_png); GuiImageData arrowDown(button_arrow_down_png); GuiImageData arrowUpOver(button_arrow_up_over_png); @@ -3613,7 +3555,8 @@ static void PaletteWindow(const char *name) moreRedBtn.SetImageOver(&moreRedOverImg); moreRedBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); moreRedBtn.SetPosition(-150,-60); - moreRedBtn.SetTrigger(0, &trigA); + moreRedBtn.SetTrigger(trigA); + moreRedBtn.SetTrigger(trig2); moreRedBtn.SetSelectable(true); moreRedBtn.SetUpdateCallback(MoreRedClick); @@ -3624,7 +3567,8 @@ static void PaletteWindow(const char *name) lessRedBtn.SetImageOver(&lessRedOverImg); lessRedBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); lessRedBtn.SetPosition(-150,+50); - lessRedBtn.SetTrigger(0, &trigA); + lessRedBtn.SetTrigger(trigA); + lessRedBtn.SetTrigger(trig2); lessRedBtn.SetSelectable(true); lessRedBtn.SetUpdateCallback(LessRedClick); @@ -3635,7 +3579,8 @@ static void PaletteWindow(const char *name) moreGreenBtn.SetImageOver(&moreGreenOverImg); moreGreenBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); moreGreenBtn.SetPosition(-50,-60); - moreGreenBtn.SetTrigger(0, &trigA); + moreGreenBtn.SetTrigger(trigA); + moreGreenBtn.SetTrigger(trig2); moreGreenBtn.SetSelectable(true); moreGreenBtn.SetUpdateCallback(MoreGreenClick); @@ -3646,7 +3591,8 @@ static void PaletteWindow(const char *name) lessGreenBtn.SetImageOver(&lessGreenOverImg); lessGreenBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); lessGreenBtn.SetPosition(-50,+50); - lessGreenBtn.SetTrigger(0, &trigA); + lessGreenBtn.SetTrigger(trigA); + lessGreenBtn.SetTrigger(trig2); lessGreenBtn.SetSelectable(true); lessGreenBtn.SetUpdateCallback(LessGreenClick); @@ -3657,7 +3603,8 @@ static void PaletteWindow(const char *name) moreBlueBtn.SetImageOver(&moreBlueOverImg); moreBlueBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); moreBlueBtn.SetPosition(50,-60); - moreBlueBtn.SetTrigger(0, &trigA); + moreBlueBtn.SetTrigger(trigA); + moreBlueBtn.SetTrigger(trig2); moreBlueBtn.SetSelectable(true); moreBlueBtn.SetUpdateCallback(MoreBlueClick); @@ -3668,7 +3615,8 @@ static void PaletteWindow(const char *name) lessBlueBtn.SetImageOver(&lessBlueOverImg); lessBlueBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); lessBlueBtn.SetPosition(50,+50); - lessBlueBtn.SetTrigger(0, &trigA); + lessBlueBtn.SetTrigger(trigA); + lessBlueBtn.SetTrigger(trig2); lessBlueBtn.SetSelectable(true); lessBlueBtn.SetUpdateCallback(LessBlueClick); @@ -3778,12 +3726,6 @@ static int MenuPalette() GuiImageData btnCloseOutline(button_small_png); GuiImageData btnCloseOutlineOver(button_small_over_png); - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiTrigger trigHome; trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0); @@ -3798,7 +3740,8 @@ static int MenuPalette() bg0Btn.SetImageOver(&bg0BtnImgOver); bg0Btn.SetSoundOver(&btnSoundOver); bg0Btn.SetSoundClick(&btnSoundClick); - bg0Btn.SetTrigger(&trigA); + bg0Btn.SetTrigger(trigA); + bg0Btn.SetTrigger(trig2); bg0Btn.SetEffectGrow(); GuiText bg1BtnTxt("BG 1", 24, GetCol(1)); @@ -3812,7 +3755,8 @@ static int MenuPalette() bg1Btn.SetImageOver(&bg1BtnImgOver); bg1Btn.SetSoundOver(&btnSoundOver); bg1Btn.SetSoundClick(&btnSoundClick); - bg1Btn.SetTrigger(&trigA); + bg1Btn.SetTrigger(trigA); + bg1Btn.SetTrigger(trig2); bg1Btn.SetEffectGrow(); GuiText bg2BtnTxt("BG 2", 24, GetCol(2)); @@ -3826,7 +3770,8 @@ static int MenuPalette() bg2Btn.SetImageOver(&bg2BtnImgOver); bg2Btn.SetSoundOver(&btnSoundOver); bg2Btn.SetSoundClick(&btnSoundClick); - bg2Btn.SetTrigger(&trigA); + bg2Btn.SetTrigger(trigA); + bg2Btn.SetTrigger(trig2); bg2Btn.SetEffectGrow(); GuiText bg3BtnTxt("BG 3", 24, GetCol(3)); @@ -3840,7 +3785,8 @@ static int MenuPalette() bg3Btn.SetImageOver(&bg3BtnImgOver); bg3Btn.SetSoundOver(&btnSoundOver); bg3Btn.SetSoundClick(&btnSoundClick); - bg3Btn.SetTrigger(&trigA); + bg3Btn.SetTrigger(trigA); + bg3Btn.SetTrigger(trig2); bg3Btn.SetEffectGrow(); GuiText win0BtnTxt("WIN 0", 24, GetCol(4)); @@ -3854,7 +3800,8 @@ static int MenuPalette() win0Btn.SetImageOver(&win0BtnImgOver); win0Btn.SetSoundOver(&btnSoundOver); win0Btn.SetSoundClick(&btnSoundClick); - win0Btn.SetTrigger(&trigA); + win0Btn.SetTrigger(trigA); + win0Btn.SetTrigger(trig2); win0Btn.SetEffectGrow(); GuiText win1BtnTxt("WIN 1", 24, GetCol(5)); @@ -3868,7 +3815,8 @@ static int MenuPalette() win1Btn.SetImageOver(&win1BtnImgOver); win1Btn.SetSoundOver(&btnSoundOver); win1Btn.SetSoundClick(&btnSoundClick); - win1Btn.SetTrigger(&trigA); + win1Btn.SetTrigger(trigA); + win1Btn.SetTrigger(trig2); win1Btn.SetEffectGrow(); GuiText win2BtnTxt("WIN 2", 24, GetCol(6)); @@ -3882,7 +3830,8 @@ static int MenuPalette() win2Btn.SetImageOver(&win2BtnImgOver); win2Btn.SetSoundOver(&btnSoundOver); win2Btn.SetSoundClick(&btnSoundClick); - win2Btn.SetTrigger(&trigA); + win2Btn.SetTrigger(trigA); + win2Btn.SetTrigger(trig2); win2Btn.SetEffectGrow(); GuiText win3BtnTxt("WIN 3", 24, GetCol(7)); @@ -3896,7 +3845,8 @@ static int MenuPalette() win3Btn.SetImageOver(&win3BtnImgOver); win3Btn.SetSoundOver(&btnSoundOver); win3Btn.SetSoundClick(&btnSoundClick); - win3Btn.SetTrigger(&trigA); + win3Btn.SetTrigger(trigA); + win3Btn.SetTrigger(trig2); win3Btn.SetEffectGrow(); GuiText obj0BtnTxt("OBJ 0", 24, GetCol(8)); @@ -3910,7 +3860,8 @@ static int MenuPalette() obj0Btn.SetImageOver(&obj0BtnImgOver); obj0Btn.SetSoundOver(&btnSoundOver); obj0Btn.SetSoundClick(&btnSoundClick); - obj0Btn.SetTrigger(&trigA); + obj0Btn.SetTrigger(trigA); + obj0Btn.SetTrigger(trig2); obj0Btn.SetEffectGrow(); GuiText obj1BtnTxt("OBJ 1", 24, GetCol(9)); @@ -3924,7 +3875,8 @@ static int MenuPalette() obj1Btn.SetImageOver(&obj1BtnImgOver); obj1Btn.SetSoundOver(&btnSoundOver); obj1Btn.SetSoundClick(&btnSoundClick); - obj1Btn.SetTrigger(&trigA); + obj1Btn.SetTrigger(trigA); + obj1Btn.SetTrigger(trig2); obj1Btn.SetEffectGrow(); GuiText obj2BtnTxt("OBJ 2", 24, GetCol(10)); @@ -3938,7 +3890,8 @@ static int MenuPalette() obj2Btn.SetImageOver(&obj2BtnImgOver); obj2Btn.SetSoundOver(&btnSoundOver); obj2Btn.SetSoundClick(&btnSoundClick); - obj2Btn.SetTrigger(&trigA); + obj2Btn.SetTrigger(trigA); + obj2Btn.SetTrigger(trig2); obj2Btn.SetEffectGrow(); GuiText spr0BtnTxt("SPR 0", 24, GetCol(11)); @@ -3952,7 +3905,8 @@ static int MenuPalette() spr0Btn.SetImageOver(&spr0BtnImgOver); spr0Btn.SetSoundOver(&btnSoundOver); spr0Btn.SetSoundClick(&btnSoundClick); - spr0Btn.SetTrigger(&trigA); + spr0Btn.SetTrigger(trigA); + spr0Btn.SetTrigger(trig2); spr0Btn.SetEffectGrow(); GuiText spr1BtnTxt("SPR 1", 24, GetCol(12)); @@ -3966,7 +3920,8 @@ static int MenuPalette() spr1Btn.SetImageOver(&spr1BtnImgOver); spr1Btn.SetSoundOver(&btnSoundOver); spr1Btn.SetSoundClick(&btnSoundClick); - spr1Btn.SetTrigger(&trigA); + spr1Btn.SetTrigger(trigA); + spr1Btn.SetTrigger(trig2); spr1Btn.SetEffectGrow(); GuiText spr2BtnTxt("SPR 2", 24, GetCol(13)); @@ -3980,7 +3935,8 @@ static int MenuPalette() spr2Btn.SetImageOver(&spr2BtnImgOver); spr2Btn.SetSoundOver(&btnSoundOver); spr2Btn.SetSoundClick(&btnSoundClick); - spr2Btn.SetTrigger(&trigA); + spr2Btn.SetTrigger(trigA); + spr2Btn.SetTrigger(trig2); spr2Btn.SetEffectGrow(); GuiText importBtnTxt("Load / Save", 22, (GXColor){0, 0, 0, 255}); @@ -3995,7 +3951,8 @@ static int MenuPalette() importBtn.SetImageOver(&importBtnImgOver); importBtn.SetSoundOver(&btnSoundOver); importBtn.SetSoundClick(&btnSoundClick); - importBtn.SetTrigger(&trigA); + importBtn.SetTrigger(trigA); + importBtn.SetTrigger(trig2); importBtn.SetEffectGrow(); GuiText closeBtnTxt("Close", 20, (GXColor){0, 0, 0, 255}); @@ -4009,7 +3966,8 @@ static int MenuPalette() closeBtn.SetImageOver(&closeBtnImgOver); closeBtn.SetSoundOver(&btnSoundOver); closeBtn.SetSoundClick(&btnSoundClick); - closeBtn.SetTrigger(&trigA); + closeBtn.SetTrigger(trigA); + closeBtn.SetTrigger(trig2); closeBtn.SetTrigger(&trigHome); closeBtn.SetEffectGrow(); @@ -4024,7 +3982,8 @@ static int MenuPalette() backBtn.SetImageOver(&backBtnImgOver); backBtn.SetSoundOver(&btnSoundOver); backBtn.SetSoundClick(&btnSoundClick); - backBtn.SetTrigger(&trigA); + backBtn.SetTrigger(trigA); + backBtn.SetTrigger(trig2); backBtn.SetEffectGrow(); HaltGui(); @@ -4236,8 +4195,25 @@ static int MenuPalette() void MainMenu (int menu) { + static bool init = false; int currentMenu = menu; lastMenu = MENU_NONE; + + if(!init) + { + init = true; + #ifdef HW_RVL + pointer[0] = new GuiImageData(player1_point_png); + pointer[1] = new GuiImageData(player2_point_png); + pointer[2] = new GuiImageData(player3_point_png); + pointer[3] = new GuiImageData(player4_point_png); + #endif + + trigA = new GuiTrigger; + trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); + trig2 = new GuiTrigger; + trig2->SetSimpleTrigger(-1, WPAD_BUTTON_2, 0); + } mainWindow = new GuiWindow(screenwidth, screenheight); @@ -4254,12 +4230,6 @@ MainMenu (int menu) bgImg->SetVisible(false); } - GuiTrigger trigA; - if(GCSettings.WiimoteOrientation) - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - else - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM); GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM); GuiImageData bgTop(bg_top_png); @@ -4282,7 +4252,8 @@ MainMenu (int menu) btnLogo->SetLabel(&logoTxt); btnLogo->SetSoundOver(&btnSoundOver); btnLogo->SetSoundClick(&btnSoundClick); - btnLogo->SetTrigger(&trigA); + btnLogo->SetTrigger(trigA); + btnLogo->SetTrigger(trig2); btnLogo->SetUpdateCallback(WindowCredits); mainWindow->Append(bgTopImg); diff --git a/source/video.cpp b/source/video.cpp index 5b90140..ccb4fe3 100644 --- a/source/video.cpp +++ b/source/video.cpp @@ -403,13 +403,6 @@ InitializeVideo () GX_SetCullMode (GX_CULL_NONE); GX_CopyDisp (xfb[whichfb], GX_TRUE); // reset xfb GX_Flush(); - - #ifdef HW_RVL - pointer[0] = new GuiImageData(player1_point_png); - pointer[1] = new GuiImageData(player2_point_png); - pointer[2] = new GuiImageData(player3_point_png); - pointer[3] = new GuiImageData(player4_point_png); - #endif }