summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/ControllerConfig.cpp50
-rw-r--r--src/core/Frontend.cpp819
-rw-r--r--src/core/Frontend.h29
-rw-r--r--src/core/MenuScreensCustom.cpp41
-rw-r--r--src/core/config.h3
-rw-r--r--src/render/Font.cpp40
-rw-r--r--src/render/Font.h5
7 files changed, 951 insertions, 36 deletions
diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp
index 7f634619..727ad06b 100644
--- a/src/core/ControllerConfig.cpp
+++ b/src/core/ControllerConfig.cpp
@@ -2416,7 +2416,7 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
#define VFB(b)
#endif
-#define CONTROLLER_BUTTONS(T, O, X, Q, L1, L2, L3, R1, R2, R3, SELECT, RSL, RSR) \
+#define CONTROLLER_BUTTONS(T, O, X, Q, L1, L2, L3, R1, R2, R3, SELECT, RSU, RSD, RSL, RSR) \
{{ \
O, /* PED_FIREWEAPON */ \
R2, /* PED_CYCLE_WEAPON_RIGHT */ \
@@ -2576,8 +2576,8 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
L3, /* PED_DUCK */ \
L1, /* PED_ANSWER_PHONE */ \
VFB(R1) /* VEHICLE_FIREWEAPON */ \
- nil, /* VEHICLE_ACCELERATE */ \
- nil, /* VEHICLE_BRAKE */ \
+ RSU, /* VEHICLE_ACCELERATE */ \
+ RSD, /* VEHICLE_BRAKE */ \
O, /* VEHICLE_CHANGE_RADIO_STATION */ \
L3, /* VEHICLE_HORN */ \
Q, /* TOGGLE_SUBMISSIONS */ \
@@ -2618,10 +2618,10 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
#define RIGHT "RIGHT"
#endif
-const char *XboxButtons_noIcons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("Y", "B", "A", "X", "LB", "LT", "LS", "RB", "RT", "RS", "BACK", "right stick left", "right stick right");
+const char *XboxButtons_noIcons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("Y", "B", "A", "X", "LB", "LT", "LS", "RB", "RT", "RS", "BACK", "right stick up", "right stick down", "right stick left", "right stick right");
#ifdef BUTTON_ICONS
-const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O~", "~X~", "~Q~", "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "BACK", "~(~", "~)~");
+const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O~", "~X~", "~Q~", "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "BACK", "~H~", "~L~", "~(~", "~)~");
#endif
@@ -2630,11 +2630,6 @@ const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O
#define PS2_CIRCLE "|"
#define PS2_CROSS "/"
#define PS2_SQUARE "^"
-#elif defined(BUTTON_ICONS)
-#define PS2_TRIANGLE "~T~"
-#define PS2_CIRCLE "~O~"
-#define PS2_CROSS "~X~"
-#define PS2_SQUARE "~Q~"
#else
#define PS2_TRIANGLE "TRIANGLE"
#define PS2_CIRCLE "CIRCLE"
@@ -2643,11 +2638,11 @@ const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O
#endif
const char *PlayStationButtons_noIcons[][MAX_CONTROLLERACTIONS] =
- CONTROLLER_BUTTONS(PS2_TRIANGLE, PS2_CIRCLE, PS2_CROSS, PS2_SQUARE, "L1", "L2", "L3", "R1", "R2", "R3", "SELECT", "right stick left", "right stick right");
+ CONTROLLER_BUTTONS(PS2_TRIANGLE, PS2_CIRCLE, PS2_CROSS, PS2_SQUARE, "L1", "L2", "L3", "R1", "R2", "R3", "SELECT", "right stick up", "right stick down", "right stick left", "right stick right");
#ifdef BUTTON_ICONS
const char *PlayStationButtons[][MAX_CONTROLLERACTIONS] =
- CONTROLLER_BUTTONS(PS2_TRIANGLE, PS2_CIRCLE, PS2_CROSS, PS2_SQUARE, "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "SELECT", "~(~", "~)~");
+ CONTROLLER_BUTTONS("~T~", "~O~", "~X~", "~Q~", "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "SELECT", "~H~", "~L~", "~(~", "~)~");
#endif
#undef PS2_TRIANGLE
@@ -2669,11 +2664,36 @@ void CControllerConfigManager::GetWideStringOfCommandKeys(uint16 action, wchar *
if (CPad::GetPad(0)->IsAffectedByController) {
wchar wstr[16];
- // TODO: INI and/or menu setting for Xbox/PS switch
+ const char* (*Buttons)[MAX_CONTROLLERACTIONS];
+
#ifdef BUTTON_ICONS
- const char *(*Buttons)[MAX_CONTROLLERACTIONS] = CFont::ButtonsSlot != -1 ? XboxButtons : XboxButtons_noIcons;
+ #ifdef GAMEPAD_MENU
+ switch (FrontEndMenuManager.m_PrefsControllerType)
+ {
+ case CMenuManager::CONTROLLER_DUALSHOCK2:
+ case CMenuManager::CONTROLLER_DUALSHOCK3:
+ case CMenuManager::CONTROLLER_DUALSHOCK4:
+ Buttons = CFont::ButtonsSlot != -1 ? PlayStationButtons : PlayStationButtons_noIcons;
+ break;
+ default:
+ #endif
+ Buttons = CFont::ButtonsSlot != -1 ? XboxButtons : XboxButtons_noIcons;
+ #ifdef GAMEPAD_MENU
+ break;
+ }
+ #endif
#else
- const char *(*Buttons)[MAX_CONTROLLERACTIONS] = XboxButtons_noIcons;
+ switch (FrontEndMenuManager.m_PrefsControllerType)
+ {
+ case CMenuManager::CONTROLLER_DUALSHOCK2:
+ case CMenuManager::CONTROLLER_DUALSHOCK3:
+ case CMenuManager::CONTROLLER_DUALSHOCK4:
+ Buttons = PlayStationButtons_noIcons;
+ break;
+ default:
+ Buttons = XboxButtons_noIcons;
+ break;
+ }
#endif
assert(Buttons[CPad::GetPad(0)->Mode][action] != nil); // we cannot use these
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 4eae64b7..141f46f8 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -125,6 +125,10 @@ bool CMenuManager::m_PrefsMarketing = false;
bool CMenuManager::m_PrefsDisableTutorials = false;
#endif // !MASTER
+#if defined(LEGACY_MENU_OPTIONS) || defined(GAMEPAD_MENU)
+uint32 TimeToStopPadShaking;
+#endif
+
const char* FrontendFilenames[][2] = {
{"background", ""},
{"vc_logo", "vc_logom"},
@@ -151,7 +155,14 @@ const char* FrontendFilenames[][2] = {
{"downOff", "buttonA"},
{"downOn", "buttonA"},
{"upOff", "buttonA"},
- {"upOn", "buttonA"}
+ {"upOn", "buttonA"},
+#ifdef GAMEPAD_MENU
+ {"fe_controller", "" },
+ {"fe_arrows1", "" },
+ {"fe_arrows2", "" },
+ {"fe_arrows3", "" },
+ {"fe_arrows4", "" },
+#endif
};
#define MENU_X_RIGHT_ALIGNED(x) SCALE_AND_CENTER_X(DEFAULT_SCREEN_WIDTH - (x))
@@ -526,6 +537,10 @@ CMenuManager::CMenuManager()
#ifdef NO_ISLAND_LOADING
m_PrefsIslandLoading = ISLAND_LOADING_LOW;
#endif
+
+#ifdef GAMEPAD_MENU
+ m_PrefsControllerType = CONTROLLER_XBOXONE;
+#endif
}
void
@@ -1074,7 +1089,7 @@ CMenuManager::DrawStandardMenus(bool activeScreen)
}
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_Action) {
-#ifdef LEGACY_MENU_OPTIONS
+#if defined(LEGACY_MENU_OPTIONS) || defined(GAMEPAD_MENU)
case MENUACTION_CTRLVIBRATION:
if (m_PrefsUseVibration)
rightText = TheText.Get("FEM_ON");
@@ -1539,6 +1554,11 @@ CMenuManager::DrawStandardMenus(bool activeScreen)
#endif
switch (m_nCurrScreen) {
+#ifdef GAMEPAD_MENU
+ case MENUPAGE_CONTROLLER_SETTINGS:
+ PrintController();
+ break;
+#endif
case MENUPAGE_STATS:
case MENUPAGE_CONTROLLER_PC:
case MENUPAGE_SOUND_SETTINGS:
@@ -2280,6 +2300,9 @@ CMenuManager::DrawBackground(bool transitionCall)
break;
case MENUPAGE_SKIN_SELECT:
case MENUPAGE_KEYBOARD_CONTROLS:
+#ifdef GAMEPAD_MENU
+ case MENUPAGE_CONTROLLER_SETTINGS:
+#endif
menuBg.topLeft_x = 14.0f;
menuBg.topLeft_y = 39.0f;
menuBg.topRight_x = 636.0f;
@@ -2948,12 +2971,19 @@ CMenuManager::LoadAllTextures()
CTxdStore::AddRef(frontendTxdSlot2);
CTxdStore::SetCurrentTxd(frontendTxdSlot2);
+#ifdef GAMEPAD_MENU
+ for (int i = 3; i < MENUSPRITE_CONTROLLER; i++) {
+#else
for (int i = 3; i < NUM_MENU_SPRITES; i++) {
+#endif
m_aFrontEndSprites[i].SetTexture(FrontendFilenames[i][0], FrontendFilenames[i][1]);
m_aFrontEndSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER);
}
CTxdStore::PopCurrentTxd();
+#ifdef GAMEPAD_MENU
+ LoadController(m_PrefsControllerType);
+#endif
CStreaming::IHaveUsedStreamingMemory();
}
@@ -4896,6 +4926,16 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
if (changeAmount != 0) {
switch (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action) {
+#if defined(LEGACY_MENU_OPTIONS) || defined(GAMEPAD_MENU)
+ case MENUACTION_CTRLCONFIG:
+ CPad::GetPad(0)->Mode += changeAmount;
+ if (CPad::GetPad(0)->Mode > 3)
+ CPad::GetPad(0)->Mode = 0;
+ else if (CPad::GetPad(0)->Mode < 0)
+ CPad::GetPad(0)->Mode = 3;
+ SaveSettings();
+ break;
+#endif
case MENUACTION_RADIO:
ChangeRadioStation(changeAmount);
break;
@@ -5037,14 +5077,14 @@ void
CMenuManager::ProcessOnOffMenuOptions()
{
switch (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action) {
-#ifdef LEGACY_MENU_OPTIONS
+#if defined(LEGACY_MENU_OPTIONS) || defined(GAMEPAD_MENU)
case MENUACTION_CTRLVIBRATION:
m_PrefsUseVibration = !m_PrefsUseVibration;
- break;
- case MENUACTION_CTRLCONFIG:
- CPad::GetPad(0)->Mode++;
- if (CPad::GetPad(0)->Mode > 3)
- CPad::GetPad(0)->Mode = 0;
+ if (m_PrefsUseVibration) {
+ CPad::GetPad(0)->StartShake(350, 150);
+ TimeToStopPadShaking = CTimer::GetTimeInMillisecondsPauseMode() + 500;
+ }
+ SaveSettings();
break;
#endif
case MENUACTION_INVERTPADY:
@@ -5510,6 +5550,14 @@ CMenuManager::SwitchMenuOnAndOff()
m_bStartUpFrontEndRequested = false;
m_bShutDownFrontEndRequested = false;
+
+#if defined(LEGACY_MENU_OPTIONS) || defined(GAMEPAD_MENU)
+ // Reset pad shaking.
+ if (TimeToStopPadShaking && TimeToStopPadShaking < CTimer::GetTimeInMillisecondsPauseMode()) {
+ CPad::StopPadsShaking();
+ TimeToStopPadShaking = 0;
+ }
+#endif
}
void
@@ -5534,6 +5582,13 @@ CMenuManager::UnloadTextures()
m_aFrontEndSprites[i].Delete();
CTxdStore::RemoveTxd(frontend2);
+
+#ifdef GAMEPAD_MENU
+ // Unload controller txd
+ int frontend_controller = CTxdStore::FindTxdSlot("frontend_controller");
+ if (frontend_controller != -1)
+ CTxdStore::RemoveTxd(frontend_controller);
+#endif
}
m_bSpritesLoaded = false;
@@ -5781,5 +5836,753 @@ uint8 CMenuManager::GetNumberOfMenuOptions()
}
#endif
+#ifdef GAMEPAD_MENU
+const char* controllerTypesPaths[] = {
+ "MODELS/FRONTEND_DS2.TXD",
+ "MODELS/FRONTEND_DS3.TXD",
+ "MODELS/FRONTEND_DS4.TXD",
+ "MODELS/FRONTEND_X360.TXD",
+ "MODELS/FRONTEND_XONE.TXD",
+};
+
+void
+CMenuManager::PrintController(void)
+{
+ // Don't print anything if controller texture is missing
+ if (!m_aFrontEndSprites[MENUSPRITE_CONTROLLER].m_pTexture) return;
+
+ const float scale = 0.9f;
+ const float CONTROLLER_SIZE_X = 235.2f;
+ const float CONTROLLER_SIZE_Y = 175.2f;
+ const float CONTROLLER_POS_X = (DEFAULT_SCREEN_WIDTH - CONTROLLER_SIZE_X) / 2.0f;
+ const float CONTROLLER_POS_Y = 220.0f;
+
+ float centerX = CONTROLLER_POS_X + CONTROLLER_SIZE_X / 2;
+ float centerY = CONTROLLER_POS_Y + CONTROLLER_SIZE_Y / 2;
+
+#define X(f) ((f)*scale + centerX)
+#define Y(f) ((f)*scale + centerY)
+
+ m_aFrontEndSprites[MENUSPRITE_CONTROLLER].Draw(MENU_X_LEFT_ALIGNED(X(-CONTROLLER_SIZE_X / 2)), MENU_Y(Y(-CONTROLLER_SIZE_Y / 2)), MENU_X(CONTROLLER_SIZE_X * scale), MENU_Y(CONTROLLER_SIZE_Y * scale), CRGBA(255, 255, 255, FadeIn(255)));
+ if (m_DisplayControllerOnFoot) {
+ if ((int)CTimer::GetTimeInMillisecondsPauseMode() & 0x400)
+ m_aFrontEndSprites[MENUSPRITE_ARROWS1].Draw(MENU_X_LEFT_ALIGNED(X(-CONTROLLER_SIZE_X / 2)), MENU_Y(Y(-CONTROLLER_SIZE_Y / 2)), MENU_X(CONTROLLER_SIZE_X * scale), MENU_Y(CONTROLLER_SIZE_Y * scale), CRGBA(255, 255, 255, FadeIn(255)));
+ else
+ m_aFrontEndSprites[MENUSPRITE_ARROWS3].Draw(MENU_X_LEFT_ALIGNED(X(-CONTROLLER_SIZE_X / 2)), MENU_Y(Y(-CONTROLLER_SIZE_Y / 2)), MENU_X(CONTROLLER_SIZE_X * scale), MENU_Y(CONTROLLER_SIZE_Y * scale), CRGBA(255, 255, 255, FadeIn(255)));
+ }
+ else {
+ if ((int)CTimer::GetTimeInMillisecondsPauseMode() & 0x400)
+ m_aFrontEndSprites[MENUSPRITE_ARROWS2].Draw(MENU_X_LEFT_ALIGNED(X(-CONTROLLER_SIZE_X / 2)), MENU_Y(Y(-CONTROLLER_SIZE_Y / 2)), MENU_X(CONTROLLER_SIZE_X * scale), MENU_Y(CONTROLLER_SIZE_Y * scale), CRGBA(255, 255, 255, FadeIn(255)));
+ else
+ m_aFrontEndSprites[MENUSPRITE_ARROWS4].Draw(MENU_X_LEFT_ALIGNED(X(-CONTROLLER_SIZE_X / 2)), MENU_Y(Y(-CONTROLLER_SIZE_Y / 2)), MENU_X(CONTROLLER_SIZE_X * scale), MENU_Y(CONTROLLER_SIZE_Y * scale), CRGBA(255, 255, 255, FadeIn(255)));
+ }
+
+ CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
+
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.9f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.9f)); // X
+
+ CFont::SetDropColor(CRGBA(0, 0, 0, FadeIn(255)));
+ CFont::SetDropShadowPosition(0);
+ CFont::SetColor(CRGBA(0, 0, 0, FadeIn(255)));
+ CFont::SetWrapx(SCREEN_WIDTH);
+
+ float TEXT_L2_X = 85.0f + CONTROLLER_POS_X - centerX, TEXT_L2_Y = -14.0f + CONTROLLER_POS_Y - centerY;
+ float TEXT_L1_X = -4.0f + CONTROLLER_POS_X - centerX, TEXT_L1_Y = 27.0f + CONTROLLER_POS_Y - centerY, TEXT_L1_Y_VEH = 3.0f + TEXT_L1_Y;
+ float TEXT_DPAD_X = -4.0f + CONTROLLER_POS_X - centerX, TEXT_DPAD_Y = 67.0f + CONTROLLER_POS_Y - centerY;
+ float TEXT_LSTICK_X = -4.0f + CONTROLLER_POS_X - centerX, TEXT_LSTICK_Y = 97.0f + CONTROLLER_POS_Y - centerY;
+ float TEXT_SELECT_X = 170.0f + CONTROLLER_POS_X - centerX, TEXT_SELECT_Y = 141.0f + CONTROLLER_POS_Y - centerY;
+ float TEXT_START_X = 130.0f + CONTROLLER_POS_X - centerX, TEXT_START_Y = 128.0f + CONTROLLER_POS_Y - centerY;
+ float TEXT_R2_X = 164.0f + CONTROLLER_POS_X - centerX, TEXT_R2_Y = -14.0f + CONTROLLER_POS_Y - centerY;
+ float TEXT_R1_X = 242.0f + CONTROLLER_POS_X - centerX, TEXT_R1_Y = 27.0f + CONTROLLER_POS_Y - centerY;
+
+ float TEXT_SQUARE_X = 147.0f + CONTROLLER_POS_X - centerX, TEXT_SQUARE_Y = 30.0f + CONTROLLER_POS_Y - centerY;
+ float TEXT_TRIANGLE_X = 242.0f + CONTROLLER_POS_X - centerX, TEXT_TRIANGLE_Y = 55.0f + CONTROLLER_POS_Y - centerY;
+ float TEXT_CIRCLE_X = 242.0f + CONTROLLER_POS_X - centerX, TEXT_CIRCLE_Y = 67.0f + CONTROLLER_POS_Y - centerY;
+ float TEXT_CROSS_X = 242.0f + CONTROLLER_POS_X - centerX, TEXT_CROSS_Y = 80.0f + CONTROLLER_POS_Y - centerY;
+ float TEXT_RSTICK_X = 242.0f + CONTROLLER_POS_X - centerX, TEXT_RSTICK_Y = 97.0f + CONTROLLER_POS_Y - centerY;
+ float TEXT_R3_X = 242.0f + CONTROLLER_POS_X - centerX, TEXT_R3_Y = 110.0f + CONTROLLER_POS_Y - centerY;
+ float TEXT_L3_X = 94.0f + CONTROLLER_POS_X - centerX, TEXT_L3_Y = 162.0f + CONTROLLER_POS_Y - centerY;
+ float TEXT_L2R2_X = 120.0f + CONTROLLER_POS_X - centerX, TEXT_L2R2_Y = -4.0f + CONTROLLER_POS_Y - centerY;
+
+ switch (m_PrefsControllerType)
+ {
+ case CONTROLLER_DUALSHOCK4:
+ TEXT_L1_Y += 7.0f;
+ TEXT_L1_Y_VEH = TEXT_L1_Y;
+ TEXT_R1_Y += 7.0f;
+ TEXT_TRIANGLE_Y -= 1.0f;
+ TEXT_CIRCLE_Y -= 1.0f;
+ TEXT_CROSS_Y -= 1.0f;
+ TEXT_RSTICK_Y -= 4.0f;
+ TEXT_R3_Y -= 4.0f;
+ TEXT_DPAD_Y -= 2.0f;
+ TEXT_LSTICK_Y -= 6.0f;
+ TEXT_L3_X -= 2.0f;
+ break;
+ case CONTROLLER_XBOXONE:
+ TEXT_L2_X -= 2.0f;
+ TEXT_R2_X += 2.0f;
+ TEXT_L1_Y += 15.0f;
+ TEXT_L1_Y_VEH = TEXT_L1_Y;
+ TEXT_R1_Y += 15.0f;
+ TEXT_TRIANGLE_Y += 4.0f;
+ TEXT_CIRCLE_Y += 4.0f;
+ TEXT_CROSS_Y += 4.0f;
+ TEXT_RSTICK_Y += 1.0f;
+ TEXT_R3_Y += 1.0f;
+ TEXT_DPAD_Y += 29.0f;
+ TEXT_LSTICK_Y -= 20.0f;
+ TEXT_L3_X -= 36.0f;
+ TEXT_L2R2_Y += 5.0f;
+ TEXT_SELECT_X += 4.0f;
+ break;
+ case CONTROLLER_XBOX360:
+ TEXT_L2_X += 8.0f;
+ TEXT_R2_X -= 8.0f;
+ TEXT_L1_Y += 15.0f;
+ TEXT_L1_Y_VEH = TEXT_L1_Y;
+ TEXT_R1_Y += 15.0f;
+ TEXT_TRIANGLE_Y += 4.0f;
+ TEXT_CIRCLE_Y += 4.0f;
+ TEXT_CROSS_Y += 4.0f;
+ TEXT_RSTICK_Y += 4.0f;
+ TEXT_R3_Y += 4.0f;
+ TEXT_DPAD_Y += 30.0f;
+ TEXT_LSTICK_Y -= 19.0f;
+ TEXT_L3_X -= 36.0f;
+ TEXT_L2R2_Y += 5.0f;
+ TEXT_SELECT_X += 3.0f;
+ break;
+ };
+
+ if (m_DisplayControllerOnFoot) {
+ switch (CPad::GetPad(0)->Mode) {
+ case 0:
+ CFont::SetRightJustifyOn();
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ case LANGUAGE_SPANISH:
+ TEXT_L2_X -= 45.0f;
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)) - SCREEN_SCALE_X(85));
+ break;
+ default:
+ CFont::SetRightJustifyWrap(0);
+ break;
+ }
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_CWL"));
+ CFont::SetRightJustifyWrap(0);
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y)), TheText.Get("FEC_LOF"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_MOV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_MOV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_CR3"));
+ CFont::SetRightJustifyOn();
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_GERMAN:
+ TEXT_SELECT_X += 20.0f;
+ break;
+ case LANGUAGE_SPANISH:
+ TEXT_SELECT_X += 15.0f;
+ break;
+ default:
+ break;
+ }
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_CAM"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU"));
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ case LANGUAGE_SPANISH:
+ TEXT_R2_X += 30.0f;
+ CFont::SetJustifyOff();
+ CFont::SetWrapx(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)) + SCREEN_SCALE_X(120));
+ break;
+ default:
+ break;
+ }
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_CWR"));
+ CFont::SetJustifyOn();
+ CFont::SetWrapx(SCREEN_WIDTH);
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_TAR"));
+ CFont::SetRightJustifyOn();
+ CFont::PrintStringFromBottom(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_JUM"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_ENV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_ATT"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_RUN"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_FPC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_LB3"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y + 13.0f)), TheText.Get("FEC_R3"));
+ break;
+ case 1:
+ CFont::SetRightJustifyOn();
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ case LANGUAGE_SPANISH:
+ TEXT_L2_X -= 45.0f;
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)) - SCREEN_SCALE_X(85));
+ break;
+ default:
+ CFont::SetRightJustifyWrap(0);
+ break;
+ }
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_CWL"));
+ CFont::SetRightJustifyWrap(0);
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y)), TheText.Get("FEC_LOF"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_CAM"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_MOV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_CR3"));
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_GERMAN:
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_NA"));
+ break;
+ default:
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X - 50)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_NA"));
+ break;
+ }
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU"));
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ case LANGUAGE_SPANISH:
+ TEXT_R2_X += 30.0f;
+ CFont::SetJustifyOff();
+ CFont::SetWrapx(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)) + SCREEN_SCALE_X(120));
+ break;
+ default:
+ break;
+ }
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_CWR"));
+ CFont::SetJustifyOn();
+ CFont::SetWrapx(SCREEN_WIDTH);
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_TAR"));
+ CFont::SetRightJustifyOn();
+ CFont::PrintStringFromBottom(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_JUM"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_ENV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_ATT"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_RUN"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_FPC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_LB3"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y + 13.0f)), TheText.Get("FEC_R3"));
+ break;
+ case 2:
+ CFont::SetRightJustifyOn();
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ case LANGUAGE_SPANISH:
+ TEXT_L2_X -= 45.0f;
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)) - SCREEN_SCALE_X(85));
+ break;
+ default:
+ CFont::SetRightJustifyWrap(0);
+ break;
+ }
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_CWL"));
+ CFont::SetRightJustifyWrap(0);
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y)), TheText.Get("FEC_ENV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_MOV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_MOV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_CR3"));
+ CFont::SetRightJustifyOn();
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_GERMAN:
+ TEXT_SELECT_X += 20.0f;
+ break;
+ case LANGUAGE_SPANISH:
+ TEXT_SELECT_X += 15.0f;
+ break;
+ default:
+ break;
+ }
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_CAM"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU"));
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ case LANGUAGE_SPANISH:
+ TEXT_R2_X += 30.0f;
+ CFont::SetJustifyOff();
+ CFont::SetWrapx(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)) + SCREEN_SCALE_X(120));
+ break;
+ default:
+ break;
+ }
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_CWR"));
+ CFont::SetJustifyOn();
+ CFont::SetWrapx(SCREEN_WIDTH);
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_TAR"));
+ CFont::SetRightJustifyOn();
+ CFont::PrintStringFromBottom(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_JUM"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_LOF"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_RUN"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_ATT"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_FPC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_LB3"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y + 13.0f)), TheText.Get("FEC_R3"));
+ break;
+ case 3:
+ CFont::SetRightJustifyOn();
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ case LANGUAGE_SPANISH:
+ TEXT_L2_X -= 45.0f;
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)) - SCREEN_SCALE_X(85));
+ break;
+ default:
+ CFont::SetRightJustifyWrap(0);
+ break;
+ }
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_CWL"));
+ CFont::SetRightJustifyWrap(0);
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y)), TheText.Get("FEC_TAR"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_NA"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_MOV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_CR3"));
+ CFont::SetRightJustifyOn();
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_GERMAN:
+ TEXT_SELECT_X += 20.0f;
+ break;
+ case LANGUAGE_SPANISH:
+ TEXT_SELECT_X += 15.0f;
+ break;
+ default:
+ break;
+ }
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_CAM"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU"));
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ case LANGUAGE_SPANISH:
+ TEXT_R2_X += 30.0f;
+ CFont::SetJustifyOff();
+ CFont::SetWrapx(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)) + SCREEN_SCALE_X(120));
+ break;
+ default:
+ break;
+ }
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_CWR"));
+ CFont::SetJustifyOn();
+ CFont::SetWrapx(SCREEN_WIDTH);
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_TAR"));
+ CFont::SetRightJustifyOn();
+ CFont::PrintStringFromBottom(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_JUM"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_LOF"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_RUN"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_ATT"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_FPC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_LB3"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y + 13.0f)), TheText.Get("FEC_R3"));
+ break;
+ default:
+ return;
+ }
+ }
+ else {
+ CFont::SetCentreOn();
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_ITALIAN:
+ if (m_PrefsControllerType != CONTROLLER_XBOX360)
+ break;
+ case LANGUAGE_FRENCH:
+ case LANGUAGE_GERMAN:
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ break;
+ default:
+ break;
+ }
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(0.0f)), MENU_Y(Y(TEXT_L2R2_Y)), TheText.Get("FEC_LB"));
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.9f), MENU_Y(SMALLESTTEXT_Y_SCALE* scale * 0.9f));
+ switch (CPad::GetPad(0)->Mode) {
+ case 0:
+ CFont::SetRightJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_LL"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y_VEH)), TheText.Get("FEC_RSC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_VES"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_VES"));
+ CFont::SetRightJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L3_X)), MENU_Y(Y(TEXT_L3_Y)), TheText.Get("FEC_HO3"));
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ TEXT_SELECT_X -= 5.0f;
+ break;
+ case LANGUAGE_GERMAN:
+ TEXT_SELECT_X += 20.0f;
+ break;
+ case LANGUAGE_SPANISH:
+ TEXT_SELECT_X += 15.0f;
+ break;
+ default:
+ break;
+ }
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)) - SCREEN_SCALE_X(80));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_CAM"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_LR"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_HAB"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_EXV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_CAW"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_ACC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_TUC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_SM3"));
+ CFont::SetRightJustifyOn();
+ switch (m_PrefsControllerType)
+ {
+ case CONTROLLER_XBOXONE:
+ case CONTROLLER_XBOX360:
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ TEXT_SQUARE_X += 3.0f;
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(90));
+ break;
+ case LANGUAGE_GERMAN:
+ case LANGUAGE_SPANISH:
+ TEXT_SQUARE_X += 18.0f;
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(90));
+ break;
+ default:
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(60));
+ break;
+ }
+ break;
+ default:
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ TEXT_SQUARE_X -= 15.0f;
+ TEXT_SQUARE_Y += 5.0f;
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(60));
+ break;
+ case LANGUAGE_GERMAN:
+ TEXT_SQUARE_X -= 15.0f;
+ TEXT_SQUARE_Y += 10.0f;
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE* scale * 0.65f));
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(60));
+ break;
+ case LANGUAGE_SPANISH:
+ TEXT_SQUARE_X += 15.0f;
+ case LANGUAGE_ITALIAN:
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ default:
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(100));
+ break;
+ }
+ break;
+ }
+ CFont::PrintStringFromBottom(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_BRA"));
+ break;
+ case 1:
+ CFont::SetRightJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_LL"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y_VEH)), TheText.Get("FEC_HOR"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_CAM"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_VES"));
+ CFont::SetRightJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L3_X)), MENU_Y(Y(TEXT_L3_Y)), TheText.Get("FEC_NA"));
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_GERMAN:
+ TEXT_SELECT_X += 20.0f;
+ break;
+ case LANGUAGE_SPANISH:
+ TEXT_SELECT_X += 12.0f;
+ break;
+ default:
+ break;
+ }
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)) - SCREEN_SCALE_X(80));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_RSC"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_LR"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_HAB"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_EXV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_CAW"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_ACC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_TUC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_SM3"));
+ CFont::SetRightJustifyOn();
+ switch (m_PrefsControllerType)
+ {
+ case CONTROLLER_XBOXONE:
+ case CONTROLLER_XBOX360:
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ TEXT_SQUARE_X += 3.0f;
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(90));
+ break;
+ case LANGUAGE_GERMAN:
+ case LANGUAGE_SPANISH:
+ TEXT_SQUARE_X += 18.0f;
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(90));
+ break;
+ default:
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(60));
+ break;
+ }
+ break;
+ default:
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ TEXT_SQUARE_X -= 15.0f;
+ TEXT_SQUARE_Y += 5.0f;
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(60));
+ break;
+ case LANGUAGE_GERMAN:
+ TEXT_SQUARE_X -= 15.0f;
+ TEXT_SQUARE_Y += 10.0f;
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(60));
+ break;
+ case LANGUAGE_SPANISH:
+ TEXT_SQUARE_X += 15.0f;
+ case LANGUAGE_ITALIAN:
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ default:
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(100));
+ break;
+ }
+ break;
+ }
+ CFont::PrintStringFromBottom(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_BRA"));
+ break;
+ case 2:
+ CFont::SetRightJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_LL"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y_VEH)), TheText.Get("FEC_EXV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_VES"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_VES"));
+ CFont::SetRightJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L3_X)), MENU_Y(Y(TEXT_L3_Y)), TheText.Get("FEC_RS3"));
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ TEXT_SELECT_X -= 5.0f;
+ break;
+ case LANGUAGE_GERMAN:
+ TEXT_SELECT_X += 20.0f;
+ break;
+ case LANGUAGE_SPANISH:
+ TEXT_SELECT_X += 15.0f;
+ break;
+ default:
+ break;
+ }
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)) - SCREEN_SCALE_X(80));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_CAM"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_LR"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_HOR"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_HAB"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_CAW"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_ACC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_TUC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_SM3"));
+ CFont::SetRightJustifyOn();
+ switch (m_PrefsControllerType)
+ {
+ case CONTROLLER_XBOXONE:
+ case CONTROLLER_XBOX360:
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ TEXT_SQUARE_X += 3.0f;
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(90));
+ break;
+ case LANGUAGE_GERMAN:
+ case LANGUAGE_SPANISH:
+ TEXT_SQUARE_X += 18.0f;
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(90));
+ break;
+ default:
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(60));
+ break;
+ }
+ break;
+ default:
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ TEXT_SQUARE_X -= 15.0f;
+ TEXT_SQUARE_Y += 5.0f;
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(60));
+ break;
+ case LANGUAGE_GERMAN:
+ TEXT_SQUARE_X -= 15.0f;
+ TEXT_SQUARE_Y += 10.0f;
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(60));
+ break;
+ case LANGUAGE_SPANISH:
+ TEXT_SQUARE_X += 15.0f;
+ case LANGUAGE_ITALIAN:
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ default:
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)) - SCREEN_SCALE_X(100));
+ break;
+ }
+ break;
+ }
+ CFont::PrintStringFromBottom(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_BRA"));
+ break;
+ case 3:
+ CFont::SetRightJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L2_X)), MENU_Y(Y(TEXT_L2_Y)), TheText.Get("FEC_LL"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L1_X)), MENU_Y(Y(TEXT_L1_Y_VEH)), TheText.Get("FEC_HAB"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_DPAD_X)), MENU_Y(Y(TEXT_DPAD_Y)), TheText.Get("FEC_TUC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_LSTICK_X)), MENU_Y(Y(TEXT_LSTICK_Y)), TheText.Get("FEC_VES"));
+ CFont::SetRightJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_L3_X)), MENU_Y(Y(TEXT_L3_Y)), TheText.Get("FEC_HO3"));
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_FRENCH:
+ TEXT_SELECT_X -= 5.0f;
+ break;
+ case LANGUAGE_GERMAN:
+ TEXT_SELECT_X += 20.0f;
+ break;
+ case LANGUAGE_SPANISH:
+ TEXT_SELECT_X += 15.0f;
+ break;
+ default:
+ break;
+ }
+ CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)) - SCREEN_SCALE_X(80));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_SELECT_X)), MENU_Y(Y(TEXT_SELECT_Y)), TheText.Get("FEC_CAM"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_START_X)), MENU_Y(Y(TEXT_START_Y)), TheText.Get("FEC_PAU"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R2_X)), MENU_Y(Y(TEXT_R2_Y)), TheText.Get("FEC_LR"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R1_X)), MENU_Y(Y(TEXT_R1_Y)), TheText.Get("FEC_CAW"));
+ CFont::SetJustifyOn();
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_TRIANGLE_X)), MENU_Y(Y(TEXT_TRIANGLE_Y)), TheText.Get("FEC_EXV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CIRCLE_X)), MENU_Y(Y(TEXT_CIRCLE_Y)), TheText.Get("FEC_RSC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_CROSS_X)), MENU_Y(Y(TEXT_CROSS_Y)), TheText.Get("FEC_NA"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_RSTICK_X)), MENU_Y(Y(TEXT_RSTICK_Y)), TheText.Get("FEC_ACC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(X(TEXT_R3_X)), MENU_Y(Y(TEXT_R3_Y)), TheText.Get("FEC_BRA"));
+ CFont::SetRightJustifyOn();
+ CFont::SetRightJustifyWrap(0);
+ switch (m_PrefsControllerType)
+ {
+ case CONTROLLER_XBOXONE:
+ case CONTROLLER_XBOX360:
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ CFont::PrintStringFromBottom(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_SMT"));
+ break;
+ default:
+ switch (m_PrefsLanguage)
+ {
+ case LANGUAGE_GERMAN:
+ TEXT_SQUARE_X += 5.0f;
+ case LANGUAGE_FRENCH:
+ case LANGUAGE_ITALIAN:
+ CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE * 2 * scale * 0.65f), MENU_Y(SMALLESTTEXT_Y_SCALE * scale * 0.65f));
+ CFont::PrintStringFromBottom(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_SMT"));
+ break;
+ default:
+ CFont::PrintStringFromBottom(MENU_X_LEFT_ALIGNED(X(TEXT_SQUARE_X + 16.0f)), MENU_Y(Y(TEXT_SQUARE_Y)), TheText.Get("FEC_SMT"));
+ break;
+ }
+ break;
+ }
+ break;
+ default:
+ return;
+ }
+ }
+
+ CFont::SetDropShadowPosition(0); // X
+
+#undef X
+#undef Y
+}
+
+
+void
+CMenuManager::LoadController(int8 type)
+{
+ switch (type)
+ {
+ case CONTROLLER_DUALSHOCK2:
+ case CONTROLLER_DUALSHOCK3:
+ case CONTROLLER_DUALSHOCK4:
+ CFont::LoadButtons("MODELS/PS3BTNS.TXD");
+ break;
+ default:
+ CFont::LoadButtons("MODELS/X360BTNS.TXD");
+ break;
+ }
+
+ // Unload current textures
+ for (int i = MENUSPRITE_CONTROLLER; i <= MENUSPRITE_ARROWS4; i++)
+ m_aFrontEndSprites[i].Delete();
+
+ // Unload txd
+ int frontend_controller = CTxdStore::FindTxdSlot("frontend_controller");
+ if (frontend_controller != -1)
+ CTxdStore::RemoveTxd(frontend_controller);
+
+ // Find the new txd to load
+ bool bTxdMissing = true;
+ if (controllerTypesPaths[type])
+ if (int file = CFileMgr::OpenFile(controllerTypesPaths[type])) {
+ CFileMgr::CloseFile(file);
+ bTxdMissing = false;
+ }
+
+ int txdSlot = -1;
+
+ if (bTxdMissing)
+ // Not found, fall back to original textures
+ txdSlot = CTxdStore::FindTxdSlot("frontend2");
+ else {
+ // Found, load txd
+ txdSlot = frontend_controller;
+ if (txdSlot == -1)
+ txdSlot = CTxdStore::AddTxdSlot("frontend_controller");
+ CTxdStore::LoadTxd(txdSlot, controllerTypesPaths[type]);
+ CTxdStore::AddRef(txdSlot);
+ }
+
+ assert(txdSlot != -1);
+ // Load new textures
+ CTxdStore::SetCurrentTxd(txdSlot);
+ for (int i = MENUSPRITE_CONTROLLER; i <= MENUSPRITE_ARROWS4; i++) {
+ m_aFrontEndSprites[i].SetTexture(FrontendFilenames[i][0], FrontendFilenames[i][1]);
+ m_aFrontEndSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER);
+ }
+}
+#endif // GAMEPAD_MENU
+
#undef GetBackJustUp
#undef GetBackJustDown
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index c1c3983e..6457ce29 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -137,6 +137,13 @@ enum eMenuSprites
MENUSPRITE_DOWNON,
MENUSPRITE_UPOFF,
MENUSPRITE_UPON,
+#ifdef GAMEPAD_MENU
+ MENUSPRITE_CONTROLLER,
+ MENUSPRITE_ARROWS1,
+ MENUSPRITE_ARROWS2,
+ MENUSPRITE_ARROWS3,
+ MENUSPRITE_ARROWS4,
+#endif
NUM_MENU_SPRITES
};
@@ -192,8 +199,10 @@ enum eMenuScreen
MENUPAGE_MOUSE_CONTROLS = 31,
MENUPAGE_PAUSE_MENU = 32,
MENUPAGE_NONE = 33, // Then chooses main menu or pause menu
-#ifdef LEGACY_MENU_OPTIONS
+#if defined(LEGACY_MENU_OPTIONS) || defined(GAMEPAD_MENU)
MENUPAGE_CONTROLLER_SETTINGS,
+#endif
+#ifdef LEGACY_MENU_OPTIONS
MENUPAGE_DEBUG_MENU,
MENUPAGE_CONTROLLER_PC_OLD1,
MENUPAGE_CONTROLLER_PC_OLD2,
@@ -275,7 +284,7 @@ enum eMenuAction
MENUACTION_DRAWDIST,
MENUACTION_MOUSESENS,
MENUACTION_MP3VOLUMEBOOST,
-#ifdef LEGACY_MENU_OPTIONS
+#if defined(LEGACY_MENU_OPTIONS) || defined(GAMEPAD_MENU)
MENUACTION_CTRLVIBRATION,
MENUACTION_CTRLCONFIG,
#endif
@@ -668,6 +677,18 @@ public:
int8 m_nDisplayMSAALevel;
#endif
+#ifdef GAMEPAD_MENU
+ enum
+ {
+ CONTROLLER_DUALSHOCK2 = 0,
+ CONTROLLER_DUALSHOCK3,
+ CONTROLLER_DUALSHOCK4,
+ CONTROLLER_XBOX360,
+ CONTROLLER_XBOXONE,
+ };
+
+ int8 m_PrefsControllerType;
+#endif
enum LANGUAGE
{
LANGUAGE_AMERICAN,
@@ -788,6 +809,10 @@ public:
int8 GetPreviousPageOption();
// uint8 GetNumberOfMenuOptions();
+#ifdef GAMEPAD_MENU
+ void LoadController(int8 type);
+ void PrintController(void);
+#endif
};
#ifndef IMPROVED_VIDEOMODE
diff --git a/src/core/MenuScreensCustom.cpp b/src/core/MenuScreensCustom.cpp
index 770e8ec1..5b2f3d16 100644
--- a/src/core/MenuScreensCustom.cpp
+++ b/src/core/MenuScreensCustom.cpp
@@ -69,11 +69,17 @@
#endif
#ifdef INVERT_LOOK_FOR_PAD
- #define INVERT_PAD_SELECTOR MENUACTION_CFO_SELECT, "FEC_ILU", { new CCFOSelect((int8*)&CPad::bInvertLook4Pad, "Controller", "InvertPad", off_on, 2, false) }, 150, 0, MENUALIGN_LEFT,
+ #define INVERT_PAD_SELECTOR MENUACTION_CFO_SELECT, "FEC_ILU", { new CCFOSelect((int8*)&CPad::bInvertLook4Pad, "Controller", "InvertPad", off_on, 2, false) }, 0, 0, MENUALIGN_LEFT,
#else
#define INVERT_PAD_SELECTOR
#endif
+#ifdef GAMEPAD_MENU
+ #define SELECT_CONTROLLER_TYPE MENUACTION_CFO_SELECT, "FEC_TYP", { new CCFOSelect((int8*)&FrontEndMenuManager.m_PrefsControllerType, "Controller", "Type", controllerTypes, ARRAY_SIZE(controllerTypes), false, ControllerTypeAfterChange) }, 0, 0, MENUALIGN_LEFT,
+#else
+ #define SELECT_CONTROLLER_TYPE
+#endif
+
const char *filterNames[] = { "FEM_NON", "FEM_SIM", "FEM_NRM", "FEM_MOB" };
const char *off_on[] = { "FEM_OFF", "FEM_ON" };
@@ -332,6 +338,14 @@ void DetectJoystickGoBack() {
}
#endif
+#ifdef GAMEPAD_MENU
+const char* controllerTypes[] = { "FEC_DS2", "FEC_DS3", "FEC_DS4", "FEC_360", "FEC_ONE" };
+void ControllerTypeAfterChange(int8 before, int8 after)
+{
+ FrontEndMenuManager.LoadController(after);
+}
+#endif
+
CMenuScreenCustom aScreens[] = {
// MENUPAGE_STATS = 0
{ "FEH_STA", MENUPAGE_NONE, nil, nil,
@@ -567,11 +581,13 @@ CMenuScreenCustom aScreens[] = {
#else
MENUACTION_KEYBOARDCTRLS,"FEC_RED", {nil, SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS}, 320, 150, MENUALIGN_CENTER,
#endif
+#ifdef GAMEPAD_MENU
+ MENUACTION_CHANGEMENU, "FET_AGS", {nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS}, 0, 0, MENUALIGN_CENTER,
+#endif
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
MENUACTION_CHANGEMENU, "FEC_JOD", {nil, SAVESLOT_NONE, MENUPAGE_DETECT_JOYSTICK}, 0, 0, MENUALIGN_CENTER,
#endif
MENUACTION_CHANGEMENU, "FEC_MOU", {nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS}, 0, 0, MENUALIGN_CENTER,
- INVERT_PAD_SELECTOR
MENUACTION_RESTOREDEF, "FET_DEF", {nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC}, 320, 0, MENUALIGN_CENTER,
MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, 0}, 320, 0, MENUALIGN_CENTER,
},
@@ -611,8 +627,12 @@ CMenuScreenCustom aScreens[] = {
{ "FEC_MOU", MENUPAGE_CONTROLLER_PC, nil, nil,
MENUACTION_MOUSESENS, "FEC_MSH", {nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS}, 40, 170, MENUALIGN_LEFT,
MENUACTION_INVVERT, "FEC_IVV", {nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS}, 0, 0, MENUALIGN_LEFT,
+#ifndef GAMEPAD_MENU
+ INVERT_PAD_SELECTOR
+#endif
MENUACTION_MOUSESTEER, "FET_MST", {nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS}, 0, 0, MENUALIGN_LEFT,
- MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, 0}, 320, 260, MENUALIGN_CENTER,
+ MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, 0}, 320, 0, MENUALIGN_CENTER,
+ //MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, 0}, 320, 260, MENUALIGN_CENTER, // original y
},
// MENUPAGE_PAUSE_MENU = 32
@@ -629,15 +649,24 @@ CMenuScreenCustom aScreens[] = {
// MENUPAGE_NONE = 33
{ "", 0, nil, nil, },
-
-#ifdef LEGACY_MENU_OPTIONS
+#ifdef GAMEPAD_MENU
+ { "FET_AGS", MENUPAGE_CONTROLLER_PC, new CCustomScreenLayout({40, 78, 25, true}), nil,
+ MENUACTION_CTRLCONFIG, "FEC_CCF", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS }, 40, 76, MENUALIGN_LEFT,
+ MENUACTION_CTRLDISPLAY, "FEC_CDP", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS }, 0, 0, MENUALIGN_LEFT,
+ INVERT_PAD_SELECTOR
+ MENUACTION_CTRLVIBRATION, "FEC_VIB", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS }, 0, 0, MENUALIGN_LEFT,
+ SELECT_CONTROLLER_TYPE
+ MENUACTION_GOBACK, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE }, 0, 0, MENUALIGN_LEFT,
+ },
+#elif defined(LEGACY_MENU_OPTIONS)
// MENUPAGE_CONTROLLER_SETTINGS = 4
{ "FET_CON", MENUPAGE_OPTIONS, nil, nil,
MENUACTION_CTRLCONFIG, "FEC_CCF", {nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS}, 0, 0, 0,
MENUACTION_CTRLVIBRATION, "FEC_VIB", {nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS}, 0, 0, 0,
MENUACTION_GOBACK, "FEDS_TB", {nil, SAVESLOT_NONE, MENUPAGE_NONE}, 0, 0, 0,
},
-
+#endif
+#ifdef LEGACY_MENU_OPTIONS
// MENUPAGE_DEBUG_MENU = 18
{ "FED_DBG", MENUPAGE_NONE, nil, nil,
MENUACTION_RELOADIDE, "FED_RID", {nil, SAVESLOT_NONE, MENUPAGE_NONE}, 0, 0, 0,
diff --git a/src/core/config.h b/src/core/config.h
index cc82f8d6..7adbdd63 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -320,6 +320,9 @@ enum Config {
//# define PS2_MENU_USEALLPAGEICONS
#else
# define MAP_ENHANCEMENTS // Adding waypoint and better mouse support
+# ifdef XINPUT
+# define GAMEPAD_MENU // Add gamepad menu
+# endif
# define TRIANGLE_BACK_BUTTON
//# define CIRCLE_BACK_BUTTON
#define LEGACY_MENU_OPTIONS // i.e. frame sync(vsync)
diff --git a/src/render/Font.cpp b/src/render/Font.cpp
index 0f5930ee..35ed2e56 100644
--- a/src/render/Font.cpp
+++ b/src/render/Font.cpp
@@ -289,11 +289,26 @@ CFont::Initialise(void)
SetDropShadowPosition(0);
CTxdStore::PopCurrentTxd();
+#if !defined(GAMEPAD_MENU) && defined(BUTTON_ICONS)
+ // loaded in CMenuManager with GAMEPAD_MENU defined
+ LoadButtons("MODELS/X360BTNS.TXD");
+#endif
+}
+
#ifdef BUTTON_ICONS
- if (int file = CFileMgr::OpenFile("MODELS/X360BTNS.TXD")) {
+void
+CFont::LoadButtons(const char *txdPath)
+{
+ if (int file = CFileMgr::OpenFile(txdPath)) {
CFileMgr::CloseFile(file);
- ButtonsSlot = CTxdStore::AddTxdSlot("buttons");
- CTxdStore::LoadTxd(ButtonsSlot, "MODELS/X360BTNS.TXD");
+ if (ButtonsSlot == -1)
+ ButtonsSlot = CTxdStore::AddTxdSlot("buttons");
+ else {
+ for (int i = 0; i < MAX_BUTTON_ICONS; i++)
+ ButtonSprite[i].Delete();
+ CTxdStore::RemoveTxd(ButtonsSlot);
+ }
+ CTxdStore::LoadTxd(ButtonsSlot, txdPath);
CTxdStore::AddRef(ButtonsSlot);
CTxdStore::PushCurrentTxd();
CTxdStore::SetCurrentTxd(ButtonsSlot);
@@ -311,12 +326,22 @@ CFont::Initialise(void)
ButtonSprite[BUTTON_R1].SetTexture("r1");
ButtonSprite[BUTTON_R2].SetTexture("r2");
ButtonSprite[BUTTON_R3].SetTexture("r3");
+ ButtonSprite[BUTTON_RSTICK_UP].SetTexture("thumbryu");
+ ButtonSprite[BUTTON_RSTICK_DOWN].SetTexture("thumbryd");
ButtonSprite[BUTTON_RSTICK_LEFT].SetTexture("thumbrxl");
ButtonSprite[BUTTON_RSTICK_RIGHT].SetTexture("thumbrxr");
CTxdStore::PopCurrentTxd();
}
-#endif // BUTTON_ICONS
+ else {
+ if (ButtonsSlot != -1) {
+ for (int i = 0; i < MAX_BUTTON_ICONS; i++)
+ ButtonSprite[i].Delete();
+ CTxdStore::RemoveTxdSlot(ButtonsSlot);
+ ButtonsSlot = -1;
+ }
+ }
}
+#endif // BUTTON_ICONS
#ifdef MORE_LANGUAGES
void
@@ -369,6 +394,7 @@ CFont::Shutdown(void)
for (int i = 0; i < MAX_BUTTON_ICONS; i++)
ButtonSprite[i].Delete();
CTxdStore::RemoveTxdSlot(ButtonsSlot);
+ ButtonsSlot = -1;
}
#endif
Sprite[0].Delete();
@@ -1437,6 +1463,8 @@ CFont::ParseToken(wchar* str, CRGBA &color, bool &flash, bool &bold)
case 'J': PS2Symbol = BUTTON_R1; break;
case 'V': PS2Symbol = BUTTON_R2; break;
case 'C': PS2Symbol = BUTTON_R3; break;
+ case 'H': PS2Symbol = BUTTON_RSTICK_UP; break;
+ case 'L': PS2Symbol = BUTTON_RSTICK_DOWN; break;
case '(': PS2Symbol = BUTTON_RSTICK_LEFT; break;
case ')': PS2Symbol = BUTTON_RSTICK_RIGHT; break;
#endif
@@ -1488,6 +1516,8 @@ CFont::ParseToken(wchar *s, bool japShit)
case 'J': PS2Symbol = BUTTON_R1; break;
case 'V': PS2Symbol = BUTTON_R2; break;
case 'C': PS2Symbol = BUTTON_R3; break;
+ case 'H': PS2Symbol = BUTTON_RSTICK_UP; break;
+ case 'L': PS2Symbol = BUTTON_RSTICK_DOWN; break;
case '(': PS2Symbol = BUTTON_RSTICK_LEFT; break;
case ')': PS2Symbol = BUTTON_RSTICK_RIGHT; break;
#endif
@@ -1612,6 +1642,8 @@ CFont::ParseToken(wchar *s)
case 'J': PS2Symbol = BUTTON_R1; break;
case 'V': PS2Symbol = BUTTON_R2; break;
case 'C': PS2Symbol = BUTTON_R3; break;
+ case 'H': PS2Symbol = BUTTON_RSTICK_UP; break;
+ case 'L': PS2Symbol = BUTTON_RSTICK_DOWN; break;
case '(': PS2Symbol = BUTTON_RSTICK_LEFT; break;
case ')': PS2Symbol = BUTTON_RSTICK_RIGHT; break;
#endif
diff --git a/src/render/Font.h b/src/render/Font.h
index 57f1814d..b0cd0a27 100644
--- a/src/render/Font.h
+++ b/src/render/Font.h
@@ -111,6 +111,8 @@ enum
BUTTON_R1,
BUTTON_R2,
BUTTON_R3,
+ BUTTON_RSTICK_UP,
+ BUTTON_RSTICK_DOWN,
BUTTON_RSTICK_LEFT,
BUTTON_RSTICK_RIGHT,
MAX_BUTTON_ICONS
@@ -137,7 +139,8 @@ public:
static int32 ButtonsSlot;
static CSprite2d ButtonSprite[MAX_BUTTON_ICONS];
static int PS2Symbol;
-
+
+ static void LoadButtons(const char *txdPath);
static void DrawButton(float x, float y);
#endif // BUTTON_ICONS