From 475e610e7ee6ea41054109ee1f59709a80f38597 Mon Sep 17 00:00:00 2001 From: SoapyMan Date: Fri, 21 Apr 2023 22:40:57 +0600 Subject: [PATCH] - support locale for Game graphics options menu --- data/DRIVER2/LANG/EN_GAME.LTXT | 21 ++++++++++++ data/DRIVER2/LANG/FR_GAME.LTXT | 21 ++++++++++++ data/DRIVER2/LANG/GE_GAME.LTXT | 22 ++++++++++++- data/DRIVER2/LANG/IT_GAME.LTXT | 21 ++++++++++++ data/DRIVER2/LANG/SP_GAME.LTXT | 21 ++++++++++++ src_rebuild/Game/Frontend/FEmain.c | 51 ++++++++++++++---------------- src_rebuild/Game/dr2locale.h | 26 ++++++++++++++- 7 files changed, 154 insertions(+), 29 deletions(-) diff --git a/data/DRIVER2/LANG/EN_GAME.LTXT b/data/DRIVER2/LANG/EN_GAME.LTXT index 3cef4294..ae391917 100644 --- a/data/DRIVER2/LANG/EN_GAME.LTXT +++ b/data/DRIVER2/LANG/EN_GAME.LTXT @@ -104,3 +104,24 @@ Night Clear Rainy Wet +Color +Details +FullScreen +VSync +PGXP +Texture Filter +Draw Distance +Dynamic Lights +Traffic Density +Peds Density +Low +Medium +High +Ultra +Off +On +Textures Only +ZBuffer Only +All +Reset to Default +Custom \ No newline at end of file diff --git a/data/DRIVER2/LANG/FR_GAME.LTXT b/data/DRIVER2/LANG/FR_GAME.LTXT index 7c705b48..60c77ef5 100644 --- a/data/DRIVER2/LANG/FR_GAME.LTXT +++ b/data/DRIVER2/LANG/FR_GAME.LTXT @@ -104,3 +104,24 @@ Nuit Dégager Pluvieux Mouiller +Color +Details +FullScreen +VSync +PGXP +TextureFilter +DrawDistance +DynamicLights +TrafficDensity +PedsDensity +Low +Medium +High +Ultra +Off +On +TexturesOnly +ZBufferOnly +All +ResetToDefault +Custom \ No newline at end of file diff --git a/data/DRIVER2/LANG/GE_GAME.LTXT b/data/DRIVER2/LANG/GE_GAME.LTXT index a4b65477..95777452 100644 --- a/data/DRIVER2/LANG/GE_GAME.LTXT +++ b/data/DRIVER2/LANG/GE_GAME.LTXT @@ -104,4 +104,24 @@ Nacht klar Regnerisch Nass - +Color +Details +FullScreen +VSync +PGXP +TextureFilter +DrawDistance +DynamicLights +TrafficDensity +PedsDensity +Low +Medium +High +Ultra +Off +On +TexturesOnly +ZBufferOnly +All +ResetToDefault +Custom \ No newline at end of file diff --git a/data/DRIVER2/LANG/IT_GAME.LTXT b/data/DRIVER2/LANG/IT_GAME.LTXT index 743ffa01..659ce699 100644 --- a/data/DRIVER2/LANG/IT_GAME.LTXT +++ b/data/DRIVER2/LANG/IT_GAME.LTXT @@ -104,3 +104,24 @@ Notte Sereno Piovoso Bagnato +Color +Details +FullScreen +VSync +PGXP +TextureFilter +DrawDistance +DynamicLights +TrafficDensity +PedsDensity +Low +Medium +High +Ultra +Off +On +TexturesOnly +ZBufferOnly +All +ResetToDefault +Custom \ No newline at end of file diff --git a/data/DRIVER2/LANG/SP_GAME.LTXT b/data/DRIVER2/LANG/SP_GAME.LTXT index 15512eb1..ed0c387d 100644 --- a/data/DRIVER2/LANG/SP_GAME.LTXT +++ b/data/DRIVER2/LANG/SP_GAME.LTXT @@ -104,3 +104,24 @@ Noche Claro Lluvioso Mojado +Color +Details +FullScreen +VSync +PGXP +TextureFilter +DrawDistance +DynamicLights +TrafficDensity +PedsDensity +Low +Medium +High +Ultra +Off +On +TexturesOnly +ZBufferOnly +All +ResetToDefault +Custom \ No newline at end of file diff --git a/src_rebuild/Game/Frontend/FEmain.c b/src_rebuild/Game/Frontend/FEmain.c index 472e24aa..83287df4 100644 --- a/src_rebuild/Game/Frontend/FEmain.c +++ b/src_rebuild/Game/Frontend/FEmain.c @@ -961,18 +961,18 @@ void SetVariable(int var, int &action) case VAR_CHOOSE_TYPE: // [A] chooser type { static char* ChooseQualityItems[] = { - "Low", - "Medium", - "High", - "Ultra", + G_LTXT(GTXT_Low), + G_LTXT(GTXT_Medium), + G_LTXT(GTXT_High), + G_LTXT(GTXT_Ultra), NULL, }; static char* ChoosePGXPItems[] = { - "Disabled", - "Textures only", - "ZBuffer only", - "Enabled", + G_LTXT(GTXT_Off), + G_LTXT(GTXT_TexturesOnly), + G_LTXT(GTXT_ZBufferOnly), + G_LTXT(GTXT_All), NULL, }; @@ -1251,7 +1251,8 @@ void DisplayOnScreenText(void) text = "Please insert controller into Port 1"; transparent = 1; } - else { + else + { if (Pads[0].type != 1) return; @@ -1306,7 +1307,7 @@ void DisplayOnScreenText(void) CVECTOR *col = &debris_colour[GameLevel][car_colour]; - FEPrintString("Color", btn->x + 190, btn->y + 270, 4, 128, 128, 128); + FEPrintString(G_LTXT(GTXT_Color), btn->x + 190, btn->y + 270, 4, 128, 128, 128); POLY_F4 *f4 = (POLY_F4*)current->primptr; current->primptr += sizeof(POLY_F4); @@ -1750,14 +1751,14 @@ void InitDetailsScreen(FE_SCREEN *screen) }; static char *ButtonNames[] = { - "FullScreen", - "VSync", - "PGXP", - "Texture Filter", - "Draw Distance", - "Dynamic Lights", - "Traffic Density", - "Peds Density", + G_LTXT(GTXT_FullScreen), + G_LTXT(GTXT_VSync), + G_LTXT(GTXT_PGXP), + G_LTXT(GTXT_TextureFilter), + G_LTXT(GTXT_DrawDistance), + G_LTXT(GTXT_DynamicLights), + G_LTXT(GTXT_TrafficDensity), + G_LTXT(GTXT_PedsDensity), }; int numButtons = BuildButtonsVertical(screen, 8, 156, 190); @@ -1765,13 +1766,9 @@ void InitDetailsScreen(FE_SCREEN *screen) for (int i = 0; i < numButtons; i++) { FE_BUTTON& btn = screen->buttons[i]; - int type = ButtonTypeMap[i]; - char *name = ButtonNames[i]; - int index = ButtonScreenMap[i]; - - strcpy(btn.Name, name); + strcpy(btn.Name, ButtonNames[i]); if (type < 0) { @@ -1780,7 +1777,7 @@ void InitDetailsScreen(FE_SCREEN *screen) } else { - btn.action = FE_MAKEVAR(BTN_NEXT_SCREEN, index); + btn.action = FE_MAKEVAR(BTN_NEXT_SCREEN, ButtonScreenMap[i]); } btn.var = FE_MAKEVAR(VAR_CHOOSE_TYPE, type); @@ -1813,7 +1810,7 @@ void InitCustomScreens() InitDetailsScreen(&PsxScreens[Sc_DetailOptions]); // insert link in Options - InsertButtonVertical(&PsxScreens[Sc_Options], 2, "Details"); + InsertButtonVertical(&PsxScreens[Sc_Options], 2, G_LTXT(GTXT_Details)); FE_BUTTON &btn = PsxScreens[Sc_Options].buttons[2]; @@ -4851,7 +4848,7 @@ int ChooseOptionScreen(int bSetup) if (value >= 0) { - extraBtn = InsertButtonVertical(pCurrScreen, numButtons, "Custom"); + extraBtn = InsertButtonVertical(pCurrScreen, numButtons, G_LTXT(GTXT_Custom)); if (extraBtn != NULL) { @@ -4874,7 +4871,7 @@ int ChooseOptionScreen(int bSetup) if (defaultValue >= 0) { - resetBtn = InsertButtonVertical(pCurrScreen, numButtons, "Reset to Default"); + resetBtn = InsertButtonVertical(pCurrScreen, numButtons, G_LTXT(GTXT_ResetToDefault)); if (resetBtn != NULL) { diff --git a/src_rebuild/Game/dr2locale.h b/src_rebuild/Game/dr2locale.h index 6653f7d4..f3691dc6 100644 --- a/src_rebuild/Game/dr2locale.h +++ b/src_rebuild/Game/dr2locale.h @@ -126,7 +126,31 @@ enum GameStrId GTXT_Clear, GTXT_Rainy, - GTXT_Wet + GTXT_Wet, + + GTXT_Color, + + GTXT_Details, + GTXT_FullScreen, + GTXT_VSync, + GTXT_PGXP, + GTXT_TextureFilter, + GTXT_DrawDistance, + GTXT_DynamicLights, + GTXT_TrafficDensity, + GTXT_PedsDensity, + + GTXT_Low, + GTXT_Medium, + GTXT_High, + GTXT_Ultra, + GTXT_Off, + GTXT_On, + GTXT_TexturesOnly, + GTXT_ZBufferOnly, + GTXT_All, + GTXT_ResetToDefault, + GTXT_Custom }; enum MissionStrId