查看: 2451|回复: 1

[有事请教] 想请教下为什么右边对应信息没有出来?

[复制链接]
梦石
0
星屑
198
在线时间
40 小时
注册时间
2020-10-10
回帖
8
发表于 2021-1-9 00:14:44 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
[pre lang="javascript"]Window_MenuCommand.prototype.addOriginalCommands = function(){
        this.addCommand("好感度", "likability", true);
}
var _Scene_Menu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
Scene_Menu.prototype.createCommandWindow = function () {
           _Scene_Menu_createCommandWindow.call(this);
           this._commandWindow.setHandler('likability', this.commandLikability.bind(this));
};
Scene_Menu.prototype.commandLikability = function() {
    SceneManager.push(Scene_Likability);
};
/*--------------------好感度窗口Start--------------------*/
function Scene_Likability(){
        this.initialize.apply(this, arguments);
}
Scene_Likability.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Likability.prototype.constructor = Scene_Likability;

Scene_Likability.prototype.initialize = function() {
    Scene_MenuBase.prototype.initialize.call(this);
};
Scene_Likability.prototype.create = function() {
    Scene_MenuBase.prototype.create.call(this);
   
    this._femaleWindow = new Window_Female(0, 0);
    this.addWindow(this._femaleWindow);

    this._descriptionindow = new Window_Description(200, 0, 600, 400);
    this.addWindow(this._descriptionindow);
};
Scene_Likability.prototype.commandDairy1 = function(){
        this._femaleWindow.activate();
        this._descriptionindow.refresh();
        switch(this._femaleWindow.currentSymbol()){
                case 'Dairy1':
                        this._descriptionindow.drawText("第一个日记", 0, 0, 600, "left");
                        break;
                case 'Dairy2':
                        this._descriptionindow.drawText("第二个日记", 0, 0, 600, "left");
                        break;
                case 'Dairy3':
                        this._descriptionindow.drawText("第三个日记", 0, 0, 600, "left");
                        break;
                case 'Dairy4':
                        this._descriptionindow.drawText("第四个日记", 0, 0, 600, "left");
                        break;
        }
}
/*---------------------好感度窗口End---------------------*/
/*--------------------人物名列表Start--------------------*/
function Window_Female(){
        this.initialize.apply(this, arguments);
}
Window_Female.prototype = Object.create(Window_Command.prototype);
Window_Female.prototype.constructor = Window_Female;

Window_Female.prototype.initialize = function(x, y) {
    Window_Command.prototype.initialize.call(this, x, y);
};
Window_Female.prototype.makeCommandList = function(){
        this.addCommand("日记一", "Dairy1", true);
        this.addCommand("日记二", "Dairy2", true);
        this.addCommand("日记三", "Dairy3", true);
        this.addCommand("日记四", "Dairy4", true);
};
/*---------------------人物名列表End---------------------*/
/*--------------------人物描述Start--------------------*/
function Window_Description(){
        this.initialize.apply(this, arguments);
}
Window_Description.prototype = Object.create(Window_Selectable.prototype);
Window_Description.prototype.constructor = Window_Description;

Window_Description.prototype.initialize = function(x, y, width, height) {
    Window_Selectable.prototype.initialize.call(this, x, y, width, height);
};
/*---------------------人物描述End---------------------*/[/pre]

请问下有大佬能帮我解答下吗?
115截图20210109001208.png
梦石
0
星屑
198
在线时间
40 小时
注册时间
2020-10-10
回帖
8
 楼主| 发表于 2021-1-9 22:23:40 | 显示全部楼层
已解决,因为没有更新指标!
此贴完结!
Scene_Likability.prototype.update = function(){
        Scene_MenuBase.prototype.update.call(this);
        if(this._tempIndex !== this._femaleWindow._index){//当前指标是否是旧的指标 若不是 则更新临时指标 并刷新右侧窗口内容
                this._tempIndex = this._femaleWindow._index;
                this.commandDairy1();
        }
}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部