设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 84|回复: 1
打印 上一主题 下一主题

[有事请教] 求解关于地图显示变量的插件,出现无法读取存档

[复制链接]

Lv2.观梦者

梦石
0
星屑
342
在线时间
107 小时
注册时间
2020-12-28
帖子
26
跳转到指定楼层
1
发表于 2024-5-24 20:22:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
40星屑
游戏打包成功,之后存档在读档就出现无法读取uull属性。





//=============================================================================

// TO_ShowNumberOnMap.js

//=============================================================================


/*:

* @plugindesc 地图显示变量.

* @author Truth Originem

*

* @help

*

* Plugin Command:

*  ShowVariable initialize 1 0.5 0.5 100 left Text:意思是建立一个变量序号为1,

*  在屏幕正中间(左上角为0,0的比例因素),最宽像素为100(
*  里面的变量最多占这么大,目前没写成比例),

*  排列方式为左对齐的对象。该对象建立期初是不可见的,内容为变量内容。

*  ShowVariable show 1 显示变量序号为Text+1的对象。

*  ShowVariable hide 1 隐藏变量序号为Text+1的对象。

*  ShowVariable setColor 1 #FF0000 使变量序号为1的对象呈现红色(#FF0000)

*/
var $dataVariables = unll;
(function(){
    var _Scene_Map_createAllWindows = Scene_Map.prototype.createAllWindows;
    Scene_Map.prototype.createAllWindows = function ()
    {
        _Scene_Map_createAllWindows.call(this);
        if(!$dataVariables){
            $dataVariables = new Window_VariableShowTab();
        }
        this.addChild($dataVariables);
    };


    function Window_VariableShowTab(){
        this.initialize.apply(this, arguments);
    }
    Window_VariableShowTab.prototype = Object.create(Window_Base.prototype);
    Window_VariableShowTab.prototype.constructor = Window_VariableShowTab;

    Window_VariableShowTab.prototype.initialize = function(){
        var width = Graphics.boxWidth;
        var height = Graphics.boxHeight;
        Window_Base.prototype.initialize.call(this, 0, 0, width, height);
        this.opacity = 0;
        this._data = [];
    };
    Window_VariableShowTab.prototype.update = function(){
        this.contents.clear();
        for(var i =0;i<this._data.length;i++){
            var data = this._data[i];
            if(data.isEnabled()){
                this.changeTextColor(data._color);
                this.drawText(data._t+data.getVariable(),data._x,data._y,data._maxWidth,data._align);
                this.resetTextColor();
            }
        }
    };
    Window_VariableShowTab.prototype.getDatas = function(){
        return this._data;
    };
    Window_VariableShowTab.prototype.getData = function(id){
        var data = null;
        for(var i =0;i<this._data.length;i++){
            if(this._data[i]._id == id){
                data = this._data[i];
                break;
            }
        }
        return data;
    };

    var _Game_Interpreter_pluginCommand =
        Game_Interpreter.prototype.pluginCommand;
    Game_Interpreter.prototype.pluginCommand = function(command, args) {
        _Game_Interpreter_pluginCommand.call(this, command, args);
        if (command === 'ShowVariable') {
            switch (args[0]) {
                case 'initialize':
                    var data = new VariableData(Number(args[1]),Number(args[2]),Number(args[3]),Number(args[4]),String(args[5]),String(args[6]));
                    $dataVariables.getDatas().push(data);
                    break;
                case 'show':
                    $dataVariables.getData(Number(args[1])).setEnabled(true);

Lv2.观梦者

梦石
0
星屑
342
在线时间
107 小时
注册时间
2020-12-28
帖子
26
2
 楼主| 发表于 2024-5-24 20:24:49 | 只看该作者
'unll' 打错字了
回复

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-6-17 06:57

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表