summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlockMen <nmuelll@web.de>2013-08-25 21:10:03 +0200
committerBlockMen <nmuelll@web.de>2013-08-25 21:10:03 +0200
commit848c8074ef1a77dd142f89b366d249c642d4d6fa (patch)
treec6384b677bed08f8f942b74b4ff04aa7620bb156
parent9f15940aaf6a9ffb04689e35cc5dede83892c3b4 (diff)
Use builtin support of hotbar textures
-rw-r--r--README.txt2
-rw-r--r--changelog.txt8
-rw-r--r--hud.conf.example8
-rw-r--r--init.lua41
-rw-r--r--textures/crosshair.png (renamed from textures/hud_cross.png)bin663 -> 663 bytes
-rw-r--r--textures/hotbar.pngbin0 -> 29397 bytes
-rw-r--r--textures/hotbar_selected.pngbin0 -> 9079 bytes
-rw-r--r--textures/hud_inv_bar.pngbin8568 -> 0 bytes
-rw-r--r--textures/hud_inv_border.pngbin1691 -> 0 bytes
9 files changed, 7 insertions, 52 deletions
diff --git a/README.txt b/README.txt
index 69a5173..0803dd6 100644
--- a/README.txt
+++ b/README.txt
@@ -1,6 +1,6 @@
Minetest mod "Better HUD"
=========================
-version: 0.4 Beta
+version: 0.5 Beta
License of source code: WTFPL
-----------------------------
diff --git a/changelog.txt b/changelog.txt
index 5ec8593..e39ebfe 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,6 +1,5 @@
0.2 Beta
--------
-
- added support of costum config files
- you can eat max. 50% more than before (although it isnt shown in hunger bar)
- you get healed with 8 breads and more (in hunger bar) now
@@ -21,9 +20,14 @@
0.3 Beta
----------
-- added fancy borders of hud inventory bar (only for screenheight <= 1280)
+- added fancy borders of hud inventory bar (only for screenheight <= 800)
0.4 Beta
----------
- enabled drowning
+0.5 Beta
+----------
+- removed the fancy borders of hud inventory bar and moved to new native support
+- moved crosshair to native support tooo
+
diff --git a/hud.conf.example b/hud.conf.example
index dcaa6ae..ffa4cd7 100644
--- a/hud.conf.example
+++ b/hud.conf.example
@@ -9,14 +9,6 @@
HUD_ENABLE_HUNGER = true --enables/disables hunger
HUD_HUNGER_TICK = 300 --sets time for loosing 1/2 bread (of 10) (in seconds)
-HUD_ENABLE_FANCY_INVBAR = true --enables/disables fancy hud inventory border(s)
-
-
---
--- crosshair
---
-HUD_CROSSHAIR_POS = {x=0.5, y=0.5} --recommended to be 0.5,0.5 (centered)
-
--!NOTICE!--
-- >>if damage is disabled neither health bar nor hunger bar or breath bar is shown
diff --git a/init.lua b/init.lua
index cfd477a..7144604 100644
--- a/init.lua
+++ b/init.lua
@@ -11,16 +11,12 @@ local SAVE_INTERVAL = 0.5*60--currently useless
--default settings
HUD_ENABLE_HUNGER = minetest.setting_getbool("enable_damage")
HUD_HUNGER_TICK = 300
-HUD_CROSSHAIR_POS = {x=0.5, y=0.5}
HUD_HEALTH_POS = {x=0.5,y=1}
HUD_HEALTH_OFFSET = {x=-175,y=-60}
HUD_HUNGER_POS = {x=0.5,y=1}
HUD_HUNGER_OFFSET = {x=15,y=-60}
HUD_AIR_POS = {x=0.5,y=1}
HUD_AIR_OFFSET = {x=15,y=-75}
-HUD_ENABLE_FANCY_INVBAR = true
-HUD_INVBAR_POS = {x=0.5,y=1}
-HUD_INVBAR_OFFSET = {x=0,y=-16}
--load costum settings
local set = io.open(minetest.get_modpath("hud").."/hud.conf", "r")
@@ -37,32 +33,6 @@ end
local function costum_hud(player)
---crosshair
- player:hud_add({
- hud_elem_type = "image",
- text = "hud_cross.png",
- position = HUD_CROSSHAIR_POS,
- scale = {x=1, y=1},
- })
-
---invbar
- if HUD_ENABLE_FANCY_INVBAR then
- player:hud_add({
- hud_elem_type = "image",
- text = "hud_inv_bar.png",
- position = HUD_INVBAR_POS,
- scale = {x=1, y=1},
- offset = HUD_INVBAR_OFFSET,
- })
-
- inv_hud[player:get_player_name()] = player:hud_add({
- hud_elem_type = "image",
- text = "hud_inv_border.png",
- position = HUD_INVBAR_POS,
- scale = {x=1, y=1},
- offset = {x=-127+36*(player:get_wield_index()-1),y=-18},
- })
- end
if minetest.setting_getbool("enable_damage") then
--hunger
@@ -135,17 +105,6 @@ local function update_fast(player)
local air = player:get_breath()*2
if player:get_breath() >= 11 then air = 0 end
player:hud_change(air_hud[player:get_player_name()], "number", air)
---hotbar
- if HUD_ENABLE_FANCY_INVBAR then
- if inv_hud[player:get_player_name()] ~= nil then player:hud_remove(inv_hud[player:get_player_name()]) end
- inv_hud[player:get_player_name()] = player:hud_add({
- hud_elem_type = "image",
- text = "hud_inv_border.png",
- position = HUD_INVBAR_POS,
- scale = {x=1, y=1},
- offset = {x=-127+36*(player:get_wield_index()-1),y=-18},
- })
- end
end
diff --git a/textures/hud_cross.png b/textures/crosshair.png
index 5822e71..5822e71 100644
--- a/textures/hud_cross.png
+++ b/textures/crosshair.png
Binary files differ
diff --git a/textures/hotbar.png b/textures/hotbar.png
new file mode 100644
index 0000000..749ec89
--- /dev/null
+++ b/textures/hotbar.png
Binary files differ
diff --git a/textures/hotbar_selected.png b/textures/hotbar_selected.png
new file mode 100644
index 0000000..22e538a
--- /dev/null
+++ b/textures/hotbar_selected.png
Binary files differ
diff --git a/textures/hud_inv_bar.png b/textures/hud_inv_bar.png
deleted file mode 100644
index de6607e..0000000
--- a/textures/hud_inv_bar.png
+++ /dev/null
Binary files differ
diff --git a/textures/hud_inv_border.png b/textures/hud_inv_border.png
deleted file mode 100644
index d932c10..0000000
--- a/textures/hud_inv_border.png
+++ /dev/null
Binary files differ