查看: 4118|回复: 4

[有事请教] 关于道具栏的问题

[复制链接]
梦石
0
星屑
965
在线时间
81 小时
注册时间
2017-10-20
回帖
33
发表于 2017-11-7 19:49:02 | 显示全部楼层 |阅读模式

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

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

×
假如我有装备A,装备B,那么能不能做到在道具栏中查看的时候隐藏道具B,只显示道具A
平穷使我明抢
梦石
0
星屑
3053
在线时间
318 小时
注册时间
2015-4-30
回帖
92
发表于 2017-11-9 03:33:03 | 显示全部楼层
a1.png


a2.png


a3.png


a4.png


a7.png


a5.png


a6.png



[pre lang="javascript" line="1"]Window_ItemList.prototype.hasTraits = function(item) {  // <<< 新建
                var aa = false;
                if(item){
                        aa = item.traits.filter(function(t){
                                return t.code == 14 && t.dataId == 13;        // <<< 13:状态ID
                        }).shift();
                };
                return !!aa;
};

Window_ItemList.prototype.includes = function(item) {       
    switch (this._category) {
    case 'item':
        return DataManager.isItem(item) && item.itypeId === 1;
    case 'weapon':
                if(this.hasTraits(item)) return false;        // <<< 添加
        return DataManager.isWeapon(item);
    case 'armor':
                if(this.hasTraits(item)) return false;        // <<< 添加
        return DataManager.isArmor(item);
    case 'keyItem':
        return DataManager.isItem(item) && item.itypeId === 2;
    default:
        return false;
    }
};[/pre]


回复

使用道具 举报

梦石
0
星屑
34462
在线时间
5096 小时
注册时间
2012-11-19
回帖
4715

开拓者

发表于 2017-11-9 08:13:01 | 显示全部楼层
或者直接在 物品/武器/防具 里备注  <NotShow>

  1. var Xr_OldPtt_Window_ItemList_includes = Window_ItemList.prototype.includes;
  2. Window_ItemList.prototype.includes = function(item) {
  3.     if (item.note.match(/<NotShow>/)) return false;
  4.     return Xr_OldPtt_Window_ItemList_includes.call(this,item);
  5. };
复制代码

点评

↓然  发表于 2017-11-9 17:18
这是脚本插件吗?  发表于 2017-11-9 15:21
xp vx va mv  va mz 各类型脚本/插件定制
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部