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

Terrain tooltip's improved to provide various useful info (diggable,...

Terrain tooltip's improved to provide various useful info (diggable, breathable, teleport, blocks sight/move)


git-svn-id: http://svn.net-core.org/repos/t-engine4@4517 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2f5771b0
No related branches found
No related tags found
No related merge requests found
......@@ -120,18 +120,25 @@ function _M:tooltip(x, y)
if self.show_tooltip then
local name = ((self.show_tooltip == true) and self.name or self.show_tooltip)
if self.desc then
tstr = tstring{{"uid", self.uid}, name, true, self.desc}
tstr = tstring{{"uid", self.uid}, name, true, self.desc, true}
else
tstr = tstring{{"uid", self.uid}, name}
tstr = tstring{{"uid", self.uid}, name, true}
end
else
tstr = tstring{{"uid", self.uid}, self.name}
tstr = tstring{{"uid", self.uid}, self.name, true}
end
if game.level.entrance_glow and self.change_zone and not game.visited_zones[self.change_zone] then
tstr:add(true, {"font","bold"}, {"color","CRIMSON"}, "Never visited yet", {"color", "LAST"}, {"font","normal"}, true)
end
if game.level.map.lites(x, y) then tstr:add({"color", "YELLOW"}, "Lit", {"color", "LAST"}, true) end
if self:check("block_sight", x, y) then tstr:add({"color", "UMBER"}, "Blocks sight", {"color", "LAST"}, true) end
if self:check("block_move", x, y, game.player) then tstr:add({"color", "UMBER"}, "Blocks movement", {"color", "LAST"}, true) end
if self:attr("air_level") then tstr:add({"color", "LIGHT_BLUE"}, "Special breathing method required", {"color", "LAST"}, true) end
if self:attr("dig") then tstr:add({"color", "LIGHT_UMBER"}, "Diggable", {"color", "LAST"}, true) end
if game.level.map.attrs(x, y, "no_teleport") then tstr:add({"color", "VIOLET"}, "Cannot teleport to this place", {"color", "LAST"}, true) end
if config.settings.cheat then
tstr:add(true, tostring(rawget(self, "type")), " / ", tostring(rawget(self, "subtype")))
tstr:add(true, "UID: ", tostring(self.uid), true, "Coords: ", tostring(x), "x", tostring(y))
......
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