code:
#pragma once
#ifdef PS2_MENU
#include "Frontend_PS2.h"
#else

#include "Sprite2d.h"

#ifdef PS2_LIKE_MENU
#define MENUHEADER_POS_X 50.0f
#define MENUHEADER_POS_Y 75.0f
#define MENUHEADER_HEIGHT 1.3f
#else
#define MENUHEADER_POS_X 35.0f
#define MENUHEADER_POS_Y 93.0f
#define MENUHEADER_HEIGHT 1.6f
#endif
#define MENUHEADER_WIDTH 0.84f

#define MENU_X_MARGIN 40.0f
#define MENUACTION_POS_Y 60.0f
#define MENUACTION_SCALE_MULT 0.9f

#define MENURADIO_ICON_SCALE 60.0f

#define MENUSLIDER_X 256.0f
#define MENUSLIDER_UNK 256.0f

#define MENUSLIDER_BARS 16
#define MENUSLIDER_LOGICAL_BARS MENUSLIDER_BARS

#define BIGTEXT_X_SCALE 0.75f // For FONT_HEADING
#define BIGTEXT_Y_SCALE 0.9f
#define MEDIUMTEXT_X_SCALE 0.55f // For FONT_HEADING
#define MEDIUMTEXT_Y_SCALE 0.8f
#define SMALLTEXT_X_SCALE 0.45f // used for FONT_HEADING and FONT_BANK, but looks off for HEADING
#define SMALLTEXT_Y_SCALE 0.7f
#define SMALLESTTEXT_X_SCALE 0.4f // used for both FONT_HEADING and FONT_BANK
#define SMALLESTTEXT_Y_SCALE 0.6f

#define HELPER_TEXT_LEFT_MARGIN 320.0f
#define HELPER_TEXT_BOTTOM_MARGIN 120.0f

#define PLAYERSETUP_LIST_TOP 28.0f
#define PLAYERSETUP_LIST_BOTTOM 125.0f
#define PLAYERSETUP_LIST_LEFT 200.0f
#define PLAYERSETUP_LIST_RIGHT 36.0f
#ifdef FIX_BUGS // See the scrollbar button drawing code
#define PLAYERSETUP_SCROLLBAR_WIDTH 19.0f
#else
#define PLAYERSETUP_SCROLLBAR_WIDTH 16.0f
#endif
#define PLAYERSETUP_SCROLLBUTTON_HEIGHT 17.0f
#define PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION 64
#define PLAYERSETUP_SKIN_COLUMN_LEFT 220.0f
#define PLAYERSETUP_DATE_COLUMN_RIGHT 56.0f
#define PLAYERSETUP_LIST_BODY_TOP 47
#define PLAYERSETUP_ROW_HEIGHT 9

#define STATS_SLIDE_Y_PER_SECOND 30.0f
#define STATS_ROW_HEIGHT 20.0f
#define STATS_ROW_X_MARGIN 50.0f
#define STATS_BOTTOM_MARGIN 135.0f
#define STATS_TOP_MARGIN 40.0f
#define STATS_TOP_DIMMING_AREA_LENGTH (93.0f - STATS_TOP_MARGIN)
#define STATS_BOTTOM_DIMMING_AREA_LENGTH 55.0f
#define STATS_PUT_BACK_TO_BOTTOM_Y 50.0f
#define STATS_RATING_X 24.0f
#define STATS_RATING_Y 20.0f

#define BRIEFS_TOP_MARGIN 40.0f
#define BRIEFS_LINE_X 50.0f
#define BRIEFS_LINE_HEIGHT 60.0f

#define CONTSETUP_STANDARD_ROW_HEIGHT 10.7f
#define CONTSETUP_CLASSIC_ROW_HEIGHT 9.0f
#define CONTSETUP_BOUND_HIGHLIGHT_HEIGHT 10
#define CONTSETUP_BOUND_COLUMN_WIDTH 190.0f
#define CONTSETUP_LIST_HEADER_HEIGHT 20.0f
#define CONTSETUP_LIST_TOP 28.0f
#define CONTSETUP_LIST_RIGHT 18.0f
#define CONTSETUP_LIST_BOTTOM 120.0f
#define CONTSETUP_LIST_LEFT 18.0f
#define CONTSETUP_COLUMN_1_X 40.0f
#define CONTSETUP_COLUMN_2_X 210.0f
#define CONTSETUP_COLUMN_3_X (CONTSETUP_COLUMN_2_X + CONTSETUP_BOUND_COLUMN_WIDTH + 10.0f)
#define CONTSETUP_BACK_RIGHT 35.0f
#define CONTSETUP_BACK_BOTTOM 122.0f
#define CONTSETUP_BACK_HEIGHT 25.0f

enum eFrontendSprites
{
	FE2_MAINPANEL_UL,
	FE2_MAINPANEL_UR,
	FE2_MAINPANEL_DL,
	FE2_MAINPANEL_DR,
	FE2_MAINPANEL_DR2,
	FE2_TABACTIVE,
	FE_ICONBRIEF,
	FE_ICONSTATS,
	FE_ICONCONTROLS,
	FE_ICONSAVE,
	FE_ICONAUDIO,
	FE_ICONDISPLAY,
	FE_ICONLANGUAGE,
	FE_CONTROLLER,
	FE_CONTROLLERSH,
	FE_ARROWS1,
	FE_ARROWS2,
	FE_ARROWS3,
	FE_ARROWS4,
	FE_RADIO1,
	FE_RADIO2,
	FE_RADIO3,
	FE_RADIO4,
	FE_RADIO5,
	FE_RADIO6,
	FE_RADIO7,
	FE_RADIO8,
	FE_RADIO9,

	NUM_FE_SPRITES
};

enum eMenuSprites
{
	MENUSPRITE_CONNECTION,
	MENUSPRITE_FINDGAME,
	MENUSPRITE_HOSTGAME,
	MENUSPRITE_MAINMENU,
	MENUSPRITE_PLAYERSET,
	MENUSPRITE_SINGLEPLAYER,
	MENUSPRITE_MULTIPLAYER,
	MENUSPRITE_DMALOGO,
	MENUSPRITE_GTALOGO,
	MENUSPRITE_RSTARLOGO,
	MENUSPRITE_GAMESPY,
	MENUSPRITE_MOUSE,
	MENUSPRITE_MOUSET,
	MENUSPRITE_MP3LOGO,
	MENUSPRITE_DOWNOFF,
	MENUSPRITE_DOWNON,
	MENUSPRITE_UPOFF,
	MENUSPRITE_UPON,
	MENUSPRITE_GTA3LOGO,
	MENUSPRITE_UNUSED,
	NUM_MENU_SPRITES
};

enum eSaveSlot
{
	SAVESLOT_NONE,
	SAVESLOT_0,
	SAVESLOT_1,
	SAVESLOT_2,
	SAVESLOT_3,
	SAVESLOT_4,
	SAVESLOT_5,
	SAVESLOT_6,
	SAVESLOT_7,
	SAVESLOT_8,
	SAVESLOT_LABEL = 36,
};

#ifdef MENU_MAP
enum MapSprites
{
	MAPMID1,
	MAPMID2,
	MAPMID3,
	MAPBOT1,
	MAPBOT2,
	MAPBOT3,
	MAPTOP1,
	MAPTOP2,
	MAPTOP3,
	NUM_MAP_SPRITES
};
#endif

enum eMenuScreen
{
	MENUPAGE_DISABLED = -1,
	MENUPAGE_NONE = 0,
	MENUPAGE_STATS = 1,
	MENUPAGE_NEW_GAME = 2,
	MENUPAGE_BRIEFS = 3,
	MENUPAGE_CONTROLLER_SETTINGS = 4,
	MENUPAGE_SOUND_SETTINGS = 5,
	MENUPAGE_DISPLAY_SETTINGS = 6,
	MENUPAGE_LANGUAGE_SETTINGS = 7,
	MENUPAGE_CHOOSE_LOAD_SLOT = 8,
	MENUPAGE_CHOOSE_DELETE_SLOT = 9,
	MENUPAGE_NEW_GAME_RELOAD = 10,
	MENUPAGE_LOAD_SLOT_CONFIRM = 11,
	MENUPAGE_DELETE_SLOT_CONFIRM = 12,
	MENUPAGE_NO_MEMORY_CARD = 13, // hud adjustment page in mobile
	MENUPAGE_LOADING_IN_PROGRESS = 14,
	MENUPAGE_DELETING_IN_PROGRESS = 15,
	MENUPAGE_PS2_LOAD_FAILED = 16,
	MENUPAGE_DELETE_FAILED = 17,
	MENUPAGE_DEBUG_MENU = 18,
	MENUPAGE_MEMORY_CARD_DEBUG = 19,
	MENUPAGE_MEMORY_CARD_TEST = 20,
	MENUPAGE_MULTIPLAYER_MAIN = 21,
	MENUPAGE_PS2_SAVE_FAILED = 22,
	MENUPAGE_PS2_SAVE_FAILED_2 = 23,
	MENUPAGE_SAVE = 24,
	MENUPAGE_NO_MEMORY_CARD_2 = 25,
	MENUPAGE_CHOOSE_SAVE_SLOT = 26,
	MENUPAGE_SAVE_OVERWRITE_CONFIRM = 27,
	MENUPAGE_MULTIPLAYER_MAP = 28,
	MENUPAGE_MULTIPLAYER_CONNECTION = 29,
	MENUPAGE_MULTIPLAYER_FIND_GAME = 30,
	MENUPAGE_MULTIPLAYER_MODE = 31,
	MENUPAGE_MULTIPLAYER_CREATE = 32,
	MENUPAGE_MULTIPLAYER_START = 33,
	MENUPAGE_SKIN_SELECT_OLD = 34,
	MENUPAGE_CONTROLLER_PC = 35,
	MENUPAGE_CONTROLLER_PC_OLD1 = 36,
	MENUPAGE_CONTROLLER_PC_OLD2 = 37,
	MENUPAGE_CONTROLLER_PC_OLD3 = 38,
	MENUPAGE_CONTROLLER_PC_OLD4 = 39,
	MENUPAGE_CONTROLLER_DEBUG = 40,
	MENUPAGE_OPTIONS = 41,
	MENUPAGE_EXIT = 42,
	MENUPAGE_SAVING_IN_PROGRESS = 43,
	MENUPAGE_SAVE_SUCCESSFUL = 44,
	MENUPAGE_DELETING = 45,
	MENUPAGE_DELETE_SUCCESS = 46,
	MENUPAGE_SAVE_FAILED = 47,
	MENUPAGE_LOAD_FAILED = 48,
	MENUPAGE_LOAD_FAILED_2 = 49,
	MENUPAGE_FILTER_GAME = 50,
	MENUPAGE_START_MENU = 51,
	MENUPAGE_PAUSE_MENU = 52,
	MENUPAGE_CHOOSE_MODE = 53,
	MENUPAGE_SKIN_SELECT = 54,
	MENUPAGE_KEYBOARD_CONTROLS = 55,
	MENUPAGE_MOUSE_CONTROLS = 56,
	MENUPAGE_MISSION_RETRY = 57,
#ifdef CUSTOM_FRONTEND_OPTIONS

#ifdef MENU_MAP
	MENUPAGE_MAP = 58,
#endif
#ifdef GRAPHICS_MENU_OPTIONS
	MENUPAGE_GRAPHICS_SETTINGS,
#endif
#ifdef DETECT_JOYSTICK_MENU
	MENUPAGE_DETECT_JOYSTICK,
#endif

#endif
	MENUPAGE_UNK, // originally 58. Custom screens are inserted above, because last screen in CMenuScreens should always be empty to make CFO work
	MENUPAGES

};

