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

Project1

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

[搬运汉化] 信息提示插件三个 - CommonPopupCore & GetInformation & PopupMessage

[复制链接]

Lv4.逐梦者

梦石
0
星屑
18563
在线时间
1029 小时
注册时间
2019-3-5
帖子
1418
跳转到指定楼层
1
发表于 2021-5-8 23:10:44 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
CommonPopupCore可以在玩家或事件头顶显示任意字符串,会消失渐变类似对话效果,过程中人物可以移动(缺点是信息不会跟着人物移动?),同时也是其他两个插件的前置。

GetInformation是很多人找的物品得失提示信息,除了得失物品,还支持你自定义信息进行显示(在屏幕边角处,玩过诅咒铠甲的懂的都懂)。


PopupMessage和GetInformation的功能有重叠,同样是把你输入的信息(通过显示文本调用)作为提示在屏幕上淡出淡入显示出来。只是没有得失的物品提示(GetInformation获取和失去物品会自动提示)。


整得来说是十分实用的插件,可惜CommonPopupCore(核心)似乎有些bug,部分功能无法正常生效(字符串的背景色调和图片无法被正常调用)。


希望有路过的大神能看看能否修复(插件是另一个作者博客的较新版本,但未能修复这个bug……),翻了一下代码页,盲猜可能是判断问题导致的(理应是or,但不知道为何只生效前面的条件)。


信息提示插件三组.zip (19.49 KB, 下载次数: 135)






评分

参与人数 2+2 收起 理由
马铃薯条 + 1 我很赞同
1071257831 + 1 精品文章

查看全部评分

Lv4.逐梦者

梦石
0
星屑
9253
在线时间
1834 小时
注册时间
2020-1-2
帖子
1082
2
发表于 2021-5-8 23:20:56 | 只看该作者
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5231
在线时间
1046 小时
注册时间
2021-3-14
帖子
563
3
发表于 2021-5-8 23:40:44 | 只看该作者
空佬也汉化这玩意了

评分

参与人数 1+1 收起 理由
Zeldashu + 1 塞糖

查看全部评分

随缘翻译。
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
18563
在线时间
1029 小时
注册时间
2019-3-5
帖子
1418
4
 楼主| 发表于 2021-5-8 23:45:47 | 只看该作者
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
16
星屑
11180
在线时间
1320 小时
注册时间
2020-3-21
帖子
356

极短23获奖

5
发表于 2021-5-9 00:09:24 | 只看该作者
CommonPopupManager.setPopup函数下读取插件指令中的内容时有一个地方写反了。
大概是第565行的
arg[code] = (Number(value) !== NaN) ? value : Number(value);
应该为
arg[code] = (Number(value) !== NaN) ? Number(value) : value ;
修改后测试成功。(字符串的背景色调和图片正常调用)

这里还有一个有趣的事:
如果插件指令的back:后面是非-1和0的数字的话,那么就会按照作者描述的那样读取img/system下的popup_back%d.png(%d是指bakc后的数字)。
但是back:后不是数字的话,就会读取img/picture下的"back后文字.png"。

评分

参与人数 3+3 收起 理由
wazse88 + 1 大佬
1071257831 + 1 NB
白嫩白嫩的 + 1 9大佬666

查看全部评分

回复 支持 1 反对 0

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
18563
在线时间
1029 小时
注册时间
2019-3-5
帖子
1418
6
 楼主| 发表于 2021-5-9 15:07:12 | 只看该作者
仇九 发表于 2021-5-9 00:09
CommonPopupManager.setPopup函数下读取插件指令中的内容时有一个地方写反了。
大概是第565行的
arg[code]  ...

感谢大佬,确实能正常调用了,只是这个插件调用图片还存在一些问题:

不管是修正前还是修正后,调用的图片只会在第一次调用时显示,此后无论切换场所还是切换菜单,继续调用命令图片都不会继续显示了(字符倒是会正常出现)。

很好奇这个bug是怎么导致的。
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
16
星屑
11180
在线时间
1320 小时
注册时间
2020-3-21
帖子
356

极短23获奖

7
发表于 2021-5-9 18:48:42 | 只看该作者
本帖最后由 仇九 于 2021-5-9 18:50 编辑
Zeldashu 发表于 2021-5-9 15:07
感谢大佬,确实能正常调用了,只是这个插件调用图片还存在一些问题:

不管是修正前还是修正后 ...


在已经将565行改了的前提下,解决这又一个问题的最简单的办法是将第246行的bitmap.clear();这一条删去或者注释掉。
原因是缓存:
Sprite_Popup.prototype.drawBackRect这个函数是用来绘制图片/背景颜色的,当背景是图片且第一次读取这张图片时,背景图片被载入此函数下的临时变量bitmap里。
mv/mz在读取图片时,也会将这张图片作为缓存储存在ImageManager._imageCache里,这样做是为了下一次读取时直接读取缓存,不再读取源文件,增加重复读取时的效率。
但是在完成所需操作后,函数里执行了bitmap.clear(),这一条指令的作用是将图片清除掉,以节省一些空间。
但这个指令是直接对bitmap操作的,ImageManager._imageCache下此图片的缓存也会被clear掉,这样的话,这张图片的缓存就是空白了。
当第二次读取这张图片时,检测到之前读取过这张图片,所以直接调用了ImageManager._imageCache下这张图片的缓存,但是它已经是空白的了,所以第二次及之后读取时就都读取是一张空白图片了。
这里的问题就在于bitmap与ImageManager._imageCache下此图片的缓存指向的是一个内存地址,所以不能直接clear,一个方法就是直接删掉,毕竟第247行的bitmap = null也已经同步删除了bitmap及缓存,所以这一步是没有意义的。
我的想法:
不过想想删掉缓存也不是个好主意,所以同时把247行的bitmap = null也删去比较好,这样既能保留缓存加快第二次读取速度,bitmap这个指向图片对象的地址的临时变量也会在函数执行完后自动被删掉。
我想,写上clear是一种比较好的习惯吧,但是这里直接clear不合适。
其他:
这些是自学的,所以要是有些地方说错了希望有大佬指正。

评分

参与人数 1+1 收起 理由
Zeldashu + 1 精品文章

查看全部评分

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
683
在线时间
81 小时
注册时间
2021-6-3
帖子
40
8
发表于 2021-8-31 10:16:23 | 只看该作者
仇九 发表于 2021-5-9 18:48
在已经将565行改了的前提下,解决这又一个问题的最简单的办法是将第246行的bitmap.clear();这一条删去或 ...

大佬 这插件有没有办法获取到物品的颜色 有用到品质颜色插件

点评

