Add documentation for SetGameFarView, Level.FarView, and Level.UVRotate, as well as some value checking.

This commit is contained in:
hispidence 2021-08-17 13:36:34 +01:00
parent 011c5b2222
commit 672f90e238
6 changed files with 174 additions and 8 deletions

View file

@ -65,6 +65,14 @@ __(not yet implemented)__
*/
m_lua->set_function("SetTitleScreenImagePath", &GameFlow::SetTitleScreenImagePath, this);
/*** The maximum draw distance, in sectors (blocks), of any level in the game.
This is equivalent to TRNG's WorldFarView variable.
__(not yet implemented)__
@function SetGameFarView
@tparam byte farview Number of sectors. Must be in the range [1, 127].
*/
m_lua->set_function("SetGameFarView", &GameFlow::SetGameFarView, 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.
@ -151,6 +159,21 @@ void GameFlow::SetTitleScreenImagePath(std::string const& path)
TitleScreenImagePath = path;
}
void GameFlow::SetGameFarView(byte val)
{
bool cond = val <= 127 && val >= 1;
std::string msg{ "Game far view value must be in the range [1, 127]." };
if (!ScriptAssert(cond, msg))
{
ScriptWarn("Setting game far view to 32.");
GameFarView = 32;
}
else
{
GameFarView = val;
}
}
void GameFlow::SetAudioTracks(sol::as_table_t<std::vector<GameScriptAudioTrack>>&& src)
{
std::vector<GameScriptAudioTrack> tracks = std::move(src);