enum eMenuAction
{
#ifdef CUSTOM_FRONTEND_OPTIONS
	MENUACTION_CFO_SLIDER = -3,
	MENUACTION_CFO_SELECT = -2,
	MENUACTION_CFO_DYNAMIC = -1,
#endif
	MENUACTION_NOTHING,
	MENUACTION_LABEL,
	MENUACTION_CHANGEMENU,
	MENUACTION_CTRLVIBRATION,
	MENUACTION_CTRLCONFIG,
	MENUACTION_CTRLDISPLAY,
	MENUACTION_FRAMESYNC,
	MENUACTION_FRAMELIMIT,
	MENUACTION_TRAILS,
	MENUACTION_SUBTITLES,
	MENUACTION_WIDESCREEN,
	MENUACTION_BRIGHTNESS,
	MENUACTION_DRAWDIST,
	MENUACTION_MUSICVOLUME,
	MENUACTION_SFXVOLUME,
	MENUACTION_UNK15,
	MENUACTION_RADIO,
	MENUACTION_LANG_ENG,
	MENUACTION_LANG_FRE,
	MENUACTION_LANG_GER,
	MENUACTION_LANG_ITA,
	MENUACTION_LANG_SPA,
	MENUACTION_POPULATESLOTS_CHANGEMENU,
	MENUACTION_CHECKSAVE,
	MENUACTION_UNK24,
	MENUACTION_NEWGAME,
	MENUACTION_RELOADIDE,
	MENUACTION_RELOADIPL,
	MENUACTION_SETDBGFLAG,
	MENUACTION_SWITCHBIGWHITEDEBUGLIGHT,
	MENUACTION_PEDROADGROUPS,
	MENUACTION_CARROADGROUPS,
	MENUACTION_COLLISIONPOLYS,
	MENUACTION_REGMEMCARD1,
	MENUACTION_TESTFORMATMEMCARD1,
	MENUACTION_TESTUNFORMATMEMCARD1,
	MENUACTION_CREATEROOTDIR,
	MENUACTION_CREATELOADICONS,
	MENUACTION_FILLWITHGUFF,
	MENUACTION_SAVEONLYTHEGAME,
	MENUACTION_SAVEGAME,
	MENUACTION_SAVEGAMEUNDERGTA,
	MENUACTION_CREATECOPYPROTECTED,
	MENUACTION_TESTSAVE,
	MENUACTION_TESTLOAD,
	MENUACTION_TESTDELETE,
	MENUACTION_PARSEHEAP,
	MENUACTION_SHOWCULL,
	MENUACTION_MEMCARDSAVECONFIRM,
	MENUACTION_RESUME_FROM_SAVEZONE,
	MENUACTION_UNK50,
	MENUACTION_DEBUGSTREAM,
	MENUACTION_MPMAP_LIBERTY,
	MENUACTION_MPMAP_REDLIGHT,
	MENUACTION_MPMAP_CHINATOWN,
	MENUACTION_MPMAP_TOWER,
	MENUACTION_MPMAP_SEWER,
	MENUACTION_MPMAP_INDUSTPARK,
	MENUACTION_MPMAP_DOCKS,
	MENUACTION_MPMAP_STAUNTON,
	MENUACTION_MPMAP_DEATHMATCH1,
	MENUACTION_MPMAP_DEATHMATCH2,
	MENUACTION_MPMAP_TEAMDEATH1,
	MENUACTION_MPMAP_TEAMDEATH2,
	MENUACTION_MPMAP_STASH,
	MENUACTION_MPMAP_CAPTURE,
	MENUACTION_MPMAP_RATRACE,
	MENUACTION_MPMAP_DOMINATION,
	MENUACTION_STARTMP,
	MENUACTION_UNK69,
	MENUACTION_UNK70,
	MENUACTION_FINDMP,
	MENUACTION_KEYBOARDCTRLS,
	MENUACTION_UNK73,
	MENUACTION_INITMP,
	MENUACTION_MP_PLAYERCOLOR,
	MENUACTION_MP_PLAYERNAME,
	MENUACTION_MP_GAMENAME,
	MENUACTION_GETKEY,
	MENUACTION_SHOWHEADBOB,
	MENUACTION_UNK80,
	MENUACTION_INVVERT,
	MENUACTION_CANCELGAME,
	MENUACTION_MP_PLAYERNUMBER,
	MENUACTION_MOUSESENS,
	MENUACTION_CHECKMPGAMES,
	MENUACTION_CHECKMPPING,
	MENUACTION_MP_SERVER,
	MENUACTION_MP_MAP,
	MENUACTION_MP_GAMETYPE,
	MENUACTION_MP_LAN,
	MENUACTION_MP_INTERNET,
	MENUACTION_RESUME,
	MENUACTION_DONTCANCEL,
	MENUACTION_SCREENRES,
	MENUACTION_AUDIOHW,
	MENUACTION_SPEAKERCONF,
	MENUACTION_PLAYERSETUP,
	MENUACTION_RESTOREDEF,
	MENUACTION_CTRLMETHOD,
	MENUACTION_DYNAMICACOUSTIC,
	MENUACTION_LOADRADIO,
	MENUACTION_MOUSESTEER,
	MENUACTION_UNK103,
	MENUACTION_UNK104,
	MENUACTION_UNK105,
	MENUACTION_UNK106,
	MENUACTION_UNK107,
	MENUACTION_UNK108,
	MENUACTION_UNK109,
	MENUACTION_UNK110,
	MENUACTION_UNK111,
	MENUACTION_UNK112,
	MENUACTION_REJECT_RETRY,
	MENUACTION_UNK114,
//#ifdef ANISOTROPIC_FILTERING
//	MENUACTION_MIPMAPS,
//	MENUACTION_TEXTURE_FILTERING,
//#endif
};

enum eCheckHover
{
	HOVEROPTION_0,
	HOVEROPTION_1,
	HOVEROPTION_RANDOM_ITEM,
	HOVEROPTION_3,
	HOVEROPTION_4,
	HOVEROPTION_5,
	HOVEROPTION_6,
	HOVEROPTION_7,
	HOVEROPTION_8,
	HOVEROPTION_BACK,	// also layer in controller setup and skin menu
	HOVEROPTION_10,
	HOVEROPTION_11,
	HOVEROPTION_OVER_SCROLL_UP,
	HOVEROPTION_OVER_SCROLL_DOWN,
	HOVEROPTION_CLICKED_SCROLL_UP,
	HOVEROPTION_CLICKED_SCROLL_DOWN,
	HOVEROPTION_HOLDING_SCROLLBAR,
	HOVEROPTION_PAGEUP,
	HOVEROPTION_PAGEDOWN,
	HOVEROPTION_LIST, // also layer in controller setup and skin menu
	HOVEROPTION_SKIN,
	HOVEROPTION_USESKIN, // also layer in controller setup and skin menu
	HOVEROPTION_RADIO_0,
	HOVEROPTION_RADIO_1,
	HOVEROPTION_RADIO_2,
	HOVEROPTION_RADIO_3,
	HOVEROPTION_RADIO_4,
	HOVEROPTION_RADIO_5,
	HOVEROPTION_RADIO_6,
	HOVEROPTION_RADIO_7,
	HOVEROPTION_RADIO_8,
	HOVEROPTION_RADIO_9,
	HOVEROPTION_INCREASE_BRIGHTNESS,
	HOVEROPTION_DECREASE_BRIGHTNESS,
	HOVEROPTION_INCREASE_DRAWDIST,
	HOVEROPTION_DECREASE_DRAWDIST,
	HOVEROPTION_INCREASE_MUSICVOLUME,
	HOVEROPTION_DECREASE_MUSICVOLUME,
	HOVEROPTION_INCREASE_SFXVOLUME,
	HOVEROPTION_DECREASE_SFXVOLUME,
	HOVEROPTION_INCREASE_MOUSESENS,
	HOVEROPTION_DECREASE_MOUSESENS,
#ifdef CUSTOM_FRONTEND_OPTIONS
	HOVEROPTION_INCREASE_CFO_SLIDER,
	HOVEROPTION_DECREASE_CFO_SLIDER,
#endif
	HOVEROPTION_NOT_HOVERING,
};

enum
{
	NUM_MENUROWS = 18,
};

enum eControlMethod
{
	CONTROL_STANDARD = 0,
	CONTROL_CLASSIC,
};

// Why??
enum ControllerSetupColumn
{
	CONTSETUP_PED_COLUMN = 0,
	CONTSETUP_VEHICLE_COLUMN = 14,
};

struct tSkinInfo
{
	int32 skinId;
	char skinNameDisplayed[256];
	char skinNameOriginal[256];
	char date[256];
	tSkinInfo *nextSkin;
};

struct BottomBarOption
{
	char name[8];
	int32 screenId;
};

#ifndef CUSTOM_FRONTEND_OPTIONS
struct CMenuScreen
{
	char m_ScreenName[8];
	int32 unk; // 2 on MENUPAGE_MULTIPLAYER_START, 1 on everywhere else, 0 on unused.
	int32 m_PreviousPage[2]; // eMenuScreen
	int32 m_ParentEntry[2]; // row

	struct CMenuEntry
	{
		int32 m_Action; // eMenuAction
		char m_EntryName[8];
		int32 m_SaveSlot; // eSaveSlot
		int32 m_TargetMenu; // eMenuScreen
	} m_aEntries[NUM_MENUROWS];
};
extern CMenuScreen aScreens[MENUPAGES];
#else
#include "frontendoption.h"
struct CCustomScreenLayout {
	eMenuSprites sprite;
	int columnWidth;
	int headerHeight;
	int lineHeight;
	int8 font;
	int8 alignment;
	bool showLeftRightHelper;
	float fontScaleX;
	float fontScaleY;
};

struct CCFO
{
	void *value;
	const char *saveCat;
	const char *save;
};

struct CCFOSelect : CCFO
{
	char** rightTexts;
	int8 numRightTexts;
	bool onlyApplyOnEnter;
	int8 displayedValue; // only if onlyApplyOnEnter enabled for now
	int8 lastSavedValue; // only if onlyApplyOnEnter enabled
	ChangeFunc changeFunc;
	bool disableIfGameLoaded;

	CCFOSelect() {};
	CCFOSelect(int8* value, const char* saveCat, const char* save, const char** rightTexts, int8 numRightTexts, bool onlyApplyOnEnter, ChangeFunc changeFunc = nil, bool disableIfGameLoaded = false){
		this->value = value;
		if (value)
			this->lastSavedValue = this->displayedValue = *value;

		this->saveCat = saveCat;
		this->save = save;
		this->rightTexts = (char**)rightTexts;
		this->numRightTexts = numRightTexts;
		this->onlyApplyOnEnter = onlyApplyOnEnter;
		this->changeFunc = changeFunc;
		this->disableIfGameLoaded = disableIfGameLoaded;
	}
};

// Value is float in here
struct CCFOSlider : CCFO
{
	ChangeFuncFloat changeFunc;
	float min;
	float max;

	CCFOSlider() {};
	CCFOSlider(float* value, const char* saveCat, const char* save, float min, float max, ChangeFuncFloat changeFunc = nil){
		this->value = value;
		this->saveCat = saveCat;
		this->save = save;
		this->changeFunc = changeFunc;
		this->min = min;
		this->max = max;
	}
};

struct CCFODynamic : CCFO
{
	DrawFunc drawFunc;
	ButtonPressFunc buttonPressFunc;

	CCFODynamic() {};
	CCFODynamic(int8* value, const char* saveCat, const char* save, DrawFunc drawFunc, ButtonPressFunc buttonPressFunc){
		this->value = value;
		this->saveCat = saveCat;
		this->save = save;
		this->drawFunc = drawFunc;
		this->buttonPressFunc = buttonPressFunc;
	}
};

struct CMenuScreenCustom
{
	char m_ScreenName[8];
	int32 m_PreviousPage[2]; // eMenuScreen
	CCustomScreenLayout *layout;
	ReturnPrevPageFunc returnPrevPageFunc;

	struct CMenuEntry
	{
		int32 m_Action; // eMenuAction - below zero is CFO
		char m_EntryName[8];
		struct {
			union {
				CCFO *m_CFO; // for initializing
				CCFOSelect *m_CFOSelect;
				CCFODynamic *m_CFODynamic;
				CCFOSlider *m_CFOSlider;
			};
			int32 m_SaveSlot; // eSaveSlot
			int32 m_TargetMenu; // eMenuScreen
		};
	} m_aEntries[NUM_MENUROWS];
};
extern CMenuScreenCustom aScreens[MENUPAGES];
#endif

class CMenuManager
{
public:
	int32 m_nPrefsVideoMode;
	int32 m_nDisplayVideoMode;
	int8 m_nPrefsAudio3DProviderIndex;
	bool m_bKeyChangeNotProcessed;
	char m_aSkinName[256];
	int32 m_nHelperTextMsgId;
	bool m_bLanguageLoaded;
	bool m_bMenuActive;
	bool m_bMenuStateChanged;
	bool m_bWaitingForNewKeyBind;
	bool m_bWantToRestart;
	bool m_bFirstTime;
	bool m_bGameNotLoaded;
	int32 m_nMousePosX;
	int32 m_nMousePosY;
	int32 m_nMouseTempPosX;
	int32 m_nMouseTempPosY;
	bool m_bShowMouse;
	tSkinInfo m_pSkinListHead;
	tSkinInfo *m_pSelectedSkin;
	int32 m_nFirstVisibleRowOnList;
	float m_nScrollbarTopMargin;
	int32 m_nTotalListRow;
	int32 m_nSkinsTotal;
 char _unk0[4];
	int32 m_nSelectedListRow;
	bool m_bSkinsEnumerated;
	bool m_bQuitGameNoCD;
 bool m_bRenderGameInMenu;
	bool m_bSaveMenuActive;
	bool m_bWantToLoad;
 char field_455;
	bool m_bStartWaitingForKeyBind;
	bool m_bSpritesLoaded;
	CSprite2d m_aFrontEndSprites[NUM_FE_SPRITES];
	CSprite2d m_aMenuSprites[NUM_MENU_SPRITES];
 int32 field_518;
	int32 m_nMenuFadeAlpha;
	bool m_bPressedPgUpOnList;
	bool m_bPressedPgDnOnList;
	bool m_bPressedUpOnList;
	bool m_bPressedDownOnList;
	bool m_bPressedScrollButton;
	int32 m_CurrCntrlAction;
 char _unk1[4];
 int32 m_nSelectedContSetupColumn;
	 bool m_bKeyIsOK;
 bool field_535;
	int8 m_nCurrExLayer;
	int32 m_nHelperTextAlpha;
	int32 m_nMouseOldPosX;
	int32 m_nMouseOldPosY;
	int32 m_nHoverOption;
	int32 m_nCurrScreen;
	int32 m_nCurrOption;
	int32 m_nOptionMouseHovering;
	int32 m_nPrevScreen;
 uint32 field_558;
	int32 m_nCurrSaveSlot;
	int32 m_nScreenChangeDelayTimer;

#ifdef IMPROVED_VIDEOMODE
	int32 m_nPrefsWidth;
	int32 m_nPrefsHeight;
	int32 m_nPrefsDepth;
	int32 m_nPrefsWindowed;
	int32 m_nPrefsSubsystem;
	int32 m_nSelectedScreenMode;
#endif
#ifdef MULTISAMPLING
	static int8 m_nPrefsMSAALevel;
	static int8 m_nDisplayMSAALevel;
#endif

	enum LANGUAGE
	{
		LANGUAGE_AMERICAN,
		LANGUAGE_FRENCH,
		LANGUAGE_GERMAN,
		LANGUAGE_ITALIAN,
		LANGUAGE_SPANISH,
#ifdef MORE_LANGUAGES
		LANGUAGE_POLISH,
		LANGUAGE_RUSSIAN,
		LANGUAGE_JAPANESE,
#endif
	};
public:
	bool GetIsMenuActive() {return !!m_bMenuActive;}

public:
	static int32 OS_Language;
	static int8 m_PrefsUseVibration;
	static int8 m_DisplayControllerOnFoot;
	static int8 m_PrefsUseWideScreen;
	static int8 m_PrefsRadioStation;
	static int8 m_PrefsVsync;
	static int8 m_PrefsVsyncDisp;
	static int8 m_PrefsFrameLimiter;
	static int8 m_PrefsShowSubtitles;
	static int8 m_PrefsSpeakers;
	static int32 m_ControlMethod;
	static int8 m_PrefsDMA;
	static int32 m_PrefsLanguage;
	static int32 m_PrefsBrightness;
	static float m_PrefsLOD;
	static int8 m_bFrontEnd_ReloadObrTxtGxt;
	static int32 m_PrefsMusicVolume;
	static int32 m_PrefsSfxVolume;
	static char m_PrefsSkinFile[256];
	static int32 m_KeyPressedCode;

	static bool m_bStartUpFrontEndRequested;
	static bool m_bShutDownFrontEndRequested;
	static bool m_PrefsAllowNastyGame;

	static uint8 m_PrefsStereoMono;
	static int32 m_SelectedMap;
	static int32 m_SelectedGameType;
	static uint8 m_PrefsPlayerRed;
	static uint8 m_PrefsPlayerGreen;
	static uint8 m_PrefsPlayerBlue;

#ifdef CUTSCENE_BORDERS_SWITCH
	static bool m_PrefsCutsceneBorders;
#endif

#ifndef MASTER
	static bool m_PrefsMarketing;
	static bool m_PrefsDisableTutorials;
#endif // !MASTER

#ifdef MENU_MAP
	static bool bMenuMapActive;
	static float fMapSize;
	static float fMapCenterY;
	static float fMapCenterX;
	static CSprite2d m_aMapSprites[NUM_MAP_SPRITES];
	void PrintMap();
#endif

#ifdef NO_ISLAND_LOADING
	enum
	{
		ISLAND_LOADING_LOW = 0,
		ISLAND_LOADING_MEDIUM,
		ISLAND_LOADING_HIGH
	};

	static int8 m_PrefsIslandLoading;

	#define ISLAND_LOADING_IS(p) if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_##p)
	#define ISLAND_LOADING_ISNT(p) if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_##p)
#else
	#define ISLAND_LOADING_IS(p)
	#define ISLAND_LOADING_ISNT(p)
#endif

#ifdef GAMEPAD_MENU
	enum
	{
		CONTROLLER_DUALSHOCK2 = 0,
		CONTROLLER_DUALSHOCK3,
		CONTROLLER_DUALSHOCK4,
		CONTROLLER_XBOX360,
		CONTROLLER_XBOXONE,
		CONTROLLER_NINTENDO_SWITCH,
	};

	static int8 m_PrefsControllerType;
#endif

public:
	static void BuildStatLine(Const char *text, void *stat, bool itsFloat, void *stat2);
	static void CentreMousePointer();
	void CheckCodesForControls(int);
	bool CheckHover(int x1, int x2, int y1, int y2);
	void CheckSliderMovement(int);
	int CostructStatLine(int);
	void DisplayHelperText();
	int DisplaySlider(float, float, float, float, float, float);
	void DoSettingsBeforeStartingAGame();
	void Draw();
	void DrawControllerBound(int32, int32, int32, int8);
	void DrawControllerScreenExtraText(int, int, int);
	void DrawControllerSetupScreen();
	void DrawFrontEnd();
	void DrawFrontEndNormal();
#ifdef PS2_SAVE_DIALOG
	void DrawFrontEndSaveZone();
#endif
	void DrawPlayerSetupScreen();
	int FadeIn(int alpha);
	void FilterOutColorMarkersFromString(wchar*, CRGBA &);
	int GetStartOptionsCntrlConfigScreens();
	static void InitialiseChangedLanguageSettings();
	void LoadAllTextures();
	void LoadSettings();
	void MessageScreen(const char *);
	void PickNewPlayerColour();
	void PrintBriefs();
	static void PrintErrorMessage();
	void PrintStats();
	void Process();
	void ProcessButtonPresses();
	void ProcessOnOffMenuOptions();
	static void RequestFrontEndShutDown();
	static void RequestFrontEndStartUp();
	void ResetHelperText();
	void SaveLoadFileError_SetUpErrorScreen();
	void SaveSettings();
	void SetHelperText(int text);
	void ShutdownJustMenu();
	float StretchX(float);
	float StretchY(float);
	void SwitchMenuOnAndOff();
	void UnloadTextures();
	void WaitForUserCD();
	void PrintController();
	int GetNumOptionsCntrlConfigScreens();
	int ConstructStatLine(int);

	// Those are either inlined in game, not in function yet, or I can't believe that they're not inlined.
	// Names were made up by me.
	void ThingsToDoBeforeGoingBack();
	void ScrollUpListByOne();
	void ScrollDownListByOne();
	void PageUpList(bool);
	void PageDownList(bool);
	int8 GetPreviousPageOption();
	void ProcessList(bool &goBack, bool &optionSelected);
#ifdef GAMEPAD_MENU
	void LoadController(int8 type);
#endif
};

#ifndef IMPROVED_VIDEOMODE
VALIDATE_SIZE(CMenuManager, 0x564);
#endif

extern CMenuManager FrontEndMenuManager;

#endif

license: mit


code:
CTriggerCaller MemCardAccessTriggerCaller;

void InitialiseTextsInMenuControllerInCar(CMenuPictureAndText *widget, CMenuManager::CONTRCONFIG cont);
void InitialiseTextsInMenuControllerOnFoot(CMenuPictureAndText *widget, CMenuManager::CONTRCONFIG cont);
void TriggerSave_BackToMainMenu(CMenuMultiChoiceTriggered *widget);
void TriggerSave_BackToMainMenuTwoLines(CMenuMultiChoiceTwoLinesTriggered *widget);
void TriggerSave_LoadGameLoadGameSelect(CMenuMultiChoiceTwoLinesTriggered *widget);
void TriggerSave_DeleteGameDeleteGameSelect(CMenuMultiChoiceTwoLinesTriggered *widget);
void TriggerSaveZone_BackToMainMenuTwoLines(CMenuMultiChoiceTwoLinesTriggered *widget);
void TriggerSaveZone_BackToMainMenuTwoLines(CMenuMultiChoiceTwoLinesTriggered *widget);
void TriggerSaveZone_SaveSlots(CMenuMultiChoiceTwoLinesTriggered *widget);

void
DisplayWarningControllerMsg()
{
	if ( CPad::bDisplayNoControllerMessage )
	{
		CSprite2d::DrawRect(CRect(X(20.0f), Y(140.0f), X(620.0f), Y(328.0)), CRGBA(64, 16, 16, 224)); // CRect(20.0f, 160.0f, 620.0f, 374.857117f)

		CFont::SetFontStyle(FONT_BANK);
		CFont::SetBackgroundOff();
		CFont::SetScale(X(0.84f), Y(1.26f)); // 1.440000
		CFont::SetPropOn();
		CFont::SetCentreOff();
		CFont::SetJustifyOn();
		CFont::SetRightJustifyOff();
		CFont::SetBackGroundOnlyTextOn();
		CFont::SetWrapx(SCRW-X(40.0f)); // 600.0f

		CPlaceableShText text;
		text.SetPosition(X(60.0f), Y(180.0f), false); // 205.714294
		text.SetColor(CRGBA(152, 152, 152, 255));
		text.m_text = TheText.Get("NOCONTE"); // Please re-insert the analog controller (DUALSHOCK@) or analog controller (DUALSHOCK@2) in controller port 1 to continue
		text.SetShadows(true, TEXT_SHADOW_COLOR, SHADOW_VECTOR*2.0f);
		text.SetAlpha(255);
		text.DrawShWrap(0.0f, 0.0f, X(600.0f+SHADOW_VECTOR.x), YF(600.0f)); //TODO check

		CFont::DrawFonts();
	}
	else if ( CPad::bObsoleteControllerMessage )
	{
		CSprite2d::DrawRect(CRect(X(20.0f), Y(140.0f), X(620.0f), Y(328.0)), CRGBA(64, 16, 16, 224)); // CRect(20.0f, 160.0f, 620.0f, 374.857117f)
		CFont::SetFontStyle(FONT_BANK);
		CFont::SetBackgroundOff();
		CFont::SetScale(X(0.84f), Y(1.26f)); // 1.440000
		CFont::SetPropOn();
		CFont::SetCentreOff();
		CFont::SetJustifyOn();
		CFont::SetRightJustifyOff();
		CFont::SetBackGroundOnlyTextOn();
		CFont::SetWrapx(SCRW-X(40.0f)); // 600.0f

		CPlaceableShText text;
		text.SetPosition(X(60.0f), Y(180.0f), false); // 205.714294
		text.SetColor(CRGBA(152, 152, 152, 255));
		text.m_text = TheText.Get("WRCONTE"); // Please re-insert the analog controller (DUALSHOCK@) or analog controller (DUALSHOCK@2) in controller port 1 to continue
		text.SetShadows(true, TEXT_SHADOW_COLOR, SHADOW_VECTOR*2.0f);
		text.SetAlpha(255);
		text.DrawShWrap(0.0f, 0.0f, X(600.0f+SHADOW_VECTOR.x), YF(600.0f)); //TODO check

		CFont::DrawFonts();
	}

}

void
TriggerMCSUM_Yes(CMenuMultiChoiceTriggered *widget)
{
	if ( widget )
		bMemoryCardStartUpMenus_ExitNow = true;
}

int32 nStatLinesIndex;
wchar aStatLines[50+1][50];
wchar *PrintStatLine(char const *text, void *stat, unsigned char itsFloat, void *stat2)
{
	if (text && stat && nStatLinesIndex < 50)
	{
		char  line [64];
		wchar uline[64];

		memset(line, 0, sizeof(line));
		memset(uline, 0, sizeof(uline));

		if (stat2)
		{
			if ( itsFloat )
				sprintf(line, "  %.2f %s %.2f", *(float*)stat, UnicodeToAscii(TheText.Get("FEST_OO")), *(float*)stat2);
			else
				sprintf(line, "  %d %s %d", *(int32*)stat, UnicodeToAscii(TheText.Get("FEST_OO")), *(int32*)stat2);
		}
		else
		{
			if (itsFloat)
				sprintf(line, "  %.2f", *(float*)stat);
			else
				sprintf(line, "  %d", *(int32*)stat);
		}

		wchar *pStatLine = aStatLines[nStatLinesIndex++];

		AsciiToUnicode(line, uline);
		UnicodeStrcpy(pStatLine, uline);

		return pStatLine;
	}

	return nil;
}