我得知道更多的信息才能帮你啊。你说一下具体你是要怎么用,用的品质颜色插件是哪一个……  发表于 2021-8-31 11:27
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
683
在线时间
81 小时
注册时间
2021-6-3
帖子
40
9
发表于 2021-8-31 15:29:45 | 只看该作者
(function() {
        var _drawItemName = Window_Base.prototype.drawItemName

        Window_Base.prototype.drawItemName = function(item, x, y, width) {
    width = width || 312;


        Color1 = '#FFFFFF' // 一般品质的色彩(白,1)
    Color2 = '#008000' //平庸品质的色彩(绿,2)
    Color3 = '#0000FF'//# 精良品质的色彩(蓝,3)
    Color4 = '#9400D3'  //  # 卓越品质的色彩(紫,4)
    Color5 = '#FF0000'// # 神秘品质的色彩(红,5)
    Color6 = '#FFA500'  //  # 传说品质的色彩(橙,6)
    Color7 = '#FFFF00'//  # 特殊品质的色彩(黄,7)
    if (item)
        {
                var iconBoxWidth = Window_Base._iconWidth + 24;
                var result = item.meta.quality;
                //if (result)
                //{
            if(result == '1')
              {
            YANSE = Color1;
                    this.contents.fillRect(x-1, y+2, 34, -2, Color1);
                    this.contents.fillRect(x-1, y+2-1, 2, 32, Color1);
                    this.contents.fillRect(x-1, y+2+31, 34, 2, Color1);
                    this.contents.fillRect(x+33, y+2, -2, 32, Color1);
                    //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
            this.drawIcon(item.iconIndex, x, y+2 );

                    this.changeTextColor(Color1);
            this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
               }
       else if (result == '2')
          {
        YANSE = Color2;
                this.contents.fillRect(x-1, y+2, 34, -2, Color2);
                this.contents.fillRect(x-1, y+2-1, 2, 32, Color2);
                this.contents.fillRect(x-1, y+2+31, 34, 2, Color2);
                this.contents.fillRect(x+33, y+2, -2, 32, Color2);
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        this.drawIcon(item.iconIndex, x, y+2 );

                this.changeTextColor(Color2);
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
      }
          else if (result == '3')
                  {
        YANSE = Color3;
                this.contents.fillRect(x-1, y+2, 34, -2, Color3);
                this.contents.fillRect(x-1, y+2-1, 2, 32, Color3);
                this.contents.fillRect(x-1, y+2+31, 34, 2, Color3);
                this.contents.fillRect(x+33, y+2, -2, 32, Color3);
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        this.drawIcon(item.iconIndex, x, y+2 );

                this.changeTextColor(Color3);
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
        }
           else if (result == '4')
          {
        YANSE = Color4;
                this.contents.fillRect(x-1, y+2, 34, -2, Color4);
                this.contents.fillRect(x-1, y+2-1, 2, 32, Color4);
                this.contents.fillRect(x-1, y+2+31, 34, 2, Color4);
                this.contents.fillRect(x+33, y+2, -2, 32, Color4);
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        this.drawIcon(item.iconIndex, x, y+2 );

                this.changeTextColor(Color4);
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
      }
          else if (result == '5')
                  {
        YANSE = Color5;
                this.contents.fillRect(x-1, y+2, 34, -2, Color5);
                this.contents.fillRect(x-1, y+2-1, 2, 32, Color5);
                this.contents.fillRect(x-1, y+2+31, 34, 2, Color5);
                this.contents.fillRect(x+33, y+2, -2, 32, Color5);
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        this.drawIcon(item.iconIndex, x, y+2 );

                this.changeTextColor(Color5);
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
          }
          else if (result == '6')
          {
        YANSE = Color6;
                this.contents.fillRect(x-1, y+2, 34, -2, Color6);
                this.contents.fillRect(x-1, y+2-1, 2, 32, Color6);
                this.contents.fillRect(x-1, y+2+31, 34, 2, Color6);
                this.contents.fillRect(x+33, y+2, -2, 32, Color6);
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        this.drawIcon(item.iconIndex, x, y+2 );

                this.changeTextColor(Color6);
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
      }
          else if (result == '7')
          {
        YANSE = Color7;
                this.contents.fillRect(x-1, y+2, 34, -2, Color7);
                this.contents.fillRect(x-1, y+2-1, 2, 32, Color7);
                this.contents.fillRect(x-1, y+2+31, 34, 2, Color7);
                this.contents.fillRect(x+33, y+2, -2, 32, Color7);
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        this.drawIcon(item.iconIndex, x, y+2 );

                this.changeTextColor(Color7);
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
      }
          else {
         this.drawIcon(item.iconIndex, x, y+2 );

                this.resetTextColor();
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
           }

    }
        //else
        //{
        //        his.drawIcon(item.iconIndex, x, y+2 );
        //        
                //this.resetTextColor();
     //   this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);}


                //this.contents.fillRect(x+-1, y+1, 34, 34, '#ff1493');
                //this.contents.fillRect(x-1, y+2, 34, -2, '#ff1493');
                //this.contents.fillRect(x-1, y+2-1, 2, 32, '#ff1493');
                //this.contents.fillRect(x-1, y+2+31, 34, 2, '#ff1493');
                //this.contents.fillRect(x+33, y+2, -2, 32, '#ff1493');
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        //this.drawIcon(item.iconIndex, x, y+2 );

                //this.changeTextColor('#ff1493');
        //this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
   // }
    //}
        ;


}
})();

就是这个颜色插件  我想获得物品的时候能对应上物品的颜色 尤其是装备 谢谢大佬
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
84
在线时间
15 小时
注册时间
2022-9-28
帖子
8
10
发表于 2022-10-8 15:19:52 | 只看该作者
您好!想问一下PopupMessage具体该怎么使用
插件帮助里写【显示信息在信息中插入_pum[delay,x,y,action,pattern]能让信息变成弹出式】,具体这个指令应该插入在哪里,事件里的【显示文字】吗,还是【插件指令】
但似乎都没有效果,放在插件指令里不会运行,显示文字会直接以普通对话框的形式显示文字,做不到弹出式
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-28 12:28

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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