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

New achievement: Fear me not!

Fixed mouse-over for chat frame

git-svn-id: http://svn.net-core.org/repos/t-engine4@5024 51575b47-30f0-44d4-a5cc-537603b46e54
parent c062a596
No related branches found
No related tags found
No related merge requests found
......@@ -700,16 +700,18 @@ function _M:checkEntity(x, y, pos, what, ...)
end
--- Lite all grids
function _M:liteAll(x, y, w, h)
function _M:liteAll(x, y, w, h, v)
if v == nil then v = true end
for i = x, x + w - 1 do for j = y, y + h - 1 do
self.lites(i, j, true)
self.lites(i, j, v)
end end
end
--- Remember all grids
function _M:rememberAll(x, y, w, h)
function _M:rememberAll(x, y, w, h, v)
if v == nil then v = true end
for i = x, x + w - 1 do for j = y, y + h - 1 do
self.remembers(i, j, true)
self.remembers(i, j, v)
end end
end
......
......@@ -412,15 +412,16 @@ function _M:mouseEvent(button, x, y, xrel, yrel, bx, by, event)
else
if not self.on_mouse or not self.dlist then return end
local citem = nil
local ci
for i = 1, #self.dlist do
local item = self.dlist[i]
if item.dh and by >= item.dh - self.mouse.delegate_offset_y then citem = self.dlist[i].src break end
if item.dh and by >= item.dh - self.mouse.delegate_offset_y then citem = self.dlist[i].src ci=i break end
end
print("================================")
util.show_backtrace()
for i = 1, #self.dlist do
local item = self.dlist[i]
if item.dh then print("===", y, by, item.dh - self.mouse.delegate_offset_y) end
if item.dh then print("===", y, by, item.dh - self.mouse.delegate_offset_y, ci==i and "*****" or "") end
end
self.on_mouse(citem and citem.login and self.channels[self.cur_channel].users[citem.login], citem and citem.login and citem, button, event, x, y, xrel, yrel, bx, by)
end
......
......@@ -1784,6 +1784,7 @@ function _M:setupMouse(mouse)
-- Chat tooltips
profile.chat:onMouse(function(user, item, button, event, x, y, xrel, yrel, bx, by)
local mx, my = core.mouse.get()
print(">>??", item, user, item and item.faded)
if not item or not user or item.faded == 0 then game.mouse:delegate(button, mx, my, xrel, yrel, nil, nil, event, "playmap") return end
local str = tstring{{"color","GOLD"}, {"font","bold"}, user.name, {"color","LAST"}, {"font","normal"}, true}
......@@ -1808,6 +1809,7 @@ function _M:setupMouse(mouse)
extra.add_map_action = { name="Show chat user", fct=function() profile.chat:showUserInfo(user.login) end }
end
end
game.tooltip.old_tmx = -100
game.mouse:delegate(button, mx, my, xrel, yrel, nil, nil, event, "playmap", extra)
end)
end
......@@ -100,3 +100,9 @@ newAchievement{
show = "name",
desc = [[Linking yourself in the ingame chat.]],
}
newAchievement{
name = "Fear me not!", id = "FEARSCAPE",
show = "full",
desc = [[Survive the Fearscape!]],
}
......@@ -207,6 +207,7 @@ newTalent{
game:onTickEnd(function()
if self.demon_plane_on_die then self:demon_plane_on_die(unpack(args)) end
self.on_die, self.demon_plane_on_die = self.demon_plane_on_die, nil
if not game.party:hasMember(self) then world:gainAchievement("FEARSCAPE", game:getPlayer(true)) end
end)
end
......@@ -223,7 +224,6 @@ newTalent{
end,
deactivate = function(self, t, p)
game:onTickEnd(function()
game.log("===exiting===")
-- Collect objects
local objs = {}
for i = 0, game.level.map.w - 1 do for j = 0, game.level.map.h - 1 do
......
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