1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-14 16:19:16 +00:00

Frontend: Stats, Briefs, gta_vc.set, slider ranges, fixes

This commit is contained in:
eray orçunus 2020-07-06 16:38:00 +03:00
parent ceb1defc4e
commit 70fa4ab79c
9 changed files with 270 additions and 236 deletions

View file

@ -39,7 +39,7 @@ extern float fRangePlayerRadius;
extern float fCloseNearClipLimit; extern float fCloseNearClipLimit;
#ifdef FREE_CAM #ifdef FREE_CAM
bool CCamera::bFreeCam; bool CCamera::bFreeCam = false;
int nPreviousMode = -1; int nPreviousMode = -1;
#endif #endif

View file

@ -193,8 +193,8 @@ CCamera::Init(void)
m_bMusicFading = false; m_bMusicFading = false;
m_fTimeToFadeMusic = 0.0f; m_fTimeToFadeMusic = 0.0f;
m_fFLOATingFadeMusic = 0.0f; m_fFLOATingFadeMusic = 0.0f;
m_fMouseAccelHorzntl = 0.003f; m_fMouseAccelVertical = 0.003f;
m_fMouseAccelVertical = 0.0025f; m_fMouseAccelHorzntl = 0.0025f;
} }
if(FrontEndMenuManager.m_bWantToRestart) if(FrontEndMenuManager.m_bWantToRestart)
m_fTimeToFadeMusic = 0.0f; m_fTimeToFadeMusic = 0.0f;

View file

