From 2d9b0066bfd40a37e0a4fb863b91f01f46933a77 Mon Sep 17 00:00:00 2001 From: Giov4 <33577286+G1ov4@users.noreply.github.com> Date: Tue, 15 Sep 2020 06:43:55 +0200 Subject: [PATCH] Added the possibility to hide wielded items in-game (#14) * Added the possibility to hide wielded items in-game * Update wieldview/README.txt Co-authored-by: David Leal --- wieldview/README.txt | 4 ++++ wieldview/init.lua | 3 +++ 2 files changed, 7 insertions(+) diff --git a/wieldview/README.txt b/wieldview/README.txt index ffa5ef0..3a8b640 100644 --- a/wieldview/README.txt +++ b/wieldview/README.txt @@ -21,3 +21,7 @@ Wield image transformation: To apply a simple transformation to the item in hand, add the group “wieldview_transform” to the item definition. The group rating equals one of the numbers used for the [transform texture modifier of the Lua API. + +Disabling the feature in-game: If you want to hide the wielded item +you can add an INT metadata to the player called "show_wielded_item" and set +it to 2 (any other value will show the wielded item again). diff --git a/wieldview/init.lua b/wieldview/init.lua index 7f68732..f0edeac 100644 --- a/wieldview/init.lua +++ b/wieldview/init.lua @@ -54,6 +54,9 @@ wieldview.update_wielded_item = function(self, player) return end if self.wielded_item[name] then + if player:get_meta():get_int("show_wielded_item") == 2 then + item = "" + end if self.wielded_item[name] == item then return end