Move GameScriptLevel, GameScriptAudioTrack, GameScriptInventoryObject, GameScriptSkyLayer, GameScriptSettings and GameScriptMirror into their own files. This could be changed later as this does create many small .h and .cpp files, but for now this cleans things up and makes it easier to check things class by class.

Treat functions as global that would previously be accessed through the GameFlow table. This does pollute the global environment in Lua a bit, but keeps it consistent with the functions in GameLogicScript, which are all accessed as globals.

Add some default member initialisers.

Remove WriteDefaults. Rename Intro to IntroImagePath and make it a std::string.

Add some documentation for the functions of GameFlowScript.

Fix some comments.
This commit is contained in:
hispidence 2021-07-28 18:44:24 +01:00
parent de71944e3c
commit e6c076eb41
16 changed files with 387 additions and 3 deletions

View file

@ -21,8 +21,8 @@
#endif
/***
Global functions and callbacks (not actually a module but a set of global functions)
@module global
functions and callbacks for game specific scripts
@module gamelogic
@pragma nostrip
*/
@ -137,7 +137,7 @@ Get a SinkInfo by its name.
*/
m_lua->set_function("GetSinkByName", &GameScript::GetSinkByName, this);
auto makeReadOnlyTable = [this](std::string const & tableName, auto const& container)
auto makeReadOnlyTable = [this](std::string const & tableName, auto const& container)
{
auto mt = tableName + "Meta";
// Put all the data in the metatable