ImportSongs: Add plugin support

- Files with filenames that end with .taikoweb.js can be imported and run to add custom functionality to the game
- The plugin file is a javascript module script that should have a class in the default export
- Currently supported methods in the class: name (string), load, start, stop, unload (functions)
- The class can be extended from the Patch class to add automatic patching of variables and functions
- Here are some of the plugins I made: https://github.com/KatieFrogs/taiko-web-plugins
This commit is contained in:
KatieFrogs
2022-02-11 17:28:22 +03:00
parent fd114d9f69
commit 1db4eb6710
43 changed files with 803 additions and 193 deletions

View File

@@ -1,9 +1,12 @@
class IDB{
constructor(name, store){
constructor(...args){
this.init(...args)
}
init(name, store){
this.name = name
this.store = store
}
init(){
start(){
if(this.db){
return Promise.resolve(this.db)
}
@@ -31,7 +34,7 @@ class IDB{
})
}
transaction(method, ...args){
return this.init().then(db =>
return this.start().then(db =>
db.transaction(this.store, "readwrite").objectStore(this.store)[method](...args)
).then(this.promise.bind(this))
}