private void UpdateState(BattleEquipType type)
 {
     foreach (KeyValuePair <BattleEquipType, LeftButtonItem> current in this.dict)
     {
         current.Value.ChoseState(current.Key == type);
     }
 }
 private void OnClick_menuItem(BattleEquip_MenuItem com)
 {
     if (null != com)
     {
         this.curMenuType = com.MenuItemType;
         MobaMessageManagerTools.SendClientMsg(ClientV2C.BattleShop_clickMenu, this.curMenuType, false);
     }
 }
    private void ClickButton(GameObject obj)
    {
        LeftButtonItem component = obj.GetComponent <LeftButtonItem>();

        if (obj == null)
        {
            return;
        }
        this.CurrentType = component.Type;
    }
Example #4
0
 public static List <string> GetShopItems(List <string> shopData, BattleEquipType type)
 {
     if (shopData != null)
     {
         shopData = shopData.Where(delegate(string obj)
         {
             SysBattleItemsVo sysBattleItemsVo;
             return(BattleEquipTools_config.GetBattleItemVo(obj, out sysBattleItemsVo) && sysBattleItemsVo.type == (int)type);
         }).ToList <string>();
     }
     return(shopData);
 }
    private void RefreshUI_iniItems()
    {
        int equipMenuCount = BattleEquipTools_config.GetEquipMenuCount();

        GridHelper.FillGrid <BattleEquip_MenuItem>(this.grid_menu, this.template_menuItem, equipMenuCount, delegate(int idx, BattleEquip_MenuItem comp)
        {
            BattleEquipType equipMenuTypeByIndex = BattleEquipTools_config.GetEquipMenuTypeByIndex(idx);
            comp.gameObject.SetActive(true);
            comp.MenuItemType = equipMenuTypeByIndex;
            comp.OnClick      = new Action <BattleEquip_MenuItem>(this.OnClick_menuItem);
            this.dict[equipMenuTypeByIndex] = comp;
        });
        this.RefreshUI_state();
    }
 public void Init()
 {
     GridHelper.FillGrid <LeftButtonItem>(this.grid, this.item, this.strList.Length, delegate(int idx, LeftButtonItem comp)
     {
         comp.gameObject.SetActive(true);
         comp.SetName(this.strList[idx]);
         comp.Type = this.typeList[idx];
         comp.SetIcon(comp.Type);
         UIEventListener.Get(comp.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickButton);
         this.dict[this.typeList[idx]] = comp;
     });
     if (this.CurrentType == BattleEquipType.none)
     {
         this.CurrentType = BattleEquipType.recommend;
     }
 }
 public void SetIcon(BattleEquipType Type)
 {
     if (Type == BattleEquipType.attack)
     {
         this.icon.spriteName = "HUD_shop_icons_attack";
     }
     else if (Type == BattleEquipType.assist)
     {
         this.icon.spriteName = "HUD_shop_icons_help";
     }
     else if (Type == BattleEquipType.defense)
     {
         this.icon.spriteName = "HUD_shop_icons_protect";
     }
     else if (Type == BattleEquipType.magic)
     {
         this.icon.spriteName = "HUD_shop_icons_magic";
     }
     else if (Type == BattleEquipType.recommend)
     {
         this.icon.spriteName = "HUD_shop_icons_recommend";
     }
     this.icon.MakePixelPerfect();
 }
Example #8
0
 public BattleShopData()
 {
     this.curMenuType = BattleEquipType.recommend;
     this.playerAlive = true;
 }
Example #9
0
        public static void idsToSItems(ref Dictionary <ColumnType, Dictionary <string, SItemData> > sItems, List <string> ids, BattleEquipType menuType = BattleEquipType.none)
        {
            BattleEquipTools_config.RegularSItems(ref sItems, true);
            SysBattleItemsVo sysBattleItemsVo = null;

            if (ids != null)
            {
                for (int i = 0; i < ids.Count; i++)
                {
                    if (BattleEquipTools_config.GetBattleItemVo(ids[i], out sysBattleItemsVo) && (menuType == BattleEquipType.none || sysBattleItemsVo.type == (int)menuType) && sItems.ContainsKey((ColumnType)sysBattleItemsVo.level))
                    {
                        sItems[(ColumnType)sysBattleItemsVo.level].Add(sysBattleItemsVo.items_id, new SItemData(sysBattleItemsVo));
                    }
                }
            }
        }
Example #10
0
 public static Dictionary <ColumnType, Dictionary <string, SItemData> > GetShopItems_common(Dictionary <ColumnType, Dictionary <string, SItemData> > sItems, BattleEquipType menuType, ShopInfo shopInfo)
 {
     if (menuType != BattleEquipType.none && shopInfo != null)
     {
         List <string> shopItems = shopInfo.ShopItems;
         BattleEquipTools_config.idsToSItems(ref sItems, shopItems, menuType);
     }
     return(sItems);
 }
Example #11
0
 public static string GetIconByEquipType(BattleEquipType t)
 {
     return((!BattleEquipTools_config.dicEquipTypeIcon.ContainsKey(t)) ? string.Empty : BattleEquipTools_config.dicEquipTypeIcon[t]);
 }
Example #12
0
 public static string GetNameByEquipType(BattleEquipType t)
 {
     return((!BattleEquipTools_config.dicMenuTypeSpriteStr.ContainsKey(t)) ? string.Empty : BattleEquipTools_config.dicMenuTypeSpriteStr[t]);
 }
 private void OnMsg_MenuChange(MobaMessage msg)
 {
     this.curMenuType = (BattleEquipType)((int)msg.Param);
     this.RefreshUI_state();
 }
 private void Init_data()
 {
     this.curMenuType = ModelManager.Instance.Get_BattleShop_curMenu();
 }