예제 #1
0
 public void OnClickItem(BackpackObservableItem item)
 {
     if (this.OnClickItemAction != null)
     {
         this.OnClickItemAction.Invoke(item);
     }
 }
예제 #2
0
    public void DoSmelt()
    {
        if (this.SmeltEquips.Count == 0)
        {
            return;
        }
        List <long> list = new List <long>();

        for (int i = 0; i < this.SmeltEquips.Count; i++)
        {
            BackpackObservableItem backpackObservableItem = this.SmeltEquips[i];
            if (backpackObservableItem.GetIsSelected())
            {
                list.Add(backpackObservableItem.id);
            }
        }
        if (list.get_Count() > 0)
        {
            this.ShowSmeltWillReturn(list);
        }
        else
        {
            UIManagerControl.Instance.ShowToastText("请选择要熔炼的装备");
        }
    }
예제 #3
0
    public static BackpackObservableItem GetBackpackObservableItem(Goods good, Action <BackpackObservableItem> action2ClickItem, int mode = 1)
    {
        BackpackObservableItem backpackObservableItem = new BackpackObservableItem();

        if (good != null)
        {
            backpackObservableItem.ItemRootNullOn = false;
            backpackObservableItem.ItemRootOn     = true;
            backpackObservableItem.SetSelectedMode(mode);
            backpackObservableItem.OnClickItemAction = action2ClickItem;
            backpackObservableItem.ItemFlag          = false;
            backpackObservableItem.SetIsSelected(false);
            backpackObservableItem.id          = good.GetLongId();
            backpackObservableItem.ItemId      = good.LocalItem.id;
            backpackObservableItem.ItemIcon    = GameDataUtils.GetIcon(good.LocalItem.icon);
            backpackObservableItem.ItemNum     = BackpackManager.Instance.OnGetGoodCount(good.GetLongId()).ToString();
            backpackObservableItem.ItemStepOn  = (good.GetItem().step > 0);
            backpackObservableItem.ItemStepNum = string.Format(GameDataUtils.GetChineseContent(505023, false), good.GetItem().step);
            bool redPointOn = false;
            if ((good.LocalItem.function == 1 || good.LocalItem.function == 2 || good.LocalItem.function == 3) && good.LocalItem.secondType == 11 && EntityWorld.Instance.EntSelf != null && good.LocalItem.minLv <= EntityWorld.Instance.EntSelf.Lv)
            {
                redPointOn = true;
            }
            backpackObservableItem.RedPointOn     = redPointOn;
            backpackObservableItem.EquipIsBinding = false;
            EquipSimpleInfo equipSimpleInfoByEquipID = EquipGlobal.GetEquipSimpleInfoByEquipID(good.GetLongId());
            if (equipSimpleInfoByEquipID != null && equipSimpleInfoByEquipID.suitId > 0)
            {
                TaoZhuangDuanZhu equipForgeCfgData = EquipGlobal.GetEquipForgeCfgData(equipSimpleInfoByEquipID.equipId);
                if (equipForgeCfgData != null)
                {
                    backpackObservableItem.ItemFrame = ResourceManager.GetIconSprite(equipForgeCfgData.frame);
                }
            }
            if (equipSimpleInfoByEquipID != null)
            {
                backpackObservableItem.EquipIsBinding = equipSimpleInfoByEquipID.binding;
            }
            int excellentCount;
            if (good.GetItem().tab == 2)
            {
                excellentCount = EquipGlobal.GetExcellentAttrsCountByColor(good.GetLongId(), 1f);
            }
            else
            {
                excellentCount = good.GetItem().gogok;
            }
            backpackObservableItem.ExcellentCount = excellentCount;
        }
        else
        {
            backpackObservableItem.ItemRootNullOn = true;
            backpackObservableItem.ItemRootOn     = false;
            backpackObservableItem.SetSelectedMode(mode);
            backpackObservableItem.OnClickItemAction = action2ClickItem;
        }
        return(backpackObservableItem);
    }
예제 #4
0
    public void DoSmeltOneKey()
    {
        if (this.SmeltEquips.Count == 0)
        {
            return;
        }
        List <MultiCheckUIViewModel.ItemData> list = new List <MultiCheckUIViewModel.ItemData>();

        list.Add(new MultiCheckUIViewModel.ItemData
        {
            id   = 4,
            name = TextColorMgr.GetColorByQuality("紫色装备", 4),
            isOn = false
        });
        list.Add(new MultiCheckUIViewModel.ItemData
        {
            id   = 5,
            name = TextColorMgr.GetColorByQuality("橙色装备", 5),
            isOn = false
        });
        list.Add(new MultiCheckUIViewModel.ItemData
        {
            id   = 6,
            name = TextColorMgr.GetColorByQuality("金色装备", 6),
            isOn = false
        });
        MultiCheckUIViewModel.Instance.ShowAsConfirm("批量熔炼", list, delegate
        {
            List <long> list2 = new List <long>();
            for (int i = 4; i <= 6; i++)
            {
                if (MultiCheckUIViewModel.Instance.IsOn(i))
                {
                    BackpackManager.Instance.GetEquimentGoods(ref this.temp_smelt_equips, i, false);
                    if (this.temp_smelt_equips != null && this.temp_smelt_equips.get_Count() > 0)
                    {
                        for (int j = 0; j < this.temp_smelt_equips.get_Count(); j++)
                        {
                            list2.Add(this.temp_smelt_equips.get_Item(j).GetLongId());
                        }
                    }
                }
            }
            for (int k = 0; k < this.SmeltEquips.Count; k++)
            {
                BackpackObservableItem backpackObservableItem = this.SmeltEquips[k];
                backpackObservableItem.SetIsSelected(list2.Contains(backpackObservableItem.id));
            }
        }, "确定", "button_orange_1", UINodesManager.MiddleUIRoot, string.Empty);
    }
예제 #5
0
 private void BackpackObservableItemClick(BackpackObservableItem item)
 {
     if (item.ItemRootNullOn)
     {
         return;
     }
     for (int i = 0; i < this.SmeltEquips.Count; i++)
     {
         BackpackObservableItem item2 = this.SmeltEquips.GetItem(i);
         if (item == item2)
         {
             item2.SetIsSelected(!item.GetIsSelected());
         }
     }
 }