public override void SetGridData(object data)
    {
        base.SetGridData(data);
        if (data == null)
        {
            itemLogData = null;
            return;
        }

        itemLogData = data as ItemTradeLog;
        ItemDataBase baseData = GameTableManager.Instance.GetTableItem <ItemDataBase>(itemLogData.item_base_id);

        if (baseData != null)
        {
            UIManager.GetTextureAsyn(baseData.itemIcon, ref m_iconCASD, () =>
            {
                if (null != itemIcon)
                {
                    itemIcon.mainTexture = null;
                }
            }, itemIcon);
            itemName.text = baseData.itemName;
            itemNum.text  = itemLogData.item_num.ToString();

            uint   saleMoney = 0;
            string iconName  = "";
            if (itemLogData.gold > 0)
            {
                CurrencyIconData Currdata = CurrencyIconData.GetCurrencyIconByMoneyType(ClientMoneyType.YinLiang);
                iconName  = Currdata.smallIconName;
                saleMoney = itemLogData.gold;
            }
            else if (itemLogData.coin > 0)
            {
                CurrencyIconData Currdata = CurrencyIconData.GetCurrencyIconByMoneyType(ClientMoneyType.YuanBao);
                saleMoney = itemLogData.coin;
                iconName  = Currdata.smallIconName;
            }

            UIManager.GetAtlasAsyn(iconName, ref m_huobi1CASD, () =>
            {
                if (null != HuoBiIcon1)
                {
                    HuoBiIcon1.atlas = null;
                }
            }, HuoBiIcon1);

            UIManager.GetAtlasAsyn(iconName, ref m_huobi2CASD, () =>
            {
                if (null != HuoBiIcon2)
                {
                    HuoBiIcon2.atlas = null;
                }
            }, HuoBiIcon2);

            itemPrice.text  = (saleMoney / itemLogData.item_num).ToString();
            totalPrice.text = saleMoney.ToString();
            remainTime.text = StringUtil.GetStringSince1970(itemLogData.sell_time);
        }
    }
예제 #2
0
    private void SetMoneyContent()
    {
        uint level             = DataManager.Manager <WelfareManager>().Previous_Lv;
        RewardFindDataBase tab = GameTableManager.Instance.GetTableItem <RewardFindDataBase>(level, (int)m_rewardData.id);

        if (tab != null)
        {
            CurrencyIconData d1 = CurrencyIconData.GetCurrencyIconByMoneyType((ClientMoneyType)tab.ord_Type);
            CurrencyIconData d2 = CurrencyIconData.GetCurrencyIconByMoneyType((ClientMoneyType)tab.pre_Type);

            UIManager.GetAtlasAsyn(d1.smallIconName, ref m_priceAsynSeed, () =>
            {
                if (null != sp1)
                {
                    sp1.atlas = null;
                }
            }, sp1);
            UIManager.GetAtlasAsyn(d2.smallIconName, ref m_priceAsynSeed2, () =>
            {
                if (null != sp2)
                {
                    sp2.atlas = null;
                }
            }, sp2);

            lb1.text = tab.ord_Num.ToString();
            lb2.text = tab.pre_Num.ToString();
        }
    }
예제 #3
0
 public void UpdateItemInfo(ItemPageInfo info, ItemSerialize data = null)
 {
     itemPageInfo = info;
     ResetInfoGrid(true);
     if (itemPageInfo != null)
     {
         marked_id = info.market_id;
         BaseItem baseItem = new BaseItem(itemPageInfo.item_base_id, data);
         itemName.text  = baseItem.Name;
         itemLevel.text = baseItem.UseLv.ToString();
         itemPrice.text = itemPageInfo.money.ToString();
         SetIcon(true, baseItem.Icon);
         bool enable = (itemPageInfo.item_num > 1) ? true : false;
         SetNum(enable, itemPageInfo.item_num.ToString());
         SetBorder(true, baseItem.BorderIcon);
         if (baseItem.IsMuhon)
         {
             SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
             SetMuhonLv(true, Muhon.GetMuhonLv(baseItem));
         }
         else if (baseItem.IsRuneStone)
         {
             SetRuneStoneMask(true, (uint)baseItem.Grade);
         }
         HadStard = DataManager.Manager <ConsignmentManager>().AllStarMarkedIDs.Contains(marked_id);
         SetStarValue(HadStard);
         m_l_leftSeconds      = (uint)((itemPageInfo.show_time - DateTimeHelper.Instance.Now) > 0 ? (itemPageInfo.show_time - DateTimeHelper.Instance.Now) :0);
         moneyIcon.spriteName = itemPageInfo.great ? CurrencyIconData.GetCurrencyIconByMoneyType(ClientMoneyType.YuanBao).smallIconName
                                                : CurrencyIconData.GetCurrencyIconByMoneyType(ClientMoneyType.YinLiang).smallIconName;
         IsGongShi.gameObject.SetActive(itemPageInfo.great);
     }
 }
