Example #1
0
        private string PraseToString(int goodsID, int num)
        {
            var goodData = ItemDataManager.Instance.GetItemData(goodsID);

            if (goodData == null)
            {
                return("ItemID is Wrong");
            }
            TextColor textColor = TextColor.white;

            switch (goodData._ColorLevel)
            {
            case 0:
                textColor = TextColor.EquipmentGreen;
                break;

            case 1:
                textColor = TextColor.EquipmentBlue;
                break;

            case 2:
                textColor = TextColor.EquipmentMagenta;
                break;

            case 3:
                textColor = TextColor.EquipmentYellow;
                break;

            default:
                break;
            }
            string content = string.Format(LanguageTextManager.GetString("IDS_H1_568"),
                                           NGUIColor.SetTxtColor(LanguageTextManager.GetString(goodData._szGoodsName), textColor), num.ToString());

            return(content);
        }
Example #2
0
        public void Show(MedicamentData m_MedicamentData, bool ShowPathLink)
        {
            ISShowing        = true;
            this.m_curGoodID = m_MedicamentData._goodID;
            if (ShowPathLink)
            {
                Btn_PathLink.gameObject.SetActive(true);
                Button_Use.gameObject.SetActive(false);
                Button_Sell.gameObject.SetActive(false);
                // Button_Exit.gameObject.SetActive(false);
                Button_AllUse.gameObject.SetActive(false);
            }
            else
            {
                Btn_PathLink.gameObject.SetActive(false);
                Button_Use.gameObject.SetActive(true);
                Button_Sell.gameObject.SetActive(m_MedicamentData._TradeFlag == 1);
                // Button_Exit.gameObject.SetActive(true);
                Button_AllUse.gameObject.SetActive(true);
            }
            TextColor textColor = TextColor.white;

            switch (m_MedicamentData._ColorLevel)
            {
            case 0:
                textColor = TextColor.EquipmentGreen;
                break;

            case 1:
                textColor = TextColor.EquipmentBlue;
                break;

            case 2:
                textColor = TextColor.EquipmentMagenta;
                break;

            case 3:
                textColor = TextColor.EquipmentYellow;
                break;
            }
            Label_GoodName.text = NGUIColor.SetTxtColor(LanguageTextManager.GetString(m_MedicamentData._szGoodsName), textColor);
            Switch_Icon.ChangeSprite(m_MedicamentData._ColorLevel + 1);
            CreatObjectToNGUI.InstantiateObj(m_MedicamentData._DisplayIdSmall, Point_GiftIcon);
            Label_AllowLevel.text = m_MedicamentData._AllowLevel.ToString();
            int playerLevel = PlayerManager.Instance.FindHeroDataModel().UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_LEVEL;

            if (playerLevel >= m_MedicamentData._AllowLevel)
            {
                m_isArrowLevel         = true;
                Label_AllowLevel.color = Color.white;
            }
            else
            {
                m_isArrowLevel         = false;
                Label_AllowLevel.color = Color.red;
            }

            this.m_curNum  = ContainerInfomanager.Instance.GetItemNumber(m_curGoodID);
            Label_Num.text = m_curNum.ToString();

            Label_Introduction.text = LanguageTextManager.GetString(m_MedicamentData._szDesc).Replace(@"\n", "\n");
            Label_SellPrice.text    = m_MedicamentData._SaleCost.ToString();

            m_GiftConfigData = ItemDataManager.Instance.GetGiftData(m_curGoodID);
            if (m_GiftConfigData._giftType == 1)
            {
                Label_ContentTitle.text = LanguageTextManager.GetString("IDS_I1_40");
            }
            else if (m_GiftConfigData._giftType == 2)
            {
                Label_ContentTitle.text = LanguageTextManager.GetString("IDS_I1_41");
            }
            //
            transform.localPosition = Vector3.zero;

            //奖品
            string content      = "";
            var    goodsDisplay = m_GiftConfigData._ProfessionGoodsDisplay.SingleOrDefault(p => p.Profession == PlayerManager.Instance.FindHeroDataModel().GetCommonValue().PLAYER_FIELD_VISIBLE_VOCATION);

            for (int i = 0; i < goodsDisplay.GoodsDisplay.Length; i++)
            {
                var ItemData = ItemDataManager.Instance.GetItemData(goodsDisplay.GoodsDisplay[i].GoodsID);
                //              if(m_GiftConfigData._giftType == 1)
                //              {
                //                  content += LanguageTextManager.GetString(ItemData._szGoodsName) + "("
                //                      +m_GiftConfigData._GoodsDisplay[i].MinNum.ToString()+ "~"
                //                          +m_GiftConfigData._GoodsDisplay[i].MinNum.ToString()+")" + "\n";
                //              }
                //              else if(m_GiftConfigData._giftType == 2)
                //              {
                //                  content += LanguageTextManager.GetString(ItemData._szGoodsName) + "("
                //                      +m_GiftConfigData._GoodsDisplay[i].MinNum.ToString()+")" + "\n";
                //              }
                if (goodsDisplay.GoodsDisplay[i].MinNum == goodsDisplay.GoodsDisplay[i].MaxNum)
                {
                    content += LanguageTextManager.GetString(ItemData._szGoodsName) + " X "
                               + goodsDisplay.GoodsDisplay[i].MinNum.ToString() + "\n";
                }
                else
                {
                    content += LanguageTextManager.GetString(ItemData._szGoodsName) + " X "
                               + goodsDisplay.GoodsDisplay[i].MinNum.ToString() + "-"
                               + goodsDisplay.GoodsDisplay[i].MaxNum.ToString() + "\n";
                }
            }
            Label_RewardContent.text = content;
        }