Skip to content

Commit 8ea031e

Browse files
tenplus1paramat
authored andcommittedMay 7, 2016
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
1 parent 8c3f96d commit 8ea031e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎mods/creative/init.lua

+3
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ local trash = minetest.create_detached_inventory("creative_trash", {
9898
})
9999
trash:set_size("main", 1)
100100

101+
creative.formspec_add = ""
102+
101103
creative.set_creative_formspec = function(player, start_i)
102104
local player_name = player:get_player_name()
103105
local inv = player_inventory[player_name]
@@ -128,6 +130,7 @@ creative.set_creative_formspec = function(player, start_i)
128130
"table[6.05,3.35;1.15,0.5;pagenum;#FFFF00," .. tostring(pagenum) .. ",#FFFFFF,/ " .. tostring(pagemax) .. "]" ..
129131
default.get_hotbar_bg(0,4.7) ..
130132
default.gui_bg .. default.gui_bg_img .. default.gui_slots
133+
.. creative.formspec_add
131134
)
132135
end
133136

3 commit comments

Comments
 (3)

davisonio commented on May 17, 2016

@davisonio
Contributor

Can you add this to game_api.txt?

sofar commented on May 17, 2016

@sofar
Contributor

please open an issue for this request so it can be tracked!

davisonio commented on May 17, 2016

@davisonio
Contributor

please open an issue for this request so it can be tracked!

Done

Please sign in to comment.