一応、スクリプトで選択肢の表示とラベルジャンプを組み合わせれば可能だと思います。
雛形を書くならこんな感じですね。
スクリプト部分を抜粋するとコードはこれです。
コード: 全て選択
const choices = [];
const cancelChoice = "キャンセル選択";
choices.push ("選択肢1");
if ($gameSwitches.value(2)) choices.push ("選択肢2"); // スイッチ2がONの場合選択肢追加
const cancelType = choices.length;
const defaultType = 0; // 初期選択位置
const positionType = 2; // ウィンドウ位置
const background = 0; // ウィンドウ背景
$gameMessage.setChoices(choices, defaultType, cancelType);
$gameMessage.setChoiceBackground(background);
$gameMessage.setChoicePositionType(positionType);
$gameMessage.setChoiceCallback(n => {
const selectChoice = choices.concat([cancelChoice])[n];
this.command119([selectChoice]);
});
this.setWaitMode("message");
コードの
const cancelType = choices.length;よりも下の部分はとりあえず無視してもらって構いません。
choices.pushの部分を増やせば増やすほど選択肢が増えていき
選択決定された文字列を基にラベルジャンプ処理に移行する、というコードです。
if ($gameSwitches.value(2)) choices.push ("選択肢2"); // スイッチ2がONの場合選択肢追加
等と書く事で条件付きで選択肢を増やす事が出来ます。
キャンセルボタンが押された場合はcancelChoiceの文字列にラベルジャンプします。
この辺を適当に調節すれば望みの仕様になるのではないかなと。
追記:需要があるか分からないですけど
ラベルを使わずに直接コモンイベントを呼びだす変形版も思いつきました。
コード: 全て選択
const cancelChoice = {text: "キャンセル選択", commonId: 4};
const choices = [];
choices.push ({text: "選択肢1", commonId: 1});
if ($gameSwitches.value(2)) choices.push ({text: "選択肢2", commonId: 2});
if ($gameSwitches.value(3)) choices.push ({text: "選択肢3", commonId: 3});
const defaultType = 0; // 初期選択位置
const cancelType = choices.length;
$gameMessage.setChoices(choices.map(c => c['text']), defaultType, cancelType);
$gameMessage.setChoiceCallback(n => {
const selectCommonId = choices.concat([cancelChoice])[n]['commonId'];
this.setupChild($dataCommonEvents[selectCommonId].list, this._eventId);
});
this.setWaitMode("message");
基本的な構造は上のコードと同じです。
choices.push ({text: "選択肢1", commonId: 1});の部分を増やしていけば選択肢が増えます。
textの部分が選択肢の表示テキスト、
commonIdの部分が選択決定した時に呼び出されるコモンイベントIDですね。
ラベルジャンプでswitch文を再現するよりもこちらの方がまだ実用的かなと。
ついでにデフォルト値から変更する必要がない箇所は指定する必要もないので省略しました。