void
DisplayMemoryCardAccessMsg(wchar *msg, CRGBA const &color)
{
	CSprite2d::DrawRect(CRect(X(70.0f), Y(100.0f), X(570.0f), Y(270.0f)), color);

	CFont::SetFontStyle(FONT_BANK);
	CFont::SetBackgroundOff();
	CFont::SetScale(X(MEMCARD_ACCESS_MSG_SIZE_X), Y(MEMCARD_ACCESS_MSG_SIZE_Y));
	CFont::SetPropOn();
	CFont::SetJustifyOn();
	CFont::SetRightJustifyOff();
	CFont::SetBackGroundOnlyTextOn();
	CFont::SetWrapx(SCRW-X(90.0f)); // 550.0f
	CFont::SetCentreOn();
	CFont::SetCentreSize(SCRW-X(180.0f)); // 460.0f

	CPlaceableShText text;

	text.SetPosition(X(320.0f), Y(120.0f), false); // 137.142868
	text.SetColor(CRGBA(200, 200, 200, 255));
	text.m_text = msg;

	text.SetShadows(true, TEXT_SHADOW_COLOR, SHADOW_VECTOR);
	text.SetAlpha(255);
	text.Draw(0.0f, 0.0f);

	CFont::DrawFonts();
	DoRWStuffEndOfFrame();
}

void
FillMenuWithMemCardFileListing(CMenuMultiChoiceTwoLinesTriggered *widget, void (*cancelTrigger)(CMenuMultiChoiceTwoLinesTriggered *), void (*selectTrigger)(CMenuMultiChoiceTwoLinesTriggered *), wchar *text, int32 y, int32 height, int32 offset)
{
	if ( widget )
	{
		int32 selected = 0;
		if ( bMemoryCardSpecialZone )
			selected = widget->m_cursor != -1 ? widget->m_cursor : 0;

		widget->DeactivateMenu(); // TODO check
		widget->m_numOptions = 0;
		widget->AddTitle(nil, 0.0f, 0.0f, 0);

		TheMemoryCard.PopulateSlotInfo(CARD_ONE);

		if ( TheMemoryCard.GetError() == CMemoryCard::NO_ERR_SUCCESS)
		{
			widget->AddOption(TheText.Get("FES_CAN"), 0.0f, YF(y), cancelTrigger, 0, 0);

			FrontEndMenuManager.field_3C = 0;

			y += offset;

			char buff[100];

			for ( int32 i = 0; i < CMemoryCard::MAX_SLOTS; i++ )
			{
				// SAVE FILE
				sprintf(buff, "%s %d ", UnicodeToAscii(TheText.Get("FES_SLO")), i+1);
				AsciiToUnicode(buff, MemoryCard_FileNames[i]);

				wchar *datetime = nil;

				switch ( TheMemoryCard.GetInfoOnSpecificSlot(i) )
				{
					case CMemoryCard::SLOT_CORRUPTED:
					{
						UnicodeStrcat(MemoryCard_FileNames[i], TheText.Get("FES_ISC")); // IS CORRUPTED
						datetime = TheMemoryCard.GetDateAndTimeOfSavedGame(i);
						break;
					}
					case CMemoryCard::SLOT_PRESENT:
					{
						if ( TheMemoryCard.GetNameOfSavedGame(i) != nil )
						{
							UnicodeStrcpy(MemoryCard_FileNames[i], TheMemoryCard.GetNameOfSavedGame(i));
							datetime = TheMemoryCard.GetDateAndTimeOfSavedGame(i);
						}
						else
						{
							UnicodeStrcpy(MemoryCard_FileNames[i], TheText.Get("FES_SAG")); // PRESENT
							datetime = TheMemoryCard.GetDateAndTimeOfSavedGame(i);
						}
						break;
					}
					case CMemoryCard::SLOT_NOTPRESENT:
					{
						UnicodeStrcat(MemoryCard_FileNames[i], TheText.Get("FES_ISF"));
						datetime = TheMemoryCard.GetDateAndTimeOfSavedGame(i);
						break;
					}
				}

				widget->AddOption(MemoryCard_FileNames[i], 0.0f, YF(y), datetime, 0.0f, YF(float(y)+(0.44f*height)), selectTrigger, 0, 0);
				y += height;
			}
		}
		else
		{
			if ( !gErrorSampleTriggered )
			{
				DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0);
				gErrorSampleTriggered = true;
			}

			// Cancel
			widget->AddOption(TheText.Get("FES_CAN"), 0.0f, YF(y+(height*2)), cancelTrigger, 0, 0);

			FrontEndMenuManager.field_3C = 1;

			y += height;

			TheMemoryCard.PopulateErrorMessage();

			// Error Reading Memory Card (PS2) in MEMORY CARD slot 1 please check and try again.
			if ( TheMemoryCard.GetErrorMessage())
				widget->AddTitle(TheMemoryCard.GetErrorMessage(), 0.0f, YF(y), 0);
			else
				widget->AddTitle(TheText.Get("FES_GME"), 0.0f, YF(y), 0);
		}

		widget->SetMenuSelection(0);
		widget->ActivateMenu(1);

		if ( bMemoryCardSpecialZone )
		{
			widget->GoFirst();

			for ( int32 i = 0; i < selected; i++ )
				widget->GoNext();
		}
	}
}

void
TriggerSaveZone_FormatFailedOK(CMenuMultiChoiceTriggered *widget)
{
	if ( widget )
		pActiveMenuPage = &MenuPageSaveZone_SaveGame;
}

void
TriggerSaveZone_BackToMainMenu(CMenuMultiChoiceTriggered *widget)
{
	bMemoryCardSpecialZone = false;
	bIgnoreTriangleButton = false;
	pActiveMenuPage = &MenuPageSaveZone_SaveGame;
}

void
TriggerSaveZone_QuitMenu(CMenuMultiChoiceTriggered *widget)
{
	if ( widget )
	{
		FrontEndMenuManager.m_bMenuActive = false;
		FrontEndMenuManager.m_bInSaveZone = false;
		CTimer::EndUserPause();
	}
}

void
TriggerSaveZone_FormatCard(CMenuMultiChoiceTriggered *widget)
{
	if ( widget )
	{
		FillMenuWithMemCardFileListing(&MenuSaveZoneSSL_1, TriggerSaveZone_BackToMainMenuTwoLines, TriggerSaveZone_SaveSlots, nil, 0, 34, 22);

		if ( TheMemoryCard.GetError() == CMemoryCard::NO_ERR_SUCCESS)
		{
			MenuSaveZoneMSG_1.m_numTexts = 0;
			MenuSaveZoneMSG_1.AddText(TheText.Get("FES_AFO"), X(-80.0f), 0.0f, TEXT_COLOR, 0);

			MenuSaveZoneMSG_2.m_numOptions = 0;
			MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(100.0f), YF(5.0f), TriggerSaveZone_BackToMainMenu, 0, 0);

			MenuPageSaveZone_Message.ActivatePage();
			pActiveMenuPage = &MenuPageSaveZone_Message;
		}
		else if ( TheMemoryCard.GetError() != CMemoryCard::ERR_NOFORMAT)
		{
			MenuSaveZoneMSG_1.m_numTexts = 0;
			MenuSaveZoneMSG_1.AddText(TheMemoryCard.GetErrorMessage(), X(-80.0f), 0.0f, TEXT_COLOR, 0);

			MenuSaveZoneMSG_2.m_numOptions = 0;
			MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(100.0f), YF(15.0f), TriggerSaveZone_BackToMainMenu, 0, 0);

			MenuPageSaveZone_Message.ActivatePage();
			pActiveMenuPage = &MenuPageSaveZone_Message;
		}
		else
		{
			if ( !MemCardAccessTriggerCaller.CanCall() )
				MemCardAccessTriggerCaller.SetTrigger(TriggerSaveZone_FormatCard, widget);
			else
			{
				// Formatting Memory Card (PS2) in MEMORY CARD slot 1.  Please do not remove the Memory Card (PS2), reset or switch off the console.
				DisplayMemoryCardAccessMsg(TheText.Get("FEFD_WR"), CRGBA(200, 50, 50, 192));
				TheMemoryCard.FormatCard(CARD_ONE);

				if ( TheMemoryCard.GetError() == CMemoryCard::NO_ERR_SUCCESS )
					pActiveMenuPage = &MenuPageSaveZone_SaveGame;
				else
				{
					TheMemoryCard.PopulateErrorMessage();

					wchar *error = TheText.Get("FESZ_FF"); // Format Failed! Check Memory Card (PS2) in MEMORY CARD slot 1 and please try again.

					// missing switch

					if ( !error ) error = TheText.Get("FES_GME"); // Error Reading Memory Card (PS2) in MEMORY CARD slot 1 please check and try again.

					MenuSaveZoneMSG_1.m_numTexts = 0;
					MenuSaveZoneMSG_1.AddText(error, X(-80.0f), 0.0f, TEXT_COLOR, 0);

					MenuSaveZoneMSG_2.m_numOptions = 0;
					MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(100.0f), YF(20.0f), TriggerSaveZone_BackToMainMenu, 0, 0);

					MenuPageSaveZone_Message.ActivatePage();
					pActiveMenuPage = &MenuPageSaveZone_Message;
				}

				if ( TheMemoryCard.GetError() == CMemoryCard::NO_ERR_SUCCESS )
				{
					FillMenuWithMemCardFileListing(&MenuSaveZoneSSL_1, TriggerSaveZone_BackToMainMenuTwoLines, TriggerSaveZone_SaveSlots, nil, 0, 34, 22);
					pActiveMenuPage = &MenuPageSaveZone_SaveSlots;
					bMemoryCardSpecialZone = true;
					bIgnoreTriangleButton = true;
					pActiveMenuPage->ActivatePage();
				}
				else
				{
					TheMemoryCard.PopulateErrorMessage();

					// Format Failed! Check Memory Card (PS2) in MEMORY CARD slot 1 and please try again.
					wchar *error = TheText.Get("FESZ_FF");

					switch ( TheMemoryCard.GetError() )
					{
						case CMemoryCard::ERR_WRITEFULLDEVICE:
						case CMemoryCard::ERR_DIRFULLDEVICE:
						case CMemoryCard::ERR_SAVEFAILED:
						{
							error = TheMemoryCard.GetErrorMessage();
							break;
						}
					}

					// Error Reading Memory Card (PS2) in MEMORY CARD slot 1 please check and try again.
					if ( !error ) error = TheText.Get("FES_GME");

					MenuSaveZoneMSG_1.m_numTexts = 0;
					MenuSaveZoneMSG_1.AddText(error, X(-80.0f), 0.0f, TEXT_COLOR, 0);

					MenuSaveZoneMSG_2.m_numOptions = 0;
					MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(100.0f), YF(20.0f), TriggerSaveZone_BackToMainMenu, 0, 0);

					MenuPageSaveZone_Message.ActivatePage();
					pActiveMenuPage = &MenuPageSaveZone_Message;
				}
			}
		}
	}
}

void
TriggerSaveZone_FormatCardSelect(CMenuMultiChoiceTriggered *widget)
{
	if ( widget )
	{
		FillMenuWithMemCardFileListing(&MenuSaveZoneSSL_1, TriggerSaveZone_BackToMainMenuTwoLines, TriggerSaveZone_SaveSlots, nil, 0, 34, 22);

		if ( TheMemoryCard.GetError() == CMemoryCard::NO_ERR_SUCCESS )
		{
			// This Memory Card (PS2) is already formatted.
			MenuSaveZoneMSG_1.m_numTexts = 0;
			MenuSaveZoneMSG_1.AddText(TheText.Get("FES_AFO"), X(-80.0f), 0.0f, TEXT_COLOR, 0);

			MenuSaveZoneMSG_2.m_numOptions = 0;
			MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(100.0f), YF(5.0f), TriggerSaveZone_BackToMainMenu, 0, 0);

			MenuPageSaveZone_Message.ActivatePage();
			pActiveMenuPage = &MenuPageSaveZone_Message;
		}
		else if ( TheMemoryCard.GetError() != CMemoryCard::ERR_NOFORMAT )
		{
			MenuSaveZoneMSG_1.m_numTexts = 0;
			MenuSaveZoneMSG_1.AddText(TheMemoryCard.GetErrorMessage(), X(-80.0f), 0.0f, TEXT_COLOR, 0);

			MenuSaveZoneMSG_2.m_numOptions = 0;
			MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(100.0f), YF(15.0f), TriggerSaveZone_BackToMainMenu, 0, 0);

			MenuPageSaveZone_Message.ActivatePage();
			pActiveMenuPage = &MenuPageSaveZone_Message;
		}
		else
		{
			// Are you sure you wish to format the Memory Card (PS2) in MEMORY CARD slot 1?
			MenuSaveZoneQYN_1.m_numTexts = 0;
			MenuSaveZoneQYN_1.AddText(TheText.Get("FESZ_QF"), X(-40.0f), 0.0f, TEXT_COLOR, 0);

			MenuSaveZoneQYN_2.m_numOptions = 0;
			MenuSaveZoneQYN_2.AddOption(TheText.Get("FEM_NO"),  X(80.0f), YF(20.0f), TriggerSaveZone_BackToMainMenu, 0, 0);
			MenuSaveZoneQYN_2.AddOption(TheText.Get("FEM_YES"), X(80.0f), 0.0f,  TriggerSaveZone_FormatCard,     0, 0);

			MenuPageSaveZone_QuestionYesNo.ActivatePage();
			pActiveMenuPage = &MenuPageSaveZone_QuestionYesNo;
		}
	}
}

