Exemple #1
0
    private void OnUpdateEquip(UIGridItem item)
    {
        if (item == null || item.mScripts == null || item.oData == null)
        {
            return;
        }
        item.onClick = ClickEquipItem;
        EquipItemInfo info = item.oData as EquipItemInfo;

        UISprite  color  = item.mScripts[0] as UISprite;
        UILabel   level  = item.mScripts[1] as UILabel;
        UITexture icon   = item.mScripts[2] as UITexture;
        UILabel   name   = item.mScripts[3] as UILabel;
        UISprite  select = item.mScripts[4] as UISprite;
        UITexture star   = item.mScripts[5] as UITexture;
        bool      show   = false;

        if (cur_equip != null)
        {
            show = cur_select_player_id == 0? info.uuid == cur_equip.uuid: info.itemID == cur_equip.itemID;
        }
        select.transform.gameObject.SetActive(show);
        if (show)
        {
            last_equip_item = item;
        }

        Transform addbg   = UtilTools.GetChild <Transform>(item.transform, "addbg");
        Transform content = UtilTools.GetChild <Transform>(item.transform, "content");

        UISprite[] equip_star = UtilTools.GetChilds <UISprite>(content, "star");

        addbg.gameObject.SetActive(string.IsNullOrEmpty(info.itemID));
        content.gameObject.SetActive(!string.IsNullOrEmpty(info.itemID));


        if (string.IsNullOrEmpty(info.itemID))
        {
            UILabel pos_txt = UtilTools.GetChild <UILabel>(addbg, "pos");
            pos_txt.text = TextManager.GetUIString(string.Format("position_{0}", info.position));
            return;
        }

        ItemInfo item_info = ItemManager.GetItemInfo(info.itemID.ToString());

        if (item_info == null)
        {
            return;
        }


        level.text = TextManager.GetUIString("UI2010") + info.strongLevel.ToString();

        name.text        = TextManager.GetItemString(info.itemID);
        color.spriteName = "color" + info.star;
        LoadSprite.LoaderItem(icon, info.itemID, false);

        //UtilTools.SetTextColor(name, info.star);
        UtilTools.SetStar(info.star, equip_star);
    }
Exemple #2
0
    /// <summary>
    /// 设置装备信息
    /// </summary>
    private void SetEquipInfo()
    {
        UILabel pos_txt = UtilTools.GetChild <UILabel>(panel.equipProp, "pos_info");

        pos_txt.text = TextManager.GetUIString("position_" + cur_equip_info.position);

        UILabel des_txt = UtilTools.GetChild <UILabel>(panel.equipInfo, "des_txt");

        des_txt.text = TextManager.GetPropsString("description_" + cur_equip_info.id);

        UILabel name_txt = UtilTools.GetChild <UILabel>(panel.equipInfo, "name");

        name_txt.text = TextManager.GetItemString(select_equip.itemID);

        UILabel level_txt = UtilTools.GetChild <UILabel>(panel.equipInfo, "level");

        level_txt.text = select_equip.strongLevel.ToString();


        UISprite[] cur_star_obj = UtilTools.GetChilds <UISprite>(panel.equipInfo, "star");
        UtilTools.SetStar(select_equip.star, cur_star_obj);

        UISprite cur_color = UtilTools.GetChild <UISprite>(panel.equipInfo, "color");

        cur_color.spriteName = "color" + select_equip.star;

        UITexture icon = UtilTools.GetChild <UITexture>(panel.equipInfo, "icon");

        LoadSprite.LoaderItem(icon, select_equip.itemID, false);
    }
    private void ChooseGrid_UpdateItem(UIGridItem item)
    {
        if (item == null || item.mScripts == null || item.oData == null)
        {
            return;
        }

        EquipItemInfo info = item.oData as EquipItemInfo;

        item.onClick = ClickEquipItem;

        UILabel   name  = item.mScripts[0] as UILabel;
        UISprite  color = item.mScripts[1] as UISprite;
        UITexture icon  = item.mScripts[2] as UITexture;

        UILabel   level = item.mScripts[7] as UILabel;
        UITexture star  = item.mScripts[8] as UITexture;

        UISprite[] equip_star = UtilTools.GetChilds <UISprite>(item.transform, "star");

        ItemInfo item_info = ItemManager.GetItemInfo(info.itemID.ToString());

        if (item_info == null)
        {
            return;
        }

        level.text       = info.strongLevel.ToString();
        name.text        = TextManager.GetItemString(info.itemID);
        color.spriteName = "color" + info.star;
        LoadSprite.LoaderItem(icon, item_info.itemID, false);

        UtilTools.SetStar(info.star, equip_star);
    }
