MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / OnScriptCompileScript

Method OnScriptCompileScript

Editor/CryEdit.cpp:1477–1512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1475}
1476
1477void 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//////////////////////////////////////////////////////////////////////////
1515void CCryEditApp::OnScriptEditScript()

Callers

nothing calls this directly

Calls 12

GetIEditorFunction · 0.85
LockCGFResourcesMethod · 0.80
GetI3DEngineMethod · 0.80
GetIAnimationSystemMethod · 0.80
GetISoundSystemMethod · 0.80
UnlockCGFResourcesMethod · 0.80
GetSystemMethod · 0.45
LockResourcesMethod · 0.45
sizeMethod · 0.45
ReloadScriptMethod · 0.45
GetIScriptSystemMethod · 0.45
UnlockResourcesMethod · 0.45

Tested by

no test coverage detected