From bdcee1e70d6110a3debeb84eef7fcabf6ab039e6 Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Sat, 8 Oct 2011 13:55:37 +0000 Subject: [PATCH] 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 --- game/modules/tome/class/Grid.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/game/modules/tome/class/Grid.lua b/game/modules/tome/class/Grid.lua index 61a2daf980..ee3c87c414 100644 --- a/game/modules/tome/class/Grid.lua +++ b/game/modules/tome/class/Grid.lua @@ -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)) -- GitLab