mirror of
https://github.com/minetest/minetest_game.git
synced 2024-11-05 23:33:51 +01:00
Creative: Add global variable creative.formspec_add
This pull adds a new global variable called creative.formspec_add that will allow mods to add to the creative inventory screen without the need to fork the mod altogether. Simple solution that works already for inventory_plus' BACK button
This commit is contained in:
parent
8c3f96d738
commit
8ea031ef77
@ -98,6 +98,8 @@ local trash = minetest.create_detached_inventory("creative_trash", {
|
|||||||
})
|
})
|
||||||
trash:set_size("main", 1)
|
trash:set_size("main", 1)
|
||||||
|
|
||||||
|
creative.formspec_add = ""
|
||||||
|
|
||||||
creative.set_creative_formspec = function(player, start_i)
|
creative.set_creative_formspec = function(player, start_i)
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
local inv = player_inventory[player_name]
|
local inv = player_inventory[player_name]
|
||||||
@ -128,6 +130,7 @@ creative.set_creative_formspec = function(player, start_i)
|
|||||||
"table[6.05,3.35;1.15,0.5;pagenum;#FFFF00," .. tostring(pagenum) .. ",#FFFFFF,/ " .. tostring(pagemax) .. "]" ..
|
"table[6.05,3.35;1.15,0.5;pagenum;#FFFF00," .. tostring(pagenum) .. ",#FFFFFF,/ " .. tostring(pagemax) .. "]" ..
|
||||||
default.get_hotbar_bg(0,4.7) ..
|
default.get_hotbar_bg(0,4.7) ..
|
||||||
default.gui_bg .. default.gui_bg_img .. default.gui_slots
|
default.gui_bg .. default.gui_bg_img .. default.gui_slots
|
||||||
|
.. creative.formspec_add
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user