mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-05 10:59:47 -05:00
Add the ability for lua libraries to define sublibraries
This commit is contained in:
@@ -33,9 +33,9 @@
|
||||
namespace openspace::scripting {
|
||||
|
||||
/**
|
||||
* This structure represents a Lua library, itself consisting of a unique #name and
|
||||
* an arbitrary number of #functions
|
||||
*/
|
||||
* This structure represents a Lua library, itself consisting of a unique #name and
|
||||
* an arbitrary number of #functions
|
||||
*/
|
||||
struct LuaLibrary {
|
||||
/**
|
||||
* This structure represents a Lua function with its #name, #function pointer
|
||||
@@ -49,7 +49,7 @@ struct LuaLibrary {
|
||||
lua_CFunction function;
|
||||
/// A vector of light userdata to be passed into the function
|
||||
std::vector<void*> userdata;
|
||||
/// A text describing the arugments to this function
|
||||
/// A text describing the arguments to this function
|
||||
std::string argumentText;
|
||||
/// A help text describing what the function does/
|
||||
std::string helpText;
|
||||
@@ -58,6 +58,8 @@ struct LuaLibrary {
|
||||
std::string name;
|
||||
/// The list of all C-based callback functions for this library
|
||||
std::vector<Function> functions;
|
||||
/// A list of all libraries that are children for this library
|
||||
std::vector<LuaLibrary> subLibraries;
|
||||
/// A list of script files that are executed for each Lua state
|
||||
std::vector<std::filesystem::path> scripts = std::vector<std::filesystem::path>();
|
||||
|
||||
@@ -77,6 +79,9 @@ struct LuaLibrary {
|
||||
|
||||
/// Comparison function that compares two LuaLibrary%s name
|
||||
bool operator<(const LuaLibrary& rhs) const;
|
||||
|
||||
/// Merges the contents of a second LuaLibrary into this LuaLibrary
|
||||
void merge(LuaLibrary rhs);
|
||||
};
|
||||
|
||||
} // namespace openspace::scripting
|
||||
|
||||
Reference in New Issue
Block a user