| | |
| | | |
| | | public class HeroDebutGiftCell : MonoBehaviour |
| | | { |
| | | [SerializeField] ImageEx vipImage; |
| | | [SerializeField] TextEx vipText; |
| | | [SerializeField] OutlineEx vipTextOutline; |
| | | [SerializeField] ImageEx rateImage; |
| | | [SerializeField] TextEx rateText; |
| | | |
| | | [SerializeField] ItemCell[] itemCells; |
| | | [SerializeField] TextEx titleText; |
| | | [SerializeField] ButtonEx buyButton; |
| | |
| | | [SerializeField] ImageEx redImage; |
| | | HeroDebutManager manager => HeroDebutManager.Instance; |
| | | StoreModel storeModel => StoreModel.Instance; |
| | | |
| | | |
| | | public void Display(int index, List<HeroDebutGiftItem> giftItems) |
| | | { |
| | | if (giftItems.IsNullOrEmpty() || index < 0 || index >= giftItems.Count) return; |
| | |
| | | buyText.SetActive(true); |
| | | buyText1.SetActive(false); |
| | | moneyIconImage.SetActive(false); |
| | | rateImage.SetActive(true); |
| | | |
| | | if (!RechargeManager.Instance.TryGetOrderInfo(ctgId, out var orderConfig)) return; |
| | | if (!RechargeManager.Instance.TryGetRechargeCount(ctgId, out var rechargeCount)) return; |
| | |
| | | if (!RechargeManager.Instance.TryGetRechargeItem(ctgId, out var rechargeItemList)) return; |
| | | |
| | | CTGConfig config = CTGConfig.Get(ctgId); |
| | | vipImage.SetActive(config.VipLevel > 0); |
| | | if (config.VipLevel > 0) |
| | | { |
| | | vipImage.SetSprite($"VipLevel{config.VipLevel}"); |
| | | vipText.text = Language.Get($"VipLevelInfo{config.VipLevel}"); |
| | | vipText.color = InvestModel.Instance.GetTextColor(config.VipLevel); |
| | | vipTextOutline.OutlineColor = InvestModel.Instance.GetOutlineColor(config.VipLevel); |
| | | } |
| | | |
| | | bool isCanBuy = manager.IsNoSellOutCTGID(ctgId); |
| | | rateImage.SetActive(true); |
| | | rateText.text = Language.Get("DailySpecials07", config.Percentage); |
| | | |
| | | bool isCanBuy = manager.IsCanBuyToday(ctgId); |
| | | titleText.text = config.Title; |
| | | buyImage.SetSprite(isCanBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2"); |
| | | buyText.text = !isCanBuy ? Language.Get("storename11") : Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNumOnSale)); |
| | | limitCountText.SetActive(true); |
| | | limitCountText.text = Language.Get("TimeRush07", UIHelper.AppendColor(rechargeCount.totalCount >= config.TotalBuyCount ? TextColType.Red : TextColType.LightGreen, Mathf.Max(0, config.TotalBuyCount - rechargeCount.totalCount).ToString())); |
| | | limitCountText.SetActive(config.DailyBuyCount > 0); |
| | | limitCountText.text = Language.Get("HeroDebut39", UIHelper.AppendColor(rechargeCount.todayCount >= config.DailyBuyCount ? TextColType.Red : TextColType.LightGreen, Mathf.Max(0, config.DailyBuyCount - rechargeCount.todayCount).ToString())); |
| | | buyButton.interactable = isCanBuy; |
| | | buyButton.SetListener(() => |
| | | { |
| | | if (config.VipLevel > 0 && !FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.PrivilegeCard)) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("MinggeAuto8"); |
| | | return; |
| | | } |
| | | if (config.VipLevel == 1 && !InvestModel.Instance.IsInvested(InvestModel.monthCardType)) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("MinggeAuto5"); |
| | | UIManager.Instance.OpenWindow<PrivilegeCardWin>(); |
| | | return; |
| | | } |
| | | if (config.VipLevel == 2 && !InvestModel.Instance.IsInvested(InvestModel.foreverCardType)) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("MinggeAuto7"); |
| | | UIManager.Instance.OpenWindow<PrivilegeCardWin>(); |
| | | return; |
| | | } |
| | | RechargeManager.Instance.CTG(ctgId); |
| | | }); |
| | | |
| | |
| | | |
| | | private void DisplayStore(int id) |
| | | { |
| | | rateImage.SetActive(false); |
| | | vipImage.SetActive(false); |
| | | if (!StoreConfig.HasKey(id)) return; |
| | | |
| | | StoreConfig storeConfig = StoreConfig.Get(id); |