Various minor updates/improvements (FCEUGX) (#478)

* Add 1+2+Plus menu toggle option

* update text strings

* Add B/1 cancel trigger to WindowPrompts

* Fix initial game selection menu "jump" when using classic controller
This commit is contained in:
InfiniteBlueGX 2022-10-26 18:02:53 -05:00 committed by GitHub
parent ca59df2961
commit ac24682c24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 6 deletions

View File

@ -133,6 +133,10 @@ s8 GuiTrigger::WPAD_Stick(u8 stick, int axis)
center = js->center.x;
}
if(min == max) {
return 0;
}
// some 3rd party controllers return invalid analog sticks calibration data
if ((min >= center) || (max <= center)) {
// force default calibration settings

View File

@ -221,6 +221,11 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, const ch
GuiImageData btnOutline(button_prompt_png);
GuiImageData btnOutlineOver(button_prompt_over_png);
GuiTrigger trigB;
GuiTrigger trig1;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B, WIIDRC_BUTTON_B);
trig1.SetButtonOnlyTrigger(-1, WPAD_BUTTON_1, 0, 0);
GuiImageData dialogBox(dialogue_box_png);
GuiImage dialogBoxImg(&dialogBox);
@ -246,6 +251,8 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, const ch
{
btn1.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
btn1.SetPosition(0, -25);
btn1.SetTrigger(&trigB);
btn1.SetTrigger(&trig1);
}
btn1.SetLabel(&btn1Txt);
@ -279,7 +286,11 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, const ch
promptWindow.Append(&btn1);
if(btn2Label)
{
promptWindow.Append(&btn2);
btn2.SetTrigger(&trigB);
btn2.SetTrigger(&trig1);
}
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 50);
CancelAction();
@ -3371,7 +3382,7 @@ static int MenuSettingsOtherMappings()
bool firstRun = true;
OptionList options;
sprintf(options.name[i++], "Enable Turbo Mode");
sprintf(options.name[i++], "Turbo Mode");
sprintf(options.name[i++], "Turbo Mode Button");
sprintf(options.name[i++], "Menu Toggle");
@ -3462,7 +3473,7 @@ static int MenuSettingsOtherMappings()
switch(GCSettings.TurboModeButton)
{
case 0:
sprintf (options.value[1], "Right Stick (default)"); break;
sprintf (options.value[1], "Default (Right Stick)"); break;
case 1:
sprintf (options.value[1], "A"); break;
case 2:
@ -3500,7 +3511,7 @@ static int MenuSettingsOtherMappings()
case 1:
sprintf (options.value[2], "Home / Right Stick"); break;
case 2:
sprintf (options.value[2], "L+R+Start"); break;
sprintf (options.value[2], "L+R+Start / 1+2+Plus"); break;
}
optionBrowser.TriggerUpdate();
@ -3649,7 +3660,7 @@ static int MenuSettingsVideo()
firstRun = false;
if (GCSettings.render == 0)
sprintf (options.value[0], "Original");
sprintf (options.value[0], "Original (240p)");
else if (GCSettings.render == 1)
sprintf (options.value[0], "Filtered");
else if (GCSettings.render == 2)
@ -4306,7 +4317,7 @@ static int MenuSettingsMenu()
if (GCSettings.ExitAction == 1)
sprintf (options.value[0], "Return to Wii Menu");
else if (GCSettings.ExitAction == 2)
sprintf (options.value[0], "Power off Wii");
sprintf (options.value[0], "Power Off Wii");
else if (GCSettings.ExitAction == 3)
sprintf (options.value[0], "Return to Loader");
else

View File

@ -610,7 +610,7 @@ bool MenuRequested()
return true;
}
}
else if (GCSettings.GamepadMenuToggle == 2) // L+R+Start combo only
else if (GCSettings.GamepadMenuToggle == 2) // L+R+Start / 1+2+Plus (Wiimote) combo only
{
if (
(userInput[i].pad.btns_h & PAD_TRIGGER_L &&
@ -620,6 +620,9 @@ bool MenuRequested()
|| (userInput[i].wpad->btns_h & WPAD_CLASSIC_BUTTON_FULL_L &&
userInput[i].wpad->btns_h & WPAD_CLASSIC_BUTTON_FULL_R &&
userInput[i].wpad->btns_h & WPAD_CLASSIC_BUTTON_PLUS)
|| (userInput[i].wpad->btns_h & WPAD_BUTTON_PLUS &&
userInput[i].wpad->btns_h & WPAD_BUTTON_1 &&
userInput[i].wpad->btns_h & WPAD_BUTTON_2)
#endif
)
{
@ -640,6 +643,9 @@ bool MenuRequested()
(userInput[i].wpad->btns_h & WPAD_CLASSIC_BUTTON_FULL_L &&
userInput[i].wpad->btns_h & WPAD_CLASSIC_BUTTON_FULL_R &&
userInput[i].wpad->btns_h & WPAD_CLASSIC_BUTTON_PLUS)
|| (userInput[i].wpad->btns_h & WPAD_BUTTON_PLUS &&
userInput[i].wpad->btns_h & WPAD_BUTTON_1 &&
userInput[i].wpad->btns_h & WPAD_BUTTON_2)
#endif
)
{