mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
missing content report moved to xml
This commit is contained in:
parent
61ca91b525
commit
132016d33f
9 changed files with 78 additions and 44 deletions
|
|
@ -226,12 +226,17 @@ bool scripting::on_item_break_block(Player* player, const ItemDef* item, int x,
|
|||
});
|
||||
}
|
||||
|
||||
void scripting::on_ui_open(UiDocument* layout, Inventory* inventory, glm::ivec3 blockcoord) {
|
||||
void scripting::on_ui_open(
|
||||
UiDocument* layout,
|
||||
std::vector<std::unique_ptr<dynamic::Value>> args
|
||||
) {
|
||||
auto argsptr = std::make_shared<std::vector<std::unique_ptr<dynamic::Value>>>(std::move(args));
|
||||
std::string name = layout->getId() + ".open";
|
||||
emit_event(name, [inventory, blockcoord] (lua::LuaState* state) {
|
||||
state->pushinteger(inventory == nullptr ? 0 : inventory->getId());
|
||||
state->pushivec3(blockcoord.x, blockcoord.y, blockcoord.z);
|
||||
return 4;
|
||||
emit_event(name, [=] (lua::LuaState* state) {
|
||||
for (const auto& value : *argsptr) {
|
||||
state->pushvalue(*value);
|
||||
}
|
||||
return argsptr->size();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue