pure-full-lily/js/plugins/MapListOutput.js
2025-09-16 10:12:44 -05:00

51 lines
1.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//=============================================================================
// MapListOutput.js
// ----------------------------------------------------------------------------
// ゲーム起動時に全マップ ID と名前をタブ区切りでコンソール出力
// Copyright (c) 2025
// Released under the MIT license.
//=============================================================================
/*:
* @target MZ
* @plugindesc ゲーム起動時に全マップIDとマップ名をタブ区切りで出力スプシ貼り付け対応
* @author IvI
*
* @help
* ▼使い方
* 1. このファイルを「MapListOutput.js」という名前で /js/plugins フォルダに置く
* 2. プラグイン管理で ON にする
* 3. ゲームを起動(テストプレイ)するとコンソールに
* ID<TAB>Name
* 1<TAB>Town
* 2<TAB>Dungeon Entrance
* …
* の形式で一覧が出ます
*
* 出力された行を丸ごとコピーして Google スプレッドシートに貼り付ければ
* ID と Name の 2 列に自動で分割されます。
*
* 追加設定は不要、導入するだけで動作します。
*/
(() => {
"use strict";
/** 全マップ一覧をタブ区切りで表示する */
function printAllMapInfos() {
if (!$dataMapInfos) return; // まだロード前なら抜ける
console.log("ID\tName"); // ヘッダー
$dataMapInfos.forEach((info, id) => {
if (info) { // index 0 は null
console.log(`${id}\t${info.name}`);
}
});
}
/** Scene_Boot.start をフックしてロード完了後に実行 */
const _Scene_Boot_start = Scene_Boot.prototype.start;
Scene_Boot.prototype.start = function() {
_Scene_Boot_start.call(this);
printAllMapInfos();
};
})();