mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 16:20:21 +00:00
Added delayed action
This commit is contained in:
parent
41a2c82f93
commit
0e6155c529
@ -280,8 +280,9 @@ namespace MWLua
|
|||||||
|
|
||||||
if constexpr (std::is_same_v<ObjectT, GObject>)
|
if constexpr (std::is_same_v<ObjectT, GObject>)
|
||||||
{ // Only for global scripts
|
{ // Only for global scripts
|
||||||
objectT["setScale"] = [](const GObject& object, float scale) {
|
objectT["setScale"] = [context](const GObject& object, float scale) {
|
||||||
MWBase::Environment::get().getWorld()->scaleObject(object.ptr(), scale);
|
context.mLuaManager->addAction(
|
||||||
|
[object, scale] { MWBase::Environment::get().getWorld()->scaleObject(object.ptr(), scale); });
|
||||||
};
|
};
|
||||||
objectT["addScript"] = [context](const GObject& object, std::string_view path, sol::object initData) {
|
objectT["addScript"] = [context](const GObject& object, std::string_view path, sol::object initData) {
|
||||||
const LuaUtil::ScriptsConfiguration& cfg = context.mLua->getConfiguration();
|
const LuaUtil::ScriptsConfiguration& cfg = context.mLua->getConfiguration();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user