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

55 lines
2.4 KiB
JavaScript
Raw Permalink 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.

/*:
* @target MZ
* @plugindesc v1.0 メニューのステートアイコン表示位置を X・Y オフセットで調整します
* @author IvI
*
* @param Offset X
* @text X オフセット
* @type number
* @default 0
* @desc ステートアイコンの X 座標に加算する値px
*
* @param Offset Y
* @text Y オフセット
* @type number
* @default 0
* @desc ステートアイコンの Y 座標に加算する値px
*
* @help
* ■概要
* Window_MenuStatus 内で描画されるステート(状態異常)アイコンの
* 座標を、オフセット指定で簡単に調整できるパッチです。
*
* ■使い方
* 1. このファイルを StateIconPosPatch.js など好きな名前で保存し、
* js/plugins フォルダへ配置します。
* 2. プラグイン管理で VE_Single_Actor_MZ.js より下に入れて有効化します。
* 3. パラメータ「X オフセット」「Y オフセット」に移動量を入力してください。
*
* ■動作仕様
* Window_MenuStatus.prototype.drawActorIcons をエイリアスし、
* オフセットを加算した座標でアイコンを描画します。
* 他ウィンドウのアイコン表示には影響しません。
*
* ■競合
* - 同じメソッドWindow_MenuStatus.prototype.drawActorIcons
* 上書きするプラグインとは競合する可能性があります。
* その場合は読み込み順を調整するか統合してください。
*
* ■ライセンス
* 商用・非商用を問わず改変/再配布自由です。クレジットは任意。
*/
(() => {
const pluginName = "StateIconPosPatch";
const params = PluginManager.parameters(pluginName);
const offsetX = Number(params["Offset X"] || 0);
const offsetY = Number(params["Offset Y"] || 0);
// ───────────────────────────────────────────
// Window_MenuStatus へのパッチ
// ───────────────────────────────────────────
const _drawActorIcons = Window_MenuStatus.prototype.drawActorIcons;
Window_MenuStatus.prototype.drawActorIcons = function (actor, x, y, width) {
_drawActorIcons.call(this, actor, x + offsetX, y + offsetY, width);
};
})();