1
0
mirror of https://repo.or.cz/minetest_hbarmor.git synced 2025-06-29 14:50:38 +02:00

1 Commits

Author SHA1 Message Date
5fdc974ebd Ajoute message de chargement du mod dans le journal "action" 2018-12-25 16:56:31 +01:00
10 changed files with 24 additions and 17 deletions

View File

@ -1,6 +1,6 @@
# HUD bar for `3d_armor` [`hbarmor`]
* Version: 1.0.0
* Version: 0.4.0
## Description
This mod adds a simple HUD bar which displays the current damage
@ -16,8 +16,8 @@ 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 2
* 3D Armor [`3d_armor`] (tested with Minetest 5.0.0)
* HUD bars [`hudbars`], major version 1
* 3D Armor [`3d_armor`] (tested with Minetest 0.4.14)
## Licensing
This mod is entirly free softare.

3
depends.txt Normal file
View File

@ -0,0 +1,3 @@
hudbars
3d_armor
intllib?

1
description.txt Normal file
View File

@ -0,0 +1 @@
Adds a HUD bar displaying the current damage of the player's armor.

View File

@ -1,5 +1,9 @@
local S = minetest.get_translator("hbarmor")
local N = function(s) return s end
local S
if (minetest.get_modpath("intllib")) then
S = intllib.Getter()
else
S = function ( s ) return s end
end
if (not armor) or (not armor.def) then
minetest.log("error", "[hbarmor] Outdated 3d_armor version. Please update your version of 3d_armor!")
@ -61,7 +65,7 @@ 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, 100, hbarmor.autohide, N("@1: @2%"), { order = { "label", "value" }, textdomain = "hbarmor" } )
hb.register_hudbar("armor", 0xFFFFFF, S("Armor"), { icon = "hbarmor_icon.png", bgicon = "hbarmor_bgicon.png", bar = "hbarmor_bar.png" }, 0, 100, hbarmor.autohide, S("%s: %d%%"))
function hbarmor.get_armor(player)
if not player or not armor.def then
@ -148,3 +152,5 @@ minetest.register_globalstep(function(dtime)
end
if timer > 4 then timer = 0 end
end)
minetest.log("action", "[hbarmor] loaded.")

2
locale/de.txt Normal file
View File

@ -0,0 +1,2 @@
Armor = Panzerung
%s: %d%% = %s: %d%%

View File

@ -1,3 +0,0 @@
# textdomain:hbarmor
Armor=Panzerung
@1: @2%=@1: @2%

View File

@ -1,3 +0,0 @@
# textdomain:hbarmor
Armor=Armatura
@1: @2%=@1:@2%

4
locale/it.txt Normal file
View File

@ -0,0 +1,4 @@
Armor = Armatura
# Format string for displaying the armor. E.g. "Armor: 100%"
%s: %d%% =

View File

@ -1,5 +1,4 @@
# textdomain:hbarmor
Armor=
Armor =
# Format string for displaying the armor. E.g. "Armor: 100%"
@1: @2%=
%s: %d%% =

View File

@ -1,3 +1 @@
name = hbarmor
description = Adds a HUD bar displaying the current damage of the player's armor.
depends = hudbars, 3d_armor