Implemented (exit)

This commit is contained in:
Devine Lu Linvega 2019-07-16 14:29:13 +09:00
parent 7a8e25b51b
commit 4358457b20
4 changed files with 7 additions and 31 deletions

View File

@ -4,16 +4,6 @@ function Library (ronin) {
return path 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) => { this.save = (path = ronin.source.folder(), type = 'png', quality = 1.0) => {
if (!path) { console.warn('Missing save path'); return path } if (!path) { console.warn('Missing save path'); return path }
var fullQuality = ronin.surface.el.toDataURL('image/png', quality) var fullQuality = ronin.surface.el.toDataURL('image/png', quality)
@ -47,8 +37,12 @@ function Library (ronin) {
return rect return rect
} }
this.folder = (path = ronin.source.path) => {
return fs.existsSync(path) ? fs.readdirSync(path) : []
}
this.exit = () => { this.exit = () => {
// TODO: Closes Ronin ronin.source.quit()
} }
// Logic // Logic
@ -293,16 +287,10 @@ function Library (ronin) {
// Generics // Generics
this.echo = (...args) => { this.echo = (...args) => {
const msg = args.reduce((acc, val) => { return acc + val + ' ' }, '') ronin.log(args)
ronin.log(msg)
return args return args
} }
this.print = (msg) => {
ronin.log(msg)
return msg
}
this.str = (...args) => { this.str = (...args) => {
return args.reduce((acc, val) => { return acc + val }, '') return args.reduce((acc, val) => { return acc + val }, '')
} }

View File

@ -40,7 +40,6 @@ function Ronin () {
this.source.start() this.source.start()
this.commander.start() this.commander.start()
this.surface.start() this.surface.start()
console.log('Ronin', 'Started') console.log('Ronin', 'Started')
} }
@ -50,7 +49,7 @@ function Ronin () {
this.log = function (msg) { this.log = function (msg) {
console.log(msg) console.log(msg)
this.commander.setStatus(msg) this.commander.setStatus(msg.reduce((acc, val) => { return acc + val + ' ' }, ''))
} }
this.load = function (content = this.default()) { this.load = function (content = this.default()) {

View File

@ -4,7 +4,6 @@ function Surface (ronin) {
this._guide = document.createElement('canvas') this._guide = document.createElement('canvas')
this._guide.id = 'guide' this._guide.id = 'guide'
this.ratio = window.devicePixelRatio this.ratio = window.devicePixelRatio
// Contexts // Contexts
this.context = this.el.getContext('2d') this.context = this.el.getContext('2d')
this.guide = this.el.getContext('2d') this.guide = this.el.getContext('2d')
@ -22,11 +21,6 @@ function Surface (ronin) {
this.start = function () { this.start = function () {
this.maximize() this.maximize()
console.log('Surface', `Ratio:${this.ratio}`)
}
this.update = function () {
} }
// Shape // Shape

View File

@ -1,5 +0,0 @@
; load file
((clear)
(print (folder))
)