//==============================
// * create HP Number
//==============================
Scene_Menu.prototype.createGold = function() {
this._gold_number = [];
this._GoldData = [this._goldImg.width / 10,this._goldImg.height]
var x = Moghunter.scMenu_GoldNumberX;
var y = Moghunter.scMenu_GoldNumberY;
for (var i = 0; i < 9; i++) {
this._gold_number[i] = new Sprite(this._goldImg);
this._gold_number[i].visible = false;
this._gold_number[i].opacity = 255;
this._gold_number[i].x = x ;
this._gold_number[i].y = y ;
this._field.addChild(this._gold_number[i]);
};
this.refresh_number(this._gold_number,$gameParty.gold(),this._GoldData,x)
};
//==============================
// * 创建命令
//==============================
Scene_Menu.prototype.createCommands = function() {
this._commands = [];
this._compos = [];
this._comzoom = [];
var h = 0
this._comField = new Sprite();
this._field.addChild(this._comField);
for (var i = 0; i < this._comList.length; i++)
{
this._commands[i] = new Sprite(this._comBitmaps[i]);
this._commands[i].anchor.x = 0.5;
this._commands[i].anchor.y = 0.5;
this._commands[i].y = -64;
this._commands[i].opacity = 255;
this._compos[i] = [Moghunter.scMenu_ComX + (48 * i),Moghunter.scMenu_ComY + (48 * h)];
this._comzoom[i] = 0;
this._comField.addChild(this._commands[i]);
h = h === 0 ? 1 : 0;
};
if(Zzy.MagicChange.SMF.IsMenuAlonePos)//启用自定义菜单选项标准
{
var infos = Zzy.MagicChange.SMF.MenuAlonePosInfo;
for (var i = 0; i < this._comList.length; i++)
{
var info = infos[i];
if(info)
{
this._compos[i] = [info.posX,info.posY];
}
}
}
};
//==============================
// * 更新命令
//==============================
Scene_Menu.prototype.updateCommands = function() {
// this.updateComField();
for (var i = 0; i < this._commands.length; i++) {
if (this.isComEnabled(i)) {
var nx = this._statusWindow.active ? Moghunter.scMenu_ComWX : this._compos[i][0];
var ny = this._statusWindow.active ? Moghunter.scMenu_ComWY : this._compos[i][1];
if (this._commandWindow.isCurrentItemEnabled()) {this._commands[i].opacity += 20};
if (this._comzoom[i] === 0 && !this._statusWindow.active) {
this._commands[i].scale.x += 0.01;
if (this._commands[i].scale.x >= 1.30) {
this._commands[i].scale.x = 1.30;
this._comzoom[i] = 1;
};
} else {
this._commands[i].scale.x -= 0.01;
if (this._commands[i].scale.x <= 1.00) {
this._commands[i].scale.x = 1.00;
this._comzoom[i] = 0;
};
};
} else {
var nx = this._compos[i][0];
var ny = this._compos[i][1];
if (this._commands[i].opacity > 180 || this._statusWindow.active) {
this._commands[i].opacity -= 10
if (this._commands[i].opacity < 180 && !this._statusWindow.active) {this._commands[i].opacity = 180}
};
if (!this._statusWindow.active && this._commands[i].opacity < 180) {
this._commands[i].opacity += 10;
if (this._commands[i].opacity > 180) {this._commands[i].opacity = 180}
};
if (this._commands[i].scale.x > 1.00) {this._commands[i].scale.x -= 0.01};
this._comzoom[i] = 0;
};
this._commands[i].x = this.commandMoveTo(this._commands[i].x,nx);
this._commands[i].y = this.commandMoveTo(this._commands[i].y,ny);
this._commands[i].scale.y = this._commands[i].scale.x;
};
};
//==============================
// * update Com Field
//==============================
Scene_Menu.prototype.updateComField = function() {
if (!this._statusWindow.active) {
this._comField.opacity += 15
if (this._comField.y < 0) {
this._comField.y += 3;
if (this._comField.y > 0 ) {this._comField.y = 0}
}
} else {
this._comField.opacity -= 15
if (this._comField.y > -50) {
this._comField.y -= 3;
if (this._comField.y < -50 ) {this._comField.y = -50}
};
};
};
//==============================
// * is Com Enabled
//==============================
Scene_Menu.prototype.isComEnabled = function(index) {
if (index != this._commandWindow._index) {return false};
return true;
};
//==============================
// * 命令移动到
//==============================
Scene_Menu.prototype.commandMoveTo = function(value,real_value) {
if (value == real_value) {return value};
var dnspeed = 3 + (Math.abs(value - real_value) / 20);
if (value > real_value) {value -= dnspeed;
if (value < real_value) {value = real_value};}
else if (value < real_value) {value += dnspeed;
if (value > real_value) {value = real_value};
};
return Math.floor(value);
};
//==============================
// * checkTouchSelection
//==============================
Scene_Menu.prototype.checkTouchSelection = function() {
for (var i = 0; i < this._selection.length; i++) {
if (this.isOnSprite(this._selection[i])) {this.setTouchSelection(i)};
};
for (var i = 0; i < this._arrow.length; i++) {
if (this.isOnSprite(this._arrow[i])) {this.setTouchArrow(i)};
};
};
//==============================
// * process Cursor Move
//==============================
Window_MenuStatus.prototype.processCursorMove = function() {
if (this.isCursorMovable()) {
var lastIndex = this.index();
if (Input.isRepeated('down') || Input.isRepeated('right')) {
this.cursorDown();
};
if (Input.isRepeated('up') || Input.isRepeated('left')) {
this.cursorUp();
};
if (this.index() !== lastIndex) {
SoundManager.playCursor();
};
};
};
//==============================
// * update SCroll Roll
//==============================
Window_MenuStatus.prototype.updateScrollRoll = function() {
if (this.isOpenAndActive() && this.maxItems() > 0) {
var srow = this.maxTopRow() === 0 ? 1 : this.maxCols();
var threshold = 20;
var idx = this._index;
if (TouchInput.wheelY >= threshold) {
this._index += srow;
if (this._index > (this.maxItems() - 1)) {this._index = this.maxItems() - 1};
this.select(this._index);
if (idx != this._index) {SoundManager.playCursor()};
};
if (TouchInput.wheelY <= -threshold) {
this._index -= srow;
if (this._index < 0) {this._index = 0};
this.select(this._index);
if (idx != this._index) {SoundManager.playCursor()};
};
};
};
//=============================================================================
// ** Scene Menu
//=============================================================================
//=============================================================================
// ** Scene Party
//=============================================================================
function Scene_Party() {
this.initialize.apply(this, arguments);
}
//==============================
// * on Formation OK
//==============================
Scene_Party.prototype.onFormationOk = function() {
var index = this._statusWindow.index();
var actor = $gameParty.members()[index];
var pendingIndex = this._statusWindow.pendingIndex();
if (pendingIndex >= 0) {
$gameParty.swapOrder(index, pendingIndex);
this._statusWindow.setPendingIndex(-1);
this._statusWindow.redrawItem(index);
} else {
this._statusWindow.setPendingIndex(index);
}
this._statusWindow.activate();
};
//==============================
// * Is Current Item Enabled
//==============================
Window_MenuStatusM.prototype.isCurrentItemEnabled = function() {
if (this._formationMode) {
var actor = $gameParty.members()[this.index()];
return actor && actor.isFormationChangeOk();
} else {
return true;
}
};