From 73b8d0e9c6c5156ffcdbb19365dd0269ac72d396 Mon Sep 17 00:00:00 2001 From: kuangshen04 <2832899707@qq.com> Date: Wed, 6 Mar 2024 18:06:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0chooseButton=E7=9A=84?= =?UTF-8?q?=E9=BB=98=E8=AE=A4complexSelect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/library/element/content.js | 3 ++- noname/library/element/player.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/noname/library/element/content.js b/noname/library/element/content.js index 9ce2bc139..83fb76409 100644 --- a/noname/library/element/content.js +++ b/noname/library/element/content.js @@ -3151,6 +3151,7 @@ export const Content = { next.set('ai', info.chooseButton.check || function () { return 1; }); next.set('filterButton', info.chooseButton.filter || function () { return true; }); next.set('selectButton', info.chooseButton.select || 1); + next.set('complexSelect', info.chooseButton.complexSelect !== false); next.set('filterOk', info.chooseButton.filterOk || (() => true)); if (event.id) next._parent_id = event.id; next.type = 'chooseToUse_button'; @@ -4546,7 +4547,7 @@ export const Content = { event.dialog.style.display = ''; event.dialog.open(); } - if (['chooseCharacter', 'chooseButtonOL'].includes(event.getParent().name)) event.complexSelect = true; + // if (['chooseCharacter', 'chooseButtonOL'].includes(event.getParent().name)) event.complexSelect = true; var filterButton = event.filterButton || function () { return true; }; var selectButton = get.select(event.selectButton); var buttons = event.dialog.buttons; diff --git a/noname/library/element/player.js b/noname/library/element/player.js index ca64ccef2..2800ed4fc 100644 --- a/noname/library/element/player.js +++ b/noname/library/element/player.js @@ -4267,7 +4267,8 @@ export class Player extends HTMLDivElement { var next = game.createEvent('chooseButton'); for (var i = 0; i < arguments.length; i++) { if (typeof arguments[i] == 'boolean') { - next.forced = arguments[i]; + if (!next.forced) next.forced = arguments[i]; + else next.complexSelect = arguments[i]; } else if (get.itemtype(arguments[i]) == 'dialog') { next.dialog = arguments[i]; @@ -4293,6 +4294,7 @@ export class Player extends HTMLDivElement { if (next.filterButton == undefined) next.filterButton = lib.filter.filterButton; if (next.selectButton == undefined) next.selectButton = [1, 1]; if (next.ai == undefined) next.ai = function () { return 1; }; + if (next.complexSelect !== false) next.complexSelect = true; next.setContent('chooseButton'); next._args = Array.from(arguments); next.forceDie = true;