private void _viewGemTab() { SetActive(gemTab, true); SetActive(bundleTab, false); SetActive(materialTab, false); CheckOpenedGemTab(); int j = 0; SetTable(gemTab, UI.TBL_LIST, "CrystalShopListItem", _purchaseGemList.Count, false, delegate(int i, Transform p) { ProductData productData2 = _purchaseGemList[j]; if (MonoBehaviourSingleton <GlobalSettingsManager> .I.packParam.HasSpecial(productData2.productId)) { return(Realizes("CrystalShopListItem2", p, true)); } return(null); }, delegate(int i, Transform t, bool b) { ProductData productData = _purchaseGemList[++j]; SetSprite(t, UI.SPR_THUMB, productData.iconImg); SetLabelText(t, UI.LBL_NAME, productData.name); SetLabelText(t, UI.LBL_PRICE, string.Format(base.sectionData.GetText("PRICE"), productData.priceIncludeTax)); SetSupportEncoding(t, UI.LBL_PROMO, true); SetLabelText(t, UI.LBL_PROMO, productData.promo.Replace("\\n", "\n")); if (productData.remainingDay > 0) { SetActive(t, UI.SPR_SOLD, true); SetActive(t, UI.SPR_SOLD_MASK, true); } else { SetActive(t, UI.SPR_SOLD, false); SetActive(t, UI.SPR_SOLD_MASK, false); if (productData.offerType > 0) { UITexture spro = FindCtrl(t, UI.OBJ_OFFER).GetComponent <UITexture>(); ResourceLoad.LoadShopImageGemOfferTexture(spro, (uint)productData.offerType, delegate(Texture tex) { if (spro != null) { spro.mainTexture = tex; } }); } } if (_nativeStoreList != null) { StoreData product = _nativeStoreList.getProduct(productData.productId); if (product != null) { SetLabelText(t, UI.LBL_PRICE, product.price.ToString()); } } SetEvent(t, "BUY", i); }); }
private void InitDrakMarketFeatured(DarkMarketItem data, bool isReloadIcon = true) { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) SetActive((Enum)UI.BTN_FEATURED_OFFER, true); if (data.saleType == 1) { SetEvent((Enum)UI.BTN_FEATURED_OFFER, "BUY_NORMAL", data.id); } else if (data.saleType == 2) { SetEvent((Enum)UI.BTN_FEATURED_OFFER, "BUY_NORMAL", data.id); } else if (data.saleType == 200) { SetEvent((Enum)UI.BTN_FEATURED_OFFER, "BUY_IAP", data.id); } int num = 100 - Mathf.RoundToInt(data.saleNum / data.baseNum * 100f); if (num < 30) { SetColor((Enum)UI.LBL_OFFER_SALE_VALUE, normalSale); } else if (num < 70) { SetColor((Enum)UI.LBL_OFFER_SALE_VALUE, mediumSale); } else { SetColor((Enum)UI.LBL_OFFER_SALE_VALUE, hotSale); } if (num > 0) { SetLabelText((Enum)UI.LBL_OFFER_SALE_VALUE, $"-{num}%"); } else { SetLabelText((Enum)UI.LBL_OFFER_SALE_VALUE, $"{num}%"); } SetFontStyle((Enum)UI.LBL_OFFER_SALE_VALUE, 2); SetLabelText((Enum)UI.LBL_OFFER_NAME, data.name); if (!string.IsNullOrEmpty(data.refProductId)) { SetActive((Enum)UI.LBL_OFFER_OLD_PRICE, true); SetLabelText((Enum)UI.LBL_OFFER_OLD_PRICE, $"[s]${data.baseNum}[/s]"); SetSupportEncoding(UI.LBL_OFFER_OLD_PRICE, true); } else { SetActive((Enum)UI.LBL_OFFER_OLD_PRICE, false); } SetLabelText((Enum)UI.LBL_OFFER_SALE_PRICE, $"${data.saleNum}"); if (_nativeStoreList != null) { StoreData product = _nativeStoreList.getProduct(data.saleoffProductId); if (product != null) { SetLabelText((Enum)UI.LBL_OFFER_SALE_PRICE, product.price.ToString()); } StoreData product2 = _nativeStoreList.getProduct(data.refProductId); if (product2 != null) { SetLabelText((Enum)UI.LBL_OFFER_OLD_PRICE, $"[s]{product2.price}[/s]"); } } if (data.usedCount >= data.limit) { SetSliderValue((Enum)UI.SLD_OFFER_BUY_PROGRESS, 0f); SetActive((Enum)UI.LBL_OFFER_SALE_PROGRESS, false); SetActive((Enum)UI.OBJ_OFFER_OUT_OFF_STOCK, true); SetColor((Enum)UI.FEATURED_OFFER_BANNER, disableTintColor); SetButtonEnabled((Enum)UI.BTN_FEATURED_OFFER, false); } else { float value = 1f - (float)data.usedCount / (float)data.limit; SetSliderValue((Enum)UI.SLD_OFFER_BUY_PROGRESS, value); SetActive((Enum)UI.LBL_OFFER_SALE_PROGRESS, true); SetLabelText((Enum)UI.LBL_OFFER_SALE_PROGRESS, $"{data.limit - data.usedCount}/{data.limit}"); SetActive((Enum)UI.OBJ_OFFER_OUT_OFF_STOCK, false); SetColor((Enum)UI.FEATURED_OFFER_BANNER, Color.get_white()); SetButtonEnabled((Enum)UI.BTN_FEATURED_OFFER, true); } if (isReloadIcon) { Transform ctrl = GetCtrl(UI.BTN_FEATURED_OFFER); UITexture spro = FindCtrl(ctrl, UI.FEATURED_OFFER_BANNER).GetComponent <UITexture>(); ResourceLoad.LoadBlackMarketOfferTexture(spro, data.imgId, delegate(Texture tex) { if (spro != null) { spro.mainTexture = tex; } }); } }