diff options
author | Devine Lu Linvega <[email protected]> | 2019-04-20 09:00:25 +0900 |
---|---|---|
committer | Devine Lu Linvega <[email protected]> | 2019-04-20 09:00:25 +0900 |
commit | f3166955e45f8daeb7757acc8f18ec5701017408 (patch) | |
tree | 73fac14c05ad91326aa600f574ed72da400b7664 /desktop/sources/scripts/terminal.js | |
parent | a2f602626afc7dabf8535a0bd146cc51cd276e81 (diff) | |
download | Orca-f3166955e45f8daeb7757acc8f18ec5701017408.tar.gz Orca-f3166955e45f8daeb7757acc8f18ec5701017408.zip |
Added toggleHardMode
Diffstat (limited to 'desktop/sources/scripts/terminal.js')
-rw-r--r-- | desktop/sources/scripts/terminal.js | 9 |
1 files changed, 8 insertions, 1 deletions
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 } |