Compare commits

...

5 Commits

Author SHA1 Message Date
Zeg9 19a4faf09e Better positionning on survival mode 2015-04-08 13:02:54 +02:00
Zeg9 dc16637d32 Only allow 2 columns even when no creative
fix from @tenplus1, thank you
and sorry for the huge delay
2015-04-04 21:11:10 +02:00
Zeg9 7b806d6ee7 Add icon for home_gui 2013-06-09 12:48:11 +02:00
Zeg9 cb84f79e50 Display 6 icons correctly in creative, instead of 3 2013-06-09 12:47:45 +02:00
Zeg9 b99c0f6dc7 Update TODO 2013-06-08 19:19:14 +02:00
2 changed files with 6 additions and 7 deletions

View File

@ -11,9 +11,8 @@ License: GPLv3
--[[
TODO:
* Include a few button textures, especially for "abandoned" mods
* Limit the number of buttons displayed, and then:
* Multiple button pages (inventory can only display 9 buttons, and creative 6)
* Multiple button pages (inventory can only display 6 buttons)
* Fallback to text if no image is present ?
]]--
@ -22,7 +21,7 @@ TODO:
inventory_plus = {}
-- tell that we are inventory++, not inventory_plus
-- ...so mods know if they can use our functions
-- ...so mods know if they can use our functions like remove_button
inventory_plus.plusplus = true
-- define buttons
@ -74,7 +73,7 @@ end
-- get_formspec
inventory_plus.get_formspec = function(player,page)
local get_buttons = function(ox,oy)
local get_buttons = function(ox,oy,mx) -- origin x, origin y, max x
if not inventory_plus.buttons[player:get_player_name()] then
return ""
end
@ -83,7 +82,7 @@ inventory_plus.get_formspec = function(player,page)
for _, i in ipairs(inventory_plus.buttons[player:get_player_name()]) do
formspec = formspec .. "image_button["..x..","..y..";1,1;inventory_plus_"..i..".png;"..i..";]"
x=x+1
if x >= ox+3 then
if x >= ox+mx then
y = y+1
x = ox
end
@ -94,10 +93,10 @@ inventory_plus.get_formspec = function(player,page)
if page=="main" then
if minetest.setting_getbool("creative_mode") then
return player:get_inventory_formspec()
.. get_buttons(5,0)
.. get_buttons(6,0,2)
else
return inventory_plus.inventory[player:get_player_name()]
.. get_buttons(0,0)
.. get_buttons(0,.5,2)
end
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B