Guest User

Skill Menu

a guest
Dec 22nd, 2016
104
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*:
  2. * @plugindesc Skills Menu
  3. * @author RicoRob
  4. * @help
  5. */
  6.  
  7. Scene_Skill.prototype = Object.create(Scene_ItemBase.prototype);
  8. Scene_Skill.prototype.constructor = Scene_Skill;
  9.  
  10. Scene_Skill.prototype.initialize = function() {
  11. Scene_ItemBase.prototype.initialize.call(this);
  12. };
  13.  
  14.  
  15. Scene_Skill.prototype.create = function() {
  16. Scene_ItemBase.prototype.create.call(this);
  17. this.createHelpWindow();
  18. //this.createSkillTypeWindow();
  19. this.createStatusWindow();
  20. this.createItemWindow();
  21. this.createActorWindow();
  22. this.refreshActor();
  23. this.commandSkill();
  24. };
  25.  
  26.  
  27. Scene_Skill.prototype.createStatusWindow = function() {
  28. var wx = 0;
  29. var wy = this._helpWindow.height;
  30. var ww = Graphics.boxWidth / 2.5;
  31. var wh = this._helpWindow.height * 1.8;
  32. this._statusWindow = new Window_SkillStatus(wx, wy, ww, wh);
  33. this.addWindow(this._statusWindow);
  34. };
  35.  
  36. Scene_Skill.prototype.createItemWindow = function() {
  37. var wx = this._statusWindow.width;
  38. var wy = this._helpWindow.height;
  39. var ww = Graphics.boxWidth;
  40. var wh = this._statusWindow.height;
  41. this._itemWindow = new Window_SkillList(wx, wy, ww, wh);
  42. this._itemWindow.setHelpWindow(this._helpWindow);
  43. this._itemWindow.setHandler('ok', this.onItemOk.bind(this));
  44. this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
  45. //this._skillTypeWindow.setSkillWindow(this._itemWindow);
  46. this.addWindow(this._itemWindow);
  47. };
  48.  
  49. Scene_Skill.prototype.refreshActor = function() {
  50. var actor = this.actor();
  51. //this._skillTypeWindow.setActor(actor);
  52. this._statusWindow.setActor(actor);
  53. this._itemWindow.setActor(actor);
  54. };
  55.  
  56.  
  57. Scene_Skill.prototype.user = function() {
  58. return this.actor();
  59. };
  60.  
  61. Scene_Skill.prototype.commandSkill = function() {
  62. this._itemWindow.activate();
  63. this._itemWindow.selectLast(0);
  64. };
  65.  
  66. Scene_Skill.prototype.onItemOk = function() {
  67. this.actor().setLastMenuSkill(this.item());
  68. this.determineItem();
  69. };
  70.  
  71. Scene_Skill.prototype.onItemCancel = function() {
  72. SceneManager.pop();
  73. };
  74.  
  75. Scene_Skill.prototype.playSeForItem = function() {
  76. SoundManager.playUseSkill();
  77. };
  78.  
  79. Scene_Skill.prototype.useItem = function() {
  80. Scene_ItemBase.prototype.useItem.call(this);
  81. this._statusWindow.refresh();
  82. this._itemWindow.refresh();
  83. };
  84.  
  85.  
  86. Scene_Equip.prototype.onActorChange = function() {
  87. this.refreshActor();
  88. this.commandSkill();
  89. };
RAW Paste Data