예제 #4
0
    /// <summary>
    /// 根据货币类型获取图标
    /// </summary>
    /// <param name="cType"></param>
    /// <returns></returns>
    public static string GetCurrencyIconNameByType(GameCmd.MoneyType cType)
    {
        string           iconName = "";
        CurrencyIconData data     = CurrencyIconData.GetCurrencyIconByMoneyType((ClientMoneyType)cType);

        if (data != null)
        {
            iconName = data.smallIconName;
        }
        return(iconName);
    }
예제 #5
0
 /// <summary>
 /// 重置
 /// </summary>
 public void Reset(bool depthClearData = false)
 {
     if (depthClearData)
     {
         blackMarketActiveStore = CommonStore.CommonStore_Six;
         //清空服务器下发下载数据(本地下架数据不清空)
         m_listServerUnShelveItems.Clear();
         //重置购买记录
         ResetPurchaseNumData();
         CurrencyIconData.Clear();
     }
 }
예제 #6
0
    void CreateRewardObj(Transform parent, QuestionDataBase db)
    {
        AddCreator(parent);
        m_lst_UIItemRewardDatas.Clear();
        if (!string.IsNullOrEmpty(db.money_reward))
        {
            string[] param = db.money_reward.Split(';');
            for (int m = 0; m < param.Length; m++)
            {
                string[] param2 = param[m].Split('_');
                uint     money  = 0;
                uint     num    = 0;
                if (uint.TryParse(param2[0], out money) && uint.TryParse(param2[1], out num))
                {
                    CurrencyIconData data = CurrencyIconData.GetCurrencyIconByMoneyType((ClientMoneyType)money);
                    if (data == null)
                    {
                        return;
                    }
                    m_lst_UIItemRewardDatas.Add(new UIItemRewardData()
                    {
                        itemID = data.itemID,
                        num    = num,
                    });
                }
            }
        }
        if (!string.IsNullOrEmpty(db.item_reward))
        {
            uint     itemID  = 0;
            uint     itemNum = 0;
            string[] data    = db.item_reward.Split(';');

            for (int i = 0; i < data.Length; i++)
            {
                string[] data2 = data[i].Split('_');
                if (uint.TryParse(data2[0], out itemID) && uint.TryParse(data2[1], out itemNum))
                {
                    m_lst_UIItemRewardDatas.Add(new UIItemRewardData()
                    {
                        itemID = itemID,
                        num    = itemNum,
                    });
                }
            }
        }
        m_ctor_UIItemRewardCreator.CreateGrids(m_lst_UIItemRewardDatas.Count);
    }
