From 0a0aa02d2d9af383873561a36912c08721f3f444 Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Sun, 12 Feb 2012 19:56:14 +0000 Subject: [PATCH] New hook "Entity:loadList" to bind on any entities file load, altering the loaded data or loading more of your own git-svn-id: http://svn.net-core.org/repos/t-engine4@4839 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/engines/default/engine/Entity.lua | 2 ++ game/modules/tome/class/uiset/Minimalist.lua | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/game/engines/default/engine/Entity.lua b/game/engines/default/engine/Entity.lua index 9e8430d28f..2b318a01e8 100644 --- a/game/engines/default/engine/Entity.lua +++ b/game/engines/default/engine/Entity.lua @@ -784,5 +784,7 @@ function _M:loadList(file, no_default, res, mod, loaded) setfenv(f, setmetatable(newenv, {__index=_G})) f() + self:triggerHook{"Entity:loadList", file=file, no_default=no_default, res=res, mod=mod, loaded=loaded} + return res end diff --git a/game/modules/tome/class/uiset/Minimalist.lua b/game/modules/tome/class/uiset/Minimalist.lua index 8eb9e56cc6..6e288a49fa 100644 --- a/game/modules/tome/class/uiset/Minimalist.lua +++ b/game/modules/tome/class/uiset/Minimalist.lua @@ -956,7 +956,7 @@ function _M:handleEffect(player, eff_id, e, p, x, y, hs, bx, by, is_first, scale end self.tbuff[eff_id..":"..dur] = {eff_id, "tbuff"..eff_id, function(x, y) - core.display.drawQuad(x, y, hs, hs, 0, 0, 0, 255) + core.display.drawQuad(x+4, y+4, 32, 32, 0, 0, 0, 255) e.display_entity:toScreen(self.hotkeys_display_icons.tiles, x+4, y+4, 32, 32) UI:drawFrame(self.buffs_base, x, y, icon[1], icon[2], icon[3], 1) if txt then @@ -1007,7 +1007,7 @@ function _M:displayBuffs(scale, bx, by) game.tooltip_x, game.tooltip_y = 1, 1; game:tooltipDisplayAtMap(game.w, game.h, desc) end self.pbuff[tid] = {tid, "pbuff"..tid, function(x, y) - core.display.drawQuad(x, y, hs, hs, 0, 0, 0, 255) + core.display.drawQuad(x+4, y+4, 32, 32, 0, 0, 0, 255) t.display_entity:toScreen(self.hotkeys_display_icons.tiles, x+4, y+4, 32, 32) UI:drawFrame(self.buffs_base, x, y, frames_colors.sustain[1], frames_colors.sustain[2], frames_colors.sustain[3], 1) end, desc_fct} -- GitLab