From 2977a40e6ba2b867e1363dbebc7a079f0a16677a Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Tue, 23 Feb 2010 00:22:21 +0000 Subject: [PATCH] tactical display git-svn-id: http://svn.net-core.org/repos/t-engine4@338 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/data/keybinds/actions.lua | 7 +++++++ game/modules/tome/class/Game.lua | 22 ++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/game/data/keybinds/actions.lua b/game/data/keybinds/actions.lua index ef633059e9..988a641a43 100644 --- a/game/data/keybinds/actions.lua +++ b/game/data/keybinds/actions.lua @@ -39,6 +39,13 @@ defineAction{ name = "Quit game", } +defineAction{ + default = { "sym:116:false:true:false:false" }, + type = "TACTICAL_DISPLAY", + group = "actions", + name = "Tactical display on/off", +} + defineAction{ default = { "sym:116:true:false:false:false" }, type = "SHOW_TIME", diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index d18e667cc9..3df6e1d2ca 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -481,18 +481,6 @@ function _M:setupCommands() self:saveGame() end, - -- Toggle tactical displau - SHOW_TIME = function() - if Map.view_faction then - self:targetMode(false, true) - self.always_target = nil - else - self.always_target = true - self:targetMode(true, true) - -- Find nearest target - self.target:scan(5) - end - end, -- Show time SHOW_TIME = function() self.log(self.calendar:getTimeDate(self.turn)) @@ -517,6 +505,16 @@ function _M:setupCommands() local menu = require("engine.dialogs.GameMenu").new{"resume", "keybinds", "resolution", "save", "quit"} self:registerDialog(menu) end, + + TACTICAL_DISPLAY = function() + if Map.view_faction then + self.always_target = nil + Map:setViewerFaction(nil) + else + self.always_target = true + Map:setViewerFaction("players") + end + end, } --[[ -- GitLab