From 2397fb5148919764cc3c2de609d41162d7ecd964 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Wed, 19 Jul 2023 22:03:09 -0400 Subject: [PATCH] mods - hudbars and hbarmor - minimize textures and simplified * remove icon on progress bar, use simple bar simplistic * optimize size of the textures * remove unnecesary textures, dont use backgrounds, simplistic --- mods/hbarmor/init.lua | 4 +++- mods/hbarmor/textures/hbarmor_icon.png | Bin 361 -> 147 bytes mods/hudbars/init.lua | 12 +++++++++--- .../hudbars/textures/hudbars_bar_background.png | Bin 113 -> 0 bytes mods/hudbars/textures/hudbars_bgicon_breath.png | Bin 161 -> 0 bytes mods/hudbars/textures/hudbars_bgicon_health.png | Bin 302 -> 0 bytes mods/hudbars/textures/hudbars_icon_breath.png | Bin 207 -> 153 bytes mods/hudbars/textures/hudbars_icon_health.png | Bin 172 -> 143 bytes 8 files changed, 12 insertions(+), 4 deletions(-) delete mode 100644 mods/hudbars/textures/hudbars_bar_background.png delete mode 100644 mods/hudbars/textures/hudbars_bgicon_breath.png delete mode 100644 mods/hudbars/textures/hudbars_bgicon_health.png diff --git a/mods/hbarmor/init.lua b/mods/hbarmor/init.lua index f97be0c..7e5c439 100644 --- a/mods/hbarmor/init.lua +++ b/mods/hbarmor/init.lua @@ -83,7 +83,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, 100, hbarmor.autohide, N("@1: @2%"), { order = { "label", "value" }, textdomain = "hbarmor" } ) +local hicon = "hbarmor_icon.png" +if hb.settings.bar_type == "progress_bar" then hicon = nil end +hb.register_hudbar("armor", 0xFFFFFF, S("Armor"), { icon = hicon, bgicon = nil, bar = "hbarmor_bar.png" }, 0, 100, hbarmor.autohide, N("@1: @2%"), { order = { "label", "value" }, textdomain = "hbarmor" } ) function hbarmor.get_armor(player) if not player or not armor.def then diff --git a/mods/hbarmor/textures/hbarmor_icon.png b/mods/hbarmor/textures/hbarmor_icon.png index 6a5a76327fc854632efebfe849cd408b97c92e31..f76e9c30d2665f57f0ecd678e03bf3bbbb889694 100644 GIT binary patch delta 130 zcmaFKG?{UNL^TsL0|P_ST=7ppiZj3`#MQmP=iu41FFt$-@Ac^d3Nn@i`2{mLJiCzw zFVdQ&MBb@05kI{-~a#s delta 346 zcmV-g0j2(v0qFve7=H)`0000V^Z#K000A&bL_t(|0mYN!fuuncMLUm8VFTOr)?=e> z+qQk?yJH(a%5~4HdN2WRYVQa5@%@`=<=}vecHnYh_IlZKI@vSk*UxnK4nPN`R*Uvv zK&{(lvRJSHe5sW7sdPFt`h7CBnjqW@=uf8tFr3Zkj7DnMV}CKi`8>&TSpZr_dk`RD z==^fRX!TwXYbc~w;EKoDce`;V5)T8~!y&O^Q4lrC?KX!#pTq)j;PK#$#U2I}8V&SE zk1QsWXe|d?&c#Q5KjvWYVSt`j?R1bewRE-0hS`k7TUIO9aF}hoT>u^oqdYFF5(P3D zU1rl_;s4$qW>dfa;V@nR^k<3Jj*roQe{F5?+h}^p+R@SDfQzO-tI6Wp;UW6F02k*^ s0%S!^ez=x}&j(zzdxQ@FzOoum03Aj3Wq1#VA^-pY07*qoM6N<$g3gnqG5`Po diff --git a/mods/hudbars/init.lua b/mods/hudbars/init.lua index 3133ff4..9fff093 100644 --- a/mods/hudbars/init.lua +++ b/mods/hudbars/init.lua @@ -234,7 +234,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta hud_elem_type = "image", position = pos, scale = bgscale, - text = "hudbars_bar_background.png", + text = "", alignment = {x=1,y=1}, offset = { x = offset.x - 1, y = offset.y - 1 }, z_index = 0, @@ -520,8 +520,14 @@ end --register built-in HUD bars if minetest.settings:get_bool("enable_damage") or hb.settings.forceload_default_hudbars then - hb.register_hudbar("health", 0xFFFFFF, S("Health"), { bar = "hudbars_bar_health.png", icon = "hudbars_icon_health.png", bgicon = "hudbars_bgicon_health.png" }, hb.settings.hp_player_maximun, hb.settings.hp_player_maximun, false) - hb.register_hudbar("breath", 0xFFFFFF, S("Breath"), { bar = "hudbars_bar_breath.png", icon = "hudbars_icon_breath.png", bgicon = "hudbars_bgicon_breath.png" }, hb.settings.br_player_maximun, hb.settings.br_player_maximun, true) + local hicon = "hudbars_icon_health.png" + local bicon = "hudbars_icon_breath.png" + if hb.settings.bar_type == "progress_bar" then + hicon = nil + bicon = nil + end + hb.register_hudbar("health", 0xFFFFFF, S("Health"), { bar = "hudbars_bar_health.png", icon = hicon, bgicon = nil }, hb.settings.hp_player_maximun, hb.settings.hp_player_maximun, false) + hb.register_hudbar("breath", 0xFFFFFF, S("Breath"), { bar = "hudbars_bar_breath.png", icon = bicon, bgicon = nil }, hb.settings.br_player_maximun, hb.settings.br_player_maximun, true) end local function hide_builtin(player) diff --git a/mods/hudbars/textures/hudbars_bar_background.png b/mods/hudbars/textures/hudbars_bar_background.png deleted file mode 100644 index e6be257576308b1447a643add9311cc2b8721f25..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 113 zcmeAS@N?(olHy`uVBq!ia0vp^i-1^&kr_xn`Ziq`NU;U@gt+GC=L4B4kC;1w6k|z{ zU$FhRhOf~;j-;oHV~E7%-qfsJ+qGZ!%M`WbZZoqP zPS$hgYlkyl?GN~+-+WBPFKmm@^C<7`&eq=tuN<2F?0u8|t3?uQ;)#sAfVMDry85}S Ib4q9e0F#q6?f?J) diff --git a/mods/hudbars/textures/hudbars_bgicon_health.png b/mods/hudbars/textures/hudbars_bgicon_health.png deleted file mode 100644 index e2be2768e569748d3d19bc3fd02e8bf36f5bfa03..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 302 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5he4R}c>anMpx^^f z7srr_IY%!Wt~#P1z?SfSf|H6XhjMUF(nP1G4)!fyTJAl$uhp1yZF~OBr0&d?|HUb8 ztPZuo@vZs}>wN_UXGosmQF2=E`}Nk9O*$K{HO*YO)ouM-J^{g`9*w07rZh*az&zt8kNnXyH@^QZnikZw^;`Xc6*GSF+1Ni!UT}Sx6G#5x+uIUj zuU|i4bH2W8VsTr?o_U81jRYl`&h7jt!GA!4`TbwrH+$O+pWW$IEKpEtnqypauHank yq5Q_U*_Wc6T@;kkZ_6{ftDiULZ=C=482iEur!jhf)`Pd79;w&XWe!*Y< zwz9Yht^Wt)TX?!ShHzX@{_+36{o(lbzdZ8cSBztNXPqrD&Ne!HGIX+}-`ZK{3Nk`1 p4lka1k*8kbwdB9%2mk*wBv?s2-Wb1N9ncI0Pgg&ebxuqPO#s#+Ic@*| delta 191 zcmV;w06_nl0nY)D7=Hu<0001_TS3$S001XYOjJeB=k=eX|3`34v()OhzWcby&D7xe zb&RZanaT0>`1}3-oyX{)vA|ixPbvTa019+cPE-4U0R569yHmYzi`XuA0000@NklM65CpVq4X6MB002ovPDHLkV1i?wPJI9X diff --git a/mods/hudbars/textures/hudbars_icon_health.png b/mods/hudbars/textures/hudbars_icon_health.png index f1c980f98c375640ffce0fbb77d787191b2651dc..d5302ec6fec6627d9de96544022d6fef7b64eb8b 100644 GIT binary patch delta 126 zcmZ3(*v~jYqMV7Dfq_9=dP@nA;tB8xadj{7dB)Dt#K`#D$K(6E<%fadj3q&S!3+-1 zZlnP@hMq2tAsp9}6BwA5En{OlcZP-S>S{rrSM`lQvRRtdCY%-B)zFxk#mszIYk?B) c1TQuQoZB@y5g;_6=DlfuBTnStRK2kR6jrr&m!w*@$VXQUMb z*=z@@VJr#q3ubV5b|VeQaq@I=4B@z*oY24|#xBOL@N~|j6s9K>@p3Mn~jI6_XY;CaNbvn%0m50k-U2~mcbQXCdSM{GHO#xZ!h`njxg HN@xNAkoPgI