Commit fc305cb0b5697b7f18def45a1ab26472fb28a678

Authored by dg
1 parent 78d1e5fc

Party icon tooltip now indicates life


git-svn-id: http://svn.net-core.org/repos/t-engine4@2652 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -120,10 +120,10 @@ function _M:mouseHandleDefault(key, allow_move, button, mx, my, xrel, yrel, even
120 120 self:mouseScrollMap(game.level.map, xrel, yrel)
121 121 moving_around = true
122 122 -- Zoom map
123   - elseif config.settings.cheat and button == "wheelup" then
124   - game.level.map:setZoom(0.1, tmx, tmy)
125   - elseif config.settings.cheat and button == "wheeldown" then
126   - game.level.map:setZoom(-0.1, tmx, tmy)
  123 +-- elseif config.settings.cheat and button == "wheelup" then
  124 +-- game.level.map:setZoom(0.1, tmx, tmy)
  125 +-- elseif config.settings.cheat and button == "wheeldown" then
  126 +-- game.level.map:setZoom(-0.1, tmx, tmy)
127 127 -- Pass any other buttons to the keybinder
128 128 elseif button ~= "none" and not xrel and not yrel and event == "button" then
129 129 key:receiveKey(button, core.key.modState("ctrl") and true or false, core.key.modState("shift") and true or false, core.key.modState("alt") and true or false, core.key.modState("meta") and true or false, nil, false, true)
... ...
... ... @@ -211,26 +211,26 @@ end
211 211
212 212 --- Scan the run direction and sides with the given function
213 213 function _M:runScan(fct)
214   - fct(self.x, self.y)
  214 + fct(self.x, self.y, "self")
215 215 if not self.running.path then
216 216 -- Ahead
217 217 local dx, dy = dir_to_coord[self.running.dir][1], dir_to_coord[self.running.dir][2]
218 218 local x, y = self.x + dx, self.y + dy
219   - fct(x, y)
  219 + fct(x, y, "ahead")
220 220
221 221 -- Ahead left
222 222 local dx, dy = dir_to_coord[sides[self.running.dir].left][1], dir_to_coord[sides[self.running.dir].left][2]
223 223 local x, y = self.x + dx, self.y + dy
224   - fct(x, y)
  224 + fct(x, y, "ahead left")
225 225
226 226 -- Ahead right
227 227 local dx, dy = dir_to_coord[sides[self.running.dir].right][1], dir_to_coord[sides[self.running.dir].right][2]
228 228 local x, y = self.x + dx, self.y + dy
229   - fct(x, y)
  229 + fct(x, y, "ahead right")
230 230 elseif self.running.path[self.running.cnt] then
231 231 -- Ahead
232 232 local x, y = self.running.path[self.running.cnt].x, self.running.path[self.running.cnt].y
233   - fct(x, y)
  233 + fct(x, y, "ahead")
234 234 end
235 235 end
236 236
... ...
... ... @@ -108,7 +108,7 @@ function _M:makePortrait(a, current, x, y)
108 108 local hl = 32 * math.max(0, a.life) / a.max_life
109 109 s:erase(colors.RED.r * 0.7, colors.RED.g * 0.7, colors.RED.b * 0.7, 255, 6, 32+6-hl, 32, hl)
110 110
111   - self:mouseTooltip("#GOLD##{bold}#"..a.name.."\n#WHITE##{normal}#Level: "..a.level.."\n"..def.title, 40, 40, x, y, function()
  111 + self:mouseTooltip("#GOLD##{bold}#"..a.name.."\n#WHITE##{normal}#Life: "..math.floor(100 * a.life / a.max_life).."%\nLevel: "..a.level.."\n"..def.title, 40, 40, x, y, function()
112 112 if def.control == "full" then
113 113 game.party:select(a)
114 114 end
... ...