Exemple #4
0
    /// <summary>
    /// 设置属性信息
    /// </summary>
    private void SetPropInfo()
    {
        UISprite[] cur_star  = UtilTools.GetChilds <UISprite>(panel.prop_info, "star");
        UISprite[] next_star = UtilTools.GetChilds <UISprite>(panel.prop_info, "next_star");

        UtilTools.SetStar(cur_star_num, cur_star);
        UtilTools.SetStar(next_star_num, next_star);

        List <EquipAddInfo> prop_list = EquipConfig.GetPropAddDataListByID(0, cur_equip_info.id, cur_star_num, cur_strong_lv);

        for (int i = 0; i < prop_list.Count; i++)
        {
            EquipAddInfo info = prop_list[i];

            string  prop_name_label = string.Format("prop_name_{0}", i.ToString());
            UILabel prop_name       = UtilTools.GetChild <UILabel>(panel.prop_info, prop_name_label);
            prop_name.text = TextManager.GetUIString(info.prop_name);

            string  cur_prop_txt_label = string.Format("cur_prop_value_{0}", i.ToString());
            UILabel cur_prop_txt       = UtilTools.GetChild <UILabel>(panel.prop_info, cur_prop_txt_label);
            cur_prop_txt.text = (info.prop_base_value + info.prop_strong_value + info.prop_star_value).ToString();

            string  next_prop_txt_label = string.Format("next_prop_value_{0}", i.ToString());
            UILabel next_prop_txt       = UtilTools.GetChild <UILabel>(panel.prop_info, next_prop_txt_label);
            next_prop_txt.text = (info.prop_base_value + info.prop_next_strong_value + info.prop_next_star_value).ToString();
        }
    }
Exemple #5
0
    private void OnUpdateEquip(UIGridItem item)
    {
        if (item == null || item.mScripts == null || item.oData == null)
        {
            return;
        }
        item.onClick  = ClickEquipItem;
        item.Selected = false;
        UITexture star  = item.mScripts[0] as UITexture;
        UISprite  color = item.mScripts[1] as UISprite;
        UITexture icon  = item.mScripts[3] as UITexture;
        UILabel   name  = item.mScripts[2] as UILabel;

        UISprite[] equip_star = UtilTools.GetChilds <UISprite>(item.transform, "star");

        EquipMakeInfo info       = item.oData as EquipMakeInfo;
        EquipInfo     equip_info = EquipConfig.GetEquipInfo(info.ID);

        name.text        = TextManager.GetItemString(info.ID.ToString());
        color.spriteName = "color" + equip_info.star;
        LoadSprite.LoaderItem(icon, info.ID.ToString(), false);

        UtilTools.SetTextColor(name, equip_info.star);
        UtilTools.SetStar(equip_info.star, equip_star);
    }
    /// <summary>
    /// 设置装备信息
    /// </summary>
    private void SetEquipInfo()
    {
        UISprite[] cur_star_obj = UtilTools.GetChilds <UISprite>(panel.cur_equip, "star");
        UtilTools.SetStar(cur_star, cur_star_obj);

        UISprite cur_color = UtilTools.GetChild <UISprite>(panel.cur_equip, "color");

        cur_color.spriteName = "color" + cur_star;

        UITexture icon = UtilTools.GetChild <UITexture>(panel.cur_equip, "icon");

        LoadSprite.LoaderItem(icon, cur_equip_data.itemID, false);
    }
    /// <summary>
    /// 设置装备信息
    /// </summary>
    private void SetEquipInfo()
    {
        UISprite[] cur_star_obj = UtilTools.GetChilds <UISprite>(panel.cur_equip, "star");
        UtilTools.SetStar(cur_star, cur_star_obj);

        UISprite cur_color = UtilTools.GetChild <UISprite>(panel.cur_equip, "color");

        cur_color.spriteName = "color" + cur_star;

        UITexture icon = UtilTools.GetChild <UITexture>(panel.cur_equip, "icon");

        LoadSprite.LoaderItem(icon, cur_equip_data.itemID, false);

        UILabel cur_strong_txt = UtilTools.GetChild <UILabel>(panel.prop_info, "cur_strong_lv");

        cur_strong_txt.text = "Lv." + cur_strong_lv.ToString();
    }
