Add setting to disable armor visuals on player model (#48)

* Add setting to disable armor visuals on player model
This commit is contained in:
Jordan Irwin 2021-05-27 00:11:04 -07:00 committed by GitHub
parent 371285a903
commit a0cf12bbd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -200,6 +200,10 @@ armor.update_player_visuals = function(self, player)
self:run_callbacks("on_update", player)
end
-- armor is not visible on player model if enabled
local transparent_armor = minetest.settings:get_bool("armor_transparent", false)
armor.set_player_armor = function(self, player)
local name, armor_inv = self:get_valid_player(player, "[set_player_armor]")
if not name then
@ -258,7 +262,9 @@ armor.set_player_armor = function(self, player)
tex = tex:gsub(".png$", "")
local prev = def.preview or tex.."_preview"
prev = prev:gsub(".png$", "")
texture = texture.."^"..tex..".png"
if not transparent_armor then
texture = texture.."^"..tex..".png"
end
preview = preview.."^"..prev..".png"
state = state + stack:get_wear()
count = count + 1

View File

@ -58,6 +58,9 @@ armor_punch_damage (Enable damage effects) bool true
# Enable migration of old armor inventories.
armor_migrate_old_inventory (Migrate old armor inventories) bool true
# Don't show armor on character model.
armor_transparent (Transparent armor) bool false
[shields]