Skip to content
Snippets Groups Projects
Commit 79253faf authored by dg's avatar dg
Browse files

improve tooltips

git-svn-id: http://svn.net-core.org/repos/t-engine4@5512 51575b47-30f0-44d4-a5cc-537603b46e54
parent 45ece724
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,7 @@ function _M:set(str, ...)
-- if locked change is forbiden
if self.locked then return end
self.pingpong = 0
str = str or {}
if type(str) == "string" then str = ... and str:format(...):toTString() or str:toTString() end
if type(str) == "number" then str = tostring(str):toTString() end
......@@ -266,7 +267,7 @@ function _M:displayAtMap(tmx, tmy, mx, my, text, force, nb_keyframes)
self.old_ttmx, self.old_ttmy = tmx, tmy
self.old_turn = game.turn
local ts = self:getTooltipAtMap(tmx, tmy, mx, my)
if ts then
if ts or self.add_map_str then
self:set(ts)
else
self:erase()
......
......@@ -30,7 +30,7 @@ newAI("move_simple", function(self)
end)
newAI("move_dmap", function(self)
if self.ai_target.actor then
if self.ai_target.actor and self.x and self.y then
local a = self.ai_target.actor
if self:hasLOS(a.x, a.y) then return self:runAI("move_simple") end
......
......@@ -1286,6 +1286,8 @@ util = {}
function util.clipOffset(w, h, total_w, total_h, loffset_x, loffset_y, dest_area)
w, h = math.floor(w), math.floor(h)
total_w, total_h, loffset_x, loffset_y = math.floor(total_w), math.floor(total_h), math.floor(loffset_x), math.floor(loffset_y)
dest_area.w , dest_area.h = math.floor(dest_area.w), math.floor(dest_area.h)
local clip_y_start = 0
local clip_y_end = 0
local clip_x_start = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment