MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / FlowHandler

Method FlowHandler

TombEngine/Scripting/Internal/TEN/Flow/FlowHandler.cpp:50–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48ScriptInterfaceFlowHandler* g_GameFlow;
49
50FlowHandler::FlowHandler(sol::state* lua, sol::table& parent) : _handler(lua)
51{
52/*** gameflow.lua.
53These functions are called in gameflow.lua, a file loosely equivalent to winroomedit's SCRIPT.DAT.
54They handle a game's 'metadata'; i.e., things such as level titles, loading screen paths, and default
55ambient tracks.
56@section Flowlua
57*/
58 sol::table tableFlow{ _handler.GetState()->lua_state(), sol::create };
59 parent.set(ScriptReserved_Flow, tableFlow);
60
61/***
62Add a level to the Flow.
63@function AddLevel
64@tparam Flow.Level level A level object.
65*/
66 tableFlow.set_function(ScriptReserved_AddLevel, &FlowHandler::AddLevel, this);
67
68/*** Image to show when loading the game. Must be a .jpg or .png image.
69@function SetIntroImagePath
70@tparam string path The path to the image, relative to the TombEngine executable.
71*/
72 tableFlow.set_function(ScriptReserved_SetIntroImagePath, &FlowHandler::SetIntroImagePath, this);
73
74/*** Video to show when loading the game. Must be a common video format, such as mp4, mkv, mov or avi.
75@function SetIntroVideoPath
76@tparam string path the path to the video, relative to the TombEngine exe
77*/
78 tableFlow.set_function(ScriptReserved_SetIntroVideoPath, &FlowHandler::SetIntroVideoPath, this);
79
80/*** Image to show in the background of the title screen. Must be a .jpg or .png image. _Not yet implemented._
81@function SetTitleScreenImagePath
82@tparam string path The path to the image, relative to the TombEngine executable.
83*/
84 tableFlow.set_function(ScriptReserved_SetTitleScreenImagePath, &FlowHandler::SetTitleScreenImagePath, this);
85
86/*** Enable or disable Lara drawing in title flyby.
87Must be true or false
88@function EnableLaraInTitle
89@tparam bool enabled True or false.
90*/
91 tableFlow.set_function(ScriptReserved_EnableLaraInTitle, &FlowHandler::EnableLaraInTitle, this);
92
93/*** Enable or disable level selection in title flyby.
94Must be true or false
95@function EnableLevelSelect
96@tparam bool enabled True or false.
97*/
98 tableFlow.set_function(ScriptReserved_EnableLevelSelect, &FlowHandler::EnableLevelSelect, this);
99
100/*** Enable or disable Home Level entry in the main menu.
101@function EnableHomeLevel
102@tparam bool enabled True or false.
103*/
104 tableFlow.set_function(ScriptReserved_EnableHomeLevel, &FlowHandler::EnableHomeLevel, this);
105
106/*** Enable or disable saving and loading of savegames.
107@function EnableLoadSave

Callers

nothing calls this directly

Calls 5

GetStateMethod · 0.80
MakeReadOnlyTableMethod · 0.80
RegisterFunction · 0.50
lua_stateMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected