/*:
* @plugindesc This is the Achievements Plug-in!
*
*
* @author TagumonYatsuray
*
* @Param Achievements
* @Desc This is the Achievements Parameter
* @Default 0
* @help This is the help file!
*
*/
(function() {
var parameters = PluginManager.parameters('Achievements Plugin');
var _Scene_Menu_createCustomMenuWindow = Scene_Menu.prototype.createCommandWindow;
Window_MenuCommand.prototype.addOriginalCommands = function() {
this.addCommand("Achievements", 'achievements', true);
};
Scene_Menu.prototype.createCommandWindow = function() {
_Scene_Menu_createCustomMenuWindow.call(this);
this._commandWindow.setHandler('achievements', this.commandAchievements.bind(this));
this.addWindow(this._commandWindow);
};
Scene_Menu.prototype.commandAchievements = function() {
SceneManager.push(Scene_Achievements);
};
//-----------------------------------------------------------------------------
// Window_Achievements_Left
//
// The window for displaying achievements.
function Window_Achievements_Left() {
this.initialize.apply(this, arguments);
}
Window_Achievements_Left.prototype = Object.create(Window_Base.prototype);
Window_Achievements_Left.prototype.constructor = Window_Achievements_Left;
Window_Achievements_Left.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};
Window_Achievements_Left.prototype.windowWidth = function() {
return 200;
};
Window_Achievements_Left.prototype.windowHeight = function() {
return 620;
};
Window_Achievements_Left.prototype.refresh = function() {
var x = this.textPadding();
var width = this.contents.width - this.textPadding() * 2;
this.contents.clear();
this.drawIcon(5,0,0);
};
Window_Achievements_Left.prototype.open = function() {
this.refresh();
Window_Base.prototype.open.call(this);
};
//-----------------------------------------------------------------------------
// Window_Achievements_Top
//
// The window for displaying achievements.
function Window_Achievements_Top() {
this.initialize.apply(this, arguments);
}
Window_Achievements_Top.prototype = Object.create(Window_Base.prototype);
Window_Achievements_Top.prototype.constructor = Window_Achievements_Top;
Window_Achievements_Top.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};
Window_Achievements_Top.prototype.windowWidth = function() {
return 600;
};
Window_Achievements_Top.prototype.windowHeight = function() {
return 200;
};
Window_Achievements_Top.prototype.refresh = function() {
var x = this.textPadding();
var width = this.contents.width - this.textPadding() * 2;
this.contents.clear();
this.drawIcon(5,0,0);
};
Window_Achievements_Top.prototype.open = function() {
this.refresh();
Window_Base.prototype.open.call(this);
};
//-----------------------------------------------------------------------------
// Window_Achievements_Bottom
//
// The window for displaying achievements.
function Window_Achievements_Bottom() {
this.initialize.apply(this, arguments);
}
Window_Achievements_Bottom.prototype = Object.create(Window_Base.prototype);
Window_Achievements_Bottom.prototype.constructor = Window_Achievements_Bottom;
Window_Achievements_Bottom.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};
Window_Achievements_Bottom.prototype.windowWidth = function() {
return 600;
};
Window_Achievements_Bottom.prototype.windowHeight = function() {
return 600;
};
Window_Achievements_Bottom.prototype.refresh = function() {
var x = this.textPadding();
var width = this.contents.width - this.textPadding() * 2;
this.contents.clear();
this.drawIcon(5,0,0);
};
Window_Achievements_Bottom.prototype.open = function() {
this.refresh();
Window_Base.prototype.open.call(this);
};
//-----------------------------------------------------------------------------
// Scene_Achievements
//
// The scene class of the menu screen.
function Scene_Achievements() {
this.initialize.apply(this, arguments);
}
Scene_Achievements.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Achievements.prototype.constructor = Scene_Achievements;
Scene_Achievements.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_Achievements.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.createAchievementsWindowLeft();
this.createAchievementsWindowTop();
this.createAchievementsWindowBottom();
};
Scene_Achievements.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this._achievementsWindowLeft = new Window_Achievements_Left(0,0);
this._achievementsWindowLeft.x = 0;
this._achievementsWindowLeft.y = 0;
this.addWindow(this._achievementsWindowLeft);
this._achievementsWindowTop = new Window_Achievements_Top(0,0);
this._achievementsWindowTop.x = 400;
this._achievementsWindowTop.y = 0;
this.addWindow(this._achievementsWindowTop);
this._achievementsWindowBottom = new Window_Achievements_Bottom(0,0);
this._achievementsWindowBottom.x = 610;
this._achievementsWindowBottom.y = 0;
this.addWindow(this._achievementsWindowBottom);
};
Scene_Achievements.prototype.start = function() {
Scene_MenuBase.prototype.start.call(this);
};
Scene_Achievements.prototype.update = function() {
Scene_MenuBase.prototype.update.call(this);
if(Input.isTriggered('cancel')) {
SoundManager.playCancel();
SceneManager.goto(Scene_Menu);
}
}
})();