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

proper keybind for debug menu

git-svn-id: http://svn.net-core.org/repos/t-engine4@4129 51575b47-30f0-44d4-a5cc-537603b46e54
parent f86f65db
No related branches found
No related tags found
No related merge requests found
......@@ -22,4 +22,13 @@ defineAction{
type = "LUA_CONSOLE",
group = "debug",
name = "Show Lua console",
only_on_cheat = true,
}
defineAction{
default = { "sym:_a:true:false:false:false" },
type = "DEBUG_MODE",
group = "debug",
name = "Debug Mode",
only_on_cheat = true,
}
......@@ -189,7 +189,7 @@ function _M:generateList(key_source, force_all)
local l = {}
for virtual, t in pairs(KeyBind.binds_def) do
if (force_all or key_source.virtuals[virtual]) and t.group ~= "debug" then
if (force_all or key_source.virtuals[virtual]) then
l[#l+1] = t
end
end
......@@ -205,21 +205,23 @@ function _M:generateList(key_source, force_all)
local tree = {}
local groups = {}
for _, k in ipairs(l) do
local item = {
k = k,
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,
bind3 = function(item) return KeyBind:getBindTable(k)[3] end,
b1 = function(item) return KeyBind:formatKeyString(util.getval(item.bind1, item)) end,
b2 = function(item) return KeyBind:formatKeyString(util.getval(item.bind2, item)) end,
g = function(item) return KeyBind:formatKeyString(util.getval(item.bind3, item)) end,
}
groups[k.group] = groups[k.group] or {}
table.insert(groups[k.group], item)
if not k.only_on_cheat or config.settings.cheat then
local item = {
k = k,
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,
bind3 = function(item) return KeyBind:getBindTable(k)[3] end,
b1 = function(item) return KeyBind:formatKeyString(util.getval(item.bind1, item)) end,
b2 = function(item) return KeyBind:formatKeyString(util.getval(item.bind2, item)) end,
g = function(item) return KeyBind:formatKeyString(util.getval(item.bind3, item)) end,
}
groups[k.group] = groups[k.group] or {}
table.insert(groups[k.group], item)
end
end
for group, data in pairs(groups) do
......
......@@ -1034,7 +1034,6 @@ function _M:setupCommands()
-- Debug mode
self.key:addCommands{
[{"_q","ctrl"}] = function() if config.settings.cheat then game:registerDialog(require("mod.dialogs.debug.DebugMain").new()) end end,
[{"_d","ctrl"}] = function() if config.settings.cheat then
local g = game.level.map(game.player.x, game.player.y, Map.TERRAIN)
print(g.define_as, g.image, g.z)
......@@ -1319,6 +1318,12 @@ game.player:learnTalent('T_GIFT_OF_AMAKTHEL',true)
self:registerDialog(DebugConsole.new())
end
end,
-- Debug dialog
DEBUG_MODE = function()
if config.settings.cheat then
game:registerDialog(require("mod.dialogs.debug.DebugMain").new())
end
end,
-- Toggle monster list
TOGGLE_NPC_LIST = function()
......
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