diff --git a/mods/HUD/hbarmor/README.md b/mods/HUD/hbarmor/README.md deleted file mode 100644 index c410a9b6a0..0000000000 --- a/mods/HUD/hbarmor/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# HUD bar for `3d_armor` [`hbarmor`] - -* Version: 0.4.0 - -## Description -This mod adds a simple HUD bar which displays the current damage -of the player's armor (from the 3D Armor [`3d_armor`] mod) as a percentage (rounded). - -100% armor means the armor is in perfect shape. 0% means the armor is almost destroyed -or non-existant. Note that to reach 100%, the player must wear at least 4 different -pieces of armor in perfect shape. - -The armor bar also does not tell anything about the armor's strength, -only how worn out it already is. - -By default, the armor bar is hidden if the player wears no armor. - -## Dependencies -* HUD bars [`hudbars`], major version 1 -* 3D Armor [`3d_armor`] (tested with Minetest 0.4.14) - -## Licensing -This mod is entirly free softare. - -### Source code - -* License: MIT License (see below) -* Authors: Wuzzy, forked from the mod “Better HUD (and hunger)” [`hud`] by BlockMen (2013-2014) - -### Textures - -* `hbarmor_icon.png`—Stu ([CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/)), modified by BlockMen -* `hbarmor_bgicon.png`—Stu (CC BY-SA 3.0), modified by BlockMen -* `hbarmor_bar.png`—Wuzzy (MIT License) - -Everything else is under the MIT License: -© Copyright BlockMen (2013-2014) - -This program is free software. It comes without any warranty, to -the extent permitted by applicable law. You can redistribute it -and/or modify it under the terms of the MIT License. -See for more details. diff --git a/mods/HUD/hbarmor/screenshot.png b/mods/HUD/hbarmor/screenshot.png deleted file mode 100644 index 907cf900de..0000000000 Binary files a/mods/HUD/hbarmor/screenshot.png and /dev/null differ diff --git a/mods/HUD/hbarmor/settingtypes.txt b/mods/HUD/hbarmor/settingtypes.txt deleted file mode 100644 index 067d5045f9..0000000000 --- a/mods/HUD/hbarmor/settingtypes.txt +++ /dev/null @@ -1,7 +0,0 @@ -#If true, automatically hides the armor HUD bar when the player wears no -#armor. Otherwise, the armor bar shows “0%”. -hbarmor_autohide (Automatically hide armor HUD bar) bool true - -#Time difference in seconds between updates to the armor HUD bar. -#Increase this number for slow servers. -hbarmor_tick (Armor HUD bar update frequency) float 0.1 0.0 4.0 diff --git a/mods/HUD/mcl_hbarmor/README.md b/mods/HUD/mcl_hbarmor/README.md new file mode 100644 index 0000000000..0f4816e4af --- /dev/null +++ b/mods/HUD/mcl_hbarmor/README.md @@ -0,0 +1,26 @@ +# MineClone 2 HUD bar for `3d_armor` [`mcl_hbarmor`] + +## Description +This mod adds a simple HUD bar which displays the player's armor points. +The players has 0-20 armor points. + +The armor bar is hidden if the player wears no armor. + +## Licensing +This mod is entirly free softare. + +### Source code +License: MIT License (see below) + +### Textures + +See MineClone 2 license. + +### MIT License +Everything else is under the MIT License: +© Copyright BlockMen (2013-2014) + +This program is free software. It comes without any warranty, to +the extent permitted by applicable law. You can redistribute it +and/or modify it under the terms of the MIT License. +See for more details. diff --git a/mods/HUD/hbarmor/description.txt b/mods/HUD/mcl_hbarmor/description.txt similarity index 100% rename from mods/HUD/hbarmor/description.txt rename to mods/HUD/mcl_hbarmor/description.txt diff --git a/mods/HUD/hbarmor/init.lua b/mods/HUD/mcl_hbarmor/init.lua similarity index 64% rename from mods/HUD/hbarmor/init.lua rename to mods/HUD/mcl_hbarmor/init.lua index c2530b61ff..f05d50459d 100644 --- a/mods/HUD/hbarmor/init.lua +++ b/mods/HUD/mcl_hbarmor/init.lua @@ -1,33 +1,27 @@ -local S = minetest.get_translator("hbarmor") +local S = minetest.get_translator("mcl_hbarmor") if (not armor) or (not armor.def) then - minetest.log("error", "[hbarmor] Outdated 3d_armor version. Please update your version of 3d_armor!") + minetest.log("error", "[mcl_hbarmor] Outdated 3d_armor version. Please update your version of 3d_armor!") end -local hbarmor = {} +local mcl_hbarmor = {} -- HUD statbar values -hbarmor.armor = {} +mcl_hbarmor.armor = {} -- Stores if player's HUD bar has been initialized so far. -hbarmor.player_active = {} +mcl_hbarmor.player_active = {} -- Time difference in seconds between updates to the HUD armor bar. -- Increase this number for slow servers. -hbarmor.tick = 0.1 +mcl_hbarmor.tick = 0.1 -- If true, the armor bar is hidden when the player does not wear any armor -hbarmor.autohide = true +mcl_hbarmor.autohide = true ---load custom settings -local set = minetest.settings:get_bool("hbarmor_autohide") -if set ~= nil then - hbarmor.autohide = set -end - -set = minetest.settings:get("hbarmor_tick") +set = minetest.settings:get("mcl_hbarmor_tick") if tonumber(set) ~= nil then - hbarmor.tick = tonumber(set) + mcl_hbarmor.tick = tonumber(set) end @@ -43,17 +37,17 @@ local function custom_hud(player) local name = player:get_player_name() if minetest.settings:get_bool("enable_damage") then - local ret = hbarmor.get_armor(player) + local ret = mcl_hbarmor.get_armor(player) if ret == false then - minetest.log("error", "[hbarmor] Call to hbarmor.get_armor in custom_hud returned with false!") + minetest.log("error", "[mcl_hbarmor] Call to mcl_hbarmor.get_armor in custom_hud returned with false!") return end - local arm = tonumber(hbarmor.armor[name]) + local arm = tonumber(mcl_hbarmor.armor[name]) if not arm then arm = 0 end local hide - if hbarmor.autohide then + if mcl_hbarmor.autohide then hide = must_hide(name, arm) else hide = false @@ -63,9 +57,9 @@ local function custom_hud(player) end --register and define armor HUD bar -hb.register_hudbar("armor", 0xFFFFFF, S("Armor"), { icon = "hbarmor_icon.png", bgicon = "hbarmor_bgicon.png", bar = "hbarmor_bar.png" }, 0, 20, hbarmor.autohide) +hb.register_hudbar("armor", 0xFFFFFF, S("Armor"), { icon = "hbarmor_icon.png", bgicon = "hbarmor_bgicon.png", bar = "hbarmor_bar.png" }, 0, 20, mcl_hbarmor.autohide) -function hbarmor.get_armor(player) +function mcl_hbarmor.get_armor(player) if not player or not armor.def then return false end @@ -74,25 +68,25 @@ function hbarmor.get_armor(player) if not pts then return false else - hbarmor.set_armor(name, pts) + mcl_hbarmor.set_armor(name, pts) end return true end -function hbarmor.set_armor(player_name, pts) - hbarmor.armor[player_name] = math.max(0, math.min(20, pts)) +function mcl_hbarmor.set_armor(player_name, pts) + mcl_hbarmor.armor[player_name] = math.max(0, math.min(20, pts)) end -- update hud elemtens if value has changed local function update_hud(player) local name = player:get_player_name() --armor - local arm = tonumber(hbarmor.armor[name]) + local arm = tonumber(mcl_hbarmor.armor[name]) if not arm then arm = 0 - hbarmor.armor[name] = 0 + mcl_hbarmor.armor[name] = 0 end - if hbarmor.autohide then + if mcl_hbarmor.autohide then -- hide armor bar completely when there is none if must_hide(name, arm) then hb.hide_hudbar(player, "armor") @@ -108,12 +102,12 @@ end minetest.register_on_joinplayer(function(player) local name = player:get_player_name() custom_hud(player) - hbarmor.player_active[name] = true + mcl_hbarmor.player_active[name] = true end) minetest.register_on_leaveplayer(function(player) local name = player:get_player_name() - hbarmor.player_active[name] = false + mcl_hbarmor.player_active[name] = false end) local main_timer = 0 @@ -121,15 +115,15 @@ local timer = 0 minetest.register_globalstep(function(dtime) main_timer = main_timer + dtime timer = timer + dtime - if main_timer > hbarmor.tick or timer > 4 then + if main_timer > mcl_hbarmor.tick or timer > 4 then if minetest.settings:get_bool("enable_damage") then - if main_timer > hbarmor.tick then main_timer = 0 end + if main_timer > mcl_hbarmor.tick then main_timer = 0 end for _,player in ipairs(minetest.get_connected_players()) do local name = player:get_player_name() - if hbarmor.player_active[name] == true then - local ret = hbarmor.get_armor(player) + if mcl_hbarmor.player_active[name] == true then + local ret = mcl_hbarmor.get_armor(player) if ret == false then - minetest.log("error", "[hbarmor] Call to hbarmor.get_armor in globalstep returned with false!") + minetest.log("error", "[mcl_hbarmor] Call to mcl_hbarmor.get_armor in globalstep returned with false!") end -- update all hud elements update_hud(player) diff --git a/mods/HUD/hbarmor/locale/hbarmor.de.tr b/mods/HUD/mcl_hbarmor/locale/hbarmor.de.tr similarity index 100% rename from mods/HUD/hbarmor/locale/hbarmor.de.tr rename to mods/HUD/mcl_hbarmor/locale/hbarmor.de.tr diff --git a/mods/HUD/hbarmor/locale/hbarmor.es.tr b/mods/HUD/mcl_hbarmor/locale/hbarmor.es.tr similarity index 100% rename from mods/HUD/hbarmor/locale/hbarmor.es.tr rename to mods/HUD/mcl_hbarmor/locale/hbarmor.es.tr diff --git a/mods/HUD/hbarmor/locale/hbarmor.it.tr b/mods/HUD/mcl_hbarmor/locale/hbarmor.it.tr similarity index 100% rename from mods/HUD/hbarmor/locale/hbarmor.it.tr rename to mods/HUD/mcl_hbarmor/locale/hbarmor.it.tr diff --git a/mods/HUD/hbarmor/locale/template.txt b/mods/HUD/mcl_hbarmor/locale/template.txt similarity index 100% rename from mods/HUD/hbarmor/locale/template.txt rename to mods/HUD/mcl_hbarmor/locale/template.txt diff --git a/mods/HUD/hbarmor/mod.conf b/mods/HUD/mcl_hbarmor/mod.conf similarity index 59% rename from mods/HUD/hbarmor/mod.conf rename to mods/HUD/mcl_hbarmor/mod.conf index 80d3891044..4d595c8c91 100644 --- a/mods/HUD/hbarmor/mod.conf +++ b/mods/HUD/mcl_hbarmor/mod.conf @@ -1,2 +1,2 @@ -name = hbarmor +name = mcl_hbarmor depends = hudbars, 3d_armor diff --git a/mods/HUD/mcl_hbarmor/settingtypes.txt b/mods/HUD/mcl_hbarmor/settingtypes.txt new file mode 100644 index 0000000000..cfd875dfe2 --- /dev/null +++ b/mods/HUD/mcl_hbarmor/settingtypes.txt @@ -0,0 +1,3 @@ +#Time difference in seconds between updates to the armor HUD bar. +#Increase this number for slow servers. +hbarmor_tick (Armor HUD bar update frequency) float 0.1 0.0 4.0 diff --git a/mods/HUD/hbarmor/textures/hbarmor_bar.png b/mods/HUD/mcl_hbarmor/textures/hbarmor_bar.png similarity index 100% rename from mods/HUD/hbarmor/textures/hbarmor_bar.png rename to mods/HUD/mcl_hbarmor/textures/hbarmor_bar.png diff --git a/mods/HUD/hbarmor/textures/hbarmor_bgicon.png b/mods/HUD/mcl_hbarmor/textures/hbarmor_bgicon.png similarity index 100% rename from mods/HUD/hbarmor/textures/hbarmor_bgicon.png rename to mods/HUD/mcl_hbarmor/textures/hbarmor_bgicon.png diff --git a/mods/HUD/hbarmor/textures/hbarmor_icon.png b/mods/HUD/mcl_hbarmor/textures/hbarmor_icon.png similarity index 100% rename from mods/HUD/hbarmor/textures/hbarmor_icon.png rename to mods/HUD/mcl_hbarmor/textures/hbarmor_icon.png diff --git a/tools/Conversion_Table.csv b/tools/Conversion_Table.csv index 8444b0227d..ab4a945190 100644 --- a/tools/Conversion_Table.csv +++ b/tools/Conversion_Table.csv @@ -1,7 +1,7 @@ Source path,Source file,Target path,Target file,xs,ys,xl,yl,xt,yt,Blacklisted? /assets/minecraft/textures/particle,particles.png,/mods/CORE/mcl_particles/textures,mcl_particles_bubble.png,0,16,8,8,0,0,y -/assets/minecraft/textures/gui,icons.png,/mods/HUD/hbarmor/textures,hbarmor_icon.png,34,9,9,9,0,0,y -/assets/minecraft/textures/gui,icons.png,/mods/HUD/hbarmor/textures,hbarmor_bgicon.png,16,9,9,9,0,0,y +/assets/minecraft/textures/gui,icons.png,/mods/HUD/mcl_hbarmor/textures,hbarmor_icon.png,34,9,9,9,0,0,y +/assets/minecraft/textures/gui,icons.png,/mods/HUD/mcl_hbarmor/textures,hbarmor_bgicon.png,16,9,9,9,0,0,y /assets/minecraft/textures/gui,icons.png,/mods/HUD/hudbars/textures,hudbars_icon_health.png,52,0,9,9,0,0,y /assets/minecraft/textures/gui,icons.png,/mods/HUD/hudbars/textures,hudbars_bgicon_health.png,16,0,9,9,0,0,y /assets/minecraft/textures/gui,icons.png,/mods/HUD/hudbars/textures,hudbars_icon_breath.png,16,18,9,9,0,0,y