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

better hotkeys

git-svn-id: http://svn.net-core.org/repos/t-engine4@95 51575b47-30f0-44d4-a5cc-537603b46e54
parent 42b63f71
No related branches found
No related tags found
No related merge requests found
-- Convert unicode keys to other unicode keys depending on locale
-- This allows to support the number bar "hotkeys" without too much trouble
if locale == "frFR" then
if locale == "fr_FR" then
return {
[_AMPERSAND] = _1,
[_WORLD_73] = _2,
......
require "config"
require "engine.class"
require "engine.Key"
......@@ -122,7 +123,7 @@ function _M:loadLocaleConvertion(file)
local f, err = loadfile(file)
if not f and err then error(err) end
setfenv(f, setmetatable({
locale = "frFR",
locale = config.settings.keyboard.locale,
}, {__index=engine.Key}))
conv = f() or {}
......
......@@ -48,7 +48,7 @@ end
function _M:defineHotkey(id)
self.actor.hotkey[id] = self.list[self.talentsel].talent
print("hotkey: ", id, "=>", self.list[self.talentsel].talent)
self:simplePopup("Hotkey "..id.." assigned", self.actor:getTalentFromId(self.list[self.talentsel].talent).name:capitalize().." assigned to hotkey "..id)
end
function _M:use()
......@@ -77,6 +77,7 @@ function _M:drawDialog(s)
self:drawHBorder(s, self.iw / 2, 2, self.ih - 4)
local talentshelp = ([[Keyboard: #00FF00#up key/down key#FFFFFF# to select a stat; #00FF00#enter#FFFFFF# to use.
#00FF00#1-0#FFFFFF# to assign a hotkey.
Mouse: #00FF00#Left click#FFFFFF# to use.
]]):splitLines(self.iw / 2 - 10, self.font)
......
--[[ Allows for remote debugging, but it makes things *SLOW*
require"remdebug.engine"
remdebug.engine.start()
]]
-- load some utility functions
dofile("/engine/utils.lua")
require "config"
require "engine.KeyCommand"
require "engine.Savefile"
require "engine.Tiles"
......@@ -18,6 +14,14 @@ fs.mkdir(fs.getHomePath())
fs.mkdir(fs.getHomePath().."/4.0/")
fs.setWritePath(fs.getHomePath())
-- Loads default config & user config
fs.mount(engine.homepath, "/")
config.loadString[[
keyboard.locale = "en_US"
]]
config.load("/settings.cfg")
fs.umount(engine.homepath)
-- Setup a default key handler
local key = engine.KeyCommand.new()
key:setCurrent()
......
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