mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-12-04 01:51:11 +00:00
game: add 'g_language' localization cvar
This commit is contained in:
parent
1f0b9904ea
commit
03cb2be1e6
6 changed files with 11 additions and 2 deletions
|
@ -79,7 +79,7 @@ Maps support:
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
|
|
||||||
* Non Quake 2 maps are limmited mostly view only, and could have issues
|
* Non Quake 2 maps are limited mostly view only, and could have issues
|
||||||
with tranparency or some animations flags and properties.
|
with tranparency or some animations flags and properties.
|
||||||
* If you like support some other maps type, create pull request for Mod_Load2QBSP
|
* If you like support some other maps type, create pull request for Mod_Load2QBSP
|
||||||
function and provide a link to demo maps.
|
function and provide a link to demo maps.
|
||||||
|
|
|
@ -249,6 +249,10 @@ it's `+set busywait 0` (setting the `busywait` cvar) and `-portable`
|
||||||
By default this cvar is set to `1`, and will only work if the
|
By default this cvar is set to `1`, and will only work if the
|
||||||
game.dll implements this behaviour.
|
game.dll implements this behaviour.
|
||||||
|
|
||||||
|
* **g_language**: Default language for ReRelease game, requires `Q2Game.kpf`
|
||||||
|
or other source of `localization/loc_english.txt` like file.
|
||||||
|
Defaults to `english`.
|
||||||
|
|
||||||
* **g_swap_speed**: Sets the speed of the "changing weapon" animation.
|
* **g_swap_speed**: Sets the speed of the "changing weapon" animation.
|
||||||
Default is `1`. If set to `2`, it will be double the speed, `3` is
|
Default is `1`. If set to `2`, it will be double the speed, `3` is
|
||||||
the triple... up until the max of `8`, since there are at least 2
|
the triple... up until the max of `8`, since there are at least 2
|
||||||
|
|
|
@ -102,6 +102,7 @@ cvar_t *aimfix;
|
||||||
cvar_t *g_machinegun_norecoil;
|
cvar_t *g_machinegun_norecoil;
|
||||||
cvar_t *g_quick_weap;
|
cvar_t *g_quick_weap;
|
||||||
cvar_t *g_swap_speed;
|
cvar_t *g_swap_speed;
|
||||||
|
cvar_t *g_language;
|
||||||
|
|
||||||
static void G_RunFrame(void);
|
static void G_RunFrame(void);
|
||||||
|
|
||||||
|
|
|
@ -53,12 +53,14 @@ LocalizationInit(void)
|
||||||
byte *raw = NULL;
|
byte *raw = NULL;
|
||||||
char *buf_local = NULL, *buf_level = NULL;
|
char *buf_local = NULL, *buf_level = NULL;
|
||||||
int len_local, len_level, curr_pos;
|
int len_local, len_level, curr_pos;
|
||||||
|
char loc_name[MAX_QPATH];
|
||||||
|
|
||||||
localmessages = NULL;
|
localmessages = NULL;
|
||||||
nlocalmessages = 0;
|
nlocalmessages = 0;
|
||||||
|
|
||||||
|
snprintf(loc_name, sizeof(loc_name) - 1, "localization/loc_%s.txt", g_language->string);
|
||||||
/* load the localization file */
|
/* load the localization file */
|
||||||
len_local = gi.FS_LoadFile("localization/loc_english.txt", (void **)&raw);
|
len_local = gi.FS_LoadFile(loc_name, (void **)&raw);
|
||||||
if (len_local > 1)
|
if (len_local > 1)
|
||||||
{
|
{
|
||||||
buf_local = malloc(len_local + 1);
|
buf_local = malloc(len_local + 1);
|
||||||
|
|
|
@ -679,6 +679,7 @@ extern cvar_t *aimfix;
|
||||||
extern cvar_t *g_machinegun_norecoil;
|
extern cvar_t *g_machinegun_norecoil;
|
||||||
extern cvar_t *g_quick_weap;
|
extern cvar_t *g_quick_weap;
|
||||||
extern cvar_t *g_swap_speed;
|
extern cvar_t *g_swap_speed;
|
||||||
|
extern cvar_t *g_language;
|
||||||
|
|
||||||
/* this is for the count of monsters */
|
/* this is for the count of monsters */
|
||||||
#define ENT_SLOTS_LEFT \
|
#define ENT_SLOTS_LEFT \
|
||||||
|
|
|
@ -263,6 +263,7 @@ InitGame(void)
|
||||||
g_machinegun_norecoil = gi.cvar("g_machinegun_norecoil", "0", CVAR_ARCHIVE);
|
g_machinegun_norecoil = gi.cvar("g_machinegun_norecoil", "0", CVAR_ARCHIVE);
|
||||||
g_quick_weap = gi.cvar("g_quick_weap", "1", CVAR_ARCHIVE);
|
g_quick_weap = gi.cvar("g_quick_weap", "1", CVAR_ARCHIVE);
|
||||||
g_swap_speed = gi.cvar("g_swap_speed", "1", CVAR_ARCHIVE);
|
g_swap_speed = gi.cvar("g_swap_speed", "1", CVAR_ARCHIVE);
|
||||||
|
g_language = gi.cvar("g_language", "english", CVAR_ARCHIVE);
|
||||||
|
|
||||||
/* initilize localization */
|
/* initilize localization */
|
||||||
LocalizationInit();
|
LocalizationInit();
|
||||||
|
|
Loading…
Reference in a new issue