增加chooseButton的默认complexSelect

This commit is contained in:
kuangshen04 2024-03-06 18:06:36 +08:00
parent ed9d00205d
commit 73b8d0e9c6
2 changed files with 5 additions and 2 deletions

View File

@ -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;

View File

@ -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;