예제 #7
0
    public static CurrencyIconData GetCurrencyIconByMoneyType(ClientMoneyType type)
    {
        if (null == m_dicCacheIconData)
        {
            m_dicCacheIconData = new Dictionary <int, CurrencyIconData>();
        }
        int moneyType         = (int)type;
        CurrencyIconData data = null;

        if (!m_dicCacheIconData.TryGetValue(moneyType, out data))
        {
            string stringKeys = GameTableManager.Instance.GetGlobalConfig <string>(CONST_CURRENCY_ICON, ((uint)type).ToString());
            if (!string.IsNullOrEmpty(stringKeys))
            {
                string[] args = stringKeys.Split('|');
                if (args.Length != 2 || string.IsNullOrEmpty(args[0]))
                {
                    Engine.Utility.Log.Error("全局配置表中的货币图标参数无法解析");
                }
                else
                {
                    data                  = new CurrencyIconData();
                    data.type             = type;
                    data.smallIconName    = args[0];
                    data.SmallIconAtlasID = DataManager.Manager <UIManager>().GetResIDByFileName(true, args[0]);
                    if (args[1] != "")
                    {
                        uint itemID = 0;
                        if (uint.TryParse(args[1], out itemID))
                        {
                            ItemDataBase item = GameTableManager.Instance.GetTableItem <ItemDataBase>(itemID);
                            if (item != null)
                            {
                                data.itemID         = itemID;
                                data.bigIconName    = item.itemIcon;
                                data.BigIconAtlasID = DataManager.Manager <UIManager>().GetResIDByFileName(true, item.itemIcon);
                            }
                        }
                    }
                    m_dicCacheIconData.Add(moneyType, data);
                }
            }
        }
        return(data);
    }
예제 #8
0
파일: BuyPanel.cs 프로젝트: zuojiashun/src
    public void UpdateBuyInfo()
    {
        if (inputInitData == null)
        {
            return;
        }
        uint item_id = inputInitData.item_id;
        int  price   = inputInitData.price;
        int  min     = inputInitData.min;
        int  max     = inputInitData.max;

        if (min > max)
        {
            return;
        }
        minNum = min;
        maxNum = max;
        m_label_UnitNum.text       = min.ToString();
        m_label_TotalPriceNum.text = (min * price).ToString();
        m_label_SellNum.text       = max.ToString();

        ItemDataBase itemData = GameTableManager.Instance.GetTableItem <ItemDataBase>(item_id);

        if (itemData != null)
        {
            UIManager.GetTextureAsyn(itemData.itemIcon, ref m_iconCASD, () =>
            {
                if (null != m__Icon)
                {
                    m__Icon.mainTexture = null;
                }
            }, m__Icon);

            m_label_Name.text      = itemData.itemName;
            m_label_UnitPrice.text = price.ToString();
        }
        CurrencyIconData data = CurrencyIconData.GetCurrencyIconByMoneyType((ClientMoneyType)inputInitData.moneyType);

        if (data != null)
        {
            m_sprite_moneyIcon.spriteName  = data.smallIconName;
            m_sprite_moneyIcon2.spriteName = data.smallIconName;
        }
    }
예제 #9
0
    void CostByMoneyType(ClientMoneyType type)
    {
        CostMoneyType = type;
        UpdatePurchaseNum(1);
        int haveYuanBaoNum        = MainPlayerHelper.GetMoneyNumByType(ClientMoneyType.YuanBao);
        int haveWenQianNum        = MainPlayerHelper.GetMoneyNumByType(ClientMoneyType.Wenqian);
        int haveYinLiangNum       = MainPlayerHelper.GetMoneyNumByType(ClientMoneyType.YinLiang);
        CurrencyIconData iconData = CurrencyIconData.GetCurrencyIconByMoneyType(type);

        if (iconData != null)
        {
            UIManager.GetAtlasAsyn(iconData.smallIconName, ref m_priceAsynSeed, () =>
            {
                if (null != m_sprite_CostIcon)
                {
                    m_sprite_CostIcon.atlas = null;
                }
            }, m_sprite_CostIcon);
        }
        m_btn_YuanBao.GetComponent <UIToggle>().value  = type == ClientMoneyType.YuanBao;
        m_btn_YinLiang.GetComponent <UIToggle>().value = type == ClientMoneyType.YinLiang;
    }
