summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dreambuilder_mp_extras/depends.txt1
-rw-r--r--dreambuilder_mp_extras/init.lua28
-rw-r--r--dreambuilder_mp_extras/textures/gui_hb_bg.pngbin0 -> 474 bytes
-rw-r--r--dreambuilder_mp_extras/textures/gui_hb_bg_16.pngbin0 -> 764 bytes
-rw-r--r--dreambuilder_mp_extras/textures/gui_hotbar.pngbin0 -> 75 bytes
-rw-r--r--dreambuilder_mp_extras/textures/gui_hotbar_selected.pngbin0 -> 5323 bytes
-rw-r--r--modpack.txt0
7 files changed, 29 insertions, 0 deletions
diff --git a/dreambuilder_mp_extras/depends.txt b/dreambuilder_mp_extras/depends.txt
new file mode 100644
index 0000000..4ad96d5
--- /dev/null
+++ b/dreambuilder_mp_extras/depends.txt
@@ -0,0 +1 @@
+default
diff --git a/dreambuilder_mp_extras/init.lua b/dreambuilder_mp_extras/init.lua
new file mode 100644
index 0000000..168bcf5
--- /dev/null
+++ b/dreambuilder_mp_extras/init.lua
@@ -0,0 +1,28 @@
+
+local hotbar_size = minetest.setting_get("hotbar_size") or 16
+
+local function resize_hotbar(size)
+ if size > 8 then return "gui_hb_bg_16.png" end
+ return "gui_hb_bg.png"
+end
+
+minetest.register_on_joinplayer(function(player)
+ player:hud_set_hotbar_itemcount(hotbar_size)
+ minetest.after(0.5,function()
+ player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
+ player:hud_set_hotbar_image(resize_hotbar(hotbar_size))
+ end)
+end)
+
+minetest.register_chatcommand("hotbar", {
+ params = "[size]",
+ description = "Sets the size of your hotbar",
+ func = function(name, slots)
+ if slots ~= "8" then slots = "16" 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) .. ".")
+ player:hud_set_hotbar_image(resize_hotbar(tonumber(slots)))
+ end,
+})
+
diff --git a/dreambuilder_mp_extras/textures/gui_hb_bg.png b/dreambuilder_mp_extras/textures/gui_hb_bg.png
new file mode 100644
index 0000000..9389700
--- /dev/null
+++ b/dreambuilder_mp_extras/textures/gui_hb_bg.png
Binary files differ
diff --git a/dreambuilder_mp_extras/textures/gui_hb_bg_16.png b/dreambuilder_mp_extras/textures/gui_hb_bg_16.png
new file mode 100644
index 0000000..2624cd0
--- /dev/null
+++ b/dreambuilder_mp_extras/textures/gui_hb_bg_16.png
Binary files differ
diff --git a/dreambuilder_mp_extras/textures/gui_hotbar.png b/dreambuilder_mp_extras/textures/gui_hotbar.png
new file mode 100644
index 0000000..4d7beb8
--- /dev/null
+++ b/dreambuilder_mp_extras/textures/gui_hotbar.png
Binary files differ
diff --git a/dreambuilder_mp_extras/textures/gui_hotbar_selected.png b/dreambuilder_mp_extras/textures/gui_hotbar_selected.png
new file mode 100644
index 0000000..abb75cc
--- /dev/null
+++ b/dreambuilder_mp_extras/textures/gui_hotbar_selected.png
Binary files differ
diff --git a/modpack.txt b/modpack.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modpack.txt