mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-27 18:52:03 +00:00
Implement a developer overlay command to change the current player ID (very useful for AI development).
This was SVN commit r13606.
This commit is contained in:
@@ -168,6 +168,12 @@ int GetPlayerID(void* UNUSED(cbdata))
|
||||
return -1;
|
||||
}
|
||||
|
||||
void SetPlayerID(void* UNUSED(cbdata), int id)
|
||||
{
|
||||
if (g_Game)
|
||||
g_Game->SetPlayerID(id);
|
||||
}
|
||||
|
||||
std::wstring GetDefaultPlayerName(void* UNUSED(cbdata))
|
||||
{
|
||||
CStr playername;
|
||||
@@ -685,6 +691,7 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
|
||||
// Misc functions
|
||||
scriptInterface.RegisterFunction<std::wstring, std::wstring, &SetCursor>("SetCursor");
|
||||
scriptInterface.RegisterFunction<int, &GetPlayerID>("GetPlayerID");
|
||||
scriptInterface.RegisterFunction<void, int, &SetPlayerID>("SetPlayerID");
|
||||
scriptInterface.RegisterFunction<std::wstring, &GetDefaultPlayerName>("GetDefaultPlayerName");
|
||||
scriptInterface.RegisterFunction<std::wstring, &GetDefaultMPServer>("GetDefaultMPServer");
|
||||
scriptInterface.RegisterFunction<void, std::wstring, std::wstring, &SaveMPConfig>("SaveMPConfig");
|
||||
|
||||
Reference in New Issue
Block a user