Enable 16-slot hotbar

add purple hotbar select image
master
Vanessa Ezekowitz 2015-01-09 12:08:45 -05:00
parent 7d9c6ac283
commit 6de872a61b
4 changed files with 16 additions and 0 deletions

15
mods/default/commands.lua Normal file
View File

@ -0,0 +1,15 @@
minetest.register_chatcommand("hotbar", {
params = "[size]",
description = "Sets the size of your hotbar",
func = function(name, slots)
if slots == "" then slots = 16 end
if type(tonumber(slots)) ~= "number" or tonumber(slots) < 1 or tonumber(slots) > 23 then
minetest.chat_send_player(name, "[_] Hotbar size must be between 1 and 23.")
return
end
local player = minetest.get_player_by_name(name)
player:hud_set_hotbar_itemcount(tonumber(slots))
minetest.chat_send_player(name, "[_] Hotbar size set to " .. tonumber(slots) .. ".")
end,
})

View File

@ -44,5 +44,6 @@ dofile(minetest.get_modpath("default").."/crafting.lua")
dofile(minetest.get_modpath("default").."/mapgen.lua")
dofile(minetest.get_modpath("default").."/player.lua")
dofile(minetest.get_modpath("default").."/trees.lua")
dofile(minetest.get_modpath("default").."/commands.lua")
dofile(minetest.get_modpath("default").."/aliases.lua")
dofile(minetest.get_modpath("default").."/legacy.lua")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB