Remove unnecessary PartsManager refreshes

This commit is contained in:
NullBite 2022-03-25 14:17:25 -04:00
parent af40621ad0
commit 625e784c57
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -621,9 +621,7 @@ function pmRefresh()
end
function ping.syncState(tbl)
for k, v in pairs(tbl) do
local_state[k]=v
end
local_state=tbl
pmRefresh()
end
@ -740,6 +738,7 @@ function armor()
local boots = string.sub(boots_item.getType(), 11, -7)
if local_state.armor_enabled then
if old_state.leggings ~= leggings then
-- leggings
armor_glint.leggings=leggings_item.hasGlint()
local leggings_color=colorArmor(leggings_item) or armor_color[leggings]
@ -761,7 +760,10 @@ function armor()
else
armor_state.leggings=false
end
pmRefresh()
end
if old_state.boots ~= boots then
-- boots
armor_glint.boots=boots_item.hasGlint()
local boots_color=colorArmor(boots_item) or armor_color[boots]
@ -781,6 +783,8 @@ function armor()
else
armor_state.boots=false
end
pmRefresh()
end
else
armor_glint.leggings=false
armor_glint.boots=false
@ -873,9 +877,6 @@ function player_init()
v.setEnabled(true)
end
local_state=getLocalState()
if cooldown(1, "refreshAll") then
PartsManager.refreshAll()
end
syncState()
end
-- Initial configuration --
@ -930,8 +931,6 @@ function tick()
cooldown(1, "refreshAll")
PartsManager.refreshAll()
refreshed=true
else
pmRefresh()
end
updateTailVisibility()