@ -203,6 +203,8 @@ void CControllerConfigManager::InitDefaultControlConfiguration()
SetControllerKeyAssociatedWithAction (GO_BACK, rsDOWN, KEYBOARD); SetControllerKeyAssociatedWithAction (GO_BACK, rsDOWN, KEYBOARD);
SetControllerKeyAssociatedWithAction (GO_BACK, 'S', OPTIONAL_EXTRA); SetControllerKeyAssociatedWithAction (GO_BACK, 'S', OPTIONAL_EXTRA);
SetControllerKeyAssociatedWithAction (NETWORK_TALK, 'T', KEYBOARD);
SetControllerKeyAssociatedWithAction (PED_LOOKBEHIND, rsPADEND, KEYBOARD); SetControllerKeyAssociatedWithAction (PED_LOOKBEHIND, rsPADEND, KEYBOARD);
SetControllerKeyAssociatedWithAction (PED_LOOKBEHIND, rsCAPSLK, OPTIONAL_EXTRA); SetControllerKeyAssociatedWithAction (PED_LOOKBEHIND, rsCAPSLK, OPTIONAL_EXTRA);
@ -436,6 +438,7 @@ void CControllerConfigManager::InitialiseControllerActionNameArray()
SETACTIONNAME(PED_SPRINT); SETACTIONNAME(PED_SPRINT);
SETACTIONNAME(PED_CYCLE_TARGET_LEFT); SETACTIONNAME(PED_CYCLE_TARGET_LEFT);
SETACTIONNAME(PED_CYCLE_TARGET_RIGHT); SETACTIONNAME(PED_CYCLE_TARGET_RIGHT);
SETACTIONNAME(PED_LOCK_TARGET); // duplicate
SETACTIONNAME(PED_CENTER_CAMERA_BEHIND_PLAYER); SETACTIONNAME(PED_CENTER_CAMERA_BEHIND_PLAYER);
SETACTIONNAME(VEHICLE_LOOKBEHIND); SETACTIONNAME(VEHICLE_LOOKBEHIND);
SETACTIONNAME(PED_DUCK); SETACTIONNAME(PED_DUCK);
@ -1808,23 +1811,23 @@ e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerActio
{ {
switch (action) switch (action)
{ {
case CAMERA_CHANGE_VIEW_ALL_SITUATIONS:
case PED_FIREWEAPON: case PED_FIREWEAPON:
case GO_LEFT: case GO_LEFT:
case GO_RIGHT: case GO_RIGHT:
case CAMERA_CHANGE_VIEW_ALL_SITUATIONS:
case NETWORK_TALK: case NETWORK_TALK:
case SWITCH_DEBUG_CAM_ON:
case TOGGLE_DPAD: case TOGGLE_DPAD:
case SWITCH_DEBUG_CAM_ON:
case TAKE_SCREEN_SHOT: case TAKE_SCREEN_SHOT:
case SHOW_MOUSE_POINTER_TOGGLE: case SHOW_MOUSE_POINTER_TOGGLE:
return ACTIONTYPE_COMMON; return ACTIONTYPE_COMMON;
break; break;
case PED_LOOKBEHIND:
case PED_CYCLE_WEAPON_LEFT:
case PED_CYCLE_WEAPON_RIGHT: case PED_CYCLE_WEAPON_RIGHT:
case PED_CYCLE_WEAPON_LEFT:
case PED_JUMPING: case PED_JUMPING:
case PED_SPRINT: case PED_SPRINT:
case PED_LOOKBEHIND:
case PED_DUCK: case PED_DUCK:
case PED_ANSWER_PHONE: case PED_ANSWER_PHONE:
case PED_CYCLE_TARGET_LEFT: case PED_CYCLE_TARGET_LEFT:
@ -1853,13 +1856,13 @@ e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerActio
return ACTIONTYPE_VEHICLE_3RDPERSON; return ACTIONTYPE_VEHICLE_3RDPERSON;
break; break;
case PED_LOCK_TARGET:
case GO_FORWARD: case GO_FORWARD:
case GO_BACK: case GO_BACK:
case PED_1RST_PERSON_LOOK_LEFT: case PED_1RST_PERSON_LOOK_LEFT:
case PED_1RST_PERSON_LOOK_RIGHT: case PED_1RST_PERSON_LOOK_RIGHT:
case PED_1RST_PERSON_LOOK_DOWN: case PED_LOCK_TARGET:
case PED_1RST_PERSON_LOOK_UP: case PED_1RST_PERSON_LOOK_UP:
case PED_1RST_PERSON_LOOK_DOWN:
return ACTIONTYPE_1RST3RDPERSON; return ACTIONTYPE_1RST3RDPERSON;
break; break;

View file

@ -61,6 +61,7 @@ enum e_ControllerAction
SWITCH_DEBUG_CAM_ON, SWITCH_DEBUG_CAM_ON,
TAKE_SCREEN_SHOT, TAKE_SCREEN_SHOT,
SHOW_MOUSE_POINTER_TOGGLE, SHOW_MOUSE_POINTER_TOGGLE,
UNKNOWN_ACTION,
MAX_CONTROLLERACTIONS, MAX_CONTROLLERACTIONS,
}; };

View file

@ -55,6 +55,7 @@ CRGBA HEADER_COLOR(255, 150, 255, 255);
CRGBA DARKMENUOPTION_COLOR(195, 90, 165, 255); CRGBA DARKMENUOPTION_COLOR(195, 90, 165, 255);
CRGBA SLIDERON_COLOR(97, 194, 247, 255); CRGBA SLIDERON_COLOR(97, 194, 247, 255);
CRGBA SLIDEROFF_COLOR(27, 89, 130, 255); CRGBA SLIDEROFF_COLOR(27, 89, 130, 255);
CRGBA LIST_BACKGROUND_COLOR(49, 101, 148, 255);
#define TIDY_UP_PBP // ProcessButtonPresses #define TIDY_UP_PBP // ProcessButtonPresses
#define MAX_VISIBLE_LIST_ROW 30 #define MAX_VISIBLE_LIST_ROW 30
@ -68,11 +69,7 @@ CRGBA SLIDEROFF_COLOR(27, 89, 130, 255);
#define FEET_IN_METER 3.33f #define FEET_IN_METER 3.33f
#endif #endif
#ifdef SCROLLABLE_STATS_PAGE
#define isPlainTextScreen(screen) (screen == MENUPAGE_BRIEFS)
#else
#define isPlainTextScreen(screen) (screen == MENUPAGE_BRIEFS || screen == MENUPAGE_STATS) #define isPlainTextScreen(screen) (screen == MENUPAGE_BRIEFS || screen == MENUPAGE_STATS)
#endif
#ifdef TRIANGLE_BACK_BUTTON #ifdef TRIANGLE_BACK_BUTTON
#define GetBackJustUp GetTriangleJustUp #define GetBackJustUp GetTriangleJustUp
@ -97,8 +94,6 @@ int curBottomBarOption = -1;
int hoveredBottomBarOption = -1; int hoveredBottomBarOption = -1;
#endif #endif
uint8 CMenuManager::m_PrefsStereoMono; // unused except restore settings
// Originally that was PS2 option color, they forget it here and used in PrintBriefs once(but didn't use the output anyway) // Originally that was PS2 option color, they forget it here and used in PrintBriefs once(but didn't use the output anyway)
#ifdef PS2_LIKE_MENU #ifdef PS2_LIKE_MENU
const CRGBA TEXT_COLOR = CRGBA(150, 110, 30, 255); const CRGBA TEXT_COLOR = CRGBA(150, 110, 30, 255);
@ -391,7 +386,7 @@ CMenuManager::CMenuManager()
m_PrefsSfxVolume = 49; m_PrefsSfxVolume = 49;
m_PrefsMusicVolume = 49; m_PrefsMusicVolume = 49;
m_PrefsRadioStation = 0; m_PrefsRadioStation = 0;
field_2C = 1; m_PrefsStereoMono = 1;
m_PrefsBrightness = 256; m_PrefsBrightness = 256;
m_PrefsLOD = 1.2f; m_PrefsLOD = 1.2f;
m_KeyPressedCode = -1; m_KeyPressedCode = -1;
@ -634,31 +629,31 @@ CMenuManager::CheckSliderMovement(int value)
{ {
switch (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action) { switch (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action) {
case MENUACTION_BRIGHTNESS: case MENUACTION_BRIGHTNESS:
m_PrefsBrightness += value * (512/16); m_PrefsBrightness += value * 24.19f;
m_PrefsBrightness = clamp(m_PrefsBrightness, 0, 511); m_PrefsBrightness = clamp(m_PrefsBrightness, 0, 384);
break; break;
case MENUACTION_DRAWDIST: case MENUACTION_DRAWDIST:
if(value > 0) if(value > 0)
m_PrefsLOD += ((1.8f - 0.8f) / 16.0f); m_PrefsLOD += ((1.8f - 0.925f) / 16.0f);
else else
m_PrefsLOD -= ((1.8f - 0.8f) / 16.0f); m_PrefsLOD -= ((1.8f - 0.925f) / 16.0f);
m_PrefsLOD = clamp(m_PrefsLOD, 0.8f, 1.8f); m_PrefsLOD = clamp(m_PrefsLOD, 0.925f, 1.8f);
CRenderer::ms_lodDistScale = m_PrefsLOD; CRenderer::ms_lodDistScale = m_PrefsLOD;
break; break;
case MENUACTION_MUSICVOLUME: case MENUACTION_MUSICVOLUME:
m_PrefsMusicVolume += value * (128/16); m_PrefsMusicVolume += value * (128/32);
m_PrefsMusicVolume = clamp(m_PrefsMusicVolume, 0, 127); m_PrefsMusicVolume = clamp(m_PrefsMusicVolume, 0, 65);
printf("%d\n", m_PrefsMusicVolume);
DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume); DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume);
break; break;
case MENUACTION_SFXVOLUME: case MENUACTION_SFXVOLUME:
m_PrefsSfxVolume += value * (128/16); m_PrefsSfxVolume += value * (128/32);
m_PrefsSfxVolume = clamp(m_PrefsSfxVolume, 0, 127); m_PrefsSfxVolume = clamp(m_PrefsSfxVolume, 0, 65);
DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume); DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
break; break;
case MENUACTION_MOUSESENS: case MENUACTION_MOUSESENS:
TheCamera.m_fMouseAccelHorzntl += value * 1.0f/200.0f/15.0f; // ??? TheCamera.m_fMouseAccelHorzntl += value * 1.0f/200.0f/15.0f; // ???
TheCamera.m_fMouseAccelHorzntl = clamp(TheCamera.m_fMouseAccelHorzntl, 1.0f/3200.0f, 1.0f/200.0f); TheCamera.m_fMouseAccelHorzntl = clamp(TheCamera.m_fMouseAccelHorzntl, 1.0f/3200.0f, 1.0f/200.0f);
TheCamera.m_fMouseAccelVertical = TheCamera.m_fMouseAccelHorzntl;
break; break;
default: default:
return; return;
@ -666,6 +661,7 @@ CMenuManager::CheckSliderMovement(int value)
SaveSettings(); SaveSettings();
} }
// --MIAMI: Done
void void
CMenuManager::DisplayHelperText(char *text) CMenuManager::DisplayHelperText(char *text)
{ {
@ -798,10 +794,10 @@ CMenuManager::DisplaySlider(float x, float y, float mostLeftBarSize, float mostR
void void
CMenuManager::DoSettingsBeforeStartingAGame() CMenuManager::DoSettingsBeforeStartingAGame()
{ {
CCamera::m_bUseMouse3rdPerson = m_ControlMethod == CONTROL_STANDARD; #ifdef LEGACY_MENU_OPTIONS
if (m_PrefsVsyncDisp != m_PrefsVsync) if (m_PrefsVsyncDisp != m_PrefsVsync)
m_PrefsVsync = m_PrefsVsyncDisp; m_PrefsVsync = m_PrefsVsyncDisp;
#endif
DMAudio.DestroyAllGameCreatedEntities(); DMAudio.DestroyAllGameCreatedEntities();
DMAudio.Service(); DMAudio.Service();
m_bShutDownFrontEndRequested = true; m_bShutDownFrontEndRequested = true;
@ -838,7 +834,7 @@ CMenuManager::DrawStandardMenus(bool drawCurrScreen)
CSprite2d::Draw2DPolygon(MENU_X_LEFT_ALIGNED(38.0f), MENU_Y(85.0f), CSprite2d::Draw2DPolygon(MENU_X_LEFT_ALIGNED(38.0f), MENU_Y(85.0f),
MENU_X_LEFT_ALIGNED(615.0f), MENU_Y(75.0f), MENU_X_LEFT_ALIGNED(615.0f), MENU_Y(75.0f),
MENU_X_LEFT_ALIGNED(30.0f), MENU_Y(320.0f), MENU_X_LEFT_ALIGNED(30.0f), MENU_Y(320.0f),
MENU_X_LEFT_ALIGNED(605.0f), MENU_Y(330.0f), CRGBA(49, 101, 148, FadeIn(130))); MENU_X_LEFT_ALIGNED(605.0f), MENU_Y(330.0f), CRGBA(LIST_BACKGROUND_COLOR.r, LIST_BACKGROUND_COLOR.g, LIST_BACKGROUND_COLOR.b, FadeIn(130)));
break; break;
/* /*
// TODO(Miami) // TODO(Miami)
@ -859,10 +855,10 @@ CMenuManager::DrawStandardMenus(bool drawCurrScreen)
PREPARE_MENU_HEADER PREPARE_MENU_HEADER
CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255))); CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255)));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X + 7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName)); CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255))); CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255)));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName)); CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
} }
// Label // Label
@ -1078,6 +1074,7 @@ CMenuManager::DrawStandardMenus(bool drawCurrScreen)
break; break;
case MENUACTION_HUD: case MENUACTION_HUD:
rightText = TheText.Get(m_PrefsShowHud ? "FEM_ON" : "FEM_OFF"); rightText = TheText.Get(m_PrefsShowHud ? "FEM_ON" : "FEM_OFF");
break;
#ifdef LEGACY_MENU_OPTIONS #ifdef LEGACY_MENU_OPTIONS
case MENUACTION_SETDBGFLAG: case MENUACTION_SETDBGFLAG:
rightText = TheText.Get(CTheScripts::IsDebugOn() ? "FEM_ON" : "FEM_OFF"); rightText = TheText.Get(CTheScripts::IsDebugOn() ? "FEM_ON" : "FEM_OFF");
@ -1181,16 +1178,20 @@ CMenuManager::DrawStandardMenus(bool drawCurrScreen)
if (drawCurrScreen && i == m_nCurrOption && itemsAreSelectable && section == 0) { if (drawCurrScreen && i == m_nCurrOption && itemsAreSelectable && section == 0) {
int leftXMax, rightXMin; int leftXMax, rightXMin;
CFont::SetScale(MENU_X(BIGTEXT_X_SCALE), MENU_Y(BIGTEXT_Y_SCALE));
// FIX: Let's don't scale those so GetStringWidth will give unscaled width, which will be handy to other calculations below that's done without scaling in mind.
// CFont::SetScale(MENU_X(BIGTEXT_X_SCALE), MENU_Y(BIGTEXT_Y_SCALE));
CFont::SetScale(BIGTEXT_X_SCALE, BIGTEXT_Y_SCALE);
wchar *curOptionName = TheText.Get(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName); wchar *curOptionName = TheText.Get(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName);
float curOptionWidth = CFont::GetStringWidth(curOptionName, true); float curOptionWidth = CFont::GetStringWidth(curOptionName, true);
if (CFont::Details.centre) { if (CFont::Details.centre) {
leftXMax = Max(0, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_X - curOptionWidth / 2.f); leftXMax = Max(0, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_X - curOptionWidth / 2.f);
rightXMin = Min(SCREEN_WIDTH, curOptionWidth / 2.f + aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_X); rightXMin = Min(DEFAULT_SCREEN_WIDTH, curOptionWidth / 2.f + aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_X);
} else if (!CFont::Details.rightJustify) { } else if (!CFont::Details.rightJustify) {
leftXMax = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_X; leftXMax = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_X;
rightXMin = Min(SCREEN_WIDTH, curOptionWidth + aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_X); rightXMin = Min(DEFAULT_SCREEN_WIDTH, curOptionWidth + aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_X);
} else { } else {
leftXMax = Max(0, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_X - curOptionWidth); leftXMax = Max(0, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_X - curOptionWidth);
rightXMin = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_X; rightXMin = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_X;
@ -1850,25 +1851,25 @@ CMenuManager::DrawControllerSetupScreen()
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN)); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN));
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENU_UNK_WIDTH)); CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENU_UNK_WIDTH));
PREPARE_MENU_HEADER
switch (m_ControlMethod) { switch (m_ControlMethod) {
case CONTROL_STANDARD: case CONTROL_STANDARD:
PREPARE_MENU_HEADER
CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255))); CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255)));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X + 7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f),
TheText.Get(aScreens[m_nCurrScreen].m_ScreenName)); TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
PREPARE_MENU_HEADER CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255)));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y),
TheText.Get(aScreens[m_nCurrScreen].m_ScreenName)); TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
break; break;
case CONTROL_CLASSIC: case CONTROL_CLASSIC:
PREPARE_MENU_HEADER
CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255))); CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255)));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X + 7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f),
TheText.Get("FET_CTI")); TheText.Get("FET_CTI"));
PREPARE_MENU_HEADER CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255)));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y),
TheText.Get("FET_CTI")); TheText.Get("FET_CTI"));
break; break;
default: default:
@ -2485,9 +2486,9 @@ CMenuManager::DrawBackground(bool transitionCall)
if (m_nCurrScreen != MENUPAGE_OUTRO) if (m_nCurrScreen != MENUPAGE_OUTRO)
if (m_menuTransitionProgress == 255) { if (m_menuTransitionProgress == 255) {
m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(MENU_X(27.0f), MENU_Y(8.0f), MENU_X(157.0f), MENU_Y(138.0f)), CRGBA(255, 255, 255, 255)); m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(SCREEN_STRETCH_X(27.0f), MENU_Y(8.0f), SCREEN_STRETCH_X(27.0f) + MENU_X(130.f), MENU_Y(138.0f)), CRGBA(255, 255, 255, 255));
} else { } else {
m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(MENU_X(27.0f), MENU_Y(8.0f), MENU_X(157.0f), MENU_Y(138.0f)), CRGBA(255, 255, 255, FadeIn(255))); m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(SCREEN_STRETCH_X(27.0f), MENU_Y(8.0f), SCREEN_STRETCH_X(27.0f) + MENU_X(130.f), MENU_Y(138.0f)), CRGBA(255, 255, 255, FadeIn(255)));
} }
if (m_ShowEmptyBindingError) { if (m_ShowEmptyBindingError) {
@ -2532,7 +2533,7 @@ CMenuManager::DrawPlayerSetupScreen()
PREPARE_MENU_HEADER PREPARE_MENU_HEADER
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get("FET_PS")); CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get("FET_PS"));
// lstrcpy's changed with strcpy // lstrcpy's changed with strcpy
@ -2935,7 +2936,7 @@ CMenuManager::FadeIn(int alpha)
} }
void void
CMenuManager::FilterOutColorMarkersFromString(wchar *str, CRGBA &newColor) CMenuManager::FilterOutColorMarkersFromString(wchar *str)
{ {
int newIdx = 0; int newIdx = 0;
wchar copy[256], *c; wchar copy[256], *c;
@ -2944,16 +2945,6 @@ CMenuManager::FilterOutColorMarkersFromString(wchar *str, CRGBA &newColor)
for (c = copy; *c != '\0'; c++) { for (c = copy; *c != '\0'; c++) {
if (*c == '~') { if (*c == '~') {
c++; c++;
switch (*c) {
case 'b': newColor = CRGBA(40, 40, 255, 255); break;
case 'g': newColor = CRGBA(40, 235, 40, 255); break;
// There is no case for "h", is that a mistake?
case 'l': newColor = CRGBA(0, 0, 0, 255); break;
case 'p': newColor = CRGBA(255, 0, 255, 255); break;
case 'r': newColor = CRGBA(255, 0, 0, 255); break;
case 'w': newColor = CRGBA(255, 255, 255, 255); break;
case 'y': newColor = CRGBA(255, 255, 0, 255); break;
}
while (*c != '~') c++; while (*c != '~') c++;
} else { } else {
str[newIdx++] = *c; str[newIdx++] = *c;
@ -3094,28 +3085,32 @@ CMenuManager::LoadAllTextures()
CTimer::Update(); CTimer::Update();
} }
// --MIAMI: Done
void void
CMenuManager::LoadSettings() CMenuManager::LoadSettings()
{ {
CFileMgr::SetDirMyDocuments(); CFileMgr::SetDirMyDocuments();
int fileHandle = CFileMgr::OpenFile("gta3.set", "r"); int fileHandle = CFileMgr::OpenFile("gta_vc.set", "r");
int32 prevLang = m_PrefsLanguage; int32 prevLang = m_PrefsLanguage;
#ifdef GTA3_1_1_PATCH
CMBlur::BlurOn = (_dwOperatingSystemVersion != OS_WIN98);
#else
CMBlur::BlurOn = true;
#endif
MousePointerStateHelper.bInvertVertically = true; MousePointerStateHelper.bInvertVertically = true;
CMBlur::BlurOn = false;
// 50 is silly // 50 is silly
char Ver[50]; char headerText[50];
int someVersion = 0;
bool fileIsValid = true;
if (fileHandle) { if (fileHandle) {
CFileMgr::Read(fileHandle, Ver, 29); CFileMgr::Read(fileHandle, headerText, 29);
if (strncmp(Ver, TopLineEmptyFile, sizeof(TopLineEmptyFile) - 1)) { if (strncmp(headerText, TopLineEmptyFile, sizeof(TopLineEmptyFile) - 1) == 0) {
fileIsValid = false;
} else {
CFileMgr::Seek(fileHandle, 0, 0); CFileMgr::Seek(fileHandle, 0, 0);
CFileMgr::Read(fileHandle, (char*)&someVersion, sizeof(someVersion));
}
if (fileIsValid && someVersion >= 3) {
ControlsManager.LoadSettings(fileHandle); ControlsManager.LoadSettings(fileHandle);
#ifdef IMPROVED_VIDEOMODE #ifdef IMPROVED_VIDEOMODE
CFileMgr::Read(fileHandle, (char*)&m_nPrefsWidth, sizeof(m_nPrefsWidth)); CFileMgr::Read(fileHandle, (char*)&m_nPrefsWidth, sizeof(m_nPrefsWidth));
@ -3139,41 +3134,52 @@ CMenuManager::LoadSettings()
CFileMgr::Read(fileHandle, gString, 20); CFileMgr::Read(fileHandle, gString, 20);
CFileMgr::Read(fileHandle, gString, 4); CFileMgr::Read(fileHandle, gString, 4);
CFileMgr::Read(fileHandle, gString, 4); CFileMgr::Read(fileHandle, gString, 4);
#ifdef FREE_CAM
CFileMgr::Read(fileHandle, (char*)&TheCamera.bFreeCam, 1);
#else
CFileMgr::Read(fileHandle, gString, 1);
#endif
#ifdef LEGACY_MENU_OPTIONS
CFileMgr::Read(fileHandle, (char*)&m_PrefsVsyncDisp, 1);
CFileMgr::Read(fileHandle, (char*)&CMBlur::BlurOn, 1);
#else
CFileMgr::Read(fileHandle, gString, 1); CFileMgr::Read(fileHandle, gString, 1);
CFileMgr::Read(fileHandle, gString, 1); CFileMgr::Read(fileHandle, gString, 1);
CFileMgr::Read(fileHandle, gString, 1); #endif
CFileMgr::Read(fileHandle, (char*)&TheCamera.m_bHeadBob, 1); CFileMgr::Read(fileHandle, (char*)&TheCamera.m_bHeadBob, 1);
CFileMgr::Read(fileHandle, (char*)&TheCamera.m_fMouseAccelHorzntl, 4); CFileMgr::Read(fileHandle, (char*)&TheCamera.m_fMouseAccelHorzntl, 4);
CFileMgr::Read(fileHandle, (char*)&TheCamera.m_fMouseAccelVertical, 4);
CFileMgr::Read(fileHandle, (char*)&MousePointerStateHelper.bInvertVertically, 1); CFileMgr::Read(fileHandle, (char*)&MousePointerStateHelper.bInvertVertically, 1);
CFileMgr::Read(fileHandle, (char*)&CVehicle::m_bDisableMouseSteering, 1); CFileMgr::Read(fileHandle, (char*)&CVehicle::m_bDisableMouseSteering, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsSfxVolume, 1); CFileMgr::Read(fileHandle, (char*)&m_PrefsSfxVolume, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsMusicVolume, 1); CFileMgr::Read(fileHandle, (char*)&m_PrefsMusicVolume, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsMP3BoostVolume, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsRadioStation, 1); CFileMgr::Read(fileHandle, (char*)&m_PrefsRadioStation, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsSpeakers, 1); CFileMgr::Read(fileHandle, (char*)&m_PrefsSpeakers, 1);
CFileMgr::Read(fileHandle, (char*)&m_nPrefsAudio3DProviderIndex, 1); CFileMgr::Read(fileHandle, (char*)&m_nPrefsAudio3DProviderIndex, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsDMA, 1); CFileMgr::Read(fileHandle, (char*)&m_PrefsDMA, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsBrightness, 1); CFileMgr::Read(fileHandle, (char*)&m_PrefsBrightness, 2);
CFileMgr::Read(fileHandle, (char*)&m_PrefsLOD, 4); CFileMgr::Read(fileHandle, (char*)&m_PrefsLOD, sizeof(m_PrefsLOD));
CFileMgr::Read(fileHandle, (char*)&m_PrefsShowSubtitles, 1); CFileMgr::Read(fileHandle, (char*)&m_PrefsShowSubtitles, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsUseWideScreen, 1); CFileMgr::Read(fileHandle, (char*)&m_PrefsUseWideScreen, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsVsyncDisp, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsFrameLimiter, 1); CFileMgr::Read(fileHandle, (char*)&m_PrefsFrameLimiter, 1);
CFileMgr::Read(fileHandle, (char*)&m_nDisplayVideoMode, 1); CFileMgr::Read(fileHandle, (char*)&m_nDisplayVideoMode, 1);
CFileMgr::Read(fileHandle, (char*)&CMBlur::BlurOn, 1);
CFileMgr::Read(fileHandle, m_PrefsSkinFile, 256); CFileMgr::Read(fileHandle, m_PrefsSkinFile, 256);
CFileMgr::Read(fileHandle, (char*)&m_ControlMethod, 1); CFileMgr::Read(fileHandle, (char*)&m_ControlMethod, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsLanguage, 1); CFileMgr::Read(fileHandle, (char*)&m_PrefsLanguage, 1);
#ifdef FREE_CAM CFileMgr::Read(fileHandle, (char*)&m_PrefsShowHud, 1);
CFileMgr::Read(fileHandle, (char*)&TheCamera.bFreeCam, 1); CFileMgr::Read(fileHandle, (char*)&m_PrefsRadarMode, 1);
#endif CFileMgr::Read(fileHandle, (char*)&m_PrefsShowLegends, 1);
} }
} }
CFileMgr::CloseFile(fileHandle); CFileMgr::CloseFile(fileHandle);
CFileMgr::SetDir(""); CFileMgr::SetDir("");
CCamera::m_bUseMouse3rdPerson = m_ControlMethod == CONTROL_STANDARD;
#ifdef LEGACY_MENU_OPTIONS
m_PrefsVsync = m_PrefsVsyncDisp; m_PrefsVsync = m_PrefsVsyncDisp;
#endif
CRenderer::ms_lodDistScale = m_PrefsLOD; CRenderer::ms_lodDistScale = m_PrefsLOD;
if (m_nPrefsAudio3DProviderIndex == INVALID_AUDIO_PROVIDER) if (m_nPrefsAudio3DProviderIndex == INVALID_AUDIO_PROVIDER)
@ -3212,15 +3218,18 @@ CMenuManager::LoadSettings()
} }
} }
// --MIAMI: Done
void void
CMenuManager::SaveSettings() CMenuManager::SaveSettings()
{ {
static char RubbishString[48] = "stuffmorestuffevenmorestuff etc"; static char RubbishString[48] = "stuffmorestuffevenmorestuff etc";
static int SomeVersion = 3;
CFileMgr::SetDirMyDocuments(); CFileMgr::SetDirMyDocuments();
int fileHandle = CFileMgr::OpenFile("gta3.set", "w+"); int fileHandle = CFileMgr::OpenFile("gta_vc.set", "w+");
if (fileHandle) { if (fileHandle) {
CFileMgr::Write(fileHandle, (char*)&SomeVersion, sizeof(SomeVersion));
ControlsManager.SaveSettings(fileHandle); ControlsManager.SaveSettings(fileHandle);
#ifdef IMPROVED_VIDEOMODE #ifdef IMPROVED_VIDEOMODE
CFileMgr::Write(fileHandle, (char*)&m_nPrefsWidth, sizeof(m_nPrefsWidth)); CFileMgr::Write(fileHandle, (char*)&m_nPrefsWidth, sizeof(m_nPrefsWidth));
@ -3234,34 +3243,42 @@ CMenuManager::SaveSettings()
CFileMgr::Write(fileHandle, RubbishString, 20); CFileMgr::Write(fileHandle, RubbishString, 20);
CFileMgr::Write(fileHandle, RubbishString, 4); CFileMgr::Write(fileHandle, RubbishString, 4);
CFileMgr::Write(fileHandle, RubbishString, 4); CFileMgr::Write(fileHandle, RubbishString, 4);
#ifdef FREE_CAM
CFileMgr::Write(fileHandle, (char*)&TheCamera.bFreeCam, 1);
#else
CFileMgr::Write(fileHandle, RubbishString, 1);
#endif
#ifdef LEGACY_MENU_OPTIONS
CFileMgr::Write(fileHandle, (char*)&m_PrefsVsyncDisp, 1);
CFileMgr::Write(fileHandle, (char*)&CMBlur::BlurOn, 1);
#else
CFileMgr::Write(fileHandle, RubbishString, 1); CFileMgr::Write(fileHandle, RubbishString, 1);
CFileMgr::Write(fileHandle, RubbishString, 1); CFileMgr::Write(fileHandle, RubbishString, 1);
CFileMgr::Write(fileHandle, RubbishString, 1); #endif
CFileMgr::Write(fileHandle, (char*)&TheCamera.m_bHeadBob, 1); CFileMgr::Write(fileHandle, (char*)&TheCamera.m_bHeadBob, 1);
CFileMgr::Write(fileHandle, (char*)&TheCamera.m_fMouseAccelHorzntl, 4); CFileMgr::Write(fileHandle, (char*)&TheCamera.m_fMouseAccelHorzntl, 4);
CFileMgr::Write(fileHandle, (char*)&TheCamera.m_fMouseAccelVertical, 4);
CFileMgr::Write(fileHandle, (char*)&MousePointerStateHelper.bInvertVertically, 1); CFileMgr::Write(fileHandle, (char*)&MousePointerStateHelper.bInvertVertically, 1);
CFileMgr::Write(fileHandle, (char*)&CVehicle::m_bDisableMouseSteering, 1); CFileMgr::Write(fileHandle, (char*)&CVehicle::m_bDisableMouseSteering, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsSfxVolume, 1); CFileMgr::Write(fileHandle, (char*)&m_PrefsSfxVolume, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsMusicVolume, 1); CFileMgr::Write(fileHandle, (char*)&m_PrefsMusicVolume, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsMP3BoostVolume, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsRadioStation, 1); CFileMgr::Write(fileHandle, (char*)&m_PrefsRadioStation, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsSpeakers, 1); CFileMgr::Write(fileHandle, (char*)&m_PrefsSpeakers, 1);
CFileMgr::Write(fileHandle, (char*)&m_nPrefsAudio3DProviderIndex, 1); CFileMgr::Write(fileHandle, (char*)&m_nPrefsAudio3DProviderIndex, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsDMA, 1); CFileMgr::Write(fileHandle, (char*)&m_PrefsDMA, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsBrightness, 1); CFileMgr::Write(fileHandle, (char*)&m_PrefsBrightness, 2);
CFileMgr::Write(fileHandle, (char*)&m_PrefsLOD, sizeof(m_PrefsLOD)); CFileMgr::Write(fileHandle, (char*)&m_PrefsLOD, sizeof(m_PrefsLOD));
CFileMgr::Write(fileHandle, (char*)&m_PrefsShowSubtitles, 1); CFileMgr::Write(fileHandle, (char*)&m_PrefsShowSubtitles, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsUseWideScreen, 1); CFileMgr::Write(fileHandle, (char*)&m_PrefsUseWideScreen, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsVsyncDisp, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsFrameLimiter, 1); CFileMgr::Write(fileHandle, (char*)&m_PrefsFrameLimiter, 1);
CFileMgr::Write(fileHandle, (char*)&m_nPrefsVideoMode, 1); CFileMgr::Write(fileHandle, (char*)&m_nPrefsVideoMode, 1);
CFileMgr::Write(fileHandle, (char*)&CMBlur::BlurOn, 1);
CFileMgr::Write(fileHandle, m_PrefsSkinFile, 256); CFileMgr::Write(fileHandle, m_PrefsSkinFile, 256);
CFileMgr::Write(fileHandle, (char*)&m_ControlMethod, 1); CFileMgr::Write(fileHandle, (char*)&m_ControlMethod, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsLanguage, 1); CFileMgr::Write(fileHandle, (char*)&m_PrefsLanguage, 1);
#ifdef FREE_CAM CFileMgr::Write(fileHandle, (char*)&m_PrefsShowHud, 1);
CFileMgr::Write(fileHandle, (char*)&TheCamera.bFreeCam, 1); CFileMgr::Write(fileHandle, (char*)&m_PrefsRadarMode, 1);
#endif CFileMgr::Write(fileHandle, (char*)&m_PrefsShowLegends, 1);
} }
m_lastWorking3DAudioProvider = m_nPrefsAudio3DProviderIndex; m_lastWorking3DAudioProvider = m_nPrefsAudio3DProviderIndex;
@ -3318,17 +3335,22 @@ CMenuManager::SmallMessageScreen(const char* text)
CFont::PrintString(SCREEN_WIDTH / 2.f, y, TheText.Get(text)); CFont::PrintString(SCREEN_WIDTH / 2.f, y, TheText.Get(text));
} }
// --MIAMI: Done, but FilterOutColorMarkersFromString is actually in CFont
void void
CMenuManager::PrintBriefs() CMenuManager::PrintBriefs()
{ {
CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255))); CFont::SetColor(CRGBA(0, 0, 0, FadeIn(255)));
CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
CFont::SetRightJustifyOff(); CFont::SetRightJustifyOff();
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X * 0.7), MENU_Y(MENU_TEXT_SIZE_Y * 0.9)); // second mulipliers are double, idk why CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
CFont::SetScale(MENU_X(MEDIUMTEXT_X_SCALE), MENU_Y(MEDIUMTEXT_Y_SCALE));
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(80.0f));
CFont::SetDropShadowPosition(0);
float nextY = BRIEFS_TOP_MARGIN; float nextY = BRIEFS_BOTTOM_MARGIN;
CRGBA newColor;
for (int i = 4; i >= 0; i--) { for (int i = 4; i >= 0; i--) {
if (nextY < BRIEFS_TOP_MARGIN)
break;
tPreviousBrief &brief = CMessages::PreviousBriefs[i]; tPreviousBrief &brief = CMessages::PreviousBriefs[i];
if (brief.m_pText) { if (brief.m_pText) {
CMessages::InsertNumberInString(brief.m_pText, CMessages::InsertNumberInString(brief.m_pText,
@ -3337,127 +3359,125 @@ CMenuManager::PrintBriefs()
brief.m_nNumber[4], brief.m_nNumber[5], gUString); brief.m_nNumber[4], brief.m_nNumber[5], gUString);
CMessages::InsertStringInString(gUString, brief.m_pString); CMessages::InsertStringInString(gUString, brief.m_pString);
CMessages::InsertPlayerControlKeysInString(gUString); CMessages::InsertPlayerControlKeysInString(gUString);
newColor = TEXT_COLOR; FilterOutColorMarkersFromString(gUString);
FilterOutColorMarkersFromString(gUString, newColor);
#ifdef PS2_LIKE_MENU nextY -= CFont::GetNumberLines(MENU_X_LEFT_ALIGNED(BRIEFS_LINE_X), nextY, gUString) * BRIEFS_LINE_HEIGHT + BRIEFS_LINE_SPACING;
// This PS2 code was always here, but unused CFont::PrintString(MENU_X_LEFT_ALIGNED(BRIEFS_LINE_X), MENU_Y(nextY), gUString);
bool rgSame = newColor.r == TEXT_COLOR.r && newColor.g == TEXT_COLOR.g;
bool bSame = rgSame && newColor.b == TEXT_COLOR.b;
bool colorNotChanged = bSame; /* && newColor.a == TEXT_COLOR.a; */
if (!colorNotChanged) {
newColor.r /= 2;
newColor.g /= 2;
newColor.b /= 2;
} }
CFont::SetDropColor(CRGBA(0, 0, 0, FadeIn(255))); // But this is from PS2
CFont::SetDropShadowPosition(1);
#endif
#if defined(FIX_BUGS) || defined(PS2_LIKE_MENU)
newColor.a = FadeIn(255);
CFont::SetColor(newColor);
#endif
CFont::PrintString(MENU_X_LEFT_ALIGNED(BRIEFS_LINE_X), nextY, gUString);
nextY += MENU_Y(BRIEFS_LINE_HEIGHT);
} }
} }
#ifdef PS2_LIKE_MENU // --MIAMI: Done
CFont::SetDropShadowPosition(0);
#endif
}
void void
CMenuManager::PrintStats() CMenuManager::PrintStats()
{ {
int rowNum = ConstructStatLine(99999); static uint8 pirateCheck = 0;
#ifdef GTA3_1_1_PATCH
CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
#endif
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X * 0.7), MENU_Y(MENU_TEXT_SIZE_Y * 0.9)); // second mulipliers are double, idk why
float nextYChange, y, alphaMult;
// Scroll stats with mouse
#ifdef SCROLLABLE_STATS_PAGE
static float scrollY = 0; static float scrollY = 0;
static PauseModeTime lastChange = m_LastScreenSwitch;
if (CPad::GetPad(0)->GetLeftMouse()) {
scrollY += (m_nMouseOldPosY - m_nMousePosY);
lastChange = CTimer::GetTimeInMillisecondsPauseMode();
} else {
scrollY += MENU_Y(STATS_SLIDE_Y_PER_SECOND) / 1000.0f * (CTimer::GetTimeInMillisecondsPauseMode() - lastChange);
lastChange = CTimer::GetTimeInMillisecondsPauseMode();
}
#else
// MENU_Y(30.0f) per second
float scrollY = MENU_Y(STATS_SLIDE_Y_PER_SECOND) * (CTimer::GetTimeInMillisecondsPauseMode() - m_LastScreenSwitch) / 1000.0f;
#endif
for (int row = 0; row < rowNum; ++row) { int rowNum = ConstructStatLine(99999);
// Put just got hidden text at the top back to the bottom, in circular fashion CSprite2d::Draw2DPolygon(MENU_X_LEFT_ALIGNED(90.0f), MENU_Y(142.0f),
for (y = MENU_Y(STATS_ROW_HEIGHT - 1) * row + SCREEN_HEIGHT - scrollY; MENU_Y(STATS_PUT_BACK_TO_BOTTOM_Y) > y; y += nextYChange) { MENU_X_LEFT_ALIGNED(543.0f), MENU_Y(142.f),
nextYChange = (MENU_Y(STATS_ROW_HEIGHT) + rowNum) * MENU_Y(STATS_ROW_HEIGHT - 1); MENU_X_LEFT_ALIGNED(107.0f), MENU_Y(316.f),
MENU_X_LEFT_ALIGNED(531.f), MENU_Y(299.f), CRGBA(LIST_BACKGROUND_COLOR.r, LIST_BACKGROUND_COLOR.g, LIST_BACKGROUND_COLOR.b, FadeIn(130)));
CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
CFont::SetPropOn();
CFont::SetDropShadowPosition(0);
if (pirateCheck == 0)
// if not pirated game
pirateCheck = 46;
// else
// pirateCheck = 45;
if (m_PrefsLanguage == LANGUAGE_AMERICAN)
CFont::SetScale(MENU_X(0.43f), MENU_Y(0.75f));
else
CFont::SetScale(MENU_X(0.37f), MENU_Y(0.75f));
static PauseModeTime lastCheck = 0;
if (CTimer::GetTimeInMillisecondsPauseMode() - lastCheck > 40) {
if (m_StatsScrollSpeed > 0.f) {
if (m_StatsScrollDirection == 0)
scrollY -= MENU_Y(100.f) / m_StatsScrollSpeed;
else
scrollY += MENU_Y(100.f) / m_StatsScrollSpeed;
} }
lastCheck = CTimer::GetTimeInMillisecondsPauseMode();
}
if (pirateCheck == 45)
return;
float nextYChange, y, alpha;
float totalHeight = (rowNum + 7) * STATS_ROW_HEIGHT;
for (int row = 0; row < rowNum; ++row) {
// Put faded away text at the top back to the bottom, in circular fashion
for (y = MENU_Y(STATS_ROW_HEIGHT) * row + MENU_Y(100.f) - scrollY; MENU_Y(STATS_FADING_AREA_LENGTH) > y; y += nextYChange) {
nextYChange = MENU_Y(totalHeight);
}
// Put faded away text at the bottom back to the top
while (SCREEN_SCALE_FROM_BOTTOM(STATS_FADING_AREA_LENGTH) < y) {
y -= MENU_Y(totalHeight);
}
alpha = 0.f;
// If it's still on screen // If it's still on screen
if (y > 0.0f && SCREEN_HEIGHT > y) { if (y > MENU_Y(STATS_VISIBLE_START_Y) && y < MENU_Y(STATS_VISIBLE_END_Y)) {
ConstructStatLine(row); ConstructStatLine(row);
// But about to dim from top // But about to dim from bottom
if (y - MENU_Y(STATS_BOTTOM_MARGIN) < MENU_Y(STATS_TOP_DIMMING_AREA_LENGTH)) { if (y < MENU_Y(STATS_BOTTOM_Y)) {
if ((y - MENU_Y(STATS_BOTTOM_MARGIN)) / MENU_Y(STATS_TOP_DIMMING_AREA_LENGTH) < 0.0f) if (y > MENU_Y(STATS_BOTTOM_Y - STATS_FADING_AREA_LENGTH))
alphaMult = 0.0f; alpha = (MENU_Y(STATS_BOTTOM_Y) - y) * 5.f;
else }
alphaMult = (y - MENU_Y(STATS_BOTTOM_MARGIN)) / MENU_Y(STATS_TOP_DIMMING_AREA_LENGTH);
// About to dim from bottom // About to dim from top
} else if (y > SCREEN_SCALE_FROM_BOTTOM(STATS_TOP_DIMMING_AREA_LENGTH) - MENU_Y(STATS_BOTTOM_DIMMING_AREA_LENGTH)) { if (y > MENU_Y(STATS_TOP_Y)) {
if ((SCREEN_SCALE_FROM_BOTTOM(STATS_BOTTOM_DIMMING_AREA_LENGTH) - y) / MENU_Y(STATS_TOP_DIMMING_AREA_LENGTH) < 0.0f) if (y < MENU_Y(STATS_TOP_Y + STATS_FADING_AREA_LENGTH))
alphaMult = 0.0f; alpha = (y - MENU_Y(STATS_TOP_Y)) * 5.f;
else }
alphaMult = (SCREEN_SCALE_FROM_BOTTOM(STATS_BOTTOM_DIMMING_AREA_LENGTH) - y) / MENU_Y(STATS_TOP_DIMMING_AREA_LENGTH);
} else
alphaMult = 1.0f;
CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255.0f * alphaMult))); // Content
if (y >= MENU_Y(STATS_TOP_Y + STATS_FADING_AREA_LENGTH) && y <= MENU_Y(STATS_BOTTOM_Y - STATS_FADING_AREA_LENGTH))
alpha = 255.0f;
CFont::SetColor(CRGBA(0, 0, 0, FadeIn(Min(255.f, alpha))));
CFont::SetRightJustifyOff(); CFont::SetRightJustifyOff();
CFont::PrintString(MENU_X_LEFT_ALIGNED(STATS_ROW_X_MARGIN), y - MENU_Y(STATS_BOTTOM_MARGIN - STATS_TOP_MARGIN), gUString); CFont::PrintString(MENU_X_LEFT_ALIGNED(STATS_ROW_LEFT_MARGIN), y, gUString);
CFont::SetRightJustifyOn(); CFont::SetRightJustifyOn();
CFont::PrintString(MENU_X_RIGHT_ALIGNED(STATS_ROW_X_MARGIN), y - MENU_Y(STATS_BOTTOM_MARGIN - STATS_TOP_MARGIN), gUString2); CFont::PrintString(MENU_X_RIGHT_ALIGNED(STATS_ROW_RIGHT_MARGIN), y, gUString2);
} }
} }
// Game doesn't do that, but it's better CFont::SetColor(CRGBA(MENUOPTION_COLOR.r, MENUOPTION_COLOR.g, MENUOPTION_COLOR.b, FadeIn(255)));
float nextX = MENU_X_LEFT_ALIGNED(STATS_RATING_X); CFont::SetDropShadowPosition(2);
CFont::SetDropColor(CRGBA(0, 0, 0, FadeIn(255)));
CFont::SetCentreOn();
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
CFont::SetScale(MENU_X(0.65f), MENU_Y(1.05f));
CFont::PrintString(MENU_X_LEFT_ALIGNED(STATS_RATING_X), MENU_Y(STATS_RATING_Y_1), TheText.Get("CRIMRA"));
CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255))); CFont::SetCentreOff();
CFont::SetRightJustifyOff(); CFont::SetRightJustifyOff();
CFont::PrintString(nextX, MENU_Y(STATS_RATING_Y), TheText.Get("CRIMRA"));
#ifdef MORE_LANGUAGES
if (CFont::IsJapanese())
nextX += MENU_X(10.0f) + CFont::GetStringWidth_Jap(TheText.Get("CRIMRA"));
else
#endif
nextX += MENU_X(10.0f) + CFont::GetStringWidth(TheText.Get("CRIMRA"), true);
UnicodeStrcpy(gUString, CStats::FindCriminalRatingString());
CFont::PrintString(nextX, MENU_Y(STATS_RATING_Y), gUString);
#ifdef MORE_LANGUAGES
if (CFont::IsJapanese())
nextX += MENU_X(6.0f) + CFont::GetStringWidth_Jap(gUString);
else
#endif
nextX += MENU_X(6.0f) + CFont::GetStringWidth(gUString, true);
sprintf(gString, "%d", CStats::FindCriminalRatingNumber());
AsciiToUnicode(gString, gUString);
CFont::PrintString(nextX, MENU_Y(STATS_RATING_Y), gUString);
// ::Draw already does that. // FIX: Game does that in a weird way, alignment and spacing is now ok
/*
PREPARE_MENU_HEADER sprintf(gString, "(%d)", CStats::FindCriminalRatingNumber());
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName)); AsciiToUnicode(gString, gUString);
*/
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X), MENU_Y(MENU_TEXT_SIZE_Y)); UnicodeStrcpy(gUString2, CStats::FindCriminalRatingString());
UnicodeStrcat(gUString2, gUString);
CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD));
CFont::SetScale(MENU_X(0.5f), MENU_Y(0.9f));
CFont::SetColor(CRGBA(0, 0, 0, FadeIn(255)));
CFont::SetDropShadowPosition(0);
CFont::PrintString(MENU_X_LEFT_ALIGNED(STATS_RATING_X) - CFont::GetStringWidth(gUString2, true) / 2.f, MENU_Y(STATS_RATING_Y_2), gUString2);
} }
// --MIAMI: Done // --MIAMI: Done
@ -4083,13 +4103,11 @@ CMenuManager::ProcessButtonPresses(void)
case HOVEROPTION_INCREASE_MOUSESENS: case HOVEROPTION_INCREASE_MOUSESENS:
TheCamera.m_fMouseAccelHorzntl += (1.0f / 3000); TheCamera.m_fMouseAccelHorzntl += (1.0f / 3000);
TheCamera.m_fMouseAccelHorzntl = clamp(TheCamera.m_fMouseAccelHorzntl, 1.0f / 3200, 1.0f / 200); TheCamera.m_fMouseAccelHorzntl = clamp(TheCamera.m_fMouseAccelHorzntl, 1.0f / 3200, 1.0f / 200);
TheCamera.m_fMouseAccelVertical = TheCamera.m_fMouseAccelHorzntl;
SaveSettings(); SaveSettings();
break; break;
case HOVEROPTION_DECREASE_MOUSESENS: case HOVEROPTION_DECREASE_MOUSESENS:
TheCamera.m_fMouseAccelHorzntl -= (1.0f / 3000); TheCamera.m_fMouseAccelHorzntl -= (1.0f / 3000);
TheCamera.m_fMouseAccelHorzntl = clamp(TheCamera.m_fMouseAccelHorzntl, 1.0f / 3200, 1.0f / 200); TheCamera.m_fMouseAccelHorzntl = clamp(TheCamera.m_fMouseAccelHorzntl, 1.0f / 3200, 1.0f / 200);
TheCamera.m_fMouseAccelVertical = TheCamera.m_fMouseAccelHorzntl;
SaveSettings(); SaveSettings();
break; break;
} }
@ -4416,9 +4434,11 @@ CMenuManager::ProcessButtonPresses(void)
SwitchToNewScreen(MENUPAGE_OUTRO); SwitchToNewScreen(MENUPAGE_OUTRO);
break; break;
case MENUACTION_RESUME: case MENUACTION_RESUME:
#ifdef LEGACY_MENU_OPTIONS
if (m_PrefsVsyncDisp != m_PrefsVsync) { if (m_PrefsVsyncDisp != m_PrefsVsync) {
m_PrefsVsync = m_PrefsVsyncDisp; m_PrefsVsync = m_PrefsVsyncDisp;
} }
#endif
RequestFrontEndShutDown(); RequestFrontEndShutDown();
break; break;
case MENUACTION_DONTCANCEL: case MENUACTION_DONTCANCEL:
@ -4480,42 +4500,41 @@ CMenuManager::ProcessButtonPresses(void)
break; break;
case MENUACTION_RESTOREDEF: case MENUACTION_RESTOREDEF:
if (m_nCurrScreen == MENUPAGE_SOUND_SETTINGS) { if (m_nCurrScreen == MENUPAGE_SOUND_SETTINGS) {
m_PrefsSfxVolume = 102; m_nPrefsAudio3DProviderIndex = DMAudio.AutoDetect3DProviders();
DMAudio.SetCurrent3DProvider(m_nPrefsAudio3DProviderIndex);
m_PrefsSfxVolume = 49;
m_PrefsMusicVolume = 49;
m_PrefsRadioStation = EMOTION;
m_PrefsMP3BoostVolume = 0;
m_PrefsStereoMono = 1;
m_PrefsSpeakers = 0; m_PrefsSpeakers = 0;
m_PrefsMusicVolume = 102; // DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume); // TODO(Miami)
m_PrefsStereoMono = 0; DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume);
m_PrefsRadioStation = WILDSTYLE;
DMAudio.SetMusicMasterVolume(102);
DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume); DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
SaveSettings(); SaveSettings();
} else if (m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) { } else if (m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) {
m_PrefsFrameLimiter = true;
m_PrefsBrightness = 256; m_PrefsBrightness = 256;
m_PrefsVsyncDisp = true;
m_PrefsLOD = 1.2f; m_PrefsLOD = 1.2f;
#ifdef LEGACY_MENU_OPTIONS
m_PrefsVsync = true; m_PrefsVsync = true;
CRenderer::ms_lodDistScale = 1.2f;
m_PrefsUseWideScreen = false;
m_PrefsShowSubtitles = true;
m_nDisplayVideoMode = m_nPrefsVideoMode;
#ifdef GTA3_1_1_PATCH
if (_dwOperatingSystemVersion == OS_WIN98) {
CMBlur::BlurOn = false;
CMBlur::MotionBlurClose();
}
else {
CMBlur::BlurOn = true;
CMBlur::MotionBlurOpen(Scene.camera);
}
#else
CMBlur::BlurOn = true;
#endif #endif
CRenderer::ms_lodDistScale = m_PrefsLOD;
m_PrefsShowSubtitles = false;
m_PrefsUseWideScreen = false;
m_PrefsShowLegends = true;
m_PrefsVsyncDisp = true;
m_PrefsFrameLimiter = true;
m_PrefsRadarMode = 0;
m_PrefsShowHud = true;
m_nDisplayVideoMode = m_nPrefsVideoMode;
CMBlur::BlurOn = false;
SaveSettings(); SaveSettings();
} else if (m_nCurrScreen == MENUPAGE_CONTROLLER_PC) { } else if (m_nCurrScreen == MENUPAGE_CONTROLLER_PC) {
ControlsManager.MakeControllerActionsBlank(); ControlsManager.MakeControllerActionsBlank();
ControlsManager.InitDefaultControlConfiguration(); ControlsManager.InitDefaultControlConfiguration();
MousePointerStateHelper.GetMouseSetUp();
ControlsManager.InitDefaultControlConfigMouse(MousePointerStateHelper.GetMouseSetUp()); ControlsManager.InitDefaultControlConfigMouse(MousePointerStateHelper.GetMouseSetUp());
#if !defined RW_GL3 #if !defined RW_GL3
if (AllValidWinJoys.m_aJoys[JOYSTICK1].m_bInitialised) { if (AllValidWinJoys.m_aJoys[JOYSTICK1].m_bInitialised) {
@ -4531,11 +4550,12 @@ CMenuManager::ProcessButtonPresses(void)
ControlsManager.InitDefaultControlConfigJoyPad(count); ControlsManager.InitDefaultControlConfigJoyPad(count);
} }
#endif #endif
m_ControlMethod = CONTROL_STANDARD; MousePointerStateHelper.bInvertVertically = true;
MousePointerStateHelper.bInvertVertically = false; TheCamera.m_bHeadBob = false;
TheCamera.m_fMouseAccelHorzntl = 0.0025f; TheCamera.m_fMouseAccelHorzntl = 0.0025f;
CVehicle::m_bDisableMouseSteering = true; CVehicle::m_bDisableMouseSteering = true;
TheCamera.m_bHeadBob = false; m_ControlMethod = CONTROL_STANDARD;
TheCamera.m_bUseMouse3rdPerson = true;
SaveSettings(); SaveSettings();
} }
SetHelperText(2); SetHelperText(2);
@ -4583,9 +4603,11 @@ CMenuManager::ProcessButtonPresses(void)
if (m_nCurrScreen == MENUPAGE_PAUSE_MENU) { if (m_nCurrScreen == MENUPAGE_PAUSE_MENU) {
#endif #endif
if (!m_bGameNotLoaded) { if (!m_bGameNotLoaded) {
#ifdef LEGACY_MENU_OPTIONS
if (m_PrefsVsyncDisp != m_PrefsVsync) { if (m_PrefsVsyncDisp != m_PrefsVsync) {
m_PrefsVsync = m_PrefsVsyncDisp; m_PrefsVsync = m_PrefsVsyncDisp;
} }
#endif
RequestFrontEndShutDown(); RequestFrontEndShutDown();
} }

View file

@ -66,20 +66,23 @@
#define PLAYERSETUP_LIST_BODY_TOP 47 #define PLAYERSETUP_LIST_BODY_TOP 47
#define PLAYERSETUP_ROW_HEIGHT 9 #define PLAYERSETUP_ROW_HEIGHT 9
#define STATS_SLIDE_Y_PER_SECOND 30.0f #define STATS_ROW_HEIGHT 17.0f
#define STATS_ROW_HEIGHT 20.0f #define STATS_ROW_LEFT_MARGIN 110.0f
#define STATS_ROW_X_MARGIN 50.0f #define STATS_ROW_RIGHT_MARGIN 113.0f
#define STATS_BOTTOM_MARGIN 135.0f #define STATS_TOP_Y 135.0f // Just faded in
#define STATS_TOP_MARGIN 40.0f #define STATS_BOTTOM_Y 300.0f // Starts to fade out after that
#define STATS_TOP_DIMMING_AREA_LENGTH (93.0f - STATS_TOP_MARGIN) #define STATS_FADING_AREA_LENGTH 50.0f
#define STATS_BOTTOM_DIMMING_AREA_LENGTH 55.0f #define STATS_VISIBLE_START_Y (STATS_TOP_Y - 10.f)
#define STATS_PUT_BACK_TO_BOTTOM_Y 50.0f #define STATS_VISIBLE_END_Y (STATS_BOTTOM_Y + 21.f)
#define STATS_RATING_X 24.0f #define STATS_RATING_X 320.0f
#define STATS_RATING_Y 20.0f #define STATS_RATING_Y_1 85.0f
#define STATS_RATING_Y_2 110.0f
#define BRIEFS_TOP_MARGIN 40.0f #define BRIEFS_TOP_MARGIN 140.0f
#define BRIEFS_LINE_X 50.0f #define BRIEFS_BOTTOM_MARGIN 280.0f
#define BRIEFS_LINE_HEIGHT 60.0f #define BRIEFS_LINE_X 100.0f
#define BRIEFS_LINE_HEIGHT 20.0f
#define BRIEFS_LINE_SPACING 10.0f
#define CONTSETUP_STANDARD_ROW_HEIGHT 10.7f #define CONTSETUP_STANDARD_ROW_HEIGHT 10.7f
#define CONTSETUP_CLASSIC_ROW_HEIGHT 9.0f #define CONTSETUP_CLASSIC_ROW_HEIGHT 9.0f
@ -477,10 +480,10 @@ public:
int8 m_nPrefsAudio3DProviderIndex; int8 m_nPrefsAudio3DProviderIndex;
int8 m_PrefsSpeakers; int8 m_PrefsSpeakers;
int8 m_PrefsDMA; int8 m_PrefsDMA;
uint8 m_PrefsSfxVolume; int8 m_PrefsSfxVolume;
uint8 m_PrefsMusicVolume; int8 m_PrefsMusicVolume;
uint8 m_PrefsRadioStation; uint8 m_PrefsRadioStation;
uint8 field_2C; uint8 m_PrefsStereoMono; // unused except restore settings
int32 m_nCurrOption; int32 m_nCurrOption;
bool m_bQuitGameNoCD; bool m_bQuitGameNoCD;
bool m_bMenuMapActive; bool m_bMenuMapActive;
@ -595,8 +598,6 @@ public:
}; };
bool GetIsMenuActive() {return !!m_bMenuActive;} bool GetIsMenuActive() {return !!m_bMenuActive;}
static uint8 m_PrefsStereoMono;
#ifndef MASTER #ifndef MASTER
static bool m_PrefsMarketing; static bool m_PrefsMarketing;
static bool m_PrefsDisableTutorials; static bool m_PrefsDisableTutorials;
@ -625,7 +626,7 @@ public:
void DrawBackground(bool transitionCall); void DrawBackground(bool transitionCall);
void DrawPlayerSetupScreen(); void DrawPlayerSetupScreen();
int FadeIn(int alpha); int FadeIn(int alpha);
void FilterOutColorMarkersFromString(wchar*, CRGBA &); void FilterOutColorMarkersFromString(wchar*);
int GetStartOptionsCntrlConfigScreens(); int GetStartOptionsCntrlConfigScreens();
void InitialiseChangedLanguageSettings(); void InitialiseChangedLanguageSettings();
void LoadAllTextures(); void LoadAllTextures();

View file

@ -243,7 +243,6 @@ enum Config {
#else #else
//# define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc. //# define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc.
# define MAP_ENHANCEMENTS // Adding waypoint etc. # define MAP_ENHANCEMENTS // Adding waypoint etc.
# define SCROLLABLE_STATS_PAGE // only draggable by mouse atm
# define TRIANGLE_BACK_BUTTON # define TRIANGLE_BACK_BUTTON
//# define CIRCLE_BACK_BUTTON //# define CIRCLE_BACK_BUTTON
//#define CUSTOM_FRONTEND_OPTIONS //#define CUSTOM_FRONTEND_OPTIONS

View file

@ -178,7 +178,11 @@ psCameraBeginUpdate(RwCamera *camera)
void void
psCameraShowRaster(RwCamera *camera) psCameraShowRaster(RwCamera *camera)
{ {
if (FrontEndMenuManager.m_PrefsVsync) #ifdef LEGACY_MENU_OPTIONS
if (FrontEndMenuManager.m_PrefsVsync || FrontEndMenuManager.m_bMenuActive)
#else
if (FrontEndMenuManager.m_PrefsFrameLimiter || FrontEndMenuManager.m_bMenuActive)
#endif
RwCameraShowRaster(camera, PSGLOBAL(window), rwRASTERFLIPWAITVSYNC); RwCameraShowRaster(camera, PSGLOBAL(window), rwRASTERFLIPWAITVSYNC);
else else
RwCameraShowRaster(camera, PSGLOBAL(window), rwRASTERFLIPDONTWAIT); RwCameraShowRaster(camera, PSGLOBAL(window), rwRASTERFLIPDONTWAIT);
@ -1488,7 +1492,7 @@ main(int argc, char *argv[])
{ {
CFileMgr::SetDirMyDocuments(); CFileMgr::SetDirMyDocuments();
int32 gta3set = CFileMgr::OpenFile("gta3.set", "r"); int32 gta3set = CFileMgr::OpenFile("gta_vc.set", "r");
if ( gta3set ) if ( gta3set )
{ {

View file

@ -223,7 +223,11 @@ psCameraBeginUpdate(RwCamera *camera)
void void
psCameraShowRaster(RwCamera *camera) psCameraShowRaster(RwCamera *camera)
{ {
if (FrontEndMenuManager.m_PrefsVsync) #ifdef LEGACY_MENU_OPTIONS
if (FrontEndMenuManager.m_PrefsVsync || FrontEndMenuManager.m_bMenuActive)
#else
if (FrontEndMenuManager.m_PrefsFrameLimiter || FrontEndMenuManager.m_bMenuActive)
#endif
RwCameraShowRaster(camera, PSGLOBAL(window), rwRASTERFLIPWAITVSYNC); RwCameraShowRaster(camera, PSGLOBAL(window), rwRASTERFLIPWAITVSYNC);
else else
RwCameraShowRaster(camera, PSGLOBAL(window), rwRASTERFLIPDONTWAIT); RwCameraShowRaster(camera, PSGLOBAL(window), rwRASTERFLIPDONTWAIT);
@ -2073,7 +2077,7 @@ WinMain(HINSTANCE instance,
{ {
CFileMgr::SetDirMyDocuments(); CFileMgr::SetDirMyDocuments();
int32 gta3set = CFileMgr::OpenFile("gta3.set", "r"); int32 gta3set = CFileMgr::OpenFile("gta_vc.set", "r");
if ( gta3set ) if ( gta3set )
{ {