[2023/09/18: ③] Add prework.
New `game.import` uses `document.currentScript` to determine the code caller. If the script is not `game.js`, we put the result to `_status` for `game.js` to wait, otherwise return the promise directly.
This commit is contained in:
parent
76e058159f
commit
9ac2a0b146
|
@ -29,6 +29,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const GameJS=document.currentScript;
|
||||||
const GeneratorFunction=(function*(){}).constructor;
|
const GeneratorFunction=(function*(){}).constructor;
|
||||||
// gnc: GeNCoroutine
|
// gnc: GeNCoroutine
|
||||||
const gnc={
|
const gnc={
|
||||||
|
@ -166,6 +167,8 @@
|
||||||
hook:{globaltrigger:{},globalskill:{}},
|
hook:{globaltrigger:{},globalskill:{}},
|
||||||
//函数钩子
|
//函数钩子
|
||||||
hooks:{
|
hooks:{
|
||||||
|
// getCurrentScript用到的接口
|
||||||
|
_getCurrentScript:()=>null,
|
||||||
// 本体势力的颜色
|
// 本体势力的颜色
|
||||||
addGroup:[(id,_short,_name,config)=>{
|
addGroup:[(id,_short,_name,config)=>{
|
||||||
if("color" in config&&config.color!=null){
|
if("color" in config&&config.color!=null){
|
||||||
|
@ -32578,8 +32581,8 @@
|
||||||
'妹子,交个朋友吧',
|
'妹子,交个朋友吧',
|
||||||
],
|
],
|
||||||
other:{
|
other:{
|
||||||
bool:(item)=>Boolean(item),
|
getCurrentScript:()=>document.currentScript||lib.hooks._getCurrentScript(),
|
||||||
ignore:()=>{}
|
ignore:()=>void 0
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const game={
|
const game={
|
||||||
|
|
Loading…
Reference in New Issue