mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 05:21:16 +00:00
- moved language CVAR to backend.
This commit is contained in:
parent
73142ef2cf
commit
b19b0db150
5 changed files with 22 additions and 15 deletions
|
@ -3,6 +3,7 @@
|
|||
#include "gamestate.h"
|
||||
#include "startupinfo.h"
|
||||
#include "c_cvars.h"
|
||||
#include "gstrings.h"
|
||||
|
||||
static_assert(sizeof(void*) == 8, "32 builds are not supported");
|
||||
|
||||
|
@ -26,3 +27,12 @@ CVAR(Bool, queryiwad, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
|||
CVAR(String, defaultiwad, "", CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
||||
CVAR(Bool, vid_fps, false, 0)
|
||||
|
||||
EXTERN_CVAR(Bool, ui_generic)
|
||||
|
||||
CUSTOM_CVAR(String, language, "auto", CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG)
|
||||
{
|
||||
GStrings.UpdateLanguage(self);
|
||||
UpdateGenericUI(ui_generic);
|
||||
if (sysCallbacks.LanguageChanged) sysCallbacks.LanguageChanged(self);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ struct SystemCallbacks
|
|||
void (*HudScaleChanged)();
|
||||
bool (*SetSpecialMenu)(FName& menu, int param);
|
||||
void (*OnMenuOpen)(bool makesound);
|
||||
void (*LanguageChanged)(const char*);
|
||||
};
|
||||
|
||||
extern SystemCallbacks sysCallbacks;
|
||||
|
|
|
@ -265,7 +265,6 @@ DEFINE_ACTION_FUNCTION(FFont, BreakLines)
|
|||
|
||||
|
||||
bool generic_ui;
|
||||
EXTERN_CVAR(String, language)
|
||||
|
||||
bool CheckFontComplete(FFont* font)
|
||||
{
|
||||
|
|
|
@ -2769,6 +2769,16 @@ void System_ConsoleToggled(int state)
|
|||
D_ToggleHud();
|
||||
}
|
||||
|
||||
void System_LanguageChanged(const char* lang)
|
||||
{
|
||||
for (auto Level : AllLevels())
|
||||
{
|
||||
// does this even make sense on secondary levels...?
|
||||
if (Level->info != nullptr) Level->LevelName = Level->info->LookupLevelName();
|
||||
}
|
||||
I_UpdateWindowTitle();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// DoomSpecificInfo
|
||||
|
@ -3543,6 +3553,7 @@ static int D_DoomMain_Internal (void)
|
|||
System_HudScaleChanged,
|
||||
M_SetSpecialMenu,
|
||||
OnMenuOpen,
|
||||
System_LanguageChanged,
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -148,18 +148,4 @@ CUSTOM_CVAR(Float, teamdamage, 0.f, CVAR_SERVERINFO | CVAR_NOINITCALL)
|
|||
}
|
||||
}
|
||||
|
||||
EXTERN_CVAR(Bool, ui_generic)
|
||||
|
||||
CUSTOM_CVAR(String, language, "auto", CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG)
|
||||
{
|
||||
GStrings.UpdateLanguage(self);
|
||||
for (auto Level : AllLevels())
|
||||
{
|
||||
// does this even make sense on secondary levels...?
|
||||
if (Level->info != nullptr) Level->LevelName = Level->info->LookupLevelName();
|
||||
}
|
||||
UpdateGenericUI(ui_generic);
|
||||
I_UpdateWindowTitle();
|
||||
}
|
||||
|
||||
CVAR(Float, cl_scaleweaponfov, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||
|
|
Loading…
Reference in a new issue