For recoverable errors, add some recovery behaviour and logging so a level designer can see in the log what was done as a result of the error.
Warn about default behaviour if no callbacks are added.
This is to be used when an error is discovered in a Lua Script.
The var ScriptErrorMode refers to the error mode the user has chosen (silent, warn, terminate). At the moment this is hardcoded but will soon become editable to a LD via settings.
ScriptAssert will read this variable and take the appropriate action when an assert is failed.
IGNORE will do nothing (we should make a note in the documentation that this should almost certainly not be used by the LD if they can avoid it).
WARN will call TENLog with LogLevel::Warn.
TERMINATE will throw a TENScriptException, where it will be caught at GameMain, where TENLog will be called.
There are circumstances where we will HAVE to terminate, even if the user has opted not to (i.e. errors where there is nothing sensible that can be done, such as syntax errors that would terminate Lua anyway). For these, we can pass in ERROR_MODE::TERMINATE as the last variable.
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.
Make a template that all GetXByName member functions work off, to reduce copypasted functions.
For consistency, rename RemoveLuaName and AddLuaName to RemoveLuaNameItem and AddLuaNameItem.
Fix some documentation comments, order function documentation into sections.
Make their properties lowercase to keep them consistent with the properties of other classes.
Move documentation from GameScriptPosition.h to GameScriptPosition.cpp.
Register GetItemByName in GameLogicScript instead of winmain. Register GameScriptColor too.
Define the lambdas passed to GameScriptItemInfo in terms of the actual functions we define. Functions that make a GameScriptItemInfo should pass false to make_unique (so the Lua object made does not control the lifetime of the ITEM_INFO).
Move LDoc from GameScriptItemInfo.h to GameScriptItemInfo.cpp. This might seem counter-intuitive, but LDoc is concerned with the Lua interfaces rather than the actual C++ functions; since the Lua interfaces are defined in GameScriptItemInfo::Register, it makes more sense for the comments to be nearby.
Add calls to the callbacks to GameScriptItemInfo::SetName, so that giving a Lua name to an object removes its existing object and any other object currently using the new name, before then putting the name into the map.
Add initial documentation for the Lua-exported parts.