修改UI
This commit is contained in:
@@ -11,37 +11,39 @@ namespace NBF
|
||||
/// <summary>
|
||||
/// 组合和id映射关系
|
||||
/// </summary>
|
||||
private static readonly Dictionary<uint, List<uint>> _group2Id = new Dictionary<uint, List<uint>>();
|
||||
private static readonly Dictionary<int, List<int>> _group2Id = new Dictionary<int, List<int>>();
|
||||
|
||||
private static readonly Dictionary<uint, GoodsConfig> _googs = new Dictionary<uint, GoodsConfig>();
|
||||
private static readonly Dictionary<int, cfg.Goods> _googs = new Dictionary<int, cfg.Goods>();
|
||||
|
||||
// private static readonly Dictionary<>
|
||||
|
||||
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
var listGoods = GoodsConfig.GetList();
|
||||
var listGoods = Game.Tables.TbGoods.DataList; //GoodsConfig.GetList();
|
||||
TabItemList.Clear();
|
||||
|
||||
|
||||
foreach (var goodsConfig in listGoods)
|
||||
{
|
||||
if (goodsConfig.Group < 1)
|
||||
var group = goodsConfig.Group;
|
||||
if (group < 1)
|
||||
{
|
||||
goodsConfig.Group = goodsConfig.Id;
|
||||
// goodsConfig.Group = goodsConfig.Id;
|
||||
group = goodsConfig.Id;
|
||||
}
|
||||
|
||||
if (!_group2Id.TryGetValue(goodsConfig.Group, out List<uint> ids))
|
||||
if (!_group2Id.TryGetValue(group, out List<int> ids))
|
||||
{
|
||||
ids = new List<uint>();
|
||||
_group2Id.Add(goodsConfig.Group, ids);
|
||||
ids = new List<int>();
|
||||
_group2Id.Add(group, ids);
|
||||
}
|
||||
|
||||
ids.Add(goodsConfig.Id);
|
||||
_googs[goodsConfig.Id] = goodsConfig;
|
||||
}
|
||||
|
||||
Dictionary<ItemType, List<GoodsConfig>> tabDic = new Dictionary<ItemType, List<GoodsConfig>>();
|
||||
Dictionary<ItemType, List<cfg.Goods>> tabDic = new Dictionary<ItemType, List<cfg.Goods>>();
|
||||
foreach (var goodsId in _group2Id.Keys)
|
||||
{
|
||||
var good = _googs[goodsId];
|
||||
@@ -49,7 +51,7 @@ namespace NBF
|
||||
var type = awards.First().Id.GetItemType();
|
||||
if (!tabDic.ContainsKey(type))
|
||||
{
|
||||
tabDic.Add(type, new List<GoodsConfig>());
|
||||
tabDic.Add(type, new List<cfg.Goods>());
|
||||
}
|
||||
|
||||
tabDic[type].Add(good);
|
||||
|
||||
Reference in New Issue
Block a user