- //============================================================================= 
- // XYZ_ItemSort.js 
- //============================================================================= 
- var Imported = Imported || {}; 
- Imported.ItemSort = true; 
-   
- var XYZ = XYZ || {}; 
- XYZ.ItemSort = XYZ.ItemSort || {}; 
- XYZ.ItemSort.version = 1.00; 
- /*: 
-  * @plugindesc 道具排序. 
-  * @author DawnKing 
-  * 
-  * @help 
-  * F8打开控制台 
-  * getItemInfo(道具编号) 打印单个道具的排序优先 
-  * getItemListInfo()     打印全部道具的排序优先,不进行排序 排除没填名字的 
-  * getItemListInfoSort() 打印排序后的 道具输出情况,该顺序与游戏中的排序顺序一致 
-  *  
-  */ 
-   
- XYZ.Parameters = PluginManager.parameters('XYZ_ItemSort'); 
-   
- // ============================================================================ 
- // 重写 
- // ============================================================================ 
- Window_ItemList.prototype.makeItemList = function() { 
-     this._data = $gameParty.allItems().filter(function(item) { 
-         return this.includes(item); 
-     }, this); 
-     if (this.includes(null)) { 
-         this._data.push(null); 
-     } 
-     this._data.sort(function(a, b) { 
-         var aLevel = a.meta['排序优先'] || 0; 
-         var bLevel = b.meta['排序优先'] || 0; 
-         return aLevel - bLevel; 
-     }); 
- }; 
-   
- // Window_SkillList.prototype.makeItemList = function() { 
- //     if (this._actor) { 
- //         this._data = this._actor.skills().filter(function(item) { 
- //             return this.includes(item); 
- //         }, this); 
- //         this._data.sort(function(a, b) { 
- //             var aLevel = a.meta['排序优先'] || 0; 
- //             var bLevel = b.meta['排序优先'] || 0; 
- //             return aLevel - bLevel; 
- //         }); 
- //     } else { 
- //         this._data = []; 
- //     } 
- // }; 
-   
- // ============================================================================ 
- // 控制台调试方法 
- // ============================================================================ 
- getItemInfo = function(itemId) { 
-     var item = $dataItems[itemId]; 
-     if (!item) { return; } 
-     if (item.name === '') { return; } 
-     console.log(item.name + ' --> 排序优先:' + (item.meta['排序优先'] || 0)) 
- }; 
-   
- getItemListInfo = function() { 
-     for (var item of $dataItems) { 
-         if (!item) { continue; } 
-         if (item.name === '') { continue; } 
-         console.log(item.name + ' --> 排序优先:' + (item.meta['排序优先'] || 0)) 
-     } 
- }; 
-   
- getItemListInfoSort = function() { 
-     var data = []; 
-     for (var item of $dataItems) { 
-         if (!item) { continue; } 
-         if (item.name === '') { continue; } 
-         data.push(item); 
-     } 
-     data.sort(function(a, b) { 
-         var aLevel = a.meta['排序优先'] || 0; 
-         var bLevel = b.meta['排序优先'] || 0; 
-         return aLevel - bLevel; 
-     }); 
-     for (var item of data) { 
-         if (!item) { continue; } 
-         if (item.name === '') { continue; } 
-         console.log(item.name + ' --> 排序优先:' + (item.meta['排序优先'] || 0)) 
-     } 
- };