Skip to content

Commit

Permalink
Added the possibility to hide wielded items in-game (#14)
Browse files Browse the repository at this point in the history
* Added the possibility to hide wielded items in-game
* Update wieldview/README.txt

Co-authored-by: David Leal <halfpacho@gmail.com>
  • Loading branch information
G1ov4 and Panquesito7 committed Sep 15, 2020
1 parent 502eb14 commit 2d9b006
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wieldview/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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).
3 changes: 3 additions & 0 deletions wieldview/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d9b006

Please sign in to comment.