void
TriggerSaveZone_DeleteSaveGame(CMenuMultiChoiceTriggered *widget)
{
	if ( widget )
	{
		bMemoryCardSpecialZone = false;
		bIgnoreTriangleButton = false;

		if ( !MemCardAccessTriggerCaller.CanCall() )
			MemCardAccessTriggerCaller.SetTrigger(TriggerSaveZone_DeleteSaveGame, widget);
		else
		{
			// Overwriting data. Please do not remove the Memory Card (PS2) in MEMORY CARD slot 1, reset or switch off the console.
			DisplayMemoryCardAccessMsg(TheText.Get("FESZ_OW"), CRGBA(200, 50, 50, 192));

			TheMemoryCard.DeleteSlot(MemoryCardSlotSelected);

			if ( TheMemoryCard.GetError() != CMemoryCard::NO_ERR_SUCCESS )
			{
				TheMemoryCard.PopulateErrorMessage();

				wchar *error = TheText.Get("FES_DEE"); // Deleting Failed! Check Memory Card (PS2) in MEMORY CARD slot 1 and please try again.

				// switch missing

				if ( !error ) error = TheText.Get("FES_GME"); // Error Reading Memory Card (PS2) in MEMORY CARD slot 1 please check and try again.

				MenuSaveZoneMSG_1.m_numTexts = 0;
				MenuSaveZoneMSG_1.AddText(error, X(-80.0f), 0.0f, TEXT_COLOR, 0);

				MenuSaveZoneMSG_2.m_numOptions = 0;
				MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(100.0f), YF(20.0f), TriggerSaveZone_BackToMainMenu, 0, 0);

				MenuPageSaveZone_Message.ActivatePage();
				pActiveMenuPage = &MenuPageSaveZone_Message;
			}
			else
			{
				TheMemoryCard.SaveSlot(MemoryCardSlotSelected);

				if ( TheMemoryCard.GetError() == CMemoryCard::NO_ERR_SUCCESS )
				{
					// Game saved successfully!
					MenuSaveZoneMSG_1.m_numTexts = 0;
					MenuSaveZoneMSG_1.AddText(TheText.Get("FESZ_L1"), X(-20.0f), YF(10.0f), TEXT_COLOR, 0);

					MenuSaveZoneMSG_2.m_numOptions = 0;
					MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(110.0f), 0.0f, TriggerSaveZone_QuitMenu, 0, 0);

					MenuPageSaveZone_Message.ActivatePage();
					pActiveMenuPage = &MenuPageSaveZone_Message;
				}
				else
				{
					TheMemoryCard.PopulateErrorMessage();

					wchar *error = TheText.Get("FESZ_SR"); // Save Failed! Check Memory Card (PS2) in MEMORY CARD slot 1 and please try again.

					switch ( TheMemoryCard.GetError() )
					{
						case CMemoryCard::ERR_WRITEFULLDEVICE:
						case CMemoryCard::ERR_DIRFULLDEVICE:
						case CMemoryCard::ERR_SAVEFAILED:
						{
							error = TheMemoryCard.GetErrorMessage();
							break;
						}
					}

					if ( !error ) error = TheText.Get("FES_GME"); // Error Reading Memory Card (PS2) in MEMORY CARD slot 1 please check and try again.

					MenuSaveZoneMSG_1.m_numTexts = 0;
					MenuSaveZoneMSG_1.AddText(error, X(-80.0f), 0.0f, TEXT_COLOR, 0);

					MenuSaveZoneMSG_2.m_numOptions = 0;
					MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(120.0f), YF(30.0f), TriggerSaveZone_BackToMainMenu, 0, 0);

					MenuPageSaveZone_Message.ActivatePage();
					pActiveMenuPage = &MenuPageSaveZone_Message;
				}
			}
		}
	}
}

void
TriggerSaveZone_SaveGame(CMenuMultiChoiceTriggered *widget)
{
	if ( widget )
	{
		bMemoryCardSpecialZone = false;
		bIgnoreTriangleButton  = false;
		if ( !MemCardAccessTriggerCaller.CanCall() )
			MemCardAccessTriggerCaller.SetTrigger(TriggerSaveZone_SaveGame, widget);
		else
		{
			DisplayMemoryCardAccessMsg(TheText.Get("FESZ_WR"), CRGBA(200, 50, 50, 192));

			TheMemoryCard.SaveSlot(MemoryCardSlotSelected);

			if ( TheMemoryCard.GetError() == CMemoryCard::NO_ERR_SUCCESS )
			{
				// Game saved successfully!
				MenuSaveZoneMSG_1.m_numTexts = 0;
				MenuSaveZoneMSG_1.AddText(TheText.Get("FESZ_L1"), X(-20.0f), YF(10.0f), TEXT_COLOR, 0);

				MenuSaveZoneMSG_2.m_numOptions = 0;
				MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(110.0f), 0.0f, TriggerSaveZone_QuitMenu, 0, 0);

				MenuPageSaveZone_Message.ActivatePage();
				pActiveMenuPage = &MenuPageSaveZone_Message;
			}
			else
			{
				TheMemoryCard.PopulateErrorMessage();

				wchar *error = TheText.Get("FESZ_SR"); // Save Failed! Check Memory Card (PS2) in MEMORY CARD slot 1 and please try again.

				switch ( TheMemoryCard.GetError() )
				{
					case CMemoryCard::ERR_WRITEFULLDEVICE:
					case CMemoryCard::ERR_DIRFULLDEVICE:
					case CMemoryCard::ERR_SAVEFAILED:
					{
						error = TheMemoryCard.GetErrorMessage();
						break;
					}
				}

				if ( !error ) error = TheText.Get("FES_GME"); // Error Reading Memory Card (PS2) in MEMORY CARD slot 1 please check and try again.

				MenuSaveZoneMSG_1.m_numTexts = 0;
				MenuSaveZoneMSG_1.AddText(error, X(-80.0f), 0.0f, TEXT_COLOR, 0);

				MenuSaveZoneMSG_2.m_numOptions = 0;
				MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(120.0f), YF(30.0f), TriggerSaveZone_BackToMainMenu, 0, 0);

				MenuPageSaveZone_Message.ActivatePage();
				pActiveMenuPage = &MenuPageSaveZone_Message;
			}
		}
	}
}

void
TriggerSaveZone_SaveSlots(CMenuMultiChoiceTwoLinesTriggered *widget)
{
	if ( widget )
	{
		if ( widget->GetMenuSelection() > 0 )
		{
			MemoryCardSlotSelected = widget->GetMenuSelection() - 1;

			switch ( TheMemoryCard.GetInfoOnSpecificSlot(MemoryCardSlotSelected) )
			{
				case CMemoryCard::SLOT_PRESENT:
				case CMemoryCard::SLOT_CORRUPTED:
				{
					// Proceed with overwriting this saved game?
					MenuSaveZoneQYN_1.m_numTexts = 0;
					MenuSaveZoneQYN_1.AddText(TheText.Get("FESZ_QO"), X(-40.0f), 0.0f, TEXT_COLOR, 0);

					MenuSaveZoneQYN_2.m_numOptions = 0;
					MenuSaveZoneQYN_2.AddOption(TheText.Get("FEM_NO"),  X(80.0f), YF(20.0f), TriggerSaveZone_BackToMainMenu, 0, 0);
					MenuSaveZoneQYN_2.AddOption(TheText.Get("FEM_YES"), X(80.0f), 0.0f,  TriggerSaveZone_DeleteSaveGame, 0, 0);

					MenuPageSaveZone_QuestionYesNo.ActivatePage();
					bMemoryCardSpecialZone = false;
					pActiveMenuPage = &MenuPageSaveZone_QuestionYesNo;
					break;
				}

				case CMemoryCard::SLOT_NOTPRESENT:
				{
					// PROCEED WITH SAVE ?
					MenuSaveZoneQYN_1.m_numTexts = 0;
					MenuSaveZoneQYN_1.AddText(TheText.Get("FESZ_QS"), X(-40.0f), 0.0f, TEXT_COLOR, 0);

					MenuSaveZoneQYN_2.m_numOptions = 0;
					MenuSaveZoneQYN_2.AddOption(TheText.Get("FEM_NO"),  X(80.0f), YF(20.0f), TriggerSaveZone_BackToMainMenu, 0, 0);
					MenuSaveZoneQYN_2.AddOption(TheText.Get("FEM_YES"), X(80.0f), 0.0f,  TriggerSaveZone_SaveGame,       0, 0);

					MenuPageSaveZone_QuestionYesNo.ActivatePage();
					bMemoryCardSpecialZone = false;
					pActiveMenuPage = &MenuPageSaveZone_QuestionYesNo;
					break;
				}
			}
		}
	}
}

void
TriggerSaveZone_SaveGameSelect(CMenuMultiChoiceTriggered *widget)
{
	if ( widget )
	{
		FillMenuWithMemCardFileListing(&MenuSaveZoneSSL_1, TriggerSaveZone_BackToMainMenuTwoLines, TriggerSaveZone_SaveSlots, nil, 0, 34, 22);

		if ( TheMemoryCard.GetError() == CMemoryCard::ERR_NOFORMAT)
		{
			gErrorSampleTriggered = false;
			pActiveMenuPage = &MenuPageSaveZone_FormatCard;
		}
		else
		{
			bMemoryCardSpecialZone = true;
			bIgnoreTriangleButton  = true;
			pActiveMenuPage = &MenuPageSaveZone_SaveSlots;
		}

		pActiveMenuPage->ActivatePage();
	}
}

void
TriggerControls_Vibrations(CMenuOnOffTriggered *widget)
{
	if ( widget )
	{
		CMenuManager::m_PrefsUseVibration = widget->GetMenuSelection();
		if ( CMenuManager::m_PrefsUseVibration )
		{
			CPad::GetPad(0)->StartShake(300, 150);
			TimeToStopPadShaking = CTimer::GetTimeInMillisecondsPauseMode() + 500;
		}
	}
}

void
TriggerControls_ContrDisplay(CMenuMultiChoiceTriggeredAlways *widget)
{
	if ( widget )
	{
		int32 conf = MenuControls_1.GetMenuSelection();
		int32 i  = MenuControls_2.GetMenuSelection();
		if ( i == 1 )
		{
			if ( conf == CMenuManager::CONFIG_2 )
				MenuPage_Controls.m_controls[0] = &MenuControls_7;
			else
				MenuPage_Controls.m_controls[0] = &MenuControls_4;
		}
		else if ( i == 0 )
		{
			if ( conf == CMenuManager::CONFIG_2 )
				MenuPage_Controls.m_controls[0] = &MenuControls_6;
			else
				MenuPage_Controls.m_controls[0] = &MenuControls_3;
		}
	}
}

void
TriggerControls_DrawHNContrConfig(CMenuMultiChoiceTriggeredAlways *widget)
{
	if ( widget )
	{
		int32 conf = widget->GetMenuSelection();

		InitialiseTextsInMenuControllerOnFoot(&MenuControls_3, (CMenuManager::CONTRCONFIG)conf);
		InitialiseTextsInMenuControllerInCar (&MenuControls_4, (CMenuManager::CONTRCONFIG)conf);

		int32 i = MenuControls_2.GetMenuSelection();
		if ( i == 1 )
		{
			if ( conf == CMenuManager::CONFIG_2 )
				MenuPage_Controls.m_controls[0] = &MenuControls_7;
			else
				MenuPage_Controls.m_controls[0] = &MenuControls_4;
		}
		else if ( i == 0 )
		{
			if ( conf == CMenuManager::CONFIG_2 )
				MenuPage_Controls.m_controls[0] = &MenuControls_6;
			else
				MenuPage_Controls.m_controls[0] = &MenuControls_3;
		}
	}
}

void
TriggerControls_DrawContrConfig(CMenuMultiChoiceTriggeredAlways *widget)
{
	if ( widget )
	{
		int32 conf = widget->GetMenuSelection();
		if ( widget->m_cursor != -1 )
			conf = widget->m_cursor;

		InitialiseTextsInMenuControllerOnFoot(&MenuControls_3, (CMenuManager::CONTRCONFIG)conf);
		InitialiseTextsInMenuControllerInCar(&MenuControls_4, (CMenuManager::CONTRCONFIG)conf);

		int32 i = MenuControls_2.GetMenuSelection();
		if ( i == 1 )
		{
			if ( conf == CMenuManager::CONFIG_2 )
				MenuPage_Controls.m_controls[0] = &MenuControls_7;
			else
				MenuPage_Controls.m_controls[0] = &MenuControls_4;
		}
		else if ( i == 0 )
		{
			if ( conf == CMenuManager::CONFIG_2 )
				MenuPage_Controls.m_controls[0] = &MenuControls_6;
			else
				MenuPage_Controls.m_controls[0] = &MenuControls_3;
		}
	}
}

