pref: modify hooks item.
This commit is contained in:
parent
16a2ac33d5
commit
c1f108bdcd
|
@ -211,8 +211,16 @@ export class Game extends Uninstantable {
|
|||
game.callHook("addGroup", [id, short, name, config]);
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
* @typedef {import("../library/hooks/interface.js").NonameHookType} NonameHookType
|
||||
*/
|
||||
/**
|
||||
* 通用的调用钩子函数
|
||||
*
|
||||
* @template {NonameHookType} HookType
|
||||
* @template {keyof HookType} Name
|
||||
* @param {Name} name
|
||||
* @param {Parameters<HookType[Name]>} args
|
||||
*/
|
||||
static callHook(name, args) {
|
||||
const callHook = () => {
|
||||
|
@ -5946,7 +5954,7 @@ export class Game extends Uninstantable {
|
|||
if (!event.forced && !event.fakeforce && get.noSelected()) confirm += 'c';
|
||||
if (event.isMine()) game.Check.confirm(event, confirm);
|
||||
|
||||
game.callHook("checkEnd", [event, { ok, auto, auto_confirm }]);
|
||||
game.callHook("checkEnd", [event, { ok, auto, auto_confirm, autoConfirm: auto_confirm }]);
|
||||
|
||||
// if (ui.confirm && ui.confirm.lastChild.link == 'cancel') {
|
||||
// if (_status.event.type == 'phase' && !_status.event.skill) {
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
import { NonameHook } from "./hook.js"
|
||||
|
||||
export const defaultHooks = {
|
||||
addGroup: new NonameHook("addGroup"),
|
||||
addNature: new NonameHook("addNature"),
|
||||
|
||||
checkBegin: new NonameHook("checkBegin"),
|
||||
checkCard: new NonameHook("checkCard"),
|
||||
checkTarget: new NonameHook("checkTarget"),
|
||||
checkButton: new NonameHook("checkButton"),
|
||||
checkEnd: new NonameHook("checkEnd"),
|
||||
|
||||
uncheckBegin: new NonameHook("uncheckBegin"),
|
||||
uncheckCard: new NonameHook("uncheckCard"),
|
||||
uncheckTarget: new NonameHook("uncheckTarget"),
|
||||
uncheckButton: new NonameHook("uncheckButton"),
|
||||
uncheckEnd: new NonameHook("uncheckEnd")
|
||||
}
|
26564
noname/library/index.js
26564
noname/library/index.js
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue