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

Hotkey display now shows the page number

git-svn-id: http://svn.net-core.org/repos/t-engine4@2248 51575b47-30f0-44d4-a5cc-537603b46e54
parent 87e84c5b
No related branches found
No related tags found
No related merge requests found
......@@ -256,6 +256,7 @@ defineAction{
default = { "sym:306:false:false:false:false" },
type = "HOTKEY_HOTPAGE2",
updown = true,
single_key = true,
group = "hotkeys",
name = "Quick switch to Hotkey Page 2",
}
......@@ -263,6 +264,7 @@ defineAction{
default = { "sym:304:false:false:false:false" },
type = "HOTKEY_HOTPAGE3",
updown = true,
single_key = true,
group = "hotkeys",
name = "Quick switch to Hotkey Page 3",
}
......@@ -114,7 +114,7 @@ function _M:display()
end
end
txt = ("%2d) %-"..(self.max_char_w-4-24).."s Key: %s"):format(i, txt, ts[4])
txt = ("%1d/%2d) %-"..(self.max_char_w-4-24).."s Key: %s"):format(a.hotkey_page, i - (a.hotkey_page-1) * 12, txt, ts[4])
local w, h = self.font:size(txt)
if self.cur_sel and self.cur_sel == i then self.surface:erase(0, 50, 120, nil, x, y, w+4, h+4) end
self.surface:drawStringBlended(self.font, txt, x+2, y+2, color[1], color[2], color[3])
......
......@@ -67,10 +67,10 @@ function _M:use(item)
local d = engine.Dialog.new(title, w + 8, h + 25, nil, nil, nil, font)
d:keyCommands{__DEFAULT=function(sym, ctrl, shift, alt, meta, unicode)
-- Modifier keys are not treated
if sym == KeyBind._LCTRL or sym == KeyBind._RCTRL or
if not t.single_key and (sym == KeyBind._LCTRL or sym == KeyBind._RCTRL or
sym == KeyBind._LSHIFT or sym == KeyBind._RSHIFT or
sym == KeyBind._LALT or sym == KeyBind._RALT or
sym == KeyBind._LMETA or sym == KeyBind._RMETA then
sym == KeyBind._LMETA or sym == KeyBind._RMETA) then
return
end
......@@ -140,6 +140,7 @@ function _M:generateList(key_source, force_all)
name = tstring{{"font","italic"}, {"color","AQUAMARINE"}, k.name, {"font","normal"}},
sortname = k.name;
type = k.type,
single_key = k.single_key,
bind1 = function(item) return KeyBind:getBindTable(k)[1] end,
bind2 = function(item) return KeyBind:getBindTable(k)[2] end,
b1 = function(item) return KeyBind:formatKeyString(util.getval(item.bind1, item)) 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