From 0d778c86bd325d7a6d5d2e6101603800242ecc88 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Wed, 10 May 2017 21:02:57 +0900 Subject: [PATCH] code cleanup unrelated --- assets/modules/basegame/locales/fiFI/game.json | 2 +- .../basegame/locales/koKR/configurator.json | 15 --------------- .../basegame/weathers/generic_light_old.tga | 3 +++ .../virtualcomputer/{bfvt.kts => bfvm.kts} | 12 ++++++------ .../terrarum/gamecontroller/GameController.kt | 6 +++--- 5 files changed, 13 insertions(+), 25 deletions(-) delete mode 100644 assets/modules/basegame/locales/koKR/configurator.json create mode 100644 assets/modules/basegame/weathers/generic_light_old.tga rename assets/modules/dwarventech/virtualcomputer/{bfvt.kts => bfvm.kts} (97%) diff --git a/assets/modules/basegame/locales/fiFI/game.json b/assets/modules/basegame/locales/fiFI/game.json index a3836e08d..c4e253783 100644 --- a/assets/modules/basegame/locales/fiFI/game.json +++ b/assets/modules/basegame/locales/fiFI/game.json @@ -3,7 +3,7 @@ "MENU_MONITOR_CALI_TITLE": "Tarkista näytön", "COPYRIGHT_ALL_RIGHTS_RESERVED": "Kaikki oikeudet pidätetään", - "COPYRIGHT_GNU_GPL_3": "Hajautettu GNU GPL 3", + "COPYRIGHT_GNU_GPL_3": "Jaetaan GNU GPL 3:n mukaisesti", "APP_ADJUST_YOUR_MONITOR": "Paras pelikokemus saavutetaan on oikealla säädetty näytöllä. Jos et ole ollut, säädä ennen pelaamista.", "APP_WARNING_HEALTH_AND_SAFETY": "VAROITUS-TERVEYS JA TURVALLISUUS", diff --git a/assets/modules/basegame/locales/koKR/configurator.json b/assets/modules/basegame/locales/koKR/configurator.json deleted file mode 100644 index 39e6de442..000000000 --- a/assets/modules/basegame/locales/koKR/configurator.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "MENU_MONITOR_CALI_TITLE": "모니터 확인", - "MENU_MONITOR_CALI_LABEL_1": "1번 막대가 배경에서 눈에 띄어야 하고", - "MENU_MONITOR_CALI_LABEL_2": "30·31·32번 막대가 확실히 구분되어야 합니다", - "MENU_MONITOR_CALI_LABEL_3": " ", - "MENU_MONITOR_CALI_LABEL_4": "조정 안 된 모니터에서는 왼쪽 끝의 막대 몇 개가 보이지 않거나", - "MENU_MONITOR_CALI_LABEL_5": "오른쪽 끝의 막대 몇 개가 똑같게 보이거나", - "MENU_MONITOR_CALI_LABEL_6": "31번과 32번의 차이가 크게 보일 것입니다", - "MENU_MONITOR_CALI_LABEL_7": " ", - "MENU_MONITOR_CALI_LABEL_8": "조정된 모니터에서는 1번 막대에서 32번 막대까지 거의 일정하게 밝아지는 것으로 보입니다", - "MENU_MONITOR_CALI_LABEL_9": " ", - "MENU_MONITOR_CALI_LABEL_10": "모니터의 대비와 밝기 설정을 조절해 모니터를 조정해 주십시오", - "MENU_MONITOR_CALI_LABEL_11": " ", - "MENU_MONITOR_CALI_LABEL_12": " " -} \ No newline at end of file diff --git a/assets/modules/basegame/weathers/generic_light_old.tga b/assets/modules/basegame/weathers/generic_light_old.tga new file mode 100644 index 000000000..0c362a7ea --- /dev/null +++ b/assets/modules/basegame/weathers/generic_light_old.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb1262241005177bed648b2d2217e84e0cde6ec969755fd7e445cbce389d065a +size 836 diff --git a/assets/modules/dwarventech/virtualcomputer/bfvt.kts b/assets/modules/dwarventech/virtualcomputer/bfvm.kts similarity index 97% rename from assets/modules/dwarventech/virtualcomputer/bfvt.kts rename to assets/modules/dwarventech/virtualcomputer/bfvm.kts index 332198b86..e5981cc3c 100644 --- a/assets/modules/dwarventech/virtualcomputer/bfvt.kts +++ b/assets/modules/dwarventech/virtualcomputer/bfvm.kts @@ -39,7 +39,7 @@ class BFVM( private val PRN = '.'.toByte() private val RDI = ','.toByte() private val JPZ = '['.toByte() - private val JPN = ']'.toByte() + private val JNZ = ']'.toByte() private val CYA = 0xFF.toByte() @@ -60,7 +60,7 @@ class BFVM( Pair(PRN, { PRN() }), Pair(RDI, { RDI() }), Pair(JPZ, { JPZ() }), - Pair(JPN, { JPN() }), + Pair(JNZ, { JPN() }), Pair(LDZ, { LDZ() }) ) @@ -94,7 +94,7 @@ class BFVM( PRN . Print as text RDI , Read from input JPZ [ Jump past to matching ] when mem is zero - JPN ] Jump back to matching [ when mem is non-zero + JNZ ] Jump back to matching [ when mem is non-zero [ Internal operations ] CYA 0xFF Marks end of the input program @@ -143,7 +143,7 @@ class BFVM( if (JPZ == mem[ir]) { r2++ } - else if (JPN == mem[ir]) { + else if (JNZ == mem[ir]) { r2-- } } @@ -159,7 +159,7 @@ class BFVM( while (r2 != -1) { ir-- - if (JPN == mem[ir]) { + if (JNZ == mem[ir]) { r2++ } else if (JPZ == mem[ir]) { @@ -243,7 +243,7 @@ class BFVM( if (optimizeLevel >= 1) { // [-] or [+] if (r1 == JPZ) { - if ((program[pc + 1] == DEC || program[pc + 1] == INC) && program[pc + 2] == JPN) { + if ((program[pc + 1] == DEC || program[pc + 1] == INC) && program[pc + 2] == JNZ) { pc += 3 putOp(LDZ) continue diff --git a/src/net/torvald/terrarum/gamecontroller/GameController.kt b/src/net/torvald/terrarum/gamecontroller/GameController.kt index 7a5401a78..6cf4b038e 100644 --- a/src/net/torvald/terrarum/gamecontroller/GameController.kt +++ b/src/net/torvald/terrarum/gamecontroller/GameController.kt @@ -67,12 +67,12 @@ object GameController { if (input.isMouseButtonDown(Terrarum.getConfigInt("mouseprimary")) || input.isMouseButtonDown(Terrarum.getConfigInt("mousesecondary"))) { val itemOnGrip = ingame.player!!.inventory.itemEquipped[GameItem.EquipPosition.HAND_GRIP] - if (itemOnGrip != null) { + itemOnGrip?.let { if (input.isMouseButtonDown(Terrarum.getConfigInt("mouseprimary"))) { - ingame.player!!.consumePrimary(itemOnGrip) + ingame.player!!.consumePrimary(it) } if (input.isMouseButtonDown(Terrarum.getConfigInt("mousesecondary"))) { - ingame.player!!.consumeSecondary(itemOnGrip) + ingame.player!!.consumeSecondary(it) } } }