void
TriggerControls_ContrConfig(CMenuMultiChoiceTriggered *widget)
{
	if ( widget )
	{
		int32 conf = widget->GetMenuSelection();

		InitialiseTextsInMenuControllerOnFoot(&MenuControls_3, (CMenuManager::CONTRCONFIG)conf);
		InitialiseTextsInMenuControllerInCar(&MenuControls_4, (CMenuManager::CONTRCONFIG)conf);

		int32 i = MenuControls_2.GetMenuSelection();
		if ( i == 1 )
		{
			if ( conf == CMenuManager::CONFIG_2 )
				MenuPage_Controls.m_controls[0] = &MenuControls_7;
			else
				MenuPage_Controls.m_controls[0] = &MenuControls_4;
		}
		else if ( i == 0 )
		{
			if ( conf == CMenuManager::CONFIG_2 )
				MenuPage_Controls.m_controls[0] = &MenuControls_6;
			else
				MenuPage_Controls.m_controls[0] = &MenuControls_3;
		}
	}
}

void
TriggerLanguage_Language(CMenuMultiChoiceTriggered *widget)
{
	if ( widget )
	{
		if ( CMenuManager::m_PrefsLanguage != widget->GetMenuSelection() )
		{
			CMenuManager::m_PrefsLanguage = widget->GetMenuSelection();
			FrontEndMenuManager.m_bInitialised = false;
			bFrontEnd_ReloadObrTxtGxt = true;
		}
	}
}

void
TriggerAudio_RadioStation(CMenuMultiChoicePicturedTriggered *widget)
{
	if ( widget )
	{
		if ( CMenuManager::m_PrefsRadioStation != widget->GetMenuSelection() )
		{
			CMenuManager::m_PrefsRadioStation = widget->GetMenuSelection();
			DMAudio.PlayFrontEndTrack(CMenuManager::m_PrefsRadioStation, TRUE);
			DMAudio.SetRadioInCar(CMenuManager::m_PrefsRadioStation);
		}
	}
}

void
TriggerAudio_StereoMono(CMenuMultiChoiceTriggered *widget)
{
	if ( widget )
	{
		if (widget->GetMenuSelection() == 1)
		{
			DMAudio.SetMonoMode(TRUE);
			DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MONO, 0);
		}
		else
		{
			DMAudio.SetMonoMode(FALSE);
			DMAudio.PlayFrontEndSound(SOUND_FRONTEND_STEREO, 0);
		}
	}
}

void
TriggerAudio_MusicVolumeAlways(CMenuSliderTriggered *widget)
{
	;
}

void
TriggerAudio_SfxVolumeAlways(CMenuSliderTriggered *widget)
{
	if ( widget )
	{
		static bool bTriggerTest = false;

		CMenuManager::m_PrefsSfxVolume = float(widget->GetMenuSelection()) / 100.0f * 127.0f + 0.5f;

		if ( CMenuManager::m_PrefsSfxVolume == 102 && !CPad::GetPad(0)->GetDPadLeft()&& !CPad::GetPad(0)->GetDPadRight() )
		{
			if ( bTriggerTest )
			{
				DMAudio.PlayFrontEndSound(SOUND_FRONTEND_AUDIO_TEST, 0);
				bTriggerTest = false;
			}
		}
		else
			bTriggerTest = true;

		FrontEndMenuManager.SetSoundLevelsForMusicMenu();
	}
}

void
TriggerAudio_MusicVolume(CMenuSliderTriggered *widget)
{
	if ( widget )
	{
		CMenuManager::m_PrefsMusicVolume = float(widget->GetMenuSelection()) / 100.0f * 127.0f + 0.5f;
		FrontEndMenuManager.SetSoundLevelsForMusicMenu();
	}
}

void
TriggerAudio_SfxVolume(CMenuSliderTriggered *widget)
{
	;
}

void
TriggerSave_NewGameNewGame(CMenuMultiChoiceTriggered *widget)
{
	FrontEndMenuManager.m_bWantToRestart = true;
	FrontEndMenuManager.m_bMenuActive    = false;
	FrontEndMenuManager.m_bInSaveZone    = false;
	bIgnoreTriangleButton = false;

	CTimer::EndUserPause();

	FrontEndMenuManager.AnaliseMenuContents();

	DMAudio.SetEffectsFadeVol(0);
	DMAudio.SetMusicFadeVol(0);
	DMAudio.ResetTimers(CTimer::GetTimeInMilliseconds());
}

void
TriggerSave_NewGameSelectYes(CMenuMultiChoiceTriggered *widget)
{
	// Are you sure you want to start a new game? All progress since the last save game will be lost. Proceed?
	MenuSaveZoneQYN_1.m_numTexts = 0;
	MenuSaveZoneQYN_1.AddText(TheText.Get("FESZ_QR"), X(-100.0f), 0.0f, TEXT_COLOR, 0);

	MenuSaveZoneQYN_2.m_numOptions = 0;
	MenuSaveZoneQYN_2.AddOption(TheText.Get("FEM_NO"),  X(80.0f), YF(30.0f), TriggerSave_BackToMainMenu, 0, 0);
	MenuSaveZoneQYN_2.AddOption(TheText.Get("FEM_YES"), X(80.0f), YF(10.0f), TriggerSave_NewGameNewGame, 0, 0);

	MenuPageSaveZone_QuestionYesNo.ActivatePage();
	pMenuSave = &MenuPageSaveZone_QuestionYesNo;
	bIgnoreTriangleButton = true;
}

void
TriggerSave_DeleteGameDeleteGame(CMenuMultiChoiceTriggered *widget)
{
	if ( widget )
	{
		bMemoryCardSpecialZone = false;
		bIgnoreTriangleButton  = false;

		if ( !MemCardAccessTriggerCaller.CanCall() )
			MemCardAccessTriggerCaller.SetTrigger(TriggerSave_DeleteGameDeleteGame, widget);
		else
		{
			// Deleting data. Please do not remove the Memory Card (PS2) in MEMORY CARD slot 1, reset or switch off the console.
			DisplayMemoryCardAccessMsg(TheText.Get("FEDL_WR"), CRGBA(200, 50, 50, 192));

			TheMemoryCard.DeleteSlot(MemoryCardSlotSelected);

			if ( TheMemoryCard.GetError() != CMemoryCard::NO_ERR_SUCCESS)
			{
				// Deleting Failed! Check Memory Card (PS2) in MEMORY CARD slot 1 and please try again.
				MenuSaveZoneMSG_1.m_numTexts = 0;
				MenuSaveZoneMSG_1.AddText(TheText.Get("FES_DEE"), X(-80.0f), YF(20.0f), TEXT_COLOR, 0);

				MenuSaveZoneMSG_2.m_numOptions = 0;
				MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(100.0f), YF(15.0f), TriggerSave_BackToMainMenu, 0, 0);

				MenuPageSaveZone_Message.ActivatePage();
				pMenuSave = &MenuPageSaveZone_Message;

				bMemoryCardSpecialZone = false;
				bIgnoreTriangleButton  = true;
			}
			else
			{
				FillMenuWithMemCardFileListing(&MenuSaveLG_2, TriggerSave_BackToMainMenuTwoLines, TriggerSave_LoadGameLoadGameSelect,     nil, 0, 34, 22);
				FillMenuWithMemCardFileListing(&MenuSaveDG_2, TriggerSave_BackToMainMenuTwoLines, TriggerSave_DeleteGameDeleteGameSelect, nil, 0, 34, 22);

				pMenuSave = &MenuPage_SaveBasic;
				pMenuSave->ActivatePage();
			}
		}
	}
}

void
TriggerSave_DeleteGameDeleteGameSelect(CMenuMultiChoiceTwoLinesTriggered *widget)
{
	if ( widget )
	{
		if ( widget->GetMenuSelection() > 0 )
		{
			MemoryCardSlotSelected = widget->GetMenuSelection() - 1;

			switch ( TheMemoryCard.GetInfoOnSpecificSlot(MemoryCardSlotSelected) )
			{
				case CMemoryCard::SLOT_NOTPRESENT:
				{
					break;
				}
				case CMemoryCard::SLOT_CORRUPTED:
				case CMemoryCard::SLOT_PRESENT:
				{
					// Proceed with deleting this saved game?
					MenuSaveZoneQYN_1.m_numTexts = 0;
					MenuSaveZoneQYN_1.AddText(TheText.Get("FESZ_QD"), X(-40.0f), 0.0f, TEXT_COLOR, 0);

					MenuSaveZoneQYN_2.m_numOptions = 0;
					MenuSaveZoneQYN_2.AddOption(TheText.Get("FEM_NO"), X(80.0f), YF(20.0f), TriggerSave_BackToMainMenu, 0, 0);
					MenuSaveZoneQYN_2.AddOption(TheText.Get("FEM_YES"), X(80.0f), 0.0f, TriggerSave_DeleteGameDeleteGame, 0, 0);

					MenuPageSaveZone_QuestionYesNo.ActivatePage();
					pMenuSave = &MenuPageSaveZone_QuestionYesNo;
					bMemoryCardSpecialZone = false;
					break;
				}
			}
		}
	}
}

void
TriggerSave_DeleteGameSelect(CMenuMultiChoiceTriggered *widget)
{
	FillMenuWithMemCardFileListing(&MenuSaveDG_2, TriggerSave_BackToMainMenuTwoLines, TriggerSave_DeleteGameDeleteGameSelect, nil, 0, 34, 22);
	FillMenuWithMemCardFileListing(&MenuSaveLG_2, TriggerSave_BackToMainMenuTwoLines, TriggerSave_LoadGameLoadGameSelect,     nil, 0, 34, 22);

	pMenuSave = &MenuPage_SaveDeleteGame;
	pMenuSave->ActivatePage();

	gErrorSampleTriggered  = false;
	bMemoryCardSpecialZone = true;
	bIgnoreTriangleButton  = true;
}

void
TriggerSave_LoadGameLoadGame(CMenuMultiChoiceTriggered *widget)
{
	if ( widget )
	{
		bMemoryCardSpecialZone = false;
		bIgnoreTriangleButton  = false;

		if ( !MemCardAccessTriggerCaller.CanCall() )
			MemCardAccessTriggerCaller.SetTrigger(TriggerSave_LoadGameLoadGame, widget);
		else
		{
			// Loading data. Please do not remove the Memory Card (PS2) in MEMORY CARD slot 1, reset or switch off the console.
			DisplayMemoryCardAccessMsg(TheText.Get("FELD_WR"), CRGBA(200, 50, 50, 192));
			TheMemoryCard.LoadSlotToBuffer(MemoryCardSlotSelected);

			if ( TheMemoryCard.GetError() == CMemoryCard::NO_ERR_SUCCESS)
			{
				FrontEndMenuManager.m_bWantToRestart = true;
				FrontEndMenuManager.AnaliseMenuContents();
				FrontEndMenuManager.m_bMenuActive = false;
				FrontEndMenuManager.m_bInSaveZone = false;

				CTimer::EndUserPause();

				TheMemoryCard.m_bWantToLoad = true;

				DMAudio.SetEffectsFadeVol(0);
				DMAudio.SetMusicFadeVol(0);
				DMAudio.ResetTimers(CTimer::GetTimeInMilliseconds());
			}
			else
			{
				// Load Failed! Check Memory Card (PS2) in MEMORY CARD slot 1 and please try again.
				MenuSaveZoneMSG_1.m_numTexts = 0;
				MenuSaveZoneMSG_1.AddText(TheText.Get("FES_LOE"), X(-80.0f), YF(20.0f), TEXT_COLOR, 0);

				MenuSaveZoneMSG_2.m_numOptions = 0;
				MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(100.0f), YF(25.0f), TriggerSave_BackToMainMenu, 0, 0);

				pMenuSave = &MenuPageSaveZone_Message;
				pMenuSave->ActivatePage();

				bMemoryCardSpecialZone = false;
				bIgnoreTriangleButton = true;
			}
		}
	}
}

