From 42f0ac7cf42f17d294c32b68d41b247317f2941b Mon Sep 17 00:00:00 2001 From: Miao_Spring <539943419@qq.com> Date: Sun, 14 Jul 2024 00:36:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8D=87=E5=AF=B9=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content.js | 7 ++++--- extension.js | 4 +++- miaoTool.js | 12 +++++++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/content.js b/content.js index 8d96833..de57856 100644 --- a/content.js +++ b/content.js @@ -1,7 +1,8 @@ import miaoTool from "./miaoTool.js"; -export default function content (config, pack) { - lib.miaoTool = miaoTool +export default (lib, game, ui, get, ai, _status) => (config, pack) => { + lib.miaoTool = miaoTool(lib, game, ui, get, ai, _status) + console.log(666,miaoTool(lib, game, ui, get, ai, _status)) /*---------------------------------------------------------------以下为杂项---------------------------------------------------------------*/ get.is.xuemai = function (skill) { var info = lib.skill[skill]; @@ -506,7 +507,7 @@ export default function content (config, pack) { }; game.changeGlobalStatus = function () { - /*改变场上状态,example:game.changeGlobalStatus(5,3,"xiyu",ture,"phase") 表示强制转换为细雨天气5回合并锁定3回合,来源默认为event.player*/ + /*改变场上状态,example:game.changeGlobalStatus(5,3,"xiyu",true,"phase") 表示强制转换为细雨天气5回合并锁定3回合,来源默认为event.player*/ if (!game.hasGlobalStatusButton) { game.hasGlobalStatusButton = true; ui.globalStatusButton = ui.create.system("喵喵", null, true); diff --git a/extension.js b/extension.js index 839f54c..f5c0212 100644 --- a/extension.js +++ b/extension.js @@ -1,8 +1,10 @@ import content from "./content.js"; +import _miaoTool from "./miaoTool.js"; game.import("extension", function (lib, game, ui, get, ai, _status) { + const miaoTool = _miaoTool(lib, game, ui, get, ai, _status) return { name: "喵喵喵喵", - content, + content:content(lib, game, ui, get, ai, _status), precontent: function () {}, help: {}, config: {}, diff --git a/miaoTool.js b/miaoTool.js index 07402dd..1128c5b 100644 --- a/miaoTool.js +++ b/miaoTool.js @@ -1 +1,11 @@ -export default { test: "test" }; +export default (lib, game, ui, get, ai, _status) => { + return { + test: "test123", + isAsyncFunction(func) { + return func.constructor.name === 'AsyncFunction'; + }, + watch: function (obj, key, callback) { + + }, + }; +};