| 1475 | } |
| 1476 | |
| 1477 | void CCryEditApp::OnScriptCompileScript() |
| 1478 | { |
| 1479 | //////////////////////////////////////////////////////////////////////// |
| 1480 | // Use the Lua compiler to compile a script |
| 1481 | //////////////////////////////////////////////////////////////////////// |
| 1482 | CErrorsRecorder errRecorder; |
| 1483 | |
| 1484 | std::vector<CString> files; |
| 1485 | if (CFileUtil::SelectMultipleFiles( EFILE_TYPE_ANY,files,"Lua Files (*.lua)|*.lua||","Scripts" )) |
| 1486 | { |
| 1487 | ////////////////////////////////////////////////////////////////////////// |
| 1488 | // Lock resources. |
| 1489 | // Speed ups loading a lot. |
| 1490 | ISystem *pSystem = GetIEditor()->GetSystem(); |
| 1491 | pSystem->GetI3DEngine()->LockCGFResources(); |
| 1492 | pSystem->GetIAnimationSystem()->LockResources(); |
| 1493 | pSystem->GetISoundSystem()->LockResources(); |
| 1494 | ////////////////////////////////////////////////////////////////////////// |
| 1495 | for (int i = 0; i < files.size(); i++) |
| 1496 | { |
| 1497 | if (!CFileUtil::CompileLuaFile( files[i] )) |
| 1498 | return; |
| 1499 | |
| 1500 | // No errors |
| 1501 | // Reload this lua file. |
| 1502 | GetIEditor()->GetSystem()->GetIScriptSystem()->ReloadScript( files[i],false ); |
| 1503 | } |
| 1504 | ////////////////////////////////////////////////////////////////////////// |
| 1505 | // Unlock resources. |
| 1506 | // Some uneeded resources that were locked before may get released here. |
| 1507 | pSystem->GetISoundSystem()->UnlockResources(); |
| 1508 | pSystem->GetIAnimationSystem()->UnlockResources(); |
| 1509 | pSystem->GetI3DEngine()->UnlockCGFResources(); |
| 1510 | ////////////////////////////////////////////////////////////////////////// |
| 1511 | } |
| 1512 | } |
| 1513 | |
| 1514 | ////////////////////////////////////////////////////////////////////////// |
| 1515 | void CCryEditApp::OnScriptEditScript() |
nothing calls this directly
no test coverage detected