|
//-----------------------------------------------------------------------------
// Scene_Item
// 物品场景
// The scene class of the item screen.
// 处理 物品画面的类
function Scene_Item() {
this.initialize.apply(this, arguments);
}
Scene_Item.prototype = Object.create(Scene_ItemBase.prototype);
Scene_Item.prototype.constructor = Scene_Item;
//初始化
Scene_Item.prototype.initialize = function() {
Scene_ItemBase.prototype.initialize.call(this);
};
//创建
Scene_Item.prototype.create = function() {
Scene_ItemBase.prototype.create.call(this);
this.createHelpWindow();
this.createCategoryWindow();
this.createItemWindow();
this.createActorWindow();
};
//创建种类窗口
Scene_Item.prototype.createCategoryWindow = function() {
this._categoryWindow = new Window_ItemCategory();
this._categoryWindow.setHelpWindow(this._helpWindow);
this._categoryWindow.y = this._helpWindow.height;
this._categoryWindow.setHandler('ok', this.onCategoryOk.bind(this));
this._categoryWindow.setHandler('cancel', this.popScene.bind(this));
this.addWindow(this._categoryWindow);
};
//创建物品窗口
Scene_Item.prototype.createItemWindow = function() {
var wy = this._categoryWindow.y + this._categoryWindow.height;
var wh = Graphics.boxHeight - wy;
this._itemWindow = new Window_ItemList(0, wy, Graphics.boxWidth, wh);
this._itemWindow.setHelpWindow(this._helpWindow);
this._itemWindow.setHandler('ok', this.onItemOk.bind(this));
this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
this.addWindow(this._itemWindow);
this._categoryWindow.setItemWindow(this._itemWindow);
};
//用户
Scene_Item.prototype.user = function() {
var members = $gameParty.movableMembers();
var bestActor = members[0];
var bestPha = 0;
for (var i = 0; i < members.length; i++) {
if (members[i].pha > bestPha) {
bestPha = members[i].pha;
bestActor = members[i];
}
}
return bestActor;
};
//当种类确定
Scene_Item.prototype.onCategoryOk = function() {
this._itemWindow.activate();
this._itemWindow.selectLast();
};
//当物品确定
Scene_Item.prototype.onItemOk = function() {
$gameParty.setLastItem(this.item());
this.determineItem();
};
//当物品取消
Scene_Item.prototype.onItemCancel = function() {
this._itemWindow.deselect();
this._categoryWindow.activate();
};
//播放se 为物品
Scene_Item.prototype.playSeForItem = function() {
SoundManager.playUseItem();
};
//用物品
Scene_Item.prototype.useItem = function() {
Scene_ItemBase.prototype.useItem.call(this);
this._itemWindow.redrawCurrentItem();
};
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-5-13 10:11
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.