From f3e1d2497a5c91f1d13d86bdcb50e3aab96634fa Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Tue, 14 Feb 2012 18:02:40 +0000 Subject: [PATCH] fix git-svn-id: http://svn.net-core.org/repos/t-engine4@4874 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/engines/default/engine/UserChat.lua | 56 ++++++++++---------- game/modules/tome/class/Actor.lua | 30 ++++++----- game/modules/tome/class/uiset/Minimalist.lua | 5 +- 3 files changed, 47 insertions(+), 44 deletions(-) diff --git a/game/engines/default/engine/UserChat.lua b/game/engines/default/engine/UserChat.lua index 487f1f13be..788463fcea 100644 --- a/game/engines/default/engine/UserChat.lua +++ b/game/engines/default/engine/UserChat.lua @@ -380,37 +380,39 @@ function _M:resize(x, y, w, h, fontname, fontsize, color, bgcolor) self.mouse = Mouse.new() self.mouse.delegate_offset_x = self.display_x self.mouse.delegate_offset_y = self.display_y - self.mouse:registerZone(0, 0, self.w, self.h, function(button, x, y, xrel, yrel, bx, by, event) - if button == "wheelup" then self:scrollUp(1) - elseif button == "wheeldown" then self:scrollUp(-1) - elseif event == "button" and button == "left" and y <= self.frame.h and self.do_display_chans then - local w = 0 - local last_ok = nil - for i = 1, #self.display_chans do - local item = self.display_chans[i] - last_ok = item - w = w + item.w + 4 - if w > x then break end - end - if last_ok then - local old = self.cur_channel - self:selectChannel(last_ok.name) - if old == self.cur_channel then self:showLogDialog(nil, self.shadow) end - end - else - if not self.on_mouse or not self.dlist then return end - local citem = nil - for i = 1, #self.dlist do - local item = self.dlist[i] - if item.dh and y >= item.dh - self.mouse.delegate_offset_y then citem = self.dlist[i].src break 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 - end) + self.mouse:registerZone(0, 0, self.w, self.h, function(button, x, y, xrel, yrel, bx, by, event) self:mouseEvent(button, x, y, xrel, yrel, bx, by, event) end) self.last_chan_update = 0 end +function _M:mouseEvent(button, x, y, xrel, yrel, bx, by, event) + if button == "wheelup" then self:scrollUp(1) + elseif button == "wheeldown" then self:scrollUp(-1) + elseif event == "button" and button == "left" and y <= self.frame.h and self.do_display_chans then + local w = 0 + local last_ok = nil + for i = 1, #self.display_chans do + local item = self.display_chans[i] + last_ok = item + w = w + item.w + 4 + if w > x then break end + end + if last_ok then + local old = self.cur_channel + self:selectChannel(last_ok.name) + if old == self.cur_channel then self:showLogDialog(nil, self.shadow) end + end + else + if not self.on_mouse or not self.dlist then return end + local citem = nil + for i = 1, #self.dlist do + local item = self.dlist[i] + if item.dh and y >= item.dh - self.mouse.delegate_offset_y then citem = self.dlist[i].src break 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 +end + function _M:enableShadow(v) self.shadow = v end diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 7556125661..6abb0604e9 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -2854,20 +2854,22 @@ function _M:getTalentFullDescription(t, addlevel, config) if t.paradox or t.sustain_paradox then d:add({"color",0x6f,0xff,0x83}, "Paradox cost: ", {"color", 176, 196, 222}, ("%0.2f"):format(t.sustain_paradox or t.paradox * (1 + (self.paradox / 300))), true) end if t.psi or t.sustain_psi then d:add({"color",0x6f,0xff,0x83}, "Psi cost: ", {"color",0x7f,0xff,0xd4}, ""..(t.sustain_psi or t.psi * (100 + 2 * self.fatigue) / 100), true) end end - if self:getTalentRange(t) > 1 then d:add({"color",0x6f,0xff,0x83}, "Range: ", {"color",0xFF,0xFF,0xFF}, ("%0.2f"):format(self:getTalentRange(t)), true) - else d:add({"color",0x6f,0xff,0x83}, "Range: ", {"color",0xFF,0xFF,0xFF}, "melee/personal", true) - end - if not config.ignore_ressources then - if self:getTalentCooldown(t) then d:add({"color",0x6f,0xff,0x83}, "Cooldown: ", {"color",0xFF,0xFF,0xFF}, ""..self:getTalentCooldown(t), true) end - end - local speed = self:getTalentProjectileSpeed(t) - if speed then d:add({"color",0x6f,0xff,0x83}, "Travel Speed: ", {"color",0xFF,0xFF,0xFF}, ""..(speed * 100).."% of base", true) - else d:add({"color",0x6f,0xff,0x83}, "Travel Speed: ", {"color",0xFF,0xFF,0xFF}, "instantaneous", true) - end - if not config.ignore_use_time then - local uspeed = "1 turn" - if t.no_energy and type(t.no_energy) == "boolean" and t.no_energy == true then uspeed = "instant" end - d:add({"color",0x6f,0xff,0x83}, "Usage Speed: ", {"color",0xFF,0xFF,0xFF}, uspeed, true) + if t.mode ~= "passive" then + if self:getTalentRange(t) > 1 then d:add({"color",0x6f,0xff,0x83}, "Range: ", {"color",0xFF,0xFF,0xFF}, ("%0.2f"):format(self:getTalentRange(t)), true) + else d:add({"color",0x6f,0xff,0x83}, "Range: ", {"color",0xFF,0xFF,0xFF}, "melee/personal", true) + end + if not config.ignore_ressources then + if self:getTalentCooldown(t) then d:add({"color",0x6f,0xff,0x83}, "Cooldown: ", {"color",0xFF,0xFF,0xFF}, ""..self:getTalentCooldown(t), true) end + end + local speed = self:getTalentProjectileSpeed(t) + if speed then d:add({"color",0x6f,0xff,0x83}, "Travel Speed: ", {"color",0xFF,0xFF,0xFF}, ""..(speed * 100).."% of base", true) + else d:add({"color",0x6f,0xff,0x83}, "Travel Speed: ", {"color",0xFF,0xFF,0xFF}, "instantaneous", true) + end + if not config.ignore_use_time then + local uspeed = "1 turn" + if t.no_energy and type(t.no_energy) == "boolean" and t.no_energy == true then uspeed = "instant" end + d:add({"color",0x6f,0xff,0x83}, "Usage Speed: ", {"color",0xFF,0xFF,0xFF}, uspeed, true) + end end d:add({"color",0x6f,0xff,0x83}, "Description: ", {"color",0xFF,0xFF,0xFF}) diff --git a/game/modules/tome/class/uiset/Minimalist.lua b/game/modules/tome/class/uiset/Minimalist.lua index 4886121c58..4f18f33ede 100644 --- a/game/modules/tome/class/uiset/Minimalist.lua +++ b/game/modules/tome/class/uiset/Minimalist.lua @@ -1410,14 +1410,12 @@ function _M:displayChatLog(scale, bx, by) if not self.locked and bx >= mhx and bx <= mhx + move_handle[6] and by >= mhy and by <= mhy + move_handle[7] then self:uiMoveResize("chatlog", button, mx, my, xrel, yrel, bx, by, event, "resize", function(mode) log:resize(self.places.chatlog.x, self.places.chatlog.y, self.places.chatlog.w, self.places.chatlog.h) --- log:display() log:resetFade() end) return end --- game.mouse:delegate(button, mx, my, xrel, yrel, nil, nil, event, "playmap", nil) - profile.chat.mouse:delegate(button, mx, my, xrel, yrel, bx, by, event) + profile.chat:mouseEvent(button, mx, my, xrel, yrel, bx, bx, event) end game.mouse:registerZone(bx, by, log.w, log.h, desc_fct, nil, "chatlog", true, scale) end @@ -1600,6 +1598,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("=====") 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} -- GitLab