Game setup changes, including showing name, civ, team, and some options loaded from the scenarios. Civ data added. Civ info window to preview civs. Icon tooltips. Support for random map implementation. Fixes #590.

This was SVN commit r8494.
This commit is contained in:
historic_bruno
2010-10-30 04:02:42 +00:00
parent 0b978d5e26
commit 9ee44bd9b8
76 changed files with 4001 additions and 370 deletions
+19 -10
View File
@@ -182,16 +182,6 @@ bool CSimulation2Impl::Update(int turnLength, const std::vector<SimulationComman
CMessageTurnStart msgTurnStart;
m_ComponentManager.BroadcastMessage(msgTurnStart);
if (m_TurnNumber == 0)
{
ScriptInterface& scriptInterface = m_ComponentManager.GetScriptInterface();
CScriptVal ret;
scriptInterface.CallFunction(scriptInterface.GetGlobalObject(), "LoadMapSettings", m_MapSettings, ret);
if (!m_StartupScript.empty())
m_ComponentManager.GetScriptInterface().LoadScript(L"map startup script", m_StartupScript);
}
CmpPtr<ICmpPathfinder> cmpPathfinder(m_SimContext, SYSTEM_ENTITY);
if (!cmpPathfinder.null())
cmpPathfinder->FinishAsyncRequests();
@@ -401,11 +391,30 @@ void CSimulation2::SetMapSettings(const utf16string& settings)
m->m_MapSettings = m->m_ComponentManager.GetScriptInterface().ParseJSON(settings);
}
void CSimulation2::SetMapSettings(const CScriptValRooted& settings)
{
m->m_MapSettings = settings;
}
std::string CSimulation2::GetMapSettings()
{
return m->m_ComponentManager.GetScriptInterface().StringifyJSON(m->m_MapSettings.get());
}
void CSimulation2::LoadPlayerSettings()
{
GetScriptInterface().CallFunctionVoid(GetScriptInterface().GetGlobalObject(), "LoadPlayerSettings", m->m_MapSettings);
}
void CSimulation2::LoadMapSettings()
{
// Initialize here instead of in Update()
GetScriptInterface().CallFunctionVoid(GetScriptInterface().GetGlobalObject(), "LoadMapSettings", m->m_MapSettings);
if (!m->m_StartupScript.empty())
GetScriptInterface().LoadScript(L"map startup script", m->m_StartupScript);
}
LibError CSimulation2::ReloadChangedFile(const VfsPath& path)
{
return m->ReloadChangedFile(path);