Reputation: 291
I have a userdatum called LuaSettings. This userdatum
, except functions, has one member - raw
. The raw
member is a common Lua table. The usage of this is following:
First, userdatum is pushed on the stack as variable settings
Then Lua file is executed and the userdatum gets modified.
-- LuaSettings:register function modifies the data.raw table
settings:register {
{
name = "Fuzz",
hello = "world"
},
{
name = "Buzz"
hello = "there"
}
}
-- User is allowed to do something like this as well:
settings.raw["Fuzz"].hello = ""
settings.raw
table is used by C++ code.How to do this? Is this even possible? How do I define the size of this userdatum?
Upvotes: 1
Views: 47