mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-26 14:06:27 +00:00
Use an actual playername instead of "You" in singleplayer, fixes #3979.
Differentiate between SP and MP name and allow editing it in the settings. Defaults to the OS username. Makes sharing singleplayer replays more effective. Also fixes a troublesome colorization of "You" in a translated sentence, refs #3501. This was SVN commit r18180.
This commit is contained in:
@@ -748,6 +748,12 @@ void Script_EndGame(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
|
||||
EndGame();
|
||||
}
|
||||
|
||||
CStrW GetSystemUsername(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
|
||||
{
|
||||
return sys_get_user_name();
|
||||
}
|
||||
|
||||
|
||||
// Cause the game to exit gracefully.
|
||||
// params:
|
||||
// returns:
|
||||
@@ -1117,4 +1123,5 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
|
||||
scriptInterface.RegisterFunction<void, unsigned int, &EnableTimeWarpRecording>("EnableTimeWarpRecording");
|
||||
scriptInterface.RegisterFunction<void, &RewindTimeWarp>("RewindTimeWarp");
|
||||
scriptInterface.RegisterFunction<void, bool, &SetBoundingBoxDebugOverlay>("SetBoundingBoxDebugOverlay");
|
||||
scriptInterface.RegisterFunction<CStrW, &GetSystemUsername>("GetSystemUsername");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user