private void UpdateItemPricePnl(CUIFormScript form, Transform pricePnlTrans, Transform tagTrans, COMDT_AKALISHOP_GOODS productInfo) { GameObject obj = Utility.FindChild(pricePnlTrans.gameObject, "oldPricePanel"); Text componetInChild = Utility.GetComponetInChild <Text>(pricePnlTrans.gameObject, "oldPricePanel/oldPriceText"); Image componetInChild2 = Utility.GetComponetInChild <Image>(pricePnlTrans.gameObject, "newPricePanel/costImage"); Text componetInChild3 = Utility.GetComponetInChild <Text>(pricePnlTrans.gameObject, "newPricePanel/newCostText"); Text componetInChild4 = Utility.GetComponetInChild <Text>(tagTrans.gameObject, "Text"); tagTrans.gameObject.CustomSetActive(false); obj.CustomSetActive(false); tagTrans.gameObject.CustomSetActive(true); float num = productInfo.dwItemDiscount / 10u; if (Math.Abs(num % 1f) < 1.401298E-45f) { componetInChild4.set_text(string.Format("{0}折", ((int)num).ToString("D"))); } else { componetInChild4.set_text(string.Format("{0}折", num.ToString("0.0"))); } obj.CustomSetActive(true); componetInChild.set_text(productInfo.dwOrigPrice.ToString()); componetInChild3.set_text(productInfo.dwRealPrice.ToString()); componetInChild2.SetSprite(CMallSystem.GetPayTypeIconPath(enPayType.DianQuan), form, true, false, false, false); }
private void InitFromView(CUIFormScript formScript) { SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext(); this.InitBuffItem(formScript, curLvelContext); this.m_relivePayType = CMallSystem.ResBuyTypeToPayType((int)curLvelContext.m_reviveInfo[curLvelContext.m_levelDifficulty].astReviveCost[3 - PVEReviveHeros.m_iRemainReviveNum].bCostType); this.m_relivePayValue = curLvelContext.m_reviveInfo[curLvelContext.m_levelDifficulty].astReviveCost[3 - PVEReviveHeros.m_iRemainReviveNum].dwCostPrice; string text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ReliveMessage"), Singleton <CTextManager> .GetInstance().GetText(CMallSystem.s_payTypeNameKeys[(int)this.m_relivePayType])); GameObject widget = formScript.GetWidget(0); if (widget != null) { Text component = widget.GetComponent <Text>(); if (component != null) { component.text = text; } } GameObject widget2 = formScript.GetWidget(1); if (widget2 != null) { Image component2 = widget2.GetComponent <Image>(); if (component2 != null) { component2.SetSprite(CMallSystem.GetPayTypeIconPath(this.m_relivePayType), formScript, true, false, false, false); } } GameObject widget3 = formScript.GetWidget(2); if (widget3 != null) { Text component3 = widget3.GetComponent <Text>(); if (component3 != null) { component3.text = this.m_relivePayValue.ToString(); } } GameObject gameObject = this.m_form.transform.Find("buffInfoPanel").gameObject; if (gameObject == null) { return; } GameObject gameObject2 = gameObject.transform.Find("ReviveText/NumText").gameObject; if (gameObject2 == null) { return; } gameObject2.GetComponent <Text>().text = PVEReviveHeros.m_iRemainReviveNum.ToString(); CUITimerScript component4 = gameObject.transform.Find("Timer").GetComponent <CUITimerScript>(); byte reviveTimeMax = curLvelContext.m_reviveTimeMax; component4.SetTotalTime((float)reviveTimeMax); }
private void InitFromView(CUIFormScript formScript) { SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext(); ResLevelCfgInfo dataByKey = GameDataMgr.levelDatabin.GetDataByKey(curLvelContext.iLevelID); this.InitBuffItem(formScript, curLvelContext, dataByKey); this.m_relivePayType = CMallSystem.ResBuyTypeToPayType(dataByKey.astReviveInfo[curLvelContext.difficulty].astReviveCost[3 - m_iRemainReviveNum].bCostType); this.m_relivePayValue = dataByKey.astReviveInfo[curLvelContext.difficulty].astReviveCost[3 - m_iRemainReviveNum].dwCostPrice; string str = string.Format(Singleton <CTextManager> .GetInstance().GetText("ReliveMessage"), Singleton <CTextManager> .GetInstance().GetText(CMallSystem.s_payTypeNameKeys[(int)this.m_relivePayType])); GameObject widget = formScript.GetWidget(0); if (widget != null) { Text component = widget.GetComponent <Text>(); if (component != null) { component.text = str; } } GameObject obj3 = formScript.GetWidget(1); if (obj3 != null) { Image image = obj3.GetComponent <Image>(); if (image != null) { image.SetSprite(CMallSystem.GetPayTypeIconPath(this.m_relivePayType), formScript, true, false, false); } } GameObject obj4 = formScript.GetWidget(2); if (obj4 != null) { Text text2 = obj4.GetComponent <Text>(); if (text2 != null) { text2.text = this.m_relivePayValue.ToString(); } } GameObject gameObject = this.m_form.transform.Find("buffInfoPanel").gameObject; if (gameObject != null) { GameObject obj6 = gameObject.transform.Find("ReviveText/NumText").gameObject; if (obj6 != null) { obj6.GetComponent <Text>().text = m_iRemainReviveNum.ToString(); CUITimerScript script = gameObject.transform.Find("Timer").GetComponent <CUITimerScript>(); byte bReviveTimeMax = dataByKey.bReviveTimeMax; script.SetTotalTime((float)bReviveTimeMax); } } }
private void UpdateItemPricePnl(CUIFormScript form, Transform pricePnlTrans, Transform tagTrans, ref stPayInfoSet payInfoSet) { GameObject obj2 = Utility.FindChild(pricePnlTrans.gameObject, "oldPricePanel"); Text componetInChild = Utility.GetComponetInChild <Text>(pricePnlTrans.gameObject, "oldPricePanel/oldPriceText"); Image image = Utility.GetComponetInChild <Image>(pricePnlTrans.gameObject, "newPricePanel/costImage"); Text text2 = Utility.GetComponetInChild <Text>(pricePnlTrans.gameObject, "newPricePanel/newCostText"); Text text3 = Utility.GetComponetInChild <Text>(tagTrans.gameObject, "Text"); tagTrans.gameObject.CustomSetActive(false); obj2.CustomSetActive(false); for (int i = 0; i < payInfoSet.m_payInfoCount; i++) { stPayInfo info = payInfoSet.m_payInfos[i]; if (!Singleton <CMallMysteryShop> .GetInstance().HasGotDiscount) { tagTrans.gameObject.CustomSetActive(true); text3.text = "?折"; text2.text = info.m_payValue.ToString(); image.SetSprite(CMallSystem.GetPayTypeIconPath(info.m_payType), form, true, false, false); } else if (Singleton <CMallMysteryShop> .GetInstance().HasGotDiscount&& ((info.m_discountForDisplay == 0x2710) || (info.m_oriValue == info.m_payValue))) { text2.text = info.m_payValue.ToString(); image.SetSprite(CMallSystem.GetPayTypeIconPath(info.m_payType), form, true, false, false); } else { tagTrans.gameObject.CustomSetActive(true); float num2 = ((float)info.m_discountForDisplay) / 1000f; if (Math.Abs((float)(num2 % 1f)) < float.Epsilon) { text3.text = string.Format("{0}折", ((int)num2).ToString("D")); } else { text3.text = string.Format("{0}折", num2.ToString("0.0")); } obj2.CustomSetActive(true); componetInChild.text = info.m_oriValue.ToString(); text2.text = info.m_payValue.ToString(); image.SetSprite(CMallSystem.GetPayTypeIconPath(info.m_payType), form, true, false, false); } } }
public uint SetItemPriceInfo(CMallItemWidget itemWidget, ref stPayInfoSet payInfoSet) { uint payValue = 0; if (itemWidget.m_priceContainer != null) { itemWidget.m_priceContainer.SetActive(true); CMallItem.OldPriceType oldPriceType = this.GetOldPriceType(); CUIListScript component = itemWidget.m_priceContainer.GetComponent <CUIListScript>(); component.SetElementAmount(1); itemWidget.m_orTextContainer.CustomSetActive(false); CUIListElementScript elemenet = component.GetElemenet(0); if (elemenet == null) { return(payValue); } GameObject widget = elemenet.GetWidget(0); GameObject obj3 = elemenet.GetWidget(1); GameObject obj4 = elemenet.GetWidget(2); GameObject obj5 = elemenet.GetWidget(4); GameObject obj6 = elemenet.GetWidget(3); GameObject obj7 = elemenet.GetWidget(5); if ((((widget == null) || (obj3 == null)) || ((obj4 == null) || (obj5 == null))) || ((obj6 == null) || (obj7 == null))) { return(payValue); } for (int i = 0; i < payInfoSet.m_payInfoCount; i++) { if ((payInfoSet.m_payInfos[i].m_payType == enPayType.Diamond) || (payInfoSet.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan)) { payInfoSet.m_payInfos[i].m_payType = enPayType.DianQuan; } } for (int j = 0; j < payInfoSet.m_payInfoCount; j++) { if (((payInfoSet.m_payInfos[j].m_payType != enPayType.DianQuan) && (payInfoSet.m_payInfos[j].m_payType != enPayType.Diamond)) && (payInfoSet.m_payInfos[j].m_payType != enPayType.DiamondAndDianQuan)) { continue; } payValue = payInfoSet.m_payInfos[j].m_payValue; switch (oldPriceType) { case CMallItem.OldPriceType.None: itemWidget.m_middleOrText.CustomSetActive(true); itemWidget.m_bottomOrText.CustomSetActive(false); widget.SetActive(false); obj3.SetActive(false); obj4.SetActive(false); obj6.SetActive(true); obj6.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString(); obj7.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false); return(payValue); case CMallItem.OldPriceType.FirstOne: itemWidget.m_middleOrText.CustomSetActive(false); itemWidget.m_bottomOrText.CustomSetActive(true); if (j != 0) { break; } obj3.SetActive(false); obj6.SetActive(false); widget.SetActive(true); obj4.SetActive(true); widget.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_oriValue.ToString(); obj4.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString(); obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false); return(payValue); case CMallItem.OldPriceType.SecondOne: itemWidget.m_middleOrText.CustomSetActive(false); itemWidget.m_bottomOrText.CustomSetActive(true); if (j != 1) { goto Label_045D; } obj3.SetActive(false); obj6.SetActive(false); widget.SetActive(true); obj4.SetActive(true); widget.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_oriValue.ToString(); obj4.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString(); obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false); return(payValue); case CMallItem.OldPriceType.Both: itemWidget.m_middleOrText.CustomSetActive(true); itemWidget.m_bottomOrText.CustomSetActive(false); obj3.SetActive(false); obj6.SetActive(false); widget.SetActive(true); obj4.SetActive(true); widget.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_oriValue.ToString(); obj4.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString(); obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false); return(payValue); default: return(payValue); } obj3.SetActive(false); widget.SetActive(false); obj6.SetActive(false); obj4.SetActive(true); obj4.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString(); obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false); return(payValue); Label_045D: obj3.SetActive(false); widget.SetActive(false); obj6.SetActive(false); obj4.SetActive(true); obj4.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString(); obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false); return(payValue); } } return(payValue); }
public uint SetItemPriceInfo(CMallItemWidget itemWidget, ref stPayInfoSet payInfoSet) { uint result = 0u; if (itemWidget.m_priceContainer == null) { return(result); } itemWidget.m_priceContainer.SetActive(true); CMallItem.OldPriceType oldPriceType = this.GetOldPriceType(); CUIListScript component = itemWidget.m_priceContainer.GetComponent <CUIListScript>(); component.SetElementAmount(1); itemWidget.m_orTextContainer.CustomSetActive(false); CUIListElementScript elemenet = component.GetElemenet(0); if (elemenet == null) { return(result); } GameObject widget = elemenet.GetWidget(0); GameObject widget2 = elemenet.GetWidget(1); GameObject widget3 = elemenet.GetWidget(2); GameObject widget4 = elemenet.GetWidget(4); GameObject widget5 = elemenet.GetWidget(3); GameObject widget6 = elemenet.GetWidget(5); if (widget == null || widget2 == null || widget3 == null || widget4 == null || widget5 == null || widget6 == null) { return(result); } for (int i = 0; i < payInfoSet.m_payInfoCount; i++) { if (payInfoSet.m_payInfos[i].m_payType == enPayType.Diamond || payInfoSet.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan) { payInfoSet.m_payInfos[i].m_payType = enPayType.DianQuan; } } for (int j = 0; j < payInfoSet.m_payInfoCount; j++) { if (payInfoSet.m_payInfos[j].m_payType == enPayType.DianQuan || payInfoSet.m_payInfos[j].m_payType == enPayType.Diamond || payInfoSet.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan) { result = payInfoSet.m_payInfos[j].m_payValue; switch (oldPriceType) { case CMallItem.OldPriceType.None: { itemWidget.m_middleOrText.CustomSetActive(true); itemWidget.m_bottomOrText.CustomSetActive(false); widget.SetActive(false); widget2.SetActive(false); widget3.SetActive(false); widget5.SetActive(true); Text component2 = widget5.GetComponent <Text>(); component2.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString()); Image component3 = widget6.GetComponent <Image>(); component3.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); break; } case CMallItem.OldPriceType.FirstOne: itemWidget.m_middleOrText.CustomSetActive(false); itemWidget.m_bottomOrText.CustomSetActive(true); if (j == 0) { widget2.SetActive(false); widget5.SetActive(false); widget.SetActive(true); widget3.SetActive(true); Text component4 = widget.GetComponent <Text>(); component4.set_text(payInfoSet.m_payInfos[j].m_oriValue.ToString()); Text component5 = widget3.GetComponent <Text>(); component5.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString()); Image component6 = widget4.GetComponent <Image>(); component6.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); } else { widget2.SetActive(false); widget.SetActive(false); widget5.SetActive(false); widget3.SetActive(true); Text component7 = widget3.GetComponent <Text>(); component7.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString()); Image component8 = widget4.GetComponent <Image>(); component8.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); } break; case CMallItem.OldPriceType.SecondOne: itemWidget.m_middleOrText.CustomSetActive(false); itemWidget.m_bottomOrText.CustomSetActive(true); if (j == 1) { widget2.SetActive(false); widget5.SetActive(false); widget.SetActive(true); widget3.SetActive(true); Text component9 = widget.GetComponent <Text>(); component9.set_text(payInfoSet.m_payInfos[j].m_oriValue.ToString()); Text component10 = widget3.GetComponent <Text>(); component10.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString()); Image component11 = widget4.GetComponent <Image>(); component11.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); } else { widget2.SetActive(false); widget.SetActive(false); widget5.SetActive(false); widget3.SetActive(true); Text component12 = widget3.GetComponent <Text>(); component12.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString()); Image component13 = widget4.GetComponent <Image>(); component13.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); } break; case CMallItem.OldPriceType.Both: { itemWidget.m_middleOrText.CustomSetActive(true); itemWidget.m_bottomOrText.CustomSetActive(false); widget2.SetActive(false); widget5.SetActive(false); widget.SetActive(true); widget3.SetActive(true); Text component14 = widget.GetComponent <Text>(); component14.set_text(payInfoSet.m_payInfos[j].m_oriValue.ToString()); Text component15 = widget3.GetComponent <Text>(); component15.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString()); Image component16 = widget4.GetComponent <Image>(); component16.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); break; } } break; } } return(result); }