void
TriggerSave_LoadGameLoadGameSelect(CMenuMultiChoiceTwoLinesTriggered *widget)
{
	if ( widget )
	{
		if ( widget->GetMenuSelection() > 0 )
		{
			MemoryCardSlotSelected = widget->GetMenuSelection() - 1;

			switch ( TheMemoryCard.GetInfoOnSpecificSlot(MemoryCardSlotSelected) )
			{
				case CMemoryCard::SLOT_NOTPRESENT:
				{
					break;
				}
				case CMemoryCard::SLOT_CORRUPTED:
				{
					// Load Failed.
					MenuSaveZoneMSG_1.m_numTexts = 0;
					MenuSaveZoneMSG_1.AddText(TheText.Get("FES_LOF"), X(50.0f), YF(20.0f), TEXT_COLOR, 0);

					MenuSaveZoneMSG_2.m_numOptions = 0;
					MenuSaveZoneMSG_2.AddOption(TheText.Get("FESZ_OK"), X(100.0f), 0.0f, TriggerSave_BackToMainMenu, 0, 0);

					MenuPageSaveZone_Message.ActivatePage();
					pMenuSave = &MenuPageSaveZone_Message;
					bMemoryCardSpecialZone = false;
					break;
				}
				case CMemoryCard::SLOT_PRESENT:
				{
					// All unsaved progress in your current game will be lost. Proceed with loading?
					MenuSaveZoneQYN_1.m_numTexts = 0;
					MenuSaveZoneQYN_1.AddText(TheText.Get("FESZ_QL"), X(-40.0f), 0.0f, TEXT_COLOR, 0);

					MenuSaveZoneQYN_2.m_numOptions = 0;
					MenuSaveZoneQYN_2.AddOption(TheText.Get("FEM_NO"),  X(80.0f), YF(20.0f), TriggerSave_BackToMainMenu,   0, 0);
					MenuSaveZoneQYN_2.AddOption(TheText.Get("FEM_YES"), X(80.0f), 0.0f,  TriggerSave_LoadGameLoadGame, 0, 0);

					MenuPageSaveZone_QuestionYesNo.ActivatePage();
					pMenuSave = &MenuPageSaveZone_QuestionYesNo;
					bMemoryCardSpecialZone = false;
					break;
				}
			}
		}
	}
}

void
TriggerSave_LoadGameSelect(CMenuMultiChoiceTriggered *widget)
{
	FillMenuWithMemCardFileListing(&MenuSaveLG_2, TriggerSave_BackToMainMenuTwoLines, TriggerSave_LoadGameLoadGameSelect,     nil, 0, 34, 22);
	FillMenuWithMemCardFileListing(&MenuSaveDG_2, TriggerSave_BackToMainMenuTwoLines, TriggerSave_DeleteGameDeleteGameSelect, nil, 0, 34, 22);

	pMenuSave = &MenuPage_SaveLoadGame;
	pMenuSave->ActivatePage();

	gErrorSampleTriggered  = false;
	bMemoryCardSpecialZone = true;
	bIgnoreTriangleButton  = true;
}

void
TriggerSave_BackToMainMenu(CMenuMultiChoiceTriggered *widget)
{
	pMenuSave = &MenuPage_SaveBasic;
	pMenuSave->ActivatePage();
	bMemoryCardSpecialZone = false;
	bIgnoreTriangleButton  = false;
}

void InitialiseTextsInMenuControllerInCar(CMenuPictureAndText *widget, CMenuManager::CONTRCONFIG cont)
{
	if ( widget )
	{
		widget->m_numTexts = 0;

		switch ( cont )
		{
			case CMenuManager::CONFIG_1:
			{
				widget->AddText(TheText.Get("FEC_LL"),  X(50.0f),  Y(-14.0f), PAD_TEXT_COLOR, true);  // -16.0f
				widget->AddText(TheText.Get("FEC_RSC"), X(-4.0f),  Y(29.0f),  PAD_TEXT_COLOR, true);  // 33.142860f
				widget->AddText(TheText.Get("FEC_VES"), X(-4.0f),  Y(65.0f),  PAD_TEXT_COLOR, true);  // 74.285721f
				widget->AddText(TheText.Get("FEC_VES"), X(-4.0f),  Y(97.0f),  PAD_TEXT_COLOR, true);  // 110.857147f
				widget->AddText(TheText.Get("FEC_HO3"), X(84.0f),  Y(162.0f), PAD_TEXT_COLOR, false); // 185.142868f
				widget->AddText(TheText.Get("FEC_CAM"), X(103.0f), Y(141.0f), PAD_TEXT_COLOR, false); // 161.142868f
				widget->AddText(TheText.Get("FEC_PAU"), X(130.0f), Y(128.0f), PAD_TEXT_COLOR, false); // 146.285721f
				widget->AddText(TheText.Get("FEC_LB"),  X(68.0f),  Y(-6.0f),  PAD_TEXT_COLOR, false); // -6.857143f
				widget->AddText(TheText.Get("FEC_LR"),  X(184.0f), Y(-14.0f), PAD_TEXT_COLOR, false); // -16.0f
				widget->AddText(TheText.Get("FEC_HAB"), X(238.0f), Y(25.0f),  PAD_TEXT_COLOR, false); // 28.571430f
				widget->AddText(TheText.Get("FEC_BRA"), X(155.0f), Y(18.0f),  PAD_TEXT_COLOR, true);  //  20.571430f
				widget->AddText(TheText.Get("FEC_EXV"), X(238.0f), Y(52.0f),  PAD_TEXT_COLOR, false); // 59.428574f
				widget->AddText(TheText.Get("FEC_CAW"), X(238.0f), Y(65.0f),  PAD_TEXT_COLOR, false); //  74.285721f
				widget->AddText(TheText.Get("FEC_ACC"), X(238.0f), Y(78.0f),  PAD_TEXT_COLOR, false); // 89.142860f
				widget->AddText(TheText.Get("FEC_TUC"), X(238.0f), Y(94.0f),  PAD_TEXT_COLOR, false); // 107.428574f
				widget->AddText(TheText.Get("FEC_SM3"), X(238.0f), Y(109.0f), PAD_TEXT_COLOR, false); // 124.571434f

				break;
			}

			case CMenuManager::CONFIG_2:
			{
				widget->AddText(TheText.Get("FEC_LL"),  X(50.0f),  Y(-14.0f), PAD_TEXT_COLOR, true);  // -16.0f
				widget->AddText(TheText.Get("FEC_HOR"), X(-4.0f),  Y(29.0f),  PAD_TEXT_COLOR, true);  // 33.142860f
				widget->AddText(TheText.Get("FEC_CAM"), X(-4.0f),  Y(65.0f),  PAD_TEXT_COLOR, true);  // 74.285721f
				widget->AddText(TheText.Get("FEC_VES"), X(-4.0f),  Y(97.0f),  PAD_TEXT_COLOR, true);  // 110.857147f
				widget->AddText(TheText.Get("FEC_NA"),  X(84.0f),  Y(162.0f), PAD_TEXT_COLOR, false); // 185.142868f
				widget->AddText(TheText.Get("FEC_RSC"), X(103.0f), Y(141.0f), PAD_TEXT_COLOR, false); // 161.142868f
				widget->AddText(TheText.Get("FEC_PAU"), X(130.0f), Y(128.0f), PAD_TEXT_COLOR, false); // 146.285721f
				widget->AddText(TheText.Get("FEC_LB"),  X(68.0f),  Y(-6.0f),  PAD_TEXT_COLOR, false); // -6.857143f
				widget->AddText(TheText.Get("FEC_LR"),  X(184.0f), Y(-14.0f), PAD_TEXT_COLOR, false); // -16.0f
				widget->AddText(TheText.Get("FEC_HAB"), X(238.0f), Y(25.0f),  PAD_TEXT_COLOR, false); // 28.571430f
				widget->AddText(TheText.Get("FEC_BRA"), X(155.0f), Y(18.0f),  PAD_TEXT_COLOR, true);  //  20.571430f
				widget->AddText(TheText.Get("FEC_EXV"), X(238.0f), Y(52.0f),  PAD_TEXT_COLOR, false); // 59.428574f
				widget->AddText(TheText.Get("FEC_CAW"), X(238.0f), Y(65.0f),  PAD_TEXT_COLOR, false); //  74.285721f
				widget->AddText(TheText.Get("FEC_ACC"), X(238.0f), Y(78.0f),  PAD_TEXT_COLOR, false); // 89.142860f
				widget->AddText(TheText.Get("FEC_TUC"), X(238.0f), Y(94.0f),  PAD_TEXT_COLOR, false); // 107.428574f
				widget->AddText(TheText.Get("FEC_SM3"), X(238.0f), Y(109.0f), PAD_TEXT_COLOR, false); // 124.571434f

				break;
			}

			case CMenuManager::CONFIG_3:
			{
				widget->AddText(TheText.Get("FEC_LL"),  X(50.0f),  Y(-14.0f), PAD_TEXT_COLOR, true);  // -16.0f
				widget->AddText(TheText.Get("FEC_EXV"), X(-4.0f),  Y(29.0f),  PAD_TEXT_COLOR, true);  // 33.142860f
				widget->AddText(TheText.Get("FEC_VES"), X(-4.0f),  Y(65.0f),  PAD_TEXT_COLOR, true);  // 74.285721f
				widget->AddText(TheText.Get("FEC_VES"), X(-4.0f),  Y(97.0f),  PAD_TEXT_COLOR, true);  // 110.857147f
				widget->AddText(TheText.Get("FEC_RS3"), X(84.0f),  Y(162.0f), PAD_TEXT_COLOR, false); // 185.142868f
				widget->AddText(TheText.Get("FEC_CAM"), X(103.0f), Y(141.0f), PAD_TEXT_COLOR, false); // 161.142868f
				widget->AddText(TheText.Get("FEC_PAU"), X(130.0f), Y(128.0f), PAD_TEXT_COLOR, false); // 146.285721f
				widget->AddText(TheText.Get("FEC_LB"),  X(68.0f),  Y(-6.0f),  PAD_TEXT_COLOR, false); // -6.857143f
				widget->AddText(TheText.Get("FEC_LR"),  X(184.0f), Y(-14.0f), PAD_TEXT_COLOR, false); // -16.0f
				widget->AddText(TheText.Get("FEC_HOR"), X(238.0f), Y(25.0f),  PAD_TEXT_COLOR, false); // 28.571430f
				widget->AddText(TheText.Get("FEC_BRA"), X(155.0f), Y(18.0f),  PAD_TEXT_COLOR, true);  //  20.571430f
				widget->AddText(TheText.Get("FEC_HAB"), X(238.0f), Y(52.0f),  PAD_TEXT_COLOR, false); // 59.428574f
				widget->AddText(TheText.Get("FEC_CAW"), X(238.0f), Y(65.0f),  PAD_TEXT_COLOR, false); //  74.285721f
				widget->AddText(TheText.Get("FEC_ACC"), X(238.0f), Y(78.0f),  PAD_TEXT_COLOR, false); // 89.142860f
				widget->AddText(TheText.Get("FEC_TUC"), X(238.0f), Y(94.0f),  PAD_TEXT_COLOR, false); // 107.428574f
				widget->AddText(TheText.Get("FEC_SM3"), X(238.0f), Y(109.0f), PAD_TEXT_COLOR, false); // 124.571434f

				break;
			}

			case CMenuManager::CONFIG_4:
			{
				widget->AddText(TheText.Get("FEC_LL"),  X(50.0f),  Y(-14.0f), PAD_TEXT_COLOR, true);  // -16.0f
				widget->AddText(TheText.Get("FEC_HAB"), X(-4.0f),  Y(29.0f),  PAD_TEXT_COLOR, true);  // 33.142860f
				widget->AddText(TheText.Get("FEC_TUC"), X(-4.0f),  Y(65.0f),  PAD_TEXT_COLOR, true);  // 74.285721f
				widget->AddText(TheText.Get("FEC_VES"), X(-4.0f),  Y(97.0f),  PAD_TEXT_COLOR, true);  // 110.857147f
				widget->AddText(TheText.Get("FEC_HO3"), X(84.0f),  Y(162.0f), PAD_TEXT_COLOR, false); //  185.142868f
				widget->AddText(TheText.Get("FEC_CAM"), X(103.0f), Y(141.0f), PAD_TEXT_COLOR, false); //  161.142868f
				widget->AddText(TheText.Get("FEC_PAU"), X(130.0f), Y(128.0f), PAD_TEXT_COLOR, false); // 146.285721f
				widget->AddText(TheText.Get("FEC_LB"),  X(68.0f),  Y(-6.0f),  PAD_TEXT_COLOR, false); //  -6.857143f
				widget->AddText(TheText.Get("FEC_LR"),  X(184.0f), Y(-14.0f), PAD_TEXT_COLOR, false); // -16.0f
				widget->AddText(TheText.Get("FEC_CAW"), X(238.0f), Y(25.0f),  PAD_TEXT_COLOR, false); //  28.571430f
				widget->AddText(TheText.Get("FEC_SMT"), X(155.0f), Y(18.0f),  PAD_TEXT_COLOR, true);  //  20.571430f
				widget->AddText(TheText.Get("FEC_EXV"), X(238.0f), Y(52.0f),  PAD_TEXT_COLOR, false); // 59.428574f
				widget->AddText(TheText.Get("FEC_RSC"), X(238.0f), Y(65.0f),  PAD_TEXT_COLOR, false); //  74.285721f
				widget->AddText(TheText.Get("FEC_NA"),  X(238.0f), Y(78.0f),  PAD_TEXT_COLOR, false); // 89.142860f
				widget->AddText(TheText.Get("FEC_ACC"), X(238.0f), Y(94.0f),  PAD_TEXT_COLOR, false); // 107.428574f
				widget->AddText(TheText.Get("FEC_BRA"), X(238.0f), Y(109.0f), PAD_TEXT_COLOR, false); // 124.571434f

				break;
			}
		}
	}
}

