64 lines
No EOL
2.5 KiB
JavaScript
64 lines
No EOL
2.5 KiB
JavaScript
//=============================================================================
|
||
// MW_SkillScene.js
|
||
//=============================================================================
|
||
/*:
|
||
* @plugindesc スキルパネルメニュー表示時に画面の中心を変更する
|
||
* @author 銀河
|
||
* @help
|
||
* スキルパネルメニュー表示時に画面の中心を変更するプラグインです。
|
||
* 指定したスイッチがOFFまたは0の場合、画面の位置は変わりません。
|
||
*
|
||
* @param 許可変数
|
||
* @type variable
|
||
* @desc 画面の中心の変更を許可する変数を指定します(初期値:0)
|
||
* @default 0
|
||
* @min 0
|
||
*/
|
||
|
||
//本屋ミニゲーム時(251)
|
||
//野球拳ミニゲーム時(238)
|
||
(function() {
|
||
|
||
var parameters = PluginManager.parameters('MW_SkillScene');
|
||
var EnableID = Number(parameters['許可スイッチ'] || 0);
|
||
|
||
var _Game_Player_prototype_centerX = Game_Player.prototype.centerX;
|
||
var _Game_Player_prototype_centerY = Game_Player.prototype.centerY;
|
||
|
||
Game_Player.prototype.centerX = function() {
|
||
if($gameSwitches.value(657)){
|
||
return ((Graphics.width-264) / $gameMap.tileWidth() - 1) / 2.0; //202030717 スイッチを251→657に変更(本屋イベント以外の立ち絵エロの座標がおかしくなるため)
|
||
}
|
||
else if((EnableID!=0)&&($gameSwitches.value(EnableID))){
|
||
return ((Graphics.width+374) / $gameMap.tileWidth() - 1) / 2.0;
|
||
}
|
||
else if($gameSwitches.value(238)){
|
||
return ((Graphics.width-336) / $gameMap.tileWidth() - 1) / 2.0;
|
||
}
|
||
else if($gameSwitches.value(789)){
|
||
return ((Graphics.width-300) / $gameMap.tileWidth() - 1) / 2.0;
|
||
}
|
||
else{
|
||
return (Graphics.width / $gameMap.tileWidth() - 1) / 2.0;
|
||
}
|
||
};
|
||
|
||
Game_Player.prototype.centerY = function() {
|
||
if($gameSwitches.value(657)){
|
||
return ((Graphics.height-24) / $gameMap.tileHeight() - 1) / 2.0; //202030717 スイッチを251→657に変更(本屋イベント以外の立ち絵エロの座標がおかしくなるため)
|
||
}
|
||
else if((EnableID!=0)&&($gameSwitches.value(EnableID))){
|
||
return ((Graphics.height-179) / $gameMap.tileHeight() - 1) / 2.0;
|
||
}
|
||
else if($gameSwitches.value(238)){
|
||
return ((Graphics.height-48) / $gameMap.tileHeight() - 1) / 2.0;
|
||
}
|
||
else if($gameSwitches.value(789)){
|
||
return ((Graphics.height-48) / $gameMap.tileHeight() - 1) / 2.0;
|
||
}
|
||
else{
|
||
return (Graphics.height / $gameMap.tileHeight() - 1) / 2.0;
|
||
}
|
||
};
|
||
|
||
})(); |