refactor(plugins): プラグイン管理UIのグループ化表示および特定ゲーム専用プラグインの分離に対応
- ModPluginDefinition に IsGameSpecific, TargetGameKey, GroupName, DefaultEnabled を追加 - プリンセスシナジー専用プラグイン(AlwaysMaxHp/AlwaysMaxMp)を一般ゲーム一覧から除外し対象ゲーム限定で表示 - TkoolGameItem のプラグイン一覧を CommonPluginOptions と SpecificPluginOptions に分離 - プラグイン設定Expander内に「共通プラグイン」と「固有ゲーム専用プラグイン」のグループ分けUIを実装 - 右側詳細パネルのレイアウトを改善し、起動ボタンを上部固定したまま下部設定のみを開閉可能に変更 - 不要な旧プラグイン GameLauncher_Mod.js の削除および読み込み除外処理を徹底
This commit is contained in:
1 parent
c0989362a9
commit
6f98860892
8 files changed
+273
-198
No files matched your search
@@ -1,99 +0,0 @@
|
||||
/*:
|
||||
* @plugindesc GameLauncher mod (HP once at self turn start / MP always MAX / speed).
|
||||
* @author GameLauncher
|
||||
*
|
||||
* @param EnableHpRecover
|
||||
* @text HP自動回復(自ターン開始時のみ)
|
||||
* @type boolean
|
||||
* @default true
|
||||
*
|
||||
* @param EnableMpRecover
|
||||
* @text MP常時MAX
|
||||
* @type boolean
|
||||
* @default true
|
||||
*
|
||||
* @param SpeedMultiplier
|
||||
* @text 速度倍率
|
||||
* @type number
|
||||
* @decimals 2
|
||||
* @default 3.0
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var pluginName = 'GameLauncher_Mod';
|
||||
var params = PluginManager.parameters(pluginName) || {};
|
||||
|
||||
function toBool(v, def) {
|
||||
if (v === undefined || v === null || v === '') return def;
|
||||
return String(v).toLowerCase() === 'true';
|
||||
}
|
||||
|
||||
var ENABLE_HP = toBool(params['EnableHpRecover'], true);
|
||||
var ENABLE_MP = toBool(params['EnableMpRecover'], true);
|
||||
var SPEED = parseFloat(params['SpeedMultiplier']);
|
||||
if (isNaN(SPEED) || SPEED <= 0) SPEED = 3.0;
|
||||
|
||||
// 自パーティのアクターかどうか(他ゲーム・敵などへ影響しないよう厳密判定)
|
||||
function isPlayerActor(battler) {
|
||||
return battler && typeof battler.isActor === 'function' && battler.isActor();
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// HP: 自ターン開始時に1度だけ MAX まで回復する。
|
||||
// 毎フレーム回復はしない(次ターンまでプレイヤーは自由にHPを減らせる)。
|
||||
// =========================================================================
|
||||
if (ENABLE_HP && typeof BattleManager !== 'undefined' && BattleManager.startTurn) {
|
||||
var _GameLauncher_startTurn = BattleManager.startTurn;
|
||||
BattleManager.startTurn = function () {
|
||||
_GameLauncher_startTurn.call(this);
|
||||
var battler = this.actor && this.actor();
|
||||
if (isPlayerActor(battler)) {
|
||||
// この瞬間に一度だけ全回復(以降はダメージで減らせる)
|
||||
battler.setHp(battler.mhp);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// MP: 常時 MAX を維持する(自アクターのみ、値が mmp 未満なら即座に戻す)。
|
||||
// =========================================================================
|
||||
if (ENABLE_MP && typeof Game_Battler !== 'undefined' && Game_Battler.prototype) {
|
||||
var _GameLauncher_setMp = Game_Battler.prototype.setMp;
|
||||
Game_Battler.prototype.setMp = function (value) {
|
||||
_GameLauncher_setMp.call(this, value);
|
||||
if (isPlayerActor(this)) {
|
||||
this._mp = this.mmp;
|
||||
}
|
||||
};
|
||||
|
||||
var _GameLauncher_refresh = Game_Battler.prototype.refresh;
|
||||
Game_Battler.prototype.refresh = function () {
|
||||
_GameLauncher_refresh.call(this);
|
||||
if (isPlayerActor(this)) {
|
||||
this._mp = this.mmp;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 速度倍率: シーン更新のデルタタイムを実質的に乗算する(speedhack)。
|
||||
// =========================================================================
|
||||
if (SPEED !== 1.0 && typeof SceneManager !== 'undefined' && SceneManager.updateMain) {
|
||||
var _GameLauncher_updateMain = SceneManager.updateMain;
|
||||
SceneManager.updateMain = function () {
|
||||
var scene = this._scene;
|
||||
if (scene && scene.isActive && scene.isActive()) {
|
||||
var delta = this._deltaTime || (1000 / 60);
|
||||
if (scene.update) {
|
||||
scene.update(delta * SPEED);
|
||||
}
|
||||
if (scene.isActive && scene.isActive()) {
|
||||
_GameLauncher_updateMain.call(this);
|
||||
}
|
||||
return;
|
||||
}
|
||||
_GameLauncher_updateMain.call(this);
|
||||
};
|
||||
}
|
||||
})();
|
||||
Reference in new issue
Block a user