private void RefreshRenewalPanel() { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CPaySystem.s_renewalDianQuanFormPath); if (form == null) { return; } uint dwConfValue = GameDataMgr.globalInfoDatabin.GetDataByKey(61u).dwConfValue; ResRandomRewardStore dataByKey = GameDataMgr.randomRewardDB.GetDataByKey(dwConfValue); Transform transform = form.transform.Find("Panel_Renewal/bodyPanel"); Text component = transform.Find("rewardDescText").GetComponent <Text>(); component.set_text(StringHelper.UTF8BytesToString(ref dataByKey.szRewardDesc)); GameObject gameObject = transform.Find("itemCellFirst").gameObject; CUseable itemUseable = CUseableManager.CreateUsableByRandowReward((RES_RANDOM_REWARD_TYPE)dataByKey.astRewardDetail[0].bItemType, (int)dataByKey.astRewardDetail[0].dwLowCnt, dataByKey.astRewardDetail[0].dwItemID); CUICommonSystem.SetItemCell(form, gameObject, itemUseable, true, false, false, false); CUIListScript component2 = transform.Find("List").GetComponent <CUIListScript>(); this.RefreshRewardList(form, component2, ref dataByKey.astRewardDetail, 1); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); bool flag = masterRoleInfo.IsGuidedStateSet(24); bool flag2 = masterRoleInfo.IsGuidedStateSet(25); GameObject gameObject2 = transform.Find("payButton").gameObject; GameObject gameObject3 = transform.Find("getButton").gameObject; CUICommonSystem.SetButtonName(gameObject2, Singleton <CTextManager> .GetInstance().GetText("Pay_Btn_Top_Up")); gameObject2.CustomSetActive(!flag); CUICommonSystem.SetButtonName(gameObject3, Singleton <CTextManager> .GetInstance().GetText("Pay_Btn_Get_Reward")); gameObject3.CustomSetActive(flag && !flag2); }
private void RefreshFirstPayPanel() { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CPaySystem.s_firstPayFormPath); if (form == null) { return; } uint dwConfValue = GameDataMgr.globalInfoDatabin.GetDataByKey(60u).dwConfValue; ResRandomRewardStore dataByKey = GameDataMgr.randomRewardDB.GetDataByKey(dwConfValue); Transform transform = form.transform.Find("Panel_FirstPay/bodyPanel"); CUIListScript component = transform.Find("rewardList").GetComponent <CUIListScript>(); this.RefreshRewardList(form, component, ref dataByKey.astRewardDetail, 0); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); bool flag = masterRoleInfo.IsGuidedStateSet(22); bool flag2 = masterRoleInfo.IsGuidedStateSet(23); GameObject gameObject = transform.Find("payButton").gameObject; GameObject gameObject2 = transform.Find("getButton").gameObject; CUICommonSystem.SetButtonName(gameObject, Singleton <CTextManager> .GetInstance().GetText("Pay_Btn_Top_Up")); gameObject.CustomSetActive(!flag); CUICommonSystem.SetButtonName(gameObject2, Singleton <CTextManager> .GetInstance().GetText("Pay_Btn_Get_Reward")); gameObject2.CustomSetActive(flag && !flag2); }
public static void RefreshDianQuanPayButton(bool notifyFromSvr = false) { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(FORM_PATH); if (form != null) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); GameObject gameObject = form.transform.Find("DiamondPayBtn").gameObject; CUIEventScript component = gameObject.GetComponent <CUIEventScript>(); CTextManager instance = Singleton <CTextManager> .GetInstance(); if (!masterRoleInfo.IsGuidedStateSet(0x16)) { CUICommonSystem.SetButtonName(gameObject, instance.GetText("Pay_Btn_FirstPay")); component.SetUIEvent(enUIEventType.Click, enUIEventID.Pay_OpenFirstPayPanel); CUICommonSystem.DelRedDot(gameObject); } else if (!masterRoleInfo.IsGuidedStateSet(0x17)) { CUICommonSystem.SetButtonName(gameObject, instance.GetText("Pay_Btn_FirstPay")); component.SetUIEvent(enUIEventType.Click, enUIEventID.Pay_OpenFirstPayPanel); CUICommonSystem.AddRedDot(gameObject, enRedDotPos.enTopRight, 0); } else if (!masterRoleInfo.IsGuidedStateSet(0x18)) { CUICommonSystem.SetButtonName(gameObject, instance.GetText("Pay_Btn_Renewal")); component.SetUIEvent(enUIEventType.Click, enUIEventID.Pay_OpenRenewalPanel); CUICommonSystem.DelRedDot(gameObject); } else if (!masterRoleInfo.IsGuidedStateSet(0x19)) { CUICommonSystem.SetButtonName(gameObject, instance.GetText("Pay_Btn_Renewal")); component.SetUIEvent(enUIEventType.Click, enUIEventID.Pay_OpenRenewalPanel); CUICommonSystem.AddRedDot(gameObject, enRedDotPos.enTopRight, 0); } else if (masterRoleInfo.IsClientBitsSet(0)) { CUICommonSystem.SetButtonName(gameObject, instance.GetText("GotoTehuiShopName")); component.SetUIEvent(enUIEventType.Click, enUIEventID.Pay_TehuiShop); } else if (notifyFromSvr) { masterRoleInfo.SetClientBits(0, true, false); RefreshDianQuanPayButton(false); } else { gameObject.CustomSetActive(false); } } }
public void UpdateSelectedHonor(CUIFormScript form, COMDT_HONORINFO honorInfo) { CTextManager instance = Singleton <CTextManager> .GetInstance(); string text = instance.GetText("Player_Info_Honor_Btn_Using"); string text2 = instance.GetText("Player_Info_Honor_Btn_Use"); string text3 = instance.GetText("Player_Info_Honor_Btn_Browse"); GameObject widget = form.GetWidget(9); if (widget == null) { return; } Transform transform = form.transform.Find("pnlBg/pnlBody/pnlHonorInfo/pnlContainer/SelectedHonor/Button"); Button button = (transform == null) ? null : transform.GetComponent <Button>(); GameObject gameObject = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/SelectedHonor/CurrentHonor/normal"); GameObject gameObject2 = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/SelectedHonor/CurrentHonor/label"); GameObject gameObject3 = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/SelectedHonor/CurrentHonor/cnt"); GameObject gameObject4 = Utility.FindChild(widget, "pnlHonorInfo/pnlContainer/SelectedHonor/Text"); CPlayerProfile profile = Singleton <CPlayerInfoSystem> .GetInstance().GetProfile(); int selectedHonorId = profile.GetSelectedHonorId(); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); bool flag = true; if (masterRoleInfo != null && masterRoleInfo.playerUllUID != profile.m_uuid) { flag = false; } if (honorInfo == null) { honorInfo = new COMDT_HONORINFO(); if (button != null) { CUICommonSystem.SetButtonEnableWithShader(button, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text2); } if (gameObject != null) { this.SetHonorImage(gameObject.transform, honorInfo); } if (gameObject2 != null) { this.SetHonorName(gameObject2.transform, honorInfo); } if (gameObject3 != null) { this.SetHonorPoint(gameObject3.transform, honorInfo); } if (gameObject4 != null) { this.SetHonorDesc(gameObject4.transform, honorInfo); } if (!flag && button != null) { CUICommonSystem.SetButtonEnableWithShader(button, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text3); return; } return; } else { if (gameObject != null) { this.SetHonorImage(gameObject.transform, honorInfo); } if (gameObject2 != null) { this.SetHonorName(gameObject2.transform, honorInfo); } if (gameObject3 != null) { this.SetHonorPoint(gameObject3.transform, honorInfo); } if (gameObject4 != null) { this.SetHonorDesc(gameObject4.transform, honorInfo); } if (!flag && button != null) { CUICommonSystem.SetButtonEnableWithShader(button, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text3); return; } if (honorInfo.iHonorID == selectedHonorId && honorInfo.iHonorID != 0) { if (button != null) { CUICommonSystem.SetButtonEnableWithShader(button, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text); } } else if (honorInfo.iHonorLevel <= 0) { if (button != null) { CUICommonSystem.SetButtonEnableWithShader(button, false, true); CUICommonSystem.SetButtonName(transform.gameObject, text2); } } else if (button != null) { CUICommonSystem.SetButtonEnableWithShader(button, true, true); CUICommonSystem.SetButtonName(transform.gameObject, text2); } return; } }