2021-12-04 21:15:26 +00:00
|
|
|
#include "frameworkandsol.h"
|
2021-07-28 18:44:24 +01:00
|
|
|
#include "GameScriptSettings.h"
|
|
|
|
|
2021-08-16 12:52:06 +01:00
|
|
|
/***
|
|
|
|
Settings that will be run on game startup.
|
2021-08-23 19:16:24 +01:00
|
|
|
@pregameclass Settings
|
2021-08-16 12:52:06 +01:00
|
|
|
@pragma nostrip
|
|
|
|
*/
|
|
|
|
|
2021-07-28 18:44:24 +01:00
|
|
|
void GameScriptSettings::Register(sol::state* lua)
|
|
|
|
{
|
2021-08-03 15:16:06 +01:00
|
|
|
lua->new_usertype<GameScriptSettings>("Settings",
|
2021-07-28 18:44:24 +01:00
|
|
|
"screenWidth", &GameScriptSettings::ScreenWidth,
|
|
|
|
"screenHeight", &GameScriptSettings::ScreenHeight,
|
|
|
|
"enableDynamicShadows", &GameScriptSettings::EnableDynamicShadows,
|
|
|
|
"windowed", &GameScriptSettings::Windowed,
|
|
|
|
"enableWaterCaustics", &GameScriptSettings::EnableWaterCaustics,
|
|
|
|
"drawingDistance", &GameScriptSettings::DrawingDistance,
|
|
|
|
"showRendererSteps", &GameScriptSettings::ShowRendererSteps,
|
2021-08-06 16:44:37 +01:00
|
|
|
"showDebugInfo", &GameScriptSettings::ShowDebugInfo,
|
2021-08-16 12:52:06 +01:00
|
|
|
|
|
|
|
/*** How should the application respond to script errors?
|
|
|
|
Must be one of the following:
|
|
|
|
`ErrorMode.TERMINATE` - print to the log file and terminate the application when any script error is hit.
|
|
|
|
This is the one you will want to go for if you want to know IMMEDIATELY if something has gone wrong.
|
|
|
|
|
|
|
|
`ErrorMode.WARN` - print to the log file and continue running the application when a recoverable script error is hit.
|
|
|
|
Choose this one if terminating the application is too much for you. Note that unrecoverable errors will still terminate
|
|
|
|
the application.
|
|
|
|
|
|
|
|
`ErrorMode.SILENT` - do nothing when a recoverable script error is hit.
|
|
|
|
Think __very__ carefully before using this setting. These error modes are here to help you to keep your scripts
|
|
|
|
working properly, but if you opt to ignore errors, you won't be alerted if you've misused a function or passed
|
|
|
|
an invalid argument.
|
|
|
|
|
|
|
|
As with `ErrorMode.WARN`, unrecoverable errors will still terminate the application.
|
|
|
|
@mem errorMode
|
|
|
|
*/
|
2021-08-06 16:44:37 +01:00
|
|
|
"errorMode", &GameScriptSettings::ErrorMode
|
2021-07-28 18:44:24 +01:00
|
|
|
);
|
|
|
|
}
|