void InitialiseTextsInMenuControllerOnFoot(CMenuPictureAndText *widget, CMenuManager::CONTRCONFIG cont)
{
	if ( widget )
	{
		widget->m_numTexts = 0;

		switch ( cont )
		{
			case CMenuManager::CONFIG_1:
			{
				widget->AddText(TheText.Get("FEC_CWL"),  X(50.0f),   Y(-14.0f), PAD_TEXT_COLOR, true);  // -16.0f
				widget->AddText(TheText.Get("FEC_LOF"),  X(-4.0f),   Y(25.0f),  PAD_TEXT_COLOR, true);  // 28.571430f
				widget->AddText(TheText.Get("FEC_MOV"),  X(-4.0f),   Y(65.0f),  PAD_TEXT_COLOR, true);  // 74.285721f
				widget->AddText(TheText.Get("FEC_MOV"),  X(-4.0f),   Y(97.0f),  PAD_TEXT_COLOR, true);  // 110.857147f
				widget->AddText(TheText.Get("FEC_CAM"),  X(103.0f),  Y(141.0f), PAD_TEXT_COLOR, false); // 161.142868f
				widget->AddText(TheText.Get("FEC_PAU"),  X(130.0f),  Y(128.0f), PAD_TEXT_COLOR, false); // 146.285721f
				widget->AddText(TheText.Get("FEC_CWR"),  X(184.0f),  Y(-14.0f), PAD_TEXT_COLOR, false); // -16.0f
				widget->AddText(TheText.Get("FEC_TAR"),  X(238.0f),  Y(25.0f),  PAD_TEXT_COLOR, false); // 28.571430f
				widget->AddText(TheText.Get("FEC_JUM"),  X(144.0f),  Y(18.0f),  PAD_TEXT_COLOR, true);  // 20.571430f
				widget->AddText(TheText.Get("FEC_ENV"),  X(238.0f),  Y(52.0f),  PAD_TEXT_COLOR, false); // 59.428574f
				widget->AddText(TheText.Get("FEC_ATT"),  X(238.0f),  Y(65.0f),  PAD_TEXT_COLOR, false); // 74.285721f
				widget->AddText(TheText.Get("FEC_RUN"),  X(238.0f),  Y(78.0f),  PAD_TEXT_COLOR, false); // 89.142860f
				widget->AddText(TheText.Get("FEC_FPC"),  X(238.0f),  Y(94.0f),  PAD_TEXT_COLOR, false); // 107.428574f
				widget->AddText(TheText.Get("FEC_LB3"),  X(238.0f),  Y(109.0f), PAD_TEXT_COLOR, false); // 124.571434f
				widget->AddText(TheText.Get("FEC_R3"),   X(238.0f),  Y(122.0f), PAD_TEXT_COLOR, false); // 139.428574f

				break;
			}

			case CMenuManager::CONFIG_2:
			{
				widget->AddText(TheText.Get("FEC_CWL"),  X(50.0f),   Y(-14.0f), PAD_TEXT_COLOR, true);  // -16.0f
				widget->AddText(TheText.Get("FEC_LOF"),  X(-4.0f),   Y(25.0f),  PAD_TEXT_COLOR, true);  // 28.571430f
				widget->AddText(TheText.Get("FEC_CAM"),  X(-4.0f),   Y(65.0f),  PAD_TEXT_COLOR, true);  // 74.285721f
				widget->AddText(TheText.Get("FEC_MOV"),  X(-4.0f),   Y(97.0f),  PAD_TEXT_COLOR, true);  // 110.857147f
				widget->AddText(TheText.Get("FEC_NA"),   X(103.0f),  Y(141.0f), PAD_TEXT_COLOR, false); // 161.142868f
				widget->AddText(TheText.Get("FEC_PAU"),  X(130.0f),  Y(128.0f), PAD_TEXT_COLOR, false); // 146.285721f
				widget->AddText(TheText.Get("FEC_CWR"),  X(184.0f),  Y(-14.0f), PAD_TEXT_COLOR, false); // -16.0f
				widget->AddText(TheText.Get("FEC_TAR"),  X(238.0f),  Y(25.0f),  PAD_TEXT_COLOR, false); // 28.571430f
				widget->AddText(TheText.Get("FEC_JUM"),  X(144.0f),  Y(18.0f),  PAD_TEXT_COLOR, true);  // 20.571430f
				widget->AddText(TheText.Get("FEC_ENV"),  X(238.0f),  Y(52.0f),  PAD_TEXT_COLOR, false); // 59.428574f
				widget->AddText(TheText.Get("FEC_ATT"),  X(238.0f),  Y(65.0f),  PAD_TEXT_COLOR, false); // 74.285721f
				widget->AddText(TheText.Get("FEC_RUN"),  X(238.0f),  Y(78.0f),  PAD_TEXT_COLOR, false); // 89.142860f
				widget->AddText(TheText.Get("FEC_FPC"),  X(238.0f),  Y(94.0f),  PAD_TEXT_COLOR, false); // 107.428574f
				widget->AddText(TheText.Get("FEC_LB3"),  X(238.0f),  Y(109.0f), PAD_TEXT_COLOR, false); // 124.571434f
				widget->AddText(TheText.Get("FEC_R3"),   X(238.0f),  Y(122.0f), PAD_TEXT_COLOR, false); // 139.428574f

				break;
			}

			case CMenuManager::CONFIG_3:
			{
				widget->AddText(TheText.Get("FEC_CWL"),  X(50.0f),   Y(-14.0f), PAD_TEXT_COLOR, true);  // -16.0f
				widget->AddText(TheText.Get("FEC_ENV"),  X(-4.0f),   Y(25.0f),  PAD_TEXT_COLOR, true);  // 28.571430f
				widget->AddText(TheText.Get("FEC_MOV"),  X(-4.0f),   Y(65.0f),  PAD_TEXT_COLOR, true);  // 74.285721f
				widget->AddText(TheText.Get("FEC_MOV"),  X(-4.0f),   Y(97.0f),  PAD_TEXT_COLOR, true);  // 110.857147f
				widget->AddText(TheText.Get("FEC_CAM"),  X(103.0f),  Y(141.0f), PAD_TEXT_COLOR, false); // 161.142868f
				widget->AddText(TheText.Get("FEC_PAU"),  X(130.0f),  Y(128.0f), PAD_TEXT_COLOR, false); // 146.285721f
				widget->AddText(TheText.Get("FEC_CWR"),  X(184.0f),  Y(-14.0f), PAD_TEXT_COLOR, false); // -16.0f
				widget->AddText(TheText.Get("FEC_TAR"),  X(238.0f),  Y(25.0f),  PAD_TEXT_COLOR, false); // 28.571430f
				widget->AddText(TheText.Get("FEC_JUM"),  X(144.0f),  Y(18.0f),  PAD_TEXT_COLOR, true);  // 20.571430f
				widget->AddText(TheText.Get("FEC_LOF"),  X(238.0f),  Y(52.0f),  PAD_TEXT_COLOR, false); // 59.428574f
				widget->AddText(TheText.Get("FEC_RUN"),  X(238.0f),  Y(65.0f),  PAD_TEXT_COLOR, false); // 74.285721f
				widget->AddText(TheText.Get("FEC_ATT"),  X(238.0f),  Y(78.0f),  PAD_TEXT_COLOR, false); // 89.142860f
				widget->AddText(TheText.Get("FEC_FPC"),  X(238.0f),  Y(94.0f),  PAD_TEXT_COLOR, false); // 107.428574f
				widget->AddText(TheText.Get("FEC_LB3"),  X(238.0f),  Y(109.0f), PAD_TEXT_COLOR, false); // 124.571434f
				widget->AddText(TheText.Get("FEC_R3"),   X(238.0f),  Y(122.0f), PAD_TEXT_COLOR, false); // 139.428574f

				break;
			}

			case CMenuManager::CONFIG_4:
			{
				widget->AddText(TheText.Get("FEC_CWL"),  X(50.0f),   Y(-14.0f), PAD_TEXT_COLOR, true);  // -16.0f
				widget->AddText(TheText.Get("FEC_TAR"),  X(-4.0f),   Y(25.0f),  PAD_TEXT_COLOR, true);  // 28.571430f
				widget->AddText(TheText.Get("FEC_NA"),   X(-4.0f),   Y(65.0f),  PAD_TEXT_COLOR, true);  // 74.285721f
				widget->AddText(TheText.Get("FEC_MOV"),  X(-4.0f),   Y(97.0f),  PAD_TEXT_COLOR, true);  // 110.857147f
				widget->AddText(TheText.Get("FEC_CAM"),  X(103.0f),  Y(141.0f), PAD_TEXT_COLOR, false); // 161.142868f
				widget->AddText(TheText.Get("FEC_PAU"),  X(130.0f),  Y(128.0f), PAD_TEXT_COLOR, false); // 146.285721f
				widget->AddText(TheText.Get("FEC_CWR"),  X(184.0f),  Y(-14.0f), PAD_TEXT_COLOR, false); // -16.0f
				widget->AddText(TheText.Get("FEC_ATT"),  X(238.0f),  Y(25.0f),  PAD_TEXT_COLOR, false); // 28.571430f
				widget->AddText(TheText.Get("FEC_JUM"),  X(144.0f),  Y(18.0f),  PAD_TEXT_COLOR, true);  // 20.571430f
				widget->AddText(TheText.Get("FEC_ENV"),  X(238.0f),  Y(52.0f),  PAD_TEXT_COLOR, false); // 59.428574f
				widget->AddText(TheText.Get("FEC_LOF"),  X(238.0f),  Y(65.0f),  PAD_TEXT_COLOR, false); // 74.285721f
				widget->AddText(TheText.Get("FEC_RUN"),  X(238.0f),  Y(78.0f),  PAD_TEXT_COLOR, false); // 89.142860f
				widget->AddText(TheText.Get("FEC_FPC"),  X(238.0f),  Y(94.0f),  PAD_TEXT_COLOR, false); // 107.428574f
				widget->AddText(TheText.Get("FEC_LB3"),  X(238.0f),  Y(109.0f), PAD_TEXT_COLOR, false); // 124.571434f
				widget->AddText(TheText.Get("FEC_R3"),   X(238.0f),  Y(122.0f), PAD_TEXT_COLOR, false); // 139.428574f

				break;
			}
		}
	}
}

void
TriggerSaveZone_BackToMainMenuTwoLines(CMenuMultiChoiceTwoLinesTriggered *widget)
{
	bMemoryCardSpecialZone = false;
	bIgnoreTriangleButton = false;
	pActiveMenuPage = &MenuPageSaveZone_SaveGame;
}

void
TriggerSave_BackToMainMenuTwoLines(CMenuMultiChoiceTwoLinesTriggered *widget)
{
	pMenuSave = &MenuPage_SaveBasic;
	pMenuSave->ActivatePage();
	bMemoryCardSpecialZone = false;
	bIgnoreTriangleButton = false;
}

void
SetRandomActiveTextlineColor(uint8 bText)
{
	if ( bMemoryCardSpecialZone )
		rgbaATC = SELECTED_TEXT_COLOR;
	else
	{
		bool bSelected = false;
		bool bHighlignted = false;

		switch ( FrontEndMenuManager.m_pageState )
		{
			case PAGESTATE_NORMAL:
				break;
			case PAGESTATE_HIGHLIGHTED:
				bHighlignted = true;
				break;
			case PAGESTATE_SELECTED:
				bSelected = true;
				break;
		}

		if ( FrontEndMenuManager.m_bInSaveZone )
			bSelected = true;

		if ( bSelected || bText )
		{
			static uint32 delayTime = 0;
			static bool bAddVal = true;

			if ( delayTime < CTimer::GetTimeInMillisecondsPauseMode() )
			{
				delayTime = CTimer::GetTimeInMillisecondsPauseMode() + 200;

				if ( bAddVal )
					rgbaATC = TEXT_COLOR;
				else
					rgbaATC = SELECTED_TEXT_COLOR;

				bAddVal = !bAddVal;
			}
		}

		if ( bHighlignted )
		{
			static uint32 delayTime = 0;
			static bool bAddVal = true;

			if ( delayTime < CTimer::GetTimeInMillisecondsPauseMode() )
			{
				delayTime = CTimer::GetTimeInMillisecondsPauseMode() + 200;

				if ( bAddVal )
					rgbaATC = TITLE_TEXT_COLOR;
				else
					rgbaATC = MENU_SELECTED_COLOR;

				bAddVal = !bAddVal;
			}
		}
	}
}

#ifdef GTA_PC

void
TriggerDisplay_Trails(CMenuOnOffTriggered *widget)
{
	if ( widget )
	{
		CMenuManager::m_PrefsShowTrails = widget->GetMenuSelection();
		CMBlur::BlurOn = CMenuManager::m_PrefsShowTrails;

		if ( CMBlur::BlurOn )
			CMBlur::MotionBlurOpen(Scene.camera);
		else
			CMBlur::MotionBlurClose();
	}
}

#endif