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

Left click on an hostile target can now be bound to a talent (archers get it...

Left click on an hostile target can now be bound to a talent (archers get it bound to Shoot by default)


git-svn-id: http://svn.net-core.org/repos/t-engine4@2446 51575b47-30f0-44d4-a5cc-537603b46e54
parent 96b7cc5c
No related branches found
No related tags found
No related merge requests found
......@@ -533,7 +533,7 @@ function _M:cooldownTalents()
end
--- Show usage dialog
function _M:useTalents()
local d = require("engine.dialogs.UseTalents").new(self)
function _M:useTalents(add_cols)
local d = require("engine.dialogs.UseTalents").new(self, add_cols)
game:registerDialog(d)
end
......@@ -24,6 +24,24 @@ local Base = require "engine.ui.Base"
--- A generic UI button
module(..., package.seeall, class.inherit(Base))
--- Requests a simple, press any key, dialog
function _M:listPopup(title, text, list, w, h, fct)
local d = new(title, 1, 1)
local desc = require("engine.ui.Textzone").new{width=w, auto_height=true, text=text, scrollbar=true}
local l = require("engine.ui.List").new{width=w, height=h-16 - desc.h, list=list, fct=function() d.key:triggerVirtual("ACCEPT") end}
d:loadUI{
{left = 3, top = 3, ui=desc},
{left = 3, top = 3 + desc.h + 3, ui=require("engine.ui.Separator").new{dir="vertical", size=w - 12}},
{left = 3, bottom = 3, ui=l},
}
d.key:addBind("EXIT", function() game:unregisterDialog(d) if fct then fct() end end)
d.key:addBind("ACCEPT", function() game:unregisterDialog(d) if fct then fct(list[l.sel]) end end)
d:setFocus(l)
d:setupUI(true, true)
game:registerDialog(d)
return d
end
--- Requests a simple, press any key, dialog
function _M:simplePopup(title, text, fct, no_leave)
local w, h = self.font:size(text)
......
......@@ -132,10 +132,15 @@ function _M:drawItem(item)
for i, col in ipairs(self.columns) do
local level = item.level
local color = util.getval(item.color, item) or {255,255,255}
local text = item[col.display_prop or col.sort]
if type(text) ~= "table" or not text.is_tstring then
text = util.getval(text, item)
if type(text) ~= "table" then text = tstring.from(tostring(text)) end
local text
if type(col.display_prop) == "function" then
text = col.display_prop(item):toTString()
else
text = item[col.display_prop or col.sort]
if type(text) ~= "table" or not text.is_tstring then
text = util.getval(text, item)
if type(text) ~= "table" then text = tstring.from(tostring(text)) end
end
end
local s = col.surface
......
......@@ -913,7 +913,7 @@ function _M:setupCommands()
end,
USE_TALENTS = not_wild(function()
self.player:useTalents()
self:registerDialog(require("mod.dialogs.UseTalents").new(self.player))
end),
LEVELUP = function()
......
......@@ -19,13 +19,13 @@
return [[During your adventures you will find items.
Each item has a weight. How much you can carry depends on your Strength: this is your maximum encumberance.
To pickup an item, press ',' or right click on yourself while standing over it.
To view your inventory, press 'I' or right-click on yourself.
To pickup an item, press 'g' or right click on yourself while standing over it.
To view your inventory, press 'i' or right-click on yourself.
Your inventory is split in two panels: your equipped items and your backpack.
To select an item, use the movement keys and press enter, click it with the mouse, or press the key next to it's name.
The item you've found is an infusion. Infusions and runes allow you to bind a power to your body, gaining new abilities.
The item you've found is an infusion. Infusions and runes allow you to bind a power to your body, gaining new abilities.
Infusions come from the powers of nature while runes use magic.
This infusion inscribes you with the power to regenerate your life at will. You can only have a finite number of inscriptions, but they can easily be replaced.
......
No preview for this file type
File added
No preview for this file type
File added
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