summaryrefslogtreecommitdiff
path: root/worldedit_gui
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-04-01 22:10:20 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-04-01 22:42:02 -0400
commit86ad3e7c6a37699f7f8297a387bf08af74e36629 (patch)
treedc368b1eaf2cc09b9df2200250890b3038d8cf2d /worldedit_gui
parent888b0ebfec8c2eff9015163549a7e47443cb8665 (diff)
downloaddreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.tar
dreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.tar.gz
dreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.tar.bz2
dreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.tar.xz
dreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.zip
Update all core mods
Diffstat (limited to 'worldedit_gui')
-rw-r--r--worldedit_gui/init.lua17
1 files changed, 15 insertions, 2 deletions
diff --git a/worldedit_gui/init.lua b/worldedit_gui/init.lua
index da54f7b..5f602ac 100644
--- a/worldedit_gui/init.lua
+++ b/worldedit_gui/init.lua
@@ -143,8 +143,21 @@ else --fallback button
if not player then --this is in case the player signs off while the media is loading
return
end
- if (minetest.check_player_privs(name, {creative=true}) or minetest.setting_getbool("creative_mode")) and creative_inventory then --creative_inventory is active, add button to modified formspec
- formspec = player:get_inventory_formspec() .. "image_button[6,0;1,1;inventory_plus_worldedit_gui.png;worldedit_gui;]"
+ if (minetest.check_player_privs(name, {creative=true}) or
+ minetest.setting_getbool("creative_mode")) and
+ creative then --creative is active, add button to modified formspec
+ local creative_formspec = player:get_inventory_formspec()
+ local tab_id = tonumber(creative_formspec:match("tabheader%[.-;(%d+)%;"))
+
+ if tab_id == 1 then
+ formspec = creative_formspec ..
+ "image_button[0,1;1,1;inventory_plus_worldedit_gui.png;worldedit_gui;]"
+ elseif not tab_id then
+ formspec = creative_formspec ..
+ "image_button[6,0;1,1;inventory_plus_worldedit_gui.png;worldedit_gui;]"
+ else
+ return
+ end
else
formspec = formspec .. "image_button[0,0;1,1;inventory_plus_worldedit_gui.png;worldedit_gui;]"
end