Exemple #8
0
    /// <summary>
    /// 设置装备信息
    /// </summary>
    private void SetEquipInfo()
    {
        UISprite[] cur_star = UtilTools.GetChilds <UISprite>(panel.cur_equip, "star");
        UtilTools.SetStar(cur_equip_info.star, cur_star);

        UISprite cur_color = UtilTools.GetChild <UISprite>(panel.cur_equip, "color");

        cur_color.spriteName = "color" + cur_equip_info.star;

        UITexture icon = UtilTools.GetChild <UITexture>(panel.cur_equip, "icon");

        LoadSprite.LoaderItem(icon, cur_equip_info.id.ToString(), false);

        UILabel name = UtilTools.GetChild <UILabel>(panel.cur_equip, "name");

        name.text = TextManager.GetItemString(cur_equip_info.id.ToString());
        UtilTools.SetTextColor(name, cur_equip_info.star);

        panel.gold_num.text = cur_make_info.money.ToString();
    }
    private void SetInherit()
    {
        panel.goldtext.text = GetNeedEuro() + "";

        UISprite[] star_obj = UtilTools.GetChilds <UISprite>(panel.select_equip, "star");
        UtilTools.SetStar(select_equip_data.star, star_obj);

        UISprite color = UtilTools.GetChild <UISprite>(panel.select_equip, "color");

        color.spriteName = "color" + select_equip_data.star;

        UITexture icon = UtilTools.GetChild <UITexture>(panel.select_equip, "icon");

        LoadSprite.LoaderItem(icon, select_equip_data.itemID, false);


        next_strong_lv = select_equip_data.strongLevel - 10;
        strong_info    = EquipStrongConfig.GetEquipStrongInfo(cur_equip_info.star, next_strong_lv);
        if (strong_info == null)
        {
            return;
        }



        UILabel next_strong_txt = UtilTools.GetChild <UILabel>(panel.prop_info, "next_strong_lv");

        next_strong_txt.text = "Lv." + next_strong_lv.ToString();

        List <EquipAddInfo> prop_list = EquipConfig.GetPropAddDataListByID(-1, int.Parse(select_equip_data.itemID), cur_star, next_strong_lv);

        for (int i = 0; i < prop_list.Count; i++)
        {
            EquipAddInfo info = prop_list[i];

            string  next_prop_txt_label = string.Format("next_prop_value_{0}", i.ToString());
            UILabel next_prop_txt       = UtilTools.GetChild <UILabel>(panel.prop_info, next_prop_txt_label);
            next_prop_txt.text = (info.prop_base_value + info.prop_next_strong_value + info.prop_next_star_value).ToString();
        }
    }
Exemple #10
0
    /// <summary>
    /// 设置装备信息
    /// </summary>
    private void SetEquipInfo()
    {
        UISprite[] cur_star  = UtilTools.GetChilds <UISprite>(panel.cur_equip, "star");
        UISprite[] next_star = UtilTools.GetChilds <UISprite>(panel.next_equip, "star");

        UtilTools.SetStar(cur_star_num, cur_star);
        UtilTools.SetStar(next_star_num, next_star);

        UITexture icon = UtilTools.GetChild <UITexture>(panel.cur_equip, "icon");

        LoadSprite.LoaderItem(icon, cur_equip_data.itemID, false);

        UITexture next_icon = UtilTools.GetChild <UITexture>(panel.next_equip, "icon");

        LoadSprite.LoaderItem(next_icon, cur_equip_data.itemID, false);

        UISprite cur_color = UtilTools.GetChild <UISprite>(panel.cur_equip, "color");

        cur_color.spriteName = "color" + cur_star_num;

        UISprite next_color = UtilTools.GetChild <UISprite>(panel.next_equip, "color");

        next_color.spriteName = "color" + next_star_num;
    }
