block coords passing to on_open
This commit is contained in:
@@ -207,11 +207,12 @@ bool scripting::on_item_break_block(Player* player, const ItemDef* item, int x,
|
||||
return false;
|
||||
}
|
||||
|
||||
void scripting::on_ui_open(UiDocument* layout, Inventory* inventory) {
|
||||
void scripting::on_ui_open(UiDocument* layout, Inventory* inventory, glm::ivec3 blockcoord) {
|
||||
std::string name = layout->getId()+".open";
|
||||
if (state->getglobal(name)) {
|
||||
state->pushinteger(inventory == nullptr ? 0 : inventory->getId());
|
||||
state->callNoThrow(1);
|
||||
state->pushivec3(blockcoord.x, blockcoord.y, blockcoord.z);
|
||||
state->callNoThrow(4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <string>
|
||||
#include <filesystem>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "../../delegates.h"
|
||||
|
||||
@@ -65,7 +66,7 @@ namespace scripting {
|
||||
bool on_item_break_block(Player* player, const ItemDef* item, int x, int y, int z);
|
||||
|
||||
/** Called on UI view show */
|
||||
void on_ui_open(UiDocument* layout, Inventory* inventory);
|
||||
void on_ui_open(UiDocument* layout, Inventory* inventory, glm::ivec3 blockcoord);
|
||||
/** Called on UI view close*/
|
||||
void on_ui_close(UiDocument* layout, Inventory* inventory);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user