mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Allow civ specific techs with {civ}
Discussed with leper Reviewed By: bb Trac Tickets: #4589 Differential Revision: https://code.wildfiregames.com/D1024 This was SVN commit r20551.
This commit is contained in:
@@ -83,6 +83,7 @@ CComponentManager::CComponentManager(CSimContext& context, shared_ptr<ScriptRunt
|
||||
m_ScriptInterface.RegisterFunction<int, std::string, CComponentManager::Script_AddLocalEntity> ("AddLocalEntity");
|
||||
m_ScriptInterface.RegisterFunction<void, int, CComponentManager::Script_DestroyEntity> ("DestroyEntity");
|
||||
m_ScriptInterface.RegisterFunction<void, CComponentManager::Script_FlushDestroyedEntities> ("FlushDestroyedEntities");
|
||||
m_ScriptInterface.RegisterFunction<bool, std::wstring, CComponentManager::Script_DataFileExists> ("DataFileExists");
|
||||
m_ScriptInterface.RegisterFunction<JS::Value, std::wstring, CComponentManager::Script_ReadJSONFile> ("ReadJSONFile");
|
||||
m_ScriptInterface.RegisterFunction<JS::Value, std::wstring, CComponentManager::Script_ReadCivJSONFile> ("ReadCivJSONFile");
|
||||
m_ScriptInterface.RegisterFunction<std::vector<std::string>, std::wstring, bool, CComponentManager::Script_FindJSONFiles> ("FindJSONFiles");
|
||||
@@ -1185,6 +1186,12 @@ std::string CComponentManager::GenerateSchema() const
|
||||
return schema;
|
||||
}
|
||||
|
||||
bool CComponentManager::Script_DataFileExists(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::wstring& fileName)
|
||||
{
|
||||
VfsPath path = VfsPath(L"simulation/data") / fileName;
|
||||
return VfsFileExists(path);
|
||||
}
|
||||
|
||||
JS::Value CComponentManager::Script_ReadJSONFile(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& fileName)
|
||||
{
|
||||
return ReadJSONFile(pCxPrivate, L"simulation/data", fileName);
|
||||
|
||||
Reference in New Issue
Block a user