Implemented (exit)
This commit is contained in:
parent
7a8e25b51b
commit
4358457b20
@ -4,16 +4,6 @@ function Library (ronin) {
|
||||
return path
|
||||
}
|
||||
|
||||
this.folder = (path = ronin.source.path) => {
|
||||
const a = []
|
||||
if (path) {
|
||||
if (fs.existsSync(path)) {
|
||||
return fs.readdirSync(path)
|
||||
}
|
||||
}
|
||||
return a
|
||||
}
|
||||
|
||||
this.save = (path = ronin.source.folder(), type = 'png', quality = 1.0) => {
|
||||
if (!path) { console.warn('Missing save path'); return path }
|
||||
var fullQuality = ronin.surface.el.toDataURL('image/png', quality)
|
||||
@ -47,8 +37,12 @@ function Library (ronin) {
|
||||
return rect
|
||||
}
|
||||
|
||||
this.folder = (path = ronin.source.path) => {
|
||||
return fs.existsSync(path) ? fs.readdirSync(path) : []
|
||||
}
|
||||
|
||||
this.exit = () => {
|
||||
// TODO: Closes Ronin
|
||||
ronin.source.quit()
|
||||
}
|
||||
|
||||
// Logic
|
||||
@ -293,16 +287,10 @@ function Library (ronin) {
|
||||
// Generics
|
||||
|
||||
this.echo = (...args) => {
|
||||
const msg = args.reduce((acc, val) => { return acc + val + ' ' }, '')
|
||||
ronin.log(msg)
|
||||
ronin.log(args)
|
||||
return args
|
||||
}
|
||||
|
||||
this.print = (msg) => {
|
||||
ronin.log(msg)
|
||||
return msg
|
||||
}
|
||||
|
||||
this.str = (...args) => {
|
||||
return args.reduce((acc, val) => { return acc + val }, '')
|
||||
}
|
||||
|
@ -40,7 +40,6 @@ function Ronin () {
|
||||
this.source.start()
|
||||
this.commander.start()
|
||||
this.surface.start()
|
||||
|
||||
console.log('Ronin', 'Started')
|
||||
}
|
||||
|
||||
@ -50,7 +49,7 @@ function Ronin () {
|
||||
|
||||
this.log = function (msg) {
|
||||
console.log(msg)
|
||||
this.commander.setStatus(msg)
|
||||
this.commander.setStatus(msg.reduce((acc, val) => { return acc + val + ' ' }, ''))
|
||||
}
|
||||
|
||||
this.load = function (content = this.default()) {
|
||||
|
@ -4,7 +4,6 @@ function Surface (ronin) {
|
||||
this._guide = document.createElement('canvas')
|
||||
this._guide.id = 'guide'
|
||||
this.ratio = window.devicePixelRatio
|
||||
|
||||
// Contexts
|
||||
this.context = this.el.getContext('2d')
|
||||
this.guide = this.el.getContext('2d')
|
||||
@ -22,11 +21,6 @@ function Surface (ronin) {
|
||||
|
||||
this.start = function () {
|
||||
this.maximize()
|
||||
console.log('Surface', `Ratio:${this.ratio}`)
|
||||
}
|
||||
|
||||
this.update = function () {
|
||||
|
||||
}
|
||||
|
||||
// Shape
|
||||
|
@ -1,5 +0,0 @@
|
||||
; load file
|
||||
|
||||
((clear)
|
||||
(print (folder))
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user