From 2eb2df946b930d8f36930157231717e6cd941040 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 13 Mar 2020 07:53:24 +0100 Subject: [PATCH 1/5] Add nil check in hb.change_hudbar --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 0f91960..ad3b010 100644 --- a/init.lua +++ b/init.lua @@ -315,6 +315,9 @@ function hb.change_hudbar(player, identifier, new_value, new_max_value, new_icon end local name = player:get_player_name() + if not hudtable.hudstate[name] then + return false + end local hudtable = hb.get_hudtable(identifier) local value_changed, max_changed = false, false From 9a8a3f0f8c5c3b7550df97dee7e58a7d779c7466 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 13 Mar 2020 07:55:01 +0100 Subject: [PATCH 2/5] Version 2.2.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 825d095..722c727 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ this mod will place them accordingly. position should be displayed correctly on every screen size. ## Current version -The current version is 2.2.0. +The current version is 2.2.1. This software uses [semantic versioning](http://semver.org), as defined by version 2.0.0 of the SemVer standard. From b19b5f090a14391111f0c9c5f3dbb2de377c6198 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 13 Mar 2020 18:10:52 +0100 Subject: [PATCH 3/5] Fix another crash --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ad3b010..bac7941 100644 --- a/init.lua +++ b/init.lua @@ -315,10 +315,10 @@ function hb.change_hudbar(player, identifier, new_value, new_max_value, new_icon end local name = player:get_player_name() + local hudtable = hb.get_hudtable(identifier) if not hudtable.hudstate[name] then return false end - local hudtable = hb.get_hudtable(identifier) local value_changed, max_changed = false, false if new_value ~= nil then From 7993feac0787b6ee32e5c3eda8360b18f761fb39 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 13 Mar 2020 18:11:13 +0100 Subject: [PATCH 4/5] Version 2.2.2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 722c727..1a4b28a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ this mod will place them accordingly. position should be displayed correctly on every screen size. ## Current version -The current version is 2.2.1. +The current version is 2.2.2. This software uses [semantic versioning](http://semver.org), as defined by version 2.0.0 of the SemVer standard. From a250d2a350cbc20dac030437266ccb1f825d72c9 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 7 Apr 2020 01:06:49 +0200 Subject: [PATCH 5/5] Add z-index to HUD elements --- init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init.lua b/init.lua index bac7941..65d60c3 100644 --- a/init.lua +++ b/init.lua @@ -200,6 +200,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta text = "hudbars_bar_background.png", alignment = {x=1,y=1}, offset = { x = offset.x - 1, y = offset.y - 1 }, + z_index = 0, }) if textures.icon ~= nil then ids.icon = player:hud_add({ @@ -209,6 +210,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta text = textures.icon, alignment = {x=-1,y=1}, offset = { x = offset.x - 3, y = offset.y }, + z_index = 1, }) end elseif hb.settings.bar_type == "statbar_modern" then @@ -222,6 +224,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta offset = { x = offset.x, y = offset.y }, direction = 0, size = {x=24, y=24}, + z_index = 0, }) end end @@ -248,6 +251,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta offset = offset, direction = 0, size = bar_size, + z_index = 1, }) if hb.settings.bar_type == "progress_bar" then ids.text = player:hud_add({ @@ -258,6 +262,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta number = text_color, direction = 0, offset = { x = offset.x + 2, y = offset.y - 1}, + z_index = 2, }) end -- Do not forget to update hb.get_hudbar_state if you add new fields to the state table