예제 #10
0
    public override void SetGridData(object data)
    {
        base.SetGridData(data);
        info = data as ItemPriceInfo;
        if (info != null)
        {
            if (money != null)
            {
                CurrencyIconData currency = CurrencyIconData.GetCurrencyIconByMoneyType((ClientMoneyType)info.money_type);
                if (currency != null)
                {
                    money.spriteName = currency.smallIconName;
                }
            }
            itData     = new ItemSerialize();
            itData     = ItemSerialize.Deserialize(info.item_data);
            price.text = info.price.ToString();
            if (itData != null)
            {
                ResetInfoGrid(true);

                BaseItem baseItem = new BaseItem(itData.dwObjectID, itData);
                name.text = baseItem.Name;

                SetIcon(true, baseItem.Icon);
                bool enable = (info.num > 1) ? true : false;
                SetNum(enable, info.num.ToString());
                SetBorder(true, baseItem.BorderIcon);
                if (baseItem.IsMuhon)
                {
                    SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
                }
                else if (baseItem.IsRuneStone)
                {
                    SetRuneStoneMask(true, (uint)baseItem.Grade);
                }
            }
        }
    }
예제 #11
0
    public void ShowByMoneyType(ClientMoneyType type)
    {
        m_trans_ChangeGoldRoot.gameObject.SetActive(type == ClientMoneyType.Gold);
        MaxInputNum = type == ClientMoneyType.Gold ? MaxYuanBaoToGold : MaxYuanBaoToYinLiang;
        CurrencyIconData iconData = CurrencyIconData.GetCurrencyIconByMoneyType(type);

        if (iconData != null)
        {
            UIManager.GetAtlasAsyn(iconData.smallIconName, ref m_priceAsynSeed_2, () =>
            {
                if (null != m_sprite_MoneyIcon)
                {
                    m_sprite_MoneyIcon.atlas = null;
                }
            }, m_sprite_MoneyIcon);
        }
        ToMoneyType = type;

        if (type == ClientMoneyType.YinLiang)
        {
            m_label_name.text = "兑换银两";
            CostMoneyType     = ClientMoneyType.YuanBao;
        }
        else if (type == ClientMoneyType.Wenqian)
        {
            m_label_name.text = "兑换绑元";
            CostMoneyType     = ClientMoneyType.YuanBao;
        }
        else
        {
            m_label_name.text = "兑换金币";
            CostMoneyType     = ClientMoneyType.YuanBao;
        }

        CostByMoneyType(CostMoneyType);
    }
