复写可加参数
This commit is contained in:
parent
e1b9aa9b0e
commit
6a478f67d3
@ -520,7 +520,7 @@ core.prototype._forwardFunc = function (name, funcname) {
|
|||||||
var parameterInfo = /^\s*function\s*[\w_$]*\(([\w_,$\s]*)\)\s*\{/.exec(core[name][funcname].toString());
|
var parameterInfo = /^\s*function\s*[\w_$]*\(([\w_,$\s]*)\)\s*\{/.exec(core[name][funcname].toString());
|
||||||
var parameters = (parameterInfo == null ? "" : parameterInfo[1]).replace(/\s*/g, '').replace(/,/g, ', ');
|
var parameters = (parameterInfo == null ? "" : parameterInfo[1]).replace(/\s*/g, '').replace(/,/g, ', ');
|
||||||
// core[funcname] = new Function(parameters, "return core."+name+"."+funcname+"("+parameters+");");
|
// core[funcname] = new Function(parameters, "return core."+name+"."+funcname+"("+parameters+");");
|
||||||
eval("core." + funcname + " = function (" + parameters + ") {\n\treturn core." + name + "." + funcname + "(" + parameters + ");\n}");
|
eval("core." + funcname + " = function (" + parameters + ") {\n\treturn core." + name + "." + funcname + ".apply(core." + name + ", arguments);\n}");
|
||||||
}
|
}
|
||||||
|
|
||||||
core.prototype.doFunc = function (func, _this) {
|
core.prototype.doFunc = function (func, _this) {
|
||||||
|
|||||||
6
runtime.d.ts
vendored
6
runtime.d.ts
vendored
@ -2784,7 +2784,7 @@ declare class icons {
|
|||||||
getTilesetOffset(id?: string): void
|
getTilesetOffset(id?: string): void
|
||||||
}
|
}
|
||||||
|
|
||||||
class plugins {
|
class plugin {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2933,9 +2933,9 @@ type core = {
|
|||||||
readonly utils: utils
|
readonly utils: utils
|
||||||
readonly icons: icons
|
readonly icons: icons
|
||||||
readonly actions: actions
|
readonly actions: actions
|
||||||
readonly plugins: plugins
|
readonly plugin: plugin
|
||||||
|
|
||||||
} & control & events & loader & enemys & items & maps & ui & utils & icons & actions & plugins
|
} & control & events & loader & enemys & items & maps & ui & utils & icons & actions & plugin
|
||||||
|
|
||||||
declare class main {
|
declare class main {
|
||||||
readonly core: core
|
readonly core: core
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user