MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / setCallbacks

Method setCallbacks

source/core/StarLua.cpp:103–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void LuaContext::setCallbacks(String const& tableName, LuaCallbacks const& callbacks) const {
104 auto& eng = engine();
105 if (LuaContext::contains(tableName))
106 return;
107
108 auto callbackTable = eng.createTable();
109 for (auto const& p : callbacks.callbacks())
110 callbackTable.set(p.first, eng.createWrappedFunction(p.second));
111 LuaContext::set(tableName, callbackTable);
112}
113
114LuaString LuaContext::createString(String const& str) {
115 return engine().createString(str);

Callers 9

updateVersionedJsonMethod · 0.80
itemConfigMethod · 0.80
createContextMethod · 0.80
addCallbacksMethod · 0.80
contextSetupMethod · 0.80
mainFunction · 0.80
TESTFunction · 0.80
TESTFunction · 0.80
AssetsMethod · 0.80

Calls 4

createWrappedFunctionMethod · 0.80
createTableMethod · 0.60
setFunction · 0.50
setMethod · 0.45

Tested by 2

TESTFunction · 0.64
TESTFunction · 0.64