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

draging on the player doll will take the most likely action

git-svn-id: http://svn.net-core.org/repos/t-engine4@4646 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2fa6317e
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,15 @@ function _M:generate()
self.inner_scroll = self:makeFrame("ui/tooltip/", self.w, self.h)
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)
if self:mouseEvent(button, x, y, xrel, yrel, bx, by, event) then
-- nothing, already done
elseif button == "drag-end" and self.drag_enable then
local drag = game.mouse.dragged.payload
if drag.kind == "inventory" and drag.inven and self.actor:getInven(drag.inven) and not self.actor:getInven(drag.inven).worn then
self:actorWear(drag.inven, drag.item_idx, drag.object)
game.mouse:usedDrag()
end
end
end)
self.key:addBinds{
ACCEPT = function() if self.focus_ui then self.focus_ui.ui.key:triggerVirtual("ACCEPT") end end,
......@@ -114,7 +122,7 @@ function _M:mouseEvent(button, x, y, xrel, yrel, bx, by, event)
-- Pass the event
ui.ui.mouse:delegate(button, bx, by, xrel, yrel, bx, by, event)
return
return true
end
end
self:no_focus()
......
......@@ -118,6 +118,6 @@ newTalent{
- Stone Golem: Melee blows can deal a small area of effect damage
- Turtle: Can force all foes in a radius into melee range
- Spider: Can project an insidious poison at its foes, reducing their healing
This talent requires Master Summoner to be active to be used.]])
This talent requires Master Summoner to be active to be used.]]):format(math.floor(self:getTalentLevel(t)))
end,
}
......@@ -42,7 +42,14 @@ Items in the chest will not encumber you.]],
use_power = { name = "transmogrify all the items in your chest at once(also done automatically when you change level)", power = 0,
use = function(self, who)
local inven = who:getInven("INVEN")
require("engine.ui.Dialog"):yesnoPopup("Transmogrification Chest", "Transmogrify all "..#inven.." item(s) in your chest?", function(ret)
local nb = 0
for i = #inven, 1, -1 do
local o = inven[i]
if o.__transmo then nb = nb + 1 end
end
if nb <= 0 then require("engine.ui.Dialog"):simplePopup("Transmogrification Chest", "You do not have any items to transmogrify in your chest.") return {id=true, used=true} end
require("engine.ui.Dialog"):yesnoPopup("Transmogrification Chest", "Transmogrify all "..nb.." item(s) in your chest?", function(ret)
if not ret then return end
for i = #inven, 1, -1 do
local o = inven[i]
......
......@@ -368,7 +368,9 @@ function _M:cancel()
end
self.actor.last_learnt_talents = self.actor_dup.last_learnt_talents
]]
local ax, ay = self.actor.x, self.actor.y
self.actor:replaceWith(self.actor_dup)
self.actor.x, self.actor.y = ax, ay
self.actor.changed = true
self.actor:removeAllMOs()
if game.level and self.actor.x then game.level.map:updateMap(self.actor.x, self.actor.y) end
......
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