File size: 9,209 Bytes
99b0de1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | //=============================================================================
// CustomizeConfigDefault.js
// ----------------------------------------------------------------------------
// (C)2015 Triacontane
// This plugin is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// 1.2.0 2021/03/01 MZで動作するよう修正、リファクタリング
// 1.1.1 2020/09/13 Mano_InputConfig.jsと併用したとき、Option項目を消していると表示不整合が発生する競合を修正
// 1.1.0 2016/08/01 項目自体を非表示にする機能を追加しました。
// 1.0.3 2016/06/22 多言語対応
// 1.0.2 2016/01/17 競合対策
// 1.0.1 2015/11/01 既存コードの再定義方法を修正(内容に変化なし)
// 1.0.0 2015/11/01 初版
// ----------------------------------------------------------------------------
// [Blog] : https://triacontane.blogspot.jp/
// [Twitter]: https://twitter.com/triacontane/
// [GitHub] : https://github.com/triacontane/
//=============================================================================
/*:
* @plugindesc Setting default value for Options
* @target MZ
* @url https://github.com/triacontane/RPGMakerMV/tree/mz_master/CustomizeConfigDefault.js
* @base PluginCommonBase
* @author triacontane
*
* @param AlwaysDash
* @desc Always dash(ON/OFF)
* @default false
* @type boolean
*
* @param CommandRemember
* @desc Command remember(ON/OFF)
* @default false
* @type boolean
*
* @param TouchUi
* @desc Touch UI(ON/OFF)
* @default true
* @type boolean
*
* @param BgmVolume
* @desc BGM Volume(0-100)
* @default 100
* @max 100
* @type number
*
* @param BgsVolume
* @desc BGS Volume(0-100)
* @default 100
* @max 100
* @type number
*
* @param MeVolume
* @desc ME Volume(0-100)
* @default 100
* @max 100
* @type number
*
* @param SeVolume
* @desc SE Volume(0-100)
* @default 100
* @max 100
* @type number
*
* @param EraseAlwaysDash
* @desc Erase AlwaysDash Option(ON/OFF)
* @default false
* @type boolean
*
* @param EraseCommandRemember
* @desc Erase CommandRemember Option(ON/OFF)
* @default false
* @type boolean
*
* @param EraseTouchUi
* @desc Erase TouchUI Option(ON/OFF)
* @default false
* @type boolean
*
* @param EraseBgmVolume
* @desc Erase BgmVolume Option(ON/OFF)
* @default false
* @type boolean
*
* @param EraseBgsVolume
* @desc Erase BgsVolume Option(ON/OFF)
* @default false
* @type boolean
*
* @param EraseMeVolume
* @desc Erase MeVolume Option(ON/OFF)
* @default false
* @type boolean
*
* @param EraseSeVolume
* @desc Erase SeVolume Option(ON/OFF)
* @default false
* @type boolean
*
* @help Setting default value for Options.
*
* This plugin is released under the MIT License.
*/
/*:ja
* @plugindesc オプションデフォルト値設定プラグイン
* @target MZ
* @url https://github.com/triacontane/RPGMakerMV/tree/mz_master/CustomizeConfigDefault.js
* @base PluginCommonBase
* @author トリアコンタン
*
* @param AlwaysDash
* @text 常時ダッシュ
* @desc 常にダッシュする。(Shiftキーを押している場合のみ歩行)(ON/OFF)
* @default false
* @type boolean
*
* @param CommandRemember
* @text コマンド記憶
* @desc 選択したコマンドを記憶する。(ON/OFF)
* @default false
* @type boolean
*
* @param TouchUi
* @text タッチUi
* @desc タッチ用のボタン等をメニュー画面に表示する。(ON/OFF)
* @default true
* @type boolean
*
* @param BgmVolume
* @text BGM音量
* @desc BGMの音量。0-100
* @default 100
* @max 100
* @type number
*
* @param BgsVolume
* @text BGS音量
* @desc BGSの音量。0-100
* @default 100
* @max 100
* @type number
*
* @param MeVolume
* @text ME音量
* @desc MEの音量。0-100
* @default 100
* @max 100
* @type number
*
* @param SeVolume
* @text SE音量
* @desc SEの音量。0-100
* @default 100
* @max 100
* @type number
*
* @param EraseAlwaysDash
* @text 常時ダッシュ消去
* @desc 常時ダッシュの項目を非表示にする。(ON/OFF)
* @default false
* @type boolean
*
* @param EraseCommandRemember
* @text コマンド記憶消去
* @desc コマンド記憶の項目を非表示にする。(ON/OFF)
* @default false
* @type boolean
*
* @param EraseTouchUi
* @text タッチUI消去
* @desc タッチUIの項目を非表示にする。(ON/OFF)
* @default false
* @type boolean
*
* @param EraseBgmVolume
* @text BGM音量消去
* @desc BGM音量の項目を非表示にする。(ON/OFF)
* @default false
* @type boolean
*
* @param EraseBgsVolume
* @text BGS音量消去
* @desc BGS音量の項目を非表示にする。(ON/OFF)
* @default false
* @type boolean
*
* @param EraseMeVolume
* @text ME音量消去
* @desc ME音量の項目を非表示にする。(ON/OFF)
* @default false
* @type boolean
*
* @param EraseSeVolume
* @text SE音量消去
* @desc SE音量の項目を非表示にする。(ON/OFF)
* @default false
* @type boolean
*
* @help オプション画面で設定可能な項目のデフォルト値を指定した値に変更します。
* 例えば、初回から常時ダッシュをONにしておけば
* プレイヤーが設定を変更する手間を省くことができます。
* この処理はconfig.rpgsaveが未作成の場合にのみ実行されます。
*
* また、項目そのものを消去することもできます。
* 例えば、戦闘がないゲームでは「コマンド記憶」等は不要なので消去できます。
*
* このプラグインにはプラグインコマンドはありません。
*
* 利用規約:
* 作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
* についても制限はありません。
* このプラグインはもうあなたのものです。
*/
(() => {
'use strict';
const script = document.currentScript;
const param = PluginManagerEx.createParameter(script);
//=============================================================================
// ConfigManager
// それぞれの項目に初期値を与えます。
//=============================================================================
const _ConfigManager_load = ConfigManager.load;
ConfigManager.load = function () {
this.alwaysDash = param.AlwaysDash;
this.commandRemember = param.CommandRemember;
this.touchUI = param.TouchUi;
this.bgmVolume = param.BgmVolume;
this.bgsVolume = param.BgsVolume;
this.meVolume = param.MeVolume;
this.seVolume = param.SeVolume;
_ConfigManager_load.apply(this, arguments);
};
//=============================================================================
// Scene_Options
// オプションウィンドウの高さを調整します。
//=============================================================================
const _Scene_Options_maxCommands = Scene_Options.prototype.maxCommands;
Scene_Options.prototype.maxCommands = function() {
let count = _Scene_Options_maxCommands.apply(this, arguments);
if (param.EraseAlwaysDash) count--;
if (param.EraseCommandRemember) count--;
if (param.EraseTouchUi) count--;
if (param.EraseBgmVolume) count--;
if (param.EraseBgsVolume) count--;
if (param.EraseMeVolume) count--;
if (param.EraseSeVolume) count--;
return count;
};
//=============================================================================
// Window_Options
// パラメータを空白にした項目を除去します。
//=============================================================================
const _Window_Options_makeCommandList = Window_Options.prototype.makeCommandList;
Window_Options.prototype.makeCommandList = function () {
_Window_Options_makeCommandList.apply(this, arguments);
if (param.EraseAlwaysDash) this.eraseOption('alwaysDash');
if (param.EraseCommandRemember) this.eraseOption('commandRemember');
if (param.EraseTouchUi) this.eraseOption('touchUI')
if (param.EraseBgmVolume) this.eraseOption('bgmVolume');
if (param.EraseBgsVolume) this.eraseOption('bgsVolume');
if (param.EraseMeVolume) this.eraseOption('meVolume');
if (param.EraseSeVolume) this.eraseOption('seVolume');
};
Window_Options.prototype.eraseOption = function (symbol) {
for (let i = 0; i < this._list.length; i++) {
if (this._list[i].symbol === symbol) {
this._list.splice(i, 1);
// for Mano_InputConfig.js
this.adjustIndexManoInputConfig(i);
break;
}
}
};
Window_Options.prototype.adjustIndexManoInputConfig = function (index) {
if (this._gamepadOptionIndex > index) {
this._gamepadOptionIndex -= 1;
}
if (this._keyboardConfigIndex > index) {
this._keyboardConfigIndex -= 1;
}
};
})(); |