/// <summary>
    /// 根据类型初始化面板内容
    /// </summary>
    private void SetContent()
    {
        m_Prime.gameObject.SetActive(false);
        m_BlueprintNameLabel.text   = TableUtil.GetItemName(m_CurrentProduce.Id);
        m_BlueprintQuality.color    = ColorUtil.GetColorByItemQuality(TableUtil.GetItemQuality(m_CurrentItem.Id));
        m_BlueprintNumberLabel.text = m_CurrentProduce.ProductNum.ToString();
        string iconName = "";

        if (m_Style == UIViewListLayout.Row)
        {
            iconName = TableUtil.GetItemIconImage(m_CurrentItem.Id);
        }
        else
        {
            iconName = TableUtil.GetItemSquareIconImage(m_CurrentItem.Id);
        }

        UIUtil.SetIconImage(m_IconImage, TableUtil.GetItemIconBundle(m_CurrentItem.Id), iconName);
        m_OverlyingIcon.sprite = m_IconImage.sprite;
        switch (m_ProduceType)
        {
        case ProduceType.HeavyWeapon:
        case ProduceType.LightWeapon:
            WeaponL2 weaponL2 = 0;
            ItemTypeUtil.SetSubType(ref weaponL2, ItemTypeUtil.GetItemType(m_CurrentItem.Type));
            m_Prime.text = TableUtil.GetLanguageString(weaponL2);
            m_Prime.gameObject.SetActive(true);
            break;
        }
    }
Beispiel #2
0
    /// <summary>
    /// 打开确认面板
    /// </summary>
    /// <param name="type">操作类型</param>
    public void OpenConfim(MsgProduceConfim confim)//消耗数据
    {
        ProduceOrder type = confim.OrderType;

        m_SelectProduceTid = confim.Tid;
        switch (type)
        {
        case ProduceOrder.Produce:      //生产
            m_ReturnTitle.text = string.Format(TableUtil.GetLanguageString("production_text_1025"),
                                               TableUtil.GetItemName(m_FoundryProxy.GetItemByProduceKey(m_SelectProduceTid).Id));
            m_HintLabel.text = "";
            break;

        case ProduceOrder.Canel:      //取消生产
            m_ReturnTitle.text = TableUtil.GetLanguageString("production_text_1026");
            m_HintLabel.text   = TableUtil.GetLanguageString("production_text_1041");
            m_IconList.Clear();
            Item[]           items   = m_FoundryProxy.GetEffectItem(m_SelectProduceTid);
            EffectElement?[] effects = m_FoundryProxy.GetEffectElementsByProduceTid(m_SelectProduceTid);
            for (int i = 0; i < items.Length; i++)
            {
                IconManager.Instance.LoadItemIcon <IconCommon>(IconConstName.ICON_COMMON, m_ReturnItemRoot,
                                                               (icon) =>
                {
                    m_IconList.Add(icon);
                    icon.SetData(TableUtil.GetItemIconTid(items[i].Id), items[i].Quality, (int)effects[i].Value.Value);
                });
            }

            break;

        case ProduceOrder.Recevie:      //领取 不要图标
            m_ReturnTitle.text = TableUtil.GetLanguageString("production_text_1028");
            m_HintLabel.text   = "";
            break;

        case ProduceOrder.SpeedUp:      //加速
            m_ReturnTitle.text = TableUtil.GetLanguageString("production_text_1027");
            m_HintLabel.text   = TableUtil.GetLanguageString("production_text_1040");
            m_IconList.Clear();
            IconManager.Instance.LoadItemIcon <IconCommon>(IconConstName.ICON_COMMON, m_ReturnItemRoot,
                                                           (icon) =>
            {
                m_IconList.Add(icon);
                icon.SetData(TableUtil.GetItemIconTid(GameConstant.CurrencyConst.RECHARGE_CURRENCY_ITEM_TID),
                             TableUtil.GetItemQuality(GameConstant.CurrencyConst.RECHARGE_CURRENCY_ITEM_TID), (int)confim.ExpendNum);
            });
            break;

        default:
            break;
        }
    }
    /// <summary>
    /// 同步手表升级奖励列表
    /// </summary>
    /// <param name="buf"></param>
    private void OnRewardList(KProtoBuf buf)
    {
        S2C_LEVELUP_REWARD_LIST respond = buf as S2C_LEVELUP_REWARD_LIST;
        List <RewardDateVO>     list    = new List <RewardDateVO>();

        foreach (RewardInfo reward in respond.rewards)
        {
            var item = new RewardDateVO();
            item.Id      = (uint)reward.id;
            item.Num     = reward.count;
            item.Quality = TableUtil.GetItemQuality(item.Id);
            list.Add(item);
        }
        GameFacade.Instance.SendNotification(NotificationName.MSG_LEVELUP_REWARD_LIST, list);
    }
Beispiel #4
0
    /// <summary>
    /// 添加条目
    /// </summary>
    /// <param name="itemGetting">条目数据</param>
    private void OnGettingItem(ItemChangeInfo itemGetting)
    {
        if (itemGetting.CountChangeDelta > 0 && itemGetting.TID > 0)
        {
            if (itemGetting.Category != 0 && itemGetting.Category != Category.Package)
            {
                ItemData data = new ItemData();
                data.Name       = TableUtil.GetItemName(itemGetting.TID);
                data.Quality    = TableUtil.GetItemQuality(itemGetting.TID);
                data.Count      = itemGetting.CountChangeDelta;
                data.IconBundle = TableUtil.GetItemIconBundle(itemGetting.TID);
                data.IconName   = TableUtil.GetItemSquareIconImage(itemGetting.TID);

                m_WaitingQueue.Add(data);
            }
        }
    }
Beispiel #5
0
    /// <summary>
    /// 设置日志内容显示
    /// </summary>
    private void SetContent(LogDataVO dataVO)
    {
        UIUtil.SetIconImage(m_Icon, TableUtil.GetItemIconBundle(dataVO.Tid), TableUtil.GetItemIconImage(dataVO.Tid));
        UIUtil.SetIconImage(m_OverlyingIcon, TableUtil.GetItemIconBundle(dataVO.Tid), TableUtil.GetItemIconImage(dataVO.Tid));
        Color  m_QualityColor = ColorUtil.GetColorByItemQuality(TableUtil.GetItemQuality(dataVO.Tid));
        string m_Name         = TableUtil.GetItemName(dataVO.Tid);
        string m_ColorText    = ColorUtil.AddColor(m_Name, m_QualityColor);
        string m_ShowText     = "";

        if (dataVO.Num > 1)
        {
            m_ShowText = string.Format(TableUtil.GetLanguageString("log_text_1011"), m_ColorText, dataVO.Num);
        }
        else
        {
            m_ShowText = string.Format(TableUtil.GetLanguageString("log_text_1010"), m_ColorText);
        }
        m_Describe.text = string.Format(m_ShowText);
    }
Beispiel #6
0
    /// <summary>
    /// 邮件 返回邮件详细信息
    /// </summary>
    /// <param name="buf"></param>
    private void MailDetailInfo(KProtoBuf buf)
    {
        S2C_MAIL_DETAIL_INFO msg = buf as S2C_MAIL_DETAIL_INFO;
        string m_MailId          = msg.id;

        if (GetMailProxy().GetMails().Count == 0)
        {
            return;
        }
        if (!GetMailProxy().GetMails().TryGetValue(m_MailId, out MailDataVO mailData))
        {
            return;
        }
        if (mailData.Readed == 0)
        {
            GetMailProxy().ReadMail(m_MailId);
        }
        if (mailData.Items == null)
        {
            List <RewardDateVO> m_List = new List <RewardDateVO>();
            for (int t = 0; t < msg.items.Count; t++)
            {
                RewardDateVO rdata = new RewardDateVO();
                if (msg.items[t].id <= 0)
                {
                    continue;
                }

                rdata.Id      = msg.items[t].id;
                rdata.Num     = msg.items[t].num;
                rdata.Quality = TableUtil.GetItemQuality(rdata.Id);
                m_List.Add(rdata);
            }
            mailData.Items = m_List;
            GameFacade.Instance.SendNotification(NotificationName.MSG_EMAIL_RENDERLIST);
        }
    }