From cc0827b25cf84fe5d7cef366de6bda9ab917beef Mon Sep 17 00:00:00 2001 From: dicebox Date: Fri, 10 Feb 2017 18:25:51 +0100 Subject: [PATCH] git subrepo clone http://repo.or.cz/minetest_hbarmor.git mods/minetest_hbarmor subrepo: subdir: "mods/minetest_hbarmor" merged: "878a351" upstream: origin: "http://repo.or.cz/minetest_hbarmor.git" branch: "master" commit: "878a351" git-subrepo: version: "0.3.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a7ee886" --- mods/minetest_hbarmor/.gitrepo | 11 ++ mods/minetest_hbarmor/README.md | 43 +++++ mods/minetest_hbarmor/depends.txt | 3 + mods/minetest_hbarmor/description.txt | 1 + mods/minetest_hbarmor/init.lua | 154 ++++++++++++++++++ mods/minetest_hbarmor/locale/de.txt | 2 + mods/minetest_hbarmor/locale/template.txt | 4 + mods/minetest_hbarmor/mod.conf | 1 + mods/minetest_hbarmor/screenshot.png | Bin 0 -> 10821 bytes mods/minetest_hbarmor/settingtypes.txt | 7 + .../minetest_hbarmor/textures/hbarmor_bar.png | Bin 0 -> 2770 bytes .../textures/hbarmor_bgicon.png | Bin 0 -> 424 bytes .../textures/hbarmor_icon.png | Bin 0 -> 3167 bytes 13 files changed, 226 insertions(+) create mode 100644 mods/minetest_hbarmor/.gitrepo create mode 100644 mods/minetest_hbarmor/README.md create mode 100644 mods/minetest_hbarmor/depends.txt create mode 100644 mods/minetest_hbarmor/description.txt create mode 100644 mods/minetest_hbarmor/init.lua create mode 100644 mods/minetest_hbarmor/locale/de.txt create mode 100644 mods/minetest_hbarmor/locale/template.txt create mode 100644 mods/minetest_hbarmor/mod.conf create mode 100644 mods/minetest_hbarmor/screenshot.png create mode 100644 mods/minetest_hbarmor/settingtypes.txt create mode 100644 mods/minetest_hbarmor/textures/hbarmor_bar.png create mode 100644 mods/minetest_hbarmor/textures/hbarmor_bgicon.png create mode 100644 mods/minetest_hbarmor/textures/hbarmor_icon.png diff --git a/mods/minetest_hbarmor/.gitrepo b/mods/minetest_hbarmor/.gitrepo new file mode 100644 index 0000000..c93e00f --- /dev/null +++ b/mods/minetest_hbarmor/.gitrepo @@ -0,0 +1,11 @@ +; DO NOT EDIT (unless you know what you are doing) +; +; This subdirectory is a git "subrepo", and this file is maintained by the +; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme +; +[subrepo] + remote = http://repo.or.cz/minetest_hbarmor.git + branch = master + commit = 878a351e9db2905dec0bb3e9d809b33ce5a65ed0 + parent = e2c75bbd22c6619411bbcc0c2bc6875e9b34fff2 + cmdver = 0.3.1 diff --git a/mods/minetest_hbarmor/README.md b/mods/minetest_hbarmor/README.md new file mode 100644 index 0000000..680f9c4 --- /dev/null +++ b/mods/minetest_hbarmor/README.md @@ -0,0 +1,43 @@ +# HUD bar for `3d_armor` [`hbarmor`] + +* Version: 0.2.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: WTFPL (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 (WTFPL) + +Everything else is WTFPL: +© 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 Do What The Fuck You Want +To Public License, Version 2, as published by Sam Hocevar. See +http://sam.zoy.org/wtfpl/COPYING for more details. diff --git a/mods/minetest_hbarmor/depends.txt b/mods/minetest_hbarmor/depends.txt new file mode 100644 index 0000000..32c2224 --- /dev/null +++ b/mods/minetest_hbarmor/depends.txt @@ -0,0 +1,3 @@ +hudbars +3d_armor +intllib? diff --git a/mods/minetest_hbarmor/description.txt b/mods/minetest_hbarmor/description.txt new file mode 100644 index 0000000..02a8a34 --- /dev/null +++ b/mods/minetest_hbarmor/description.txt @@ -0,0 +1 @@ +Adds a HUD bar displaying the current damage of the player's armor. diff --git a/mods/minetest_hbarmor/init.lua b/mods/minetest_hbarmor/init.lua new file mode 100644 index 0000000..fb697e7 --- /dev/null +++ b/mods/minetest_hbarmor/init.lua @@ -0,0 +1,154 @@ +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!") +end + +local hbarmor = {} + +-- HUD statbar values +hbarmor.armor = {} + +-- Stores if player's HUD bar has been initialized so far. +hbarmor.player_active = {} + +-- Time difference in seconds between updates to the HUD armor bar. +-- Increase this number for slow servers. +hbarmor.tick = 0.1 + +-- If true, the armor bar is hidden when the player does not wear any armor +hbarmor.autohide = true + +--load custom settings +local set = minetest.setting_getbool("hbarmor_autohide") +if set ~= nil then + hbarmor.autohide = set +end + +set = minetest.setting_get("hbarmor_tick") +if tonumber(set) ~= nil then + hbarmor.tick = tonumber(set) +end + + +local must_hide = function(playername, arm) + return ((not armor.def[playername].count or armor.def[playername].count == 0) and arm == 0) +end + +local arm_printable = function(arm) + return math.ceil(math.floor(arm+0.5)) +end + +local function custom_hud(player) + local name = player:get_player_name() + + if minetest.setting_getbool("enable_damage") then + local ret = hbarmor.get_armor(player) + if ret == false then + minetest.log("error", "[hbarmor] Call to hbarmor.get_armor in custom_hud returned with false!") + end + local arm = tonumber(hbarmor.armor[name]) + if not arm then arm = 0 end + local hide + if hbarmor.autohide then + hide = must_hide(name, arm) + else + hide = false + end + hb.init_hudbar(player, "armor", arm_printable(arm), nil, hide) + end +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, S("%s: %d%%")) + +function hbarmor.get_armor(player) + if not player or not armor.def then + return false + end + local name = player:get_player_name() + local def = armor.def[name] or nil + if def and def.state and def.count then + hbarmor.set_armor(name, def.state, def.count) + else + return false + end + return true +end + +function hbarmor.set_armor(player_name, ges_state, items) + local max_items = 4 + if items == 5 then + max_items = items + end + local max = max_items * 65535 + local lvl = max - ges_state + lvl = lvl/max + if ges_state == 0 and items == 0 then + lvl = 0 + end + + hbarmor.armor[player_name] = math.min(lvl* (items * (100 / max_items)), 100) +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]) + if not arm then + arm = 0 + hbarmor.armor[name] = 0 + end + if hbarmor.autohide then + -- hide armor bar completely when there is none + if must_hide(name, arm) then + hb.hide_hudbar(player, "armor") + else + hb.change_hudbar(player, "armor", arm_printable(arm)) + hb.unhide_hudbar(player, "armor") + end + else + hb.change_hudbar(player, "armor", arm_printable(arm)) + end +end + +minetest.register_on_joinplayer(function(player) + local name = player:get_player_name() + custom_hud(player) + hbarmor.player_active[name] = true +end) + +minetest.register_on_leaveplayer(function(player) + local name = player:get_player_name() + hbarmor.player_active[name] = false +end) + +local main_timer = 0 +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 minetest.setting_getbool("enable_damage") then + if main_timer > 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 ret == false then + minetest.log("error", "[hbarmor] Call to hbarmor.get_armor in globalstep returned with false!") + end + -- update all hud elements + update_hud(player) + end + end + end + end + if timer > 4 then timer = 0 end +end) diff --git a/mods/minetest_hbarmor/locale/de.txt b/mods/minetest_hbarmor/locale/de.txt new file mode 100644 index 0000000..5a6bacd --- /dev/null +++ b/mods/minetest_hbarmor/locale/de.txt @@ -0,0 +1,2 @@ +Armor = Panzerung +%s: %d%% = %s: %d%% diff --git a/mods/minetest_hbarmor/locale/template.txt b/mods/minetest_hbarmor/locale/template.txt new file mode 100644 index 0000000..d898abe --- /dev/null +++ b/mods/minetest_hbarmor/locale/template.txt @@ -0,0 +1,4 @@ +Armor = + +# Format string for displaying the armor. E.g. "Armor: 100%" +%s: %d%% = diff --git a/mods/minetest_hbarmor/mod.conf b/mods/minetest_hbarmor/mod.conf new file mode 100644 index 0000000..47352c1 --- /dev/null +++ b/mods/minetest_hbarmor/mod.conf @@ -0,0 +1 @@ +name = hbarmor diff --git a/mods/minetest_hbarmor/screenshot.png b/mods/minetest_hbarmor/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..907cf900de5407f5fffc0b6e7cb4d6ac082972f8 GIT binary patch literal 10821 zcmV-LD!SE)P)Px#32;bRa{vGi!~g&e!~vBn4jTXf00(qQO+^Rb3j-Dn5qLnZpa1{>3~5wYbVF}# zZDnqB000000KBfUnE(JOzez+vRCwC$T?w2N)tRrW&zbJIn2Td(00CDnjR>d+DllqH z7PGD!btPhy)pdVKG{y~RG>J#lxUR;m8xhnfDz3Vyt0-4Q8C1@wgBp-)1O{ec?&Ani?^RcIS9QPtZ+=bj`c>7d>i2*D@B7}xe)rzfm>Bv`_!u07!wepZh8c0P zIXnHB7c|>=oNPfqZVCHOcyY4XYfP9I^f`lAZ>HRcc|ngOfc40}5bis)3pm-_-2u!C zaz+*>Tk$X>_K#9n^^hZea%>b~zjS4v93Pkr#0Mq=@qx)e3SEOEW*~O+g9-fR2NU=* zSb)Hk!NNpQg+bX1@&+s$f$%3$+5pI*4B`Xd7R7xzE$(i$pX{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e`HofSnj8JVLhI0B#V z+nP+vLF;F3_a_D7B&SrB*2*+TlOLO`G0tp>LGV=uOD>m)2Q+}Xj>gS^3_3)h{XPP=@EA7~lyW>kReERB(>ex{kKo&{LT2l0g zAY3*+s)=q5*Mw|{>WGR+>rhT9U7BwNxBlXbFTf1$=;&aw;$mmQKng7dW-^Oxs&p_zF)@Kh#l#Wc`5 z)cYq<4z2@yi)SGGHxvW9czb(0YBDU-bWklaltBvRNSITkutiVtFrnKG=mErt519ZV zCE`g=-6@x8U`M}{K{_SXiI4$Jq>>7d&_^<8e;`P-+wHbYJ3;FlMFRdGCf}ak(+hX{ P00000NkvXXu0mjftq_bx literal 0 HcmV?d00001 diff --git a/mods/minetest_hbarmor/settingtypes.txt b/mods/minetest_hbarmor/settingtypes.txt new file mode 100644 index 0000000..067d504 --- /dev/null +++ b/mods/minetest_hbarmor/settingtypes.txt @@ -0,0 +1,7 @@ +#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/minetest_hbarmor/textures/hbarmor_bar.png b/mods/minetest_hbarmor/textures/hbarmor_bar.png new file mode 100644 index 0000000000000000000000000000000000000000..9623c4e9dfc56ab674ae08df4c278648129b4fa1 GIT binary patch literal 2770 zcmV;@3N7`CP)uJ@VVD_UC<6{NG_fI~0ue<-1QkJoA_k0xBC#Thg@9ne9*`iQ#9$Or zQF$}6R&?d%y_c8YA7_1QpS|}zXYYO1x&V;8{kgn!SPFnNo`4_X6{c}T{8k*B#$jdxfFg<9uYy1K45IaYvHg`_dOZM)Sy63ve6hvv z1)yUy0P^?0*fb9UASvow`@mQCp^4`uNg&9uGcn1|&Nk+9SjOUl{-OWr@Hh0;_l(8q z{wNRKos+;6rV8ldy0Owz(}jF`W(JeRp&R{qi2rfmU!T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H=SSy{V>ut&IOq{_dl zbFb#!9eY1iCsp6Bajj|Hr?hX|zPbJE{X++w546-O*Ot`2Kgd0Jx6Z4syT zu9enWavU5N9)I?I-1m1*_?_rJ$vD~agVqoG+9++s?NEDe`%Fht$4F;X=in*dQ{7$m zU2Q)a|9JSc+Uc4zvS-T963!N$T{xF_ZuWe}`RNOZ7sk3{yB}PPym+f8xTpV;-=!;; zJuhGEb?H5K#o@~7t9DmUU1MD9xNd#Dz0azz?I)|B+WM{g+Xrk0I&awC=o(x)cy`EX z=)z6+o0o6-+`4{y+3mqQ%kSJBju{@g%f35#FZJHb`&swrA8dGtepviS>QUumrN{L@ z>;2q1Vm)$Z)P1z?N$8UYW2~{~zhwUMVZ87u`Dx{Z>O|9|`Q+&->FRy-Sjp7DHs zy69KwU-!MxeeuI@&cF4|M9z%AfP?@5 z`Tzg`fam}Kbua(`>RI+y?e7jT@qQ9J+u02fI_K~xCWW9;wm|Ifg{z`(=+1p~_f Y0D}nv%)1^G`v3p{07*qoM6N<$f-F^0_W%F@ literal 0 HcmV?d00001 diff --git a/mods/minetest_hbarmor/textures/hbarmor_bgicon.png b/mods/minetest_hbarmor/textures/hbarmor_bgicon.png new file mode 100644 index 0000000000000000000000000000000000000000..32401003a8f42a81bb123e03be086fdda348c159 GIT binary patch literal 424 zcmV;Z0ayNsP)paFLO0b(HqY%<_pLI`0NQ0n~k zCHwvUp@bUP7-M9bCb?WL_ux5z8-{!bui60Cy4YpNUw{yTSZhV!Nt3&<(k!~%@8?sq z#&Im)!CJj6bKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>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