Adds game speed option to match setup, adds in-game control for single player games, fixes #785.

Refactors some GUI utility functions.

This was SVN commit r13340.
This commit is contained in:
historic_bruno
2013-04-03 23:24:22 +00:00
parent 62dc594a71
commit 16de5c75ac
10 changed files with 214 additions and 57 deletions
+7 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2012 Wildfire Games.
/* Copyright (C) 2013 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -526,6 +526,11 @@ void SetSimRate(void* UNUSED(cbdata), float rate)
g_Game->SetSimRate(rate);
}
float GetSimRate(void* UNUSED(cbdata))
{
return g_Game->GetSimRate();
}
void SetTurnLength(void* UNUSED(cbdata), int length)
{
if (g_NetServer)
@@ -680,6 +685,7 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
// Development/debugging functions
scriptInterface.RegisterFunction<void, float, &SetSimRate>("SetSimRate");
scriptInterface.RegisterFunction<float, &GetSimRate>("GetSimRate");
scriptInterface.RegisterFunction<void, int, &SetTurnLength>("SetTurnLength");
scriptInterface.RegisterFunction<void, float, float, float, &SetCameraTarget>("SetCameraTarget");
scriptInterface.RegisterFunction<int, &Crash>("Crash");