예제 #12
0
    void ShowUI()
    {
        if (m_Trailerdata == null)
        {
            return;
        }
        itemDic.Clear();
        m_label_title.text = m_Trailerdata.strTitle;
        m_label_desc.text  = m_Trailerdata.strDesc;

        m_sprite_icon.spriteName = m_Trailerdata.strIcon;
        m_sprite_icon.MakePixelPerfect();
        FunctionPushManager manager = DataManager.Manager <FunctionPushManager>();
        UIParticleWidget    p       = m_spriteEx_btnget.GetComponent <UIParticleWidget>();

        if (p == null)
        {
            p       = m_spriteEx_btnget.gameObject.AddComponent <UIParticleWidget>();
            p.depth = 20;
        }
        if (manager.CanOpen(m_Trailerdata))
        {
            m_label_conditiondesc.text  = m_Trailerdata.strCondidtionDesc;
            m_label_conditiondesc.color = new Color(9 / 255.0f, 127 / 255.0f, 29 / 255.0f);
            m_label_btnLabel.text       = "领取奖励";
            m_spriteEx_btnget.ChangeSprite(2);

            if (p != null)
            {
                p.SetDimensions(200, 54);
                p.ReleaseParticle();
                p.AddRoundParticle();
            }
        }
        else
        {
            if (p != null)
            {
                p.ReleaseParticle();
            }
            m_label_btnLabel.text = "前往升级";
            m_spriteEx_btnget.ChangeSprite(1);

            string[] strcondition = m_Trailerdata.strCondidtionDesc.Split(new string[] { "\\n" }, StringSplitOptions.RemoveEmptyEntries);

            if (strcondition.Length == 2)
            {
                int           level = MainPlayerHelper.GetPlayerLevel();
                StringBuilder msg   = new StringBuilder();
                if (level < m_Trailerdata.level)
                {
                    msg.Append(ColorManager.GetColorString(ColorType.JZRY_Txt_Red, string.Format("{0}(还差{1}级)\n", strcondition[0], (m_Trailerdata.level - level))));
                }
                else
                {
                    msg.Append(ColorManager.GetColorString(ColorType.JZRY_Green, string.Format("{0}", strcondition[0])));
                }

                if (DataManager.Manager <TaskDataManager>().CheckTaskFinished(m_Trailerdata.task))
                {
                    msg.Append(ColorManager.GetColorString(ColorType.JZRY_Green, (string.Format("\n{0}", strcondition[1]))));
                }
                else
                {
                    msg.Append(ColorManager.GetColorString(ColorType.JZRY_Txt_Red, string.Format("\n{0}", strcondition[1])));
                }
                m_label_conditiondesc.text = msg.ToString();
            }
            else
            {
                int level = MainPlayerHelper.GetPlayerLevel();
                if (level < m_Trailerdata.level)
                {
                    m_label_conditiondesc.text = ColorManager.GetColorString(ColorType.JZRY_Txt_Red, string.Format("{0}(还差{1}级)", strcondition[0], (m_Trailerdata.level - level)));
                }
                else
                {
                    m_label_conditiondesc.text = ColorManager.GetColorString(ColorType.JZRY_Green, string.Format("{0}", strcondition[0]));
                }
            }
        }

        int       index = 0;
        UIManager uiMan = DataManager.Manager <UIManager>();

        if (string.IsNullOrEmpty(m_Trailerdata.strJobItem) == false)
        {
            string[] strJobItem = m_Trailerdata.strJobItem.Split(';');
            int      job        = MainPlayerHelper.GetMainPlayerJob();
            if (strJobItem.Length >= job && job > 0)
            {
                string[] strItem = strJobItem[job - 1].Split('_');
                if (strItem.Length == 2)
                {
                    uint itemId  = uint.Parse(strItem[0]);
                    uint itemNum = uint.Parse(strItem[1]);
                    if (!itemDic.ContainsKey(itemId))
                    {
                        itemDic.Add(itemId, itemNum);
                    }
                }
            }
        }
        else if (string.IsNullOrEmpty(m_Trailerdata.strItem) == false)
        {
            string[] strItem = m_Trailerdata.strItem.Split('_');
            if (strItem.Length == 2)
            {
                uint itemId  = uint.Parse(strItem[0]);
                uint itemNum = uint.Parse(strItem[1]);
                if (!itemDic.ContainsKey(itemId))
                {
                    itemDic.Add(itemId, itemNum);
                }
            }
        }
        else if (string.IsNullOrEmpty(m_Trailerdata.strMoney) == false)
        {
            string[] strItems = m_Trailerdata.strMoney.Split(';');
            for (int i = 0; i < strItems.Length; i++)
            {
                string[] strItem = strItems[i].Split('_');
                if (strItem.Length == 2)
                {
                    uint itemId  = uint.Parse(strItem[0]);
                    uint itemNum = uint.Parse(strItem[1]);
                    if (!itemDic.ContainsKey(itemId))
                    {
                        CurrencyIconData data = CurrencyIconData.GetCurrencyIconByMoneyType((ClientMoneyType)itemId);
                        if (data != null)
                        {
                            uint id = data.itemID;
                            itemDic.Add(id, itemNum);
                        }
                    }
                }
            }
        }
        m_lst_UIItemRewardDatas.Clear();
        var item = itemDic.GetEnumerator();

        while (item.MoveNext())
        {
            m_lst_UIItemRewardDatas.Add(new UIItemRewardData()
            {
                itemID = item.Current.Key,
                num    = item.Current.Value,
            });
        }
        m_ctor_UIItemRewardCreator.CreateGrids(m_lst_UIItemRewardDatas.Count);
    }
