Project1

标题: 想请教下为什么右边对应信息没有出来? [打印本页]

作者: 1761772361    时间: 2021-1-9 00:14
标题: 想请教下为什么右边对应信息没有出来?
JAVASCRIPT 代码复制
  1. Window_MenuCommand.prototype.addOriginalCommands = function(){
  2.         this.addCommand("好感度", "likability", true);
  3. }
  4. var _Scene_Menu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
  5. Scene_Menu.prototype.createCommandWindow = function () {
  6.            _Scene_Menu_createCommandWindow.call(this);
  7.            this._commandWindow.setHandler('likability', this.commandLikability.bind(this));
  8. };
  9. Scene_Menu.prototype.commandLikability = function() {
  10.     SceneManager.push(Scene_Likability);
  11. };
  12. /*--------------------好感度窗口Start--------------------*/
  13. function Scene_Likability(){
  14.         this.initialize.apply(this, arguments);
  15. }
  16. Scene_Likability.prototype = Object.create(Scene_MenuBase.prototype);
  17. Scene_Likability.prototype.constructor = Scene_Likability;
  18.  
  19. Scene_Likability.prototype.initialize = function() {
  20.     Scene_MenuBase.prototype.initialize.call(this);
  21. };
  22. Scene_Likability.prototype.create = function() {
  23.     Scene_MenuBase.prototype.create.call(this);
  24.  
  25.     this._femaleWindow = new Window_Female(0, 0);
  26.     this.addWindow(this._femaleWindow);
  27.  
  28.     this._descriptionindow = new Window_Description(200, 0, 600, 400);
  29.     this.addWindow(this._descriptionindow);
  30. };
  31. Scene_Likability.prototype.commandDairy1 = function(){
  32.         this._femaleWindow.activate();
  33.         this._descriptionindow.refresh();
  34.         switch(this._femaleWindow.currentSymbol()){
  35.                 case 'Dairy1':
  36.                         this._descriptionindow.drawText("第一个日记", 0, 0, 600, "left");
  37.                         break;
  38.                 case 'Dairy2':
  39.                         this._descriptionindow.drawText("第二个日记", 0, 0, 600, "left");
  40.                         break;
  41.                 case 'Dairy3':
  42.                         this._descriptionindow.drawText("第三个日记", 0, 0, 600, "left");
  43.                         break;
  44.                 case 'Dairy4':
  45.                         this._descriptionindow.drawText("第四个日记", 0, 0, 600, "left");
  46.                         break;
  47.         }
  48. }
  49. /*---------------------好感度窗口End---------------------*/
  50. /*--------------------人物名列表Start--------------------*/
  51. function Window_Female(){
  52.         this.initialize.apply(this, arguments);
  53. }
  54. Window_Female.prototype = Object.create(Window_Command.prototype);
  55. Window_Female.prototype.constructor = Window_Female;
  56.  
  57. Window_Female.prototype.initialize = function(x, y) {
  58.     Window_Command.prototype.initialize.call(this, x, y);
  59. };
  60. Window_Female.prototype.makeCommandList = function(){
  61.         this.addCommand("日记一", "Dairy1", true);
  62.         this.addCommand("日记二", "Dairy2", true);
  63.         this.addCommand("日记三", "Dairy3", true);
  64.         this.addCommand("日记四", "Dairy4", true);
  65. };
  66. /*---------------------人物名列表End---------------------*/
  67. /*--------------------人物描述Start--------------------*/
  68. function Window_Description(){
  69.         this.initialize.apply(this, arguments);
  70. }
  71. Window_Description.prototype = Object.create(Window_Selectable.prototype);
  72. Window_Description.prototype.constructor = Window_Description;
  73.  
  74. Window_Description.prototype.initialize = function(x, y, width, height) {
  75.     Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  76. };
  77. /*---------------------人物描述End---------------------*/


请问下有大佬能帮我解答下吗?

115截图20210109001208.png (483.55 KB, 下载次数: 17)

115截图20210109001208.png

作者: 1761772361    时间: 2021-1-9 22:23
已解决,因为没有更新指标!
此贴完结!
Scene_Likability.prototype.update = function(){
        Scene_MenuBase.prototype.update.call(this);
        if(this._tempIndex !== this._femaleWindow._index){//当前指标是否是旧的指标 若不是 则更新临时指标 并刷新右侧窗口内容
                this._tempIndex = this._femaleWindow._index;
                this.commandDairy1();
        }
}




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1