Support navigation via guitars

This commit is contained in:
wiidev 2023-01-01 17:00:20 +00:00
parent 43cc0d3601
commit e0e6815b8f
2 changed files with 6 additions and 5 deletions

View File

@ -458,7 +458,8 @@ void GuiButton::Update(GuiTrigger * t)
cc_btns_trig = trigger[i]->wpad.btns_d >> 16; cc_btns_trig = trigger[i]->wpad.btns_d >> 16;
if( ((t->wpad.btns_d > 0 && wm_btns == wm_btns_trig) if( ((t->wpad.btns_d > 0 && wm_btns == wm_btns_trig)
|| (t->wpad.exp.type == WPAD_EXP_CLASSIC && cc_btns == cc_btns_trig)) || (t->wpad.exp.type == WPAD_EXP_CLASSIC && cc_btns == cc_btns_trig)
|| (t->wpad.exp.type == WPAD_EXP_GUITARHERO3 && cc_btns == cc_btns_trig))
|| (t->pad.btns_d > 0 && t->pad.btns_d == trigger[i]->pad.btns_d)) || (t->pad.btns_d > 0 && t->pad.btns_d == trigger[i]->pad.btns_d))
{ {
if (t->chan == stateChan || stateChan == -1) if (t->chan == stateChan || stateChan == -1)
@ -501,6 +502,7 @@ void GuiButton::Update(GuiTrigger * t)
if( (t->wpad.btns_d > 0 && wm_btns == wm_btns_trig) if( (t->wpad.btns_d > 0 && wm_btns == wm_btns_trig)
|| (t->wpad.exp.type == WPAD_EXP_CLASSIC && cc_btns == cc_btns_trig) || (t->wpad.exp.type == WPAD_EXP_CLASSIC && cc_btns == cc_btns_trig)
|| (t->wpad.exp.type == WPAD_EXP_GUITARHERO3 && cc_btns == cc_btns_trig)
|| (t->pad.btns_d > 0 && t->pad.btns_d == trigger[i]->pad.btns_d)) || (t->pad.btns_d > 0 && t->pad.btns_d == trigger[i]->pad.btns_d))
{ {
if (trigger[i]->type == TRIGGER_HELD && state == STATE_SELECTED && (t->chan == stateChan || stateChan == -1)) if (trigger[i]->type == TRIGGER_HELD && state == STATE_SELECTED && (t->chan == stateChan || stateChan == -1))
@ -509,6 +511,7 @@ void GuiButton::Update(GuiTrigger * t)
if( (t->wpad.btns_h > 0 && wm_btns_h == wm_btns_trig) 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->wpad.exp.type == WPAD_EXP_CLASSIC && cc_btns_h == cc_btns_trig)
|| (t->wpad.exp.type == WPAD_EXP_GUITARHERO3 && cc_btns_h == cc_btns_trig)
|| (t->pad.btns_h > 0 && t->pad.btns_h == trigger[i]->pad.btns_h) || (t->pad.btns_h > 0 && t->pad.btns_h == trigger[i]->pad.btns_h)
) )
{ {

View File

@ -79,8 +79,6 @@ s8 GuiTrigger::WPAD_Stick(u8 right, int axis)
switch (wpad.exp.type) switch (wpad.exp.type)
{ {
case WPAD_EXP_NUNCHUK: case WPAD_EXP_NUNCHUK:
js = right ? NULL : &wpad.exp.nunchuk.js;
break;
case WPAD_EXP_GUITARHERO3: case WPAD_EXP_GUITARHERO3:
js = right ? NULL : &wpad.exp.nunchuk.js; js = right ? NULL : &wpad.exp.nunchuk.js;
break; break;
@ -181,7 +179,7 @@ bool GuiTrigger::Right()
bool GuiTrigger::Up() bool GuiTrigger::Up()
{ {
u32 wiibtn = WPAD_BUTTON_UP; u32 wiibtn = WPAD_BUTTON_UP;
if (wpad.exp.type == WPAD_EXP_CLASSIC) if (wpad.exp.type == WPAD_EXP_CLASSIC || wpad.exp.type == WPAD_EXP_GUITARHERO3)
wiibtn |= WPAD_CLASSIC_BUTTON_UP; wiibtn |= WPAD_CLASSIC_BUTTON_UP;
if (((wpad.btns_d | wpad.btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h) & PAD_BUTTON_UP)) if (((wpad.btns_d | wpad.btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h) & PAD_BUTTON_UP))
@ -203,7 +201,7 @@ bool GuiTrigger::Up()
bool GuiTrigger::Down() bool GuiTrigger::Down()
{ {
u32 wiibtn = WPAD_BUTTON_DOWN; u32 wiibtn = WPAD_BUTTON_DOWN;
if (wpad.exp.type == WPAD_EXP_CLASSIC) if (wpad.exp.type == WPAD_EXP_CLASSIC || wpad.exp.type == WPAD_EXP_GUITARHERO3)
wiibtn |= WPAD_CLASSIC_BUTTON_DOWN; wiibtn |= WPAD_CLASSIC_BUTTON_DOWN;
if (((wpad.btns_d | wpad.btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h) & PAD_BUTTON_DOWN)) if (((wpad.btns_d | wpad.btns_h) & wiibtn) || ((pad.btns_d | pad.btns_h) & PAD_BUTTON_DOWN))