pref: modify hooks item.

This commit is contained in:
Rintim 2024-03-16 19:00:28 +08:00
parent 16a2ac33d5
commit c1f108bdcd
No known key found for this signature in database
GPG Key ID: BE9E1EA615BACFCF
3 changed files with 13193 additions and 13399 deletions

View File

@ -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) {

View File

@ -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")
}

File diff suppressed because it is too large Load Diff