diff options
Diffstat (limited to 'desktop/sources')
-rw-r--r-- | desktop/sources/index.html | 1 | ||||
-rw-r--r-- | desktop/sources/scripts/terminal.js | 9 |
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 } |