mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
rewriting on_inventory_interact
This commit is contained in:
parent
f2684edf1f
commit
8ae35c0a5e
6 changed files with 62 additions and 21 deletions
|
|
@ -93,17 +93,18 @@ void scripting::on_frontend_close() {
|
|||
scripting::post_processing = nullptr;
|
||||
}
|
||||
|
||||
void scripting::on_inventory_interact(int invid, int slot, int action) {
|
||||
void scripting::on_inventory_interact(int invid, int slot, int mode, int action) {
|
||||
auto L = lua::get_main_state();
|
||||
for (auto& pack : content_control->getAllContentPacks()) {
|
||||
lua::emit_event(
|
||||
L,
|
||||
pack.id + ":.hudinventoryinteract",
|
||||
pack.id + ":.inventoryinteract",
|
||||
[&](lua::State* L) {
|
||||
lua::pushinteger(L, invid);
|
||||
lua::pushinteger(L, slot);
|
||||
lua::pushinteger(L, mode);
|
||||
lua::pushinteger(L, action);
|
||||
return 3;
|
||||
return 4;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -125,7 +126,7 @@ void scripting::load_hud_script(
|
|||
register_event(env, "on_hud_open", packid + ":.hudopen");
|
||||
register_event(env, "on_hud_render", packid + ":.hudrender");
|
||||
register_event(env, "on_hud_close", packid + ":.hudclose");
|
||||
register_event(env, "on_hud_inventory_interact", packid + ":.hudinventoryinteract");
|
||||
register_event(env, "on_inventory_interact", packid + ":.inventoryinteract");
|
||||
}
|
||||
|
||||
gui::PageLoaderFunc scripting::create_page_loader() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue