Skip to content

Commit

Permalink
Creative: Add global variable creative.formspec_add
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tenplus1 authored and paramat committed May 7, 2016
1 parent 8c3f96d commit 8ea031e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mods/creative/init.lua
Expand Up @@ -98,6 +98,8 @@ local trash = minetest.create_detached_inventory("creative_trash", {
})
trash:set_size("main", 1)

creative.formspec_add = ""

creative.set_creative_formspec = function(player, start_i)
local player_name = player:get_player_name()
local inv = player_inventory[player_name]
Expand Down Expand Up @@ -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) .. "]" ..
default.get_hotbar_bg(0,4.7) ..
default.gui_bg .. default.gui_bg_img .. default.gui_slots
.. creative.formspec_add
)
end

Expand Down

3 comments on commit 8ea031e

@davisonio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this to game_api.txt?

@sofar
Copy link
Contributor

@sofar sofar commented on 8ea031e May 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@davisonio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Done

Please sign in to comment.