- support locale for Game graphics options menu

This commit is contained in:
SoapyMan 2023-04-21 22:40:57 +06:00
parent 593cb7e580
commit 475e610e7e
7 changed files with 154 additions and 29 deletions

View File

@ -104,3 +104,24 @@ Night
Clear Clear
Rainy Rainy
Wet 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

View File

@ -104,3 +104,24 @@ Nuit
Dégager Dégager
Pluvieux Pluvieux
Mouiller Mouiller
Color
Details
FullScreen
VSync
PGXP
TextureFilter
DrawDistance
DynamicLights
TrafficDensity
PedsDensity
Low
Medium
High
Ultra
Off
On
TexturesOnly
ZBufferOnly
All
ResetToDefault
Custom

View File

@ -104,4 +104,24 @@ Nacht
klar klar
Regnerisch Regnerisch
Nass Nass
Color
Details
FullScreen
VSync
PGXP
TextureFilter
DrawDistance
DynamicLights
TrafficDensity
PedsDensity
Low
Medium
High
Ultra
Off
On
TexturesOnly
ZBufferOnly
All
ResetToDefault
Custom

View File

@ -104,3 +104,24 @@ Notte
Sereno Sereno
Piovoso Piovoso
Bagnato Bagnato
Color
Details
FullScreen
VSync
PGXP
TextureFilter
DrawDistance
DynamicLights
TrafficDensity
PedsDensity
Low
Medium
High
Ultra
Off
On
TexturesOnly
ZBufferOnly
All
ResetToDefault
Custom

View File

@ -104,3 +104,24 @@ Noche
Claro Claro
Lluvioso Lluvioso
Mojado Mojado
Color
Details
FullScreen
VSync
PGXP
TextureFilter
DrawDistance
DynamicLights
TrafficDensity
PedsDensity
Low
Medium
High
Ultra
Off
On
TexturesOnly
ZBufferOnly
All
ResetToDefault
Custom

View File

@ -961,18 +961,18 @@ void SetVariable(int var, int &action)
case VAR_CHOOSE_TYPE: // [A] chooser type case VAR_CHOOSE_TYPE: // [A] chooser type
{ {
static char* ChooseQualityItems[] = { static char* ChooseQualityItems[] = {
"Low", G_LTXT(GTXT_Low),
"Medium", G_LTXT(GTXT_Medium),
"High", G_LTXT(GTXT_High),
"Ultra", G_LTXT(GTXT_Ultra),
NULL, NULL,
}; };
static char* ChoosePGXPItems[] = { static char* ChoosePGXPItems[] = {
"Disabled", G_LTXT(GTXT_Off),
"Textures only", G_LTXT(GTXT_TexturesOnly),
"ZBuffer only", G_LTXT(GTXT_ZBufferOnly),
"Enabled", G_LTXT(GTXT_All),
NULL, NULL,
}; };
@ -1251,7 +1251,8 @@ void DisplayOnScreenText(void)
text = "Please insert controller into Port 1"; text = "Please insert controller into Port 1";
transparent = 1; transparent = 1;
} }
else { else
{
if (Pads[0].type != 1) if (Pads[0].type != 1)
return; return;
@ -1306,7 +1307,7 @@ void DisplayOnScreenText(void)
CVECTOR *col = &debris_colour[GameLevel][car_colour]; 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; POLY_F4 *f4 = (POLY_F4*)current->primptr;
current->primptr += sizeof(POLY_F4); current->primptr += sizeof(POLY_F4);
@ -1750,14 +1751,14 @@ void InitDetailsScreen(FE_SCREEN *screen)
}; };
static char *ButtonNames[] = { static char *ButtonNames[] = {
"FullScreen", G_LTXT(GTXT_FullScreen),
"VSync", G_LTXT(GTXT_VSync),
"PGXP", G_LTXT(GTXT_PGXP),
"Texture Filter", G_LTXT(GTXT_TextureFilter),
"Draw Distance", G_LTXT(GTXT_DrawDistance),
"Dynamic Lights", G_LTXT(GTXT_DynamicLights),
"Traffic Density", G_LTXT(GTXT_TrafficDensity),
"Peds Density", G_LTXT(GTXT_PedsDensity),
}; };
int numButtons = BuildButtonsVertical(screen, 8, 156, 190); int numButtons = BuildButtonsVertical(screen, 8, 156, 190);
@ -1765,13 +1766,9 @@ void InitDetailsScreen(FE_SCREEN *screen)
for (int i = 0; i < numButtons; i++) for (int i = 0; i < numButtons; i++)
{ {
FE_BUTTON& btn = screen->buttons[i]; FE_BUTTON& btn = screen->buttons[i];
int type = ButtonTypeMap[i]; int type = ButtonTypeMap[i];
char *name = ButtonNames[i];
int index = ButtonScreenMap[i]; strcpy(btn.Name, ButtonNames[i]);
strcpy(btn.Name, name);
if (type < 0) if (type < 0)
{ {
@ -1780,7 +1777,7 @@ void InitDetailsScreen(FE_SCREEN *screen)
} }
else 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); btn.var = FE_MAKEVAR(VAR_CHOOSE_TYPE, type);
@ -1813,7 +1810,7 @@ void InitCustomScreens()
InitDetailsScreen(&PsxScreens[Sc_DetailOptions]); InitDetailsScreen(&PsxScreens[Sc_DetailOptions]);
// insert link in Options // 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]; FE_BUTTON &btn = PsxScreens[Sc_Options].buttons[2];
@ -4851,7 +4848,7 @@ int ChooseOptionScreen(int bSetup)
if (value >= 0) if (value >= 0)
{ {
extraBtn = InsertButtonVertical(pCurrScreen, numButtons, "Custom"); extraBtn = InsertButtonVertical(pCurrScreen, numButtons, G_LTXT(GTXT_Custom));
if (extraBtn != NULL) if (extraBtn != NULL)
{ {
@ -4874,7 +4871,7 @@ int ChooseOptionScreen(int bSetup)
if (defaultValue >= 0) if (defaultValue >= 0)
{ {
resetBtn = InsertButtonVertical(pCurrScreen, numButtons, "Reset to Default"); resetBtn = InsertButtonVertical(pCurrScreen, numButtons, G_LTXT(GTXT_ResetToDefault));
if (resetBtn != NULL) if (resetBtn != NULL)
{ {

View File

@ -126,7 +126,31 @@ enum GameStrId
GTXT_Clear, GTXT_Clear,
GTXT_Rainy, 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 enum MissionStrId