Time |
Nick |
Message |
00:15 |
|
Nitori joined #minetest-mods |
00:33 |
|
dhasenan_ joined #minetest-mods |
00:54 |
|
Nitori joined #minetest-mods |
01:17 |
|
Nitori joined #minetest-mods |
01:57 |
|
zlsa joined #minetest-mods |
02:01 |
|
DuDraig joined #minetest-mods |
02:08 |
DuDraig |
For a node with an inventory that uses on_rightclick() to show the associated formspec (not in meta formspec), how do you receive field actions? The node on_receive_fields is never called despite the formspec using metanode with the node location. register_on_player_receive_fields does not seem usable because when would you use for node code when the player logs in. Or am I missing something? |
02:09 |
DuDraig |
The idea is to implement a node inventory that will not show if the user is not authorized but that can use buttons. |
02:11 |
DuDraig |
*"use it for" |
04:12 |
|
Nitori joined #minetest-mods |
04:16 |
DuDraig |
If you use register_on_player_receive_fields(player, formName, fields), how do you pass the position of the node from the code that does the show_formspec() in on_rightclick() so you can get the node meta data to manipulate the node inventory? |
04:19 |
|
Miner_48er joined #minetest-mods |
05:03 |
DuDraig |
I figured out one way, but it's really ugly. You create a table in your mod table keyed by the player name with the node pos as the value (my_mod.formNodePosition = {}). In on_rightclick, you set "my_mod.formNodePosition[player:get_player_name()] = pointed_thing.under". In the function given to register_on_player_received_fields(), you get the node pos from that table "local meta = minetest.get_meta(my_mod.formNodePosition[player: |
05:03 |
DuDraig |
get_player_name()])". It works but... Please tell me there's a better way. |
06:55 |
|
FR^2 joined #minetest-mods |
08:11 |
|
LazyJ joined #minetest-mods |
12:02 |
|
Nitori joined #minetest-mods |
12:17 |
|
PilzAdam joined #minetest-mods |
12:31 |
|
DuDraig joined #minetest-mods |
13:44 |
|
Nitori joined #minetest-mods |
14:34 |
|
zlsa joined #minetest-mods |
15:36 |
|
rubenwardy joined #minetest-mods |
15:38 |
|
zlsa joined #minetest-mods |
17:20 |
|
Nitori joined #minetest-mods |
17:38 |
|
zlsa joined #minetest-mods |
18:02 |
|
dhasenan_ joined #minetest-mods |
18:19 |
|
Nitori joined #minetest-mods |
18:27 |
|
Nitori joined #minetest-mods |
20:06 |
|
Miner_48er joined #minetest-mods |
21:51 |
|
Nitori joined #minetest-mods |
23:22 |
|
phantombeta joined #minetest-mods |