CCAPI update as "bit" is now an alias of "bit32"

Former-commit-id: 68c272908747e3ab451799b4cddd211fbee09489
Former-commit-id: aeaa3e995030501175d3692248a1a3cc2d9bfcfa
This commit is contained in:
Song Minjae
2016-09-28 00:44:43 +09:00
parent 7fec3fc066
commit 4b1ff36344
2 changed files with 24 additions and 30 deletions

View File

@@ -22,14 +22,14 @@ class Input(globals: Globals, computer: BaseTerrarumComputer) {
val keys_caps = intArrayOf(Key.CAPS_LOCK, Key.BACKSPACE, Key.L_CONTROL)
}
class IsKeyDown(val computer: BaseTerrarumComputer) : OneArgFunction() {
class IsKeyDown(val host: BaseTerrarumComputer) : OneArgFunction() {
override fun call(keyCode: LuaValue): LuaValue {
val key = keyCode.checkint()
// L_Alt and L_COMMAND are homogeneous
if (keys_alt.contains(key)) {
for (k in keys_alt) {
val down = computer.input.isKeyDown(k)
val down = host.input.isKeyDown(k)
if (down) return LuaValue.valueOf(true)
}
}
@@ -37,12 +37,12 @@ class Input(globals: Globals, computer: BaseTerrarumComputer) {
// Caps, Backspace, L_Control, for Colemak and HHKB
if (keys_caps.contains(key)) {
for (k in keys_caps) {
val down = computer.input.isKeyDown(k)
val down = host.input.isKeyDown(k)
if (down) return LuaValue.valueOf(true)
}
}
return LuaValue.valueOf(computer.input.isKeyDown(keyCode.checkint()))
return LuaValue.valueOf(host.input.isKeyDown(keyCode.checkint()))
}
}
}