mirror of
https://github.com/rastapasta/mapscii.git
synced 2024-11-22 08:03:07 +01:00
🎨 adding notify method to display temporary debug information
This commit is contained in:
parent
b790a4d76a
commit
bf5cc5a21d
@ -85,6 +85,10 @@ draw = ->
|
|||||||
getStatus = ->
|
getStatus = ->
|
||||||
"view: [#{view.toString()}] scale: [#{size}] columns: [#{process.stdout.columns}]"
|
"view: [#{view.toString()}] scale: [#{size}] columns: [#{process.stdout.columns}]"
|
||||||
|
|
||||||
|
notify = (text) ->
|
||||||
|
return if drawing
|
||||||
|
process.stdout.write "\r\x1B[K#{getStatus()} #{text}"
|
||||||
|
|
||||||
moving = null
|
moving = null
|
||||||
process.stdin.on 'mousepress', (info) ->
|
process.stdin.on 'mousepress', (info) ->
|
||||||
# TODO: file bug @keypress, fails after x>95 / sequence: '\u001b[M#B'
|
# TODO: file bug @keypress, fails after x>95 / sequence: '\u001b[M#B'
|
||||||
@ -122,7 +126,10 @@ process.stdin.on 'keypress', (ch, key) ->
|
|||||||
else
|
else
|
||||||
false
|
false
|
||||||
|
|
||||||
draw() if result
|
if result
|
||||||
|
draw()
|
||||||
|
else
|
||||||
|
notify JSON.stringify key
|
||||||
|
|
||||||
process.stdout.on 'resize', ->
|
process.stdout.on 'resize', ->
|
||||||
init()
|
init()
|
||||||
|
Loading…
Reference in New Issue
Block a user