Improve button preference UI (there's always one.)

This commit is contained in:
Unknown W. Brackets 2013-06-21 17:40:41 -07:00
parent aab081fa81
commit 2438259c8a

View File

@ -1161,24 +1161,33 @@ void SystemScreen::render() {
UICheckBox(GEN_ID, x, y += stride, s->T("Fast Memory", "Fast Memory (unstable)"), ALIGN_TOPLEFT, &g_Config.bFastMemory);
UICheckBox(GEN_ID, x, y += stride, s->T("Daylight Savings"), ALIGN_TOPLEFT, &g_Config.bDayLightSavings);
UICheckBox(GEN_ID, x, y += stride, s->T("Button Preference"), ALIGN_TOPLEFT, &g_Config.bButtonPreference);
if (g_Config.bButtonPreference) {
char button[256];
std::string type;
switch (g_Config.iButtonPreference) {
case 0: type = "O to Enter";break;
case 1: type = "X to Enter";break;
}
sprintf(button, "%s %s", s->T("Type :"), type.c_str());
ui_draw2d.DrawText(UBUNTU24, button, x + 60, y += stride , 0xFFFFFFFF, ALIGN_LEFT);
HLinear hlinear1(x + 280, y, 20);
if (UIButton(GEN_ID, hlinear1, 90, 0, s->T("Use O"), ALIGN_LEFT))
g_Config.iButtonPreference = 0;
if (UIButton(GEN_ID, hlinear1, 90, 0, s->T("Use X"), ALIGN_LEFT))
g_Config.iButtonPreference = 1;
y += 10;
const char *buttonPreferenceTitle;
switch (g_Config.iButtonPreference) {
case PSP_SYSTEMPARAM_BUTTON_CIRCLE:
buttonPreferenceTitle = s->T("Button Preference - O to Confirm");
break;
case PSP_SYSTEMPARAM_BUTTON_CROSS:
default:
buttonPreferenceTitle = s->T("Button Preference - X to Confirm");
break;
}
#ifdef _WIN32
const int checkboxH = 32;
#else
const int checkboxH = 48;
#endif
ui_draw2d.DrawTextShadow(UBUNTU24, buttonPreferenceTitle, x + UI_SPACE + 29, (y += stride) + checkboxH / 2, 0xFFFFFFFF, ALIGN_LEFT | ALIGN_VCENTER);
y += stride;
// 29 is the width of the checkbox, new UI will replace.
HLinear hlinearButtonPref(x + UI_SPACE + 29, y, 20);
if (UIButton(GEN_ID, hlinearButtonPref, 90, 0, s->T("Use O"), ALIGN_LEFT))
g_Config.iButtonPreference = PSP_SYSTEMPARAM_BUTTON_CIRCLE;
if (UIButton(GEN_ID, hlinearButtonPref, 90, 0, s->T("Use X"), ALIGN_LEFT))
g_Config.iButtonPreference = PSP_SYSTEMPARAM_BUTTON_CROSS;
y += 20 + 6;
/*
bool time = g_Config.iTimeFormat > 0 ;
UICheckBox(GEN_ID, x, y += stride, s->T("Time Format"), ALIGN_TOPLEFT, &time);