Merge pull request #7 from JordanL2/damage_texture_mod

Texture mod fix when indicating damage
This commit is contained in:
ElCeejo 2022-02-20 14:54:19 -08:00 committed by GitHub
commit 23c61e0751
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -55,10 +55,11 @@ end
---------------
local function indicate_damage(self)
self.object:set_texture_mod("^[colorize:#FF000040")
local texture_mod = self.object:get_texture_mod()
self.object:set_texture_mod(texture_mod .. "^[colorize:#FF000040")
core.after(0.2, function()
if creatura.is_alive(self) then
self.object:set_texture_mod("")
self.object:set_texture_mod(texture_mod)
end
end)
end

View file

@ -203,10 +203,11 @@ local function index_box_border(self)
end
local function indicate_damage(self)
self.object:set_texture_mod("^[colorize:#FF000040")
local texture_mod = self.object:get_texture_mod()
self.object:set_texture_mod(texture_mod .. "^[colorize:#FF000040")
core.after(0.2, function()
if creatura.is_alive(self) then
self.object:set_texture_mod("")
self.object:set_texture_mod(texture_mod)
end
end)
end