Exemple #11
0
    /// <summary>
    /// 界面显示时调用
    /// </summary>
    protected override void OnShow(INotification notification)
    {
        if (panelType == PanelType.Info || panelType == PanelType.Sell || panelType == PanelType.Use)
        {
            m_Panel.CloseBtn.transform.localPosition = new Vector3(323, 244, 0);
            m_Panel.itemInfo.gameObject.SetActive(true);
            itemIcon  = m_Panel.transform.FindChild("itemInfo/itemIcon").GetComponent <UITexture>();
            itemcolor = m_Panel.transform.FindChild("itemInfo/itemcolor").GetComponent <UISprite>();
            itemName  = m_Panel.transform.FindChild("itemInfo/itemName").GetComponent <UILabel>();
            ShowItemInfo showItemInfo = (notification.Body as List <object>)[0] as ShowItemInfo;
            itemID = (notification.Body as List <object>)[1] as string;
            string uuid = (notification.Body as List <object>)[2] as string;
            item = ItemManager.GetItemInfo(itemID);
            EquipItemInfo equip = EquipConfig.GetEquipDataByUUID(uuid);
            if (equip != null)
            {
                itemcolor.spriteName = UtilTools.StringBuilder("color", equip.star);
            }
            else
            {
                itemcolor.spriteName = UtilTools.StringBuilder("color", item.color);
            }
            itemName.text = TextManager.GetItemString(item.itemID);
            LoadSprite.LoaderItem(itemIcon, itemID, false);
            if (panelType == PanelType.Info)
            {
                m_Panel.SellOne.gameObject.SetActive(false);
                m_Panel.Info.gameObject.SetActive(true);
                sellBtn    = m_Panel.transform.FindChild("itemInfo/Info/sellBtn").GetComponent <UIButton>();
                useItemBtn = m_Panel.transform.FindChild("itemInfo/Info/useItemBtn").GetComponent <UIButton>();
                itemDesc   = m_Panel.transform.FindChild("itemInfo/Info/itemDesc").GetComponent <UILabel>();
                itemPrice  = m_Panel.transform.FindChild("itemInfo/Info/itemPrice").GetComponent <UILabel>();
                itemNum    = m_Panel.transform.FindChild("itemInfo/Info/itemNum").GetComponent <UILabel>();
                UIEventListener.Get(sellBtn.gameObject).onClick    = OnClick;
                UIEventListener.Get(useItemBtn.gameObject).onClick = OnClick;
                if (item == null)
                {
                    return;
                }
                itemDesc.text  = TextManager.GetPropsString("description_" + item.itemID);
                itemPrice.text = item.itemPrice.ToString();
                itemNum.text   = ItemManager.GetBagItemCount(itemID.ToString()).ToString();
                sellItem       = showItemInfo.sellItem;
                useItem        = showItemInfo.useItem;
                if (sellItem == null && useItem == null)
                {
                    sellBtn.gameObject.SetActive(false);
                    useItemBtn.gameObject.SetActive(false);
                }
                else
                {
                    sellBtn.gameObject.SetActive(true);
                    useItemBtn.gameObject.SetActive(true);
                    sellItem = showItemInfo.sellItem;
                    useItem  = showItemInfo.useItem;
                }
            }
            else if (panelType == PanelType.Sell)
            {
                m_Panel.Info.gameObject.SetActive(false);
                m_Panel.SellOne.gameObject.SetActive(true);
                minBtn           = m_Panel.transform.FindChild("itemInfo/SellOne/minBtn").GetComponent <UIButton>();
                maxBtn           = m_Panel.transform.FindChild("itemInfo/SellOne/maxBtn").GetComponent <UIButton>();
                addBtn           = m_Panel.transform.FindChild("itemInfo/SellOne/addBtn").GetComponent <UIButton>();
                subtractBtn      = m_Panel.transform.FindChild("itemInfo/SellOne/subtractBtn").GetComponent <UIButton>();
                cancelOneSellBtn = m_Panel.transform.FindChild("itemInfo/SellOne/cancelOneSellBtn").GetComponent <UIButton>();
                okOneSellBtn     = m_Panel.transform.FindChild("itemInfo/SellOne/okOneSellBtn").GetComponent <UIButton>();
                haveNum          = m_Panel.transform.FindChild("itemInfo/SellOne/haveNum").GetComponent <UILabel>();
                changeNum        = m_Panel.transform.FindChild("itemInfo/SellOne/changeNum").GetComponent <UILabel>();
                sellPrcie        = m_Panel.transform.FindChild("itemInfo/SellOne/sellPrcie").GetComponent <UILabel>();
                UIEventListener.Get(cancelOneSellBtn.gameObject).onClick = OnClick;
                LongClickEvent.Get(subtractBtn.gameObject).onPress       = OnPress;
                LongClickEvent.Get(subtractBtn.gameObject).duration      = 3;
                LongClickEvent.Get(addBtn.gameObject).onPress            = OnPress;
                LongClickEvent.Get(addBtn.gameObject).duration           = 3;
                UIEventListener.Get(minBtn.gameObject).onClick           = OnClick;
                UIEventListener.Get(maxBtn.gameObject).onClick           = OnClick;
                UIEventListener.Get(okOneSellBtn.gameObject).onClick     = OnClick;
                subtractBtn.gameObject.SetActive(info.amount > 1);
                addBtn.gameObject.SetActive(info.amount > 1);
                maxBtn.gameObject.SetActive(info.amount > 1);
                minBtn.gameObject.SetActive(info.amount > 1);
                changeNum.gameObject.SetActive(info.amount > 1);
                changeNum.text = "1";
                sellPrcie.text = item.itemPrice.ToString();
                haveNum.text   = info.amount.ToString();
                SellOne        = showItemInfo.sellOne;
            }
            else if (panelType == PanelType.Use)
            {
                sellBtn    = m_Panel.transform.FindChild("itemInfo/Info/sellBtn").GetComponent <UIButton>();
                useItemBtn = m_Panel.transform.FindChild("itemInfo/Info/useItemBtn").GetComponent <UIButton>();
                itemDesc   = m_Panel.transform.FindChild("itemInfo/Info/itemDesc").GetComponent <UILabel>();
                itemPrice  = m_Panel.transform.FindChild("itemInfo/Info/itemPrice").GetComponent <UILabel>();
                itemNum    = m_Panel.transform.FindChild("itemInfo/Info/itemNum").GetComponent <UILabel>();
                sellBtn.gameObject.SetActive(false);
                useItemBtn.gameObject.SetActive(false);
                m_Panel.Info.gameObject.SetActive(true);
                m_Panel.use.gameObject.SetActive(true);
                if (item == null)
                {
                    return;
                }
                itemDesc.text  = TextManager.GetPropsString("description_" + item.itemID);
                itemPrice.text = item.itemPrice.ToString();
                itemNum.text   = info.amount.ToString();
                okuse          = m_Panel.transform.FindChild("itemInfo/use/okuse").GetComponent <UIButton>();
                cancelUse      = m_Panel.transform.FindChild("itemInfo/use/cancelUse").GetComponent <UIButton>();
                UIEventListener.Get(okuse.gameObject).onClick     = OnClick;
                UIEventListener.Get(cancelUse.gameObject).onClick = OnClick;
                UseOne = showItemInfo.useOne;
            }
        }
        else if (panelType == PanelType.Reward)
        {
            rewardIndex = 0;
            m_Panel.Mask.GetComponent <BoxCollider>().enabled    = false;
            UIEventListener.Get(m_Panel.Mask.gameObject).onClick = OnClick;
            m_Panel.CloseBtn.gameObject.SetActive(false);
            GameObject cell = m_Panel.RewardItem.gameObject;
            PoolManager.CreatePrefabPools(PoolManager.PoolKey.Prefab_RewardItem, cell, false);
            m_Panel.getReward.gameObject.SetActive(true);
            rewardList = notification.Body as List <object>;
            TimerManager.Destroy("rewardIndex");
            TimerManager.AddTimer("rewardIndex", 0.02f, CreateRewardItem);
            //getRewardBtn = m_Panel.transform.FindChild("getReward/getRewardBtn").GetComponent<UIButton>();
            //UIEventListener.Get(getRewardBtn.gameObject).onClick = OnClick;
        }
        else if (panelType == PanelType.ChooseFriend)
        {
            if (FriendMediator.friendList.Count < 1)
            {
                GUIManager.SetPromptInfo(TextManager.GetUIString("UI2048"), null);
                ClosePanel(null);
                return;
            }
            m_Panel.CloseBtn.transform.localPosition = new Vector3(374, 229, 0);
            m_Panel.chooseFriend.gameObject.SetActive(true);

            FriendGrid         = UtilTools.GetChild <UIGrid>(m_Panel.transform, "chooseFriend/ScrollView/FriendGrid");
            FriendGrid.enabled = true;
            FriendGrid.BindCustomCallBack(UpdateFriendGrid);
            FriendGrid.StartCustom();
        }
        else if (panelType == PanelType.UpMentality)
        {
            m_Panel.CloseBtn.transform.localPosition = new Vector3(316, 277, 0);
            UPMentality    = UtilTools.GetChilds <UIToggle>(m_Panel.transform, "ballerUpMentality/group");
            mentalityDesc  = UtilTools.GetChilds <UILabel>(m_Panel.transform, "ballerUpMentality/group");
            UPMentalityBtn = m_Panel.transform.FindChild("ballerUpMentality/UPMentalityBtn").GetComponent <UISprite>();
            UIEventListener.Get(UPMentalityBtn.gameObject).onClick = OnClick;
            m_Panel.ballerUpMentality.gameObject.SetActive(true);
        }
        else if (panelType == PanelType.SwitchInherit)
        {
            m_Panel.CloseBtn.transform.localPosition = new Vector3(378, 243, 0);
            m_Panel.switchballer.gameObject.SetActive(true);
            List <object> list = notification.Body as List <object>;
            ChooseGrid         = UtilTools.GetChild <UIGrid>(m_Panel.transform, "switchballer/ScrollView/ChooseGrid");
            ChooseGrid.enabled = true;
            ChooseGrid.BindCustomCallBack(UpdateInheriter);
            ChooseGrid.StartCustom();
            ChooseGrid.AddCustomDataList(list);
        }
    }