changeLayout function takes string instead of whole table
This commit is contained in:
parent
78c2065378
commit
53eef6f083
3 changed files with 5 additions and 6 deletions
|
@ -14,10 +14,10 @@ this.modInfo = "Allows use of non-qwerty keyboard layouts.\n\nCurrently supporte
|
|||
|
||||
function this.log(str) mwse.log("[%s] %s", this.modName, str) end
|
||||
|
||||
function this.changeLayout(keys)
|
||||
function this.changeLayout(layout)
|
||||
-- Thanks NullCascade
|
||||
mwse.memory.writeBytes({address = 0x775148, bytes = keys.lowercase})
|
||||
mwse.memory.writeBytes({address = 0x775248, bytes = keys.uppercase})
|
||||
mwse.memory.writeBytes({address = 0x775148, bytes = keys[layout].lowercase})
|
||||
mwse.memory.writeBytes({address = 0x775248, bytes = keys[layout].uppercase})
|
||||
end
|
||||
|
||||
return this
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
local keys = require("Keyboard Layout Changer.keys")
|
||||
local common = require("Keyboard Layout Changer.common")
|
||||
local config = require("Keyboard Layout Changer.config").getConfig()
|
||||
|
||||
local function onInitialized()
|
||||
common.log("Changing layout to " .. config.keyboardLayout)
|
||||
common.changeLayout(keys[config.keyboardLayout])
|
||||
common.changeLayout(config.keyboardLayout)
|
||||
end
|
||||
|
||||
event.register("initialized", onInitialized)
|
||||
|
|
|
@ -28,7 +28,7 @@ local function applyLayout()
|
|||
local message = "Changing layout to " .. config.keyboardLayout
|
||||
tes3.messageBox(message)
|
||||
common.log(message)
|
||||
common.changeLayout(keys[config.keyboardLayout])
|
||||
common.changeLayout(config.keyboardLayout)
|
||||
end
|
||||
|
||||
local template = mwse.mcm.createTemplate(common.modName)
|
||||
|
|
Loading…
Add table
Reference in a new issue