aboutsummaryrefslogtreecommitdiffhomepage
path: root/desktop
diff options
context:
space:
mode:
authorDevine Lu Linvega <[email protected]>2019-04-20 09:00:25 +0900
committerDevine Lu Linvega <[email protected]>2019-04-20 09:00:25 +0900
commitf3166955e45f8daeb7757acc8f18ec5701017408 (patch)
tree73fac14c05ad91326aa600f574ed72da400b7664 /desktop
parenta2f602626afc7dabf8535a0bd146cc51cd276e81 (diff)
downloadOrca-f3166955e45f8daeb7757acc8f18ec5701017408.tar.gz
Orca-f3166955e45f8daeb7757acc8f18ec5701017408.zip
Added toggleHardMode
Diffstat (limited to 'desktop')
-rw-r--r--desktop/sources/index.html1
-rw-r--r--desktop/sources/scripts/terminal.js9
2 files changed, 9 insertions, 1 deletions
diff --git a/desktop/sources/index.html b/desktop/sources/index.html
index 2ec6159..a51d515 100644
--- a/desktop/sources/index.html
+++ b/desktop/sources/index.html
@@ -55,6 +55,7 @@
terminal.controller.add("default","View","Zoom Out",() => { terminal.modZoom(-0.25) },"CmdOrCtrl+-")
terminal.controller.add("default","View","Zoom Reset",() => { terminal.modZoom(1,true) },"CmdOrCtrl+0")
terminal.controller.add("default","View","Toggle Retina",() => { terminal.toggleRetina() },"`")
+ terminal.controller.add("default","View","Toggle Hardmode",() => { terminal.toggleHardmode() },"Tab")
terminal.controller.addSpacer('default', 'View', 'commander')
terminal.controller.add("default","View","Toggle Commander",() => { terminal.commander.start() },"CmdOrCtrl+K")
terminal.controller.add("default","View","Run Commander",() => { terminal.commander.run() },"Enter")
diff --git a/desktop/sources/scripts/terminal.js b/desktop/sources/scripts/terminal.js
index 28ccad0..7e8c3ae 100644
--- a/desktop/sources/scripts/terminal.js
+++ b/desktop/sources/scripts/terminal.js
@@ -32,6 +32,7 @@ function Terminal () {
this.grid = { w: 8, h: 8 }
this.tile = { w: 10, h: 15 }
this.scale = window.devicePixelRatio
+ this.hardmode = true
this.install = function (host) {
host.appendChild(this.el)
@@ -96,6 +97,12 @@ function Terminal () {
this.resize(true)
}
+ this.toggleHardmode = function () {
+ this.hardmode = this.hardmode !== true
+ console.log('Terminal', `Hardmode: ${this.hardmode}`)
+ this.update()
+ }
+
this.modGrid = function (x = 0, y = 0) {
const w = clamp(this.grid.w + x, 4, 16)
const h = clamp(this.grid.h + y, 4, 16)
@@ -171,7 +178,7 @@ function Terminal () {
const isLocked = this.orca.lockAt(x, y)
const port = this.ports[this.orca.indexAt(x, y)]
if (this.isSelection(x, y)) { return 4 }
- if (glyph === '.' && isLocked === false) { return this.isLocals(x, y) === true ? 9 : 7 }
+ if (glyph === '.' && isLocked === false && this.hardmode === true) { return this.isLocals(x, y) === true ? 9 : 7 }
if (selection === glyph && isLocked === false && selection !== '.') { return 6 }
if (port) { return port[2] }
if (isLocked === true) { return 5 }