Add documentation comments in GameFlowScript.cpp.

Move windowTitle from GameScriptSettings to GameFlowScript and rename it to SetWindowTitleKey.
This commit is contained in:
hispidence 2021-08-15 23:04:56 +01:00
parent 769e36702a
commit 813b8bb42a
3 changed files with 60 additions and 24 deletions

View file

@ -17,7 +17,7 @@
#endif
/***
Functions to be used in GameFlow.lua
Files that will be run on game startup.
@module gameflow
@pragma nostrip
*/
@ -38,11 +38,17 @@ GameFlow::GameFlow(sol::state* lua) : LuaHandler{ lua }
GameScriptAudioTrack::Register(m_lua);
GameScriptColor::Register(m_lua);
GameScriptRotation::Register(m_lua);
/*** gameflow.lua.
These functions are called in gameflow.lua, a file loosely equivalent to winroomedit's SCRIPT.DAT.
They handle a game's 'metadata'; i.e., things such as level titles, loading screen paths, and default
ambient tracks.
@section gameflowlua
*/
/***
Add a level to the gameflow.
@function AddLevel
@tparam @{Level} level a level object
@tparam Level level a level object
*/
m_lua->set_function("AddLevel", &GameFlow::AddLevel, this);
@ -59,29 +65,52 @@ __(not yet implemented)__
*/
m_lua->set_function("SetTitleScreenImagePath", &GameFlow::SetTitleScreenImagePath, this);
/*** The string ID of the title of the game
__(not yet implemented)__
@function SetWindowTitleKey
@tparam string string ID of the title as set in TombIDE.
*/
m_lua->set_function("SetWindowTitleKey", &GameFlow::SetWindowTitleKey, this);
/*** settings.lua.
These functions are called in settings.lua, a file which holds your local settings.
settings.lua shouldn't be bundled with any finished levels/games.
@section settingslua
*/
/***
@function SetSettings
@tparam Settings settings a settings object
*/
m_lua->set_function("SetSettings", &GameFlow::SetSettings, this);
/*** tracks.lua.
__TODO CONFIRM PROPER BEHAVIOUR__
@section trackslua
*/
/***
@function SetAudioTracks
@tparam table table array-style table with @{AudioTrack} objects
*/
//TODO confirm proper behaviour
m_lua->set_function("SetAudioTracks", &GameFlow::SetAudioTracks, this);
/***
/*** strings.lua.
These functions used in strings.lua, which is generated by TombIDE.
You will not need to call them manually.
@section stringslua
*/
/*** Set string variable keys and their translations.
@function SetStrings
@tparam table table array-style table with strings
*/
m_lua->set_function("SetStrings", &GameFlow::SetStrings, this);
/***
/*** Specify which translations in the strings table correspond to which languages.
@function SetLanguageNames
@tparam table table array-style table with TODO EXTRA INFO HERE
@tparam table table array-style table with language names
*/
m_lua->set_function("SetLanguageNames", &GameFlow::SetLanguageNames, this);
/***
@function SetSettings
@tparam table table array-style table with TODO EXTRA INFO HERE
*/
m_lua->set_function("SetSettings", &GameFlow::SetSettings, this);
MakeReadOnlyTable("WeatherType", kWeatherTypes);
MakeReadOnlyTable("LaraType", kLaraTypes);
@ -128,6 +157,12 @@ void GameFlow::SetTitleScreenImagePath(std::string const& path)
TitleScreenImagePath = path;
}
void GameFlow::SetWindowTitleKey(std::string const& key)
{
// TODO FIXME: I need to actually implement this
WindowTitleKey = key;
}
void GameFlow::SetAudioTracks(sol::as_table_t<std::vector<GameScriptAudioTrack>>&& src)
{
std::vector<GameScriptAudioTrack> tracks = std::move(src);