예제 #13
0
    public override void SetGridData(object data)
    {
        base.SetGridData(data);
        if (null != data)
        {
            this.m_data = data as ClanDefine.LocalClanDonateDB;
            if (null != m_lab_name)
            {
                m_lab_name.text = m_data.Name;
            }
            if (null != m_lab_sw)
            {
                m_lab_sw.text = m_data.SW + "";
            }
            if (null != m_lab_zg)
            {
                m_lab_zg.text = m_data.ZG + "";
            }
            if (null != m_lab_zj)
            {
                m_lab_zj.text = m_data.ZJ + "";
            }
            if (null != m_lab_leftTimes)
            {
                string leftText = (m_data.LeftTimes > 0) ? ColorManager.GetColorString(ColorType.Green, m_data.LeftTimes.ToString())
                    : ColorManager.GetColorString(ColorType.Red, m_data.LeftTimes.ToString());
                leftText            += "/" + m_data.TotalTimes;
                m_lab_leftTimes.text = string.Format("({0})"
                                                     , leftText);
            }
            if (null != m_icon)
            {
            }
            string iconName = MallDefine.GetCurrencyIconNameByType((GameCmd.MoneyType)m_data.DonateType);
            UIManager.GetAtlasAsyn(iconName, ref m_playerAvataCASD, () =>
            {
                if (null != m_sp_donateIcon)
                {
                    m_sp_donateIcon.atlas = null;
                }
            }, m_sp_donateIcon);

            if (null != m_lab_donateNum)
            {
                m_lab_donateNum.text = m_data.DonateNum + "";
            }
            if (null != headIcon)
            {
                list.Clear();
                CurrencyIconData curr = CurrencyIconData.GetCurrencyIconByMoneyType((ClientMoneyType)m_data.DonateType);
                if (curr != null)
                {
                    list.Add(new UIItemRewardData()
                    {
                        itemID = curr.itemID,
                        num    = 0,
                    });
                }
                m_ctor.CreateGrids(list.Count);
            }
        }
    }
예제 #14
0
    /// <summary>
    /// 右侧Text塞数据
    /// </summary>
    /// <param name="mailIndex"></param>
    private void SetMsgText(uint mailIndex)
    {
        if (mailList == null)
        {
            m_btn_lingqu_btn.gameObject.SetActive(false);
            m_btn_one_btn_get.gameObject.SetActive(false);
            m_label_mark_message.gameObject.SetActive(true);
            return;
        }
        if (mailList.Count == 0)
        {
            m_btn_lingqu_btn.gameObject.SetActive(false);
            m_btn_one_btn_get.gameObject.SetActive(false);
            m_label_mark_message.gameObject.SetActive(true);
            return;
        }
        if (mailIndex >= mailList.Count)
        {
            return;
        }
        curMail = mailList[(int)mailIndex];
        m_label_mail_text_name.text = curMail.title;
        m_label_mail_text.text      = curMail.text;
        DateTime dt = DataManager.Manager <MailManager>().GetCreatTime(curMail.createTime);

        m_label_recieve_time.text = dt.Year + "年" +
                                    dt.Month + "月" +
                                    dt.Day + "日";

        m_lst_UIItemRewardDatas.Clear();
        if (curMail.item.Count > 0)
        {
            for (int i = 0; i < curMail.item.Count; i++)
            {
                m_lst_UIItemRewardDatas.Add(new UIItemRewardData()
                {
                    itemID = curMail.item[i].dwObjectID,
                    num    = curMail.item[i].dwNum,
                    data   = curMail.item[i],
                });
            }
        }
        if (curMail.sendMoney.Count > 0)
        {
            foreach (var money in curMail.sendMoney)
            {
                CurrencyIconData data = CurrencyIconData.GetCurrencyIconByMoneyType((ClientMoneyType)money.moneytype);
                if (data == null)
                {
                    return;
                }
                m_lst_UIItemRewardDatas.Add(new UIItemRewardData()
                {
                    itemID = data.itemID,
                    num    = money.moneynum,
                });
            }
        }

        m_ctor_UIItemRewardCreator.CreateGrids(m_lst_UIItemRewardDatas.Count);
        int count = m_lst_UIItemRewardDatas.Count;

        m_sprite_arrow_left.gameObject.SetActive(count > 5);
        m_sprite_arrow_right.gameObject.SetActive(count > 5);
        m_btn_lingqu_btn.gameObject.SetActive(count > 0);
    }