555 子 【付费功能】皮肤商店 / 【付费功能】时装商店-客户端
| | |
| | | public partial class HeroSkinAttrConfig : ConfigBase<int, HeroSkinAttrConfig>
|
| | | {
|
| | |
|
| | | public static List<int> itemIdList = new List<int>();
|
| | | public static Dictionary<int, int> itemIdToSkinIDDict = new Dictionary<int, int>();
|
| | |
|
| | | protected override void OnConfigParseCompleted()
|
| | | {
|
| | | itemIdList.Add(NeedItemID);
|
| | | itemIdToSkinIDDict[NeedItemID] = SkinID;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 通过物品ID获取皮肤ID
|
| | | /// </summary>
|
| | | static Dictionary<int, int> itemDict = new();
|
| | | public static bool TryGetSkinIDByItemID(int itemID, out int skinID)
|
| | | {
|
| | | if (itemDict.IsNullOrEmpty())
|
| | | {
|
| | | foreach (var config in GetValues())
|
| | | {
|
| | | if (itemDict == null)
|
| | | itemDict = new Dictionary<int, int>();
|
| | | itemDict[config.NeedItemID] = config.SkinID;
|
| | | }
|
| | | }
|
| | | return itemDict.TryGetValue(itemID, out skinID);
|
| | | return itemIdToSkinIDDict.TryGetValue(itemID, out skinID);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | |
| | | public partial class OrderInfoConfig : ConfigBase<int, OrderInfoConfig> |
| | | { |
| | | //0.1折 |
| | | //0.1折 注意用UIHelper.GetMoneyFormat(PayRMBNumOnSale) |
| | | public float PayRMBNumOnSale |
| | | { |
| | | get |
| | |
| | | MoneyList[i] = new tagMCGiveAwardMoney();
|
| | | TransBytes (out MoneyList[i].MoneyType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out MoneyList[i].MoneyValue, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out MoneyList[i].IsBind, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | TransBytes (out ItemLen, vBytes, NetDataType.BYTE);
|
| | | ItemList = new tagMCGiveAwardItem[ItemLen];
|
| | |
| | | public class tagMCGiveAwardMoney {
|
| | | public byte MoneyType;
|
| | | public uint MoneyValue;
|
| | | public byte IsBind; // 同物品IsBind标记逻辑
|
| | | }
|
| | |
|
| | | public class tagMCGiveAwardItem {
|
| | |
| | | rechargeRect.SetActive(true);
|
| | | var ctgID = BattlePassManager.Instance.GetCTGIDByType(battlePasstype);
|
| | | RechargeManager.Instance.TryGetOrderInfo(ctgID, out var orderInfoConfig);
|
| | | buyText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale);
|
| | | buyText.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfoConfig.PayRMBNumOnSale));
|
| | |
|
| | | var config = CTGConfig.Get(ctgID);
|
| | | int itemID = config.GainItemList[0][0];
|
| | |
| | | List<Item> showItems = new List<Item>(); |
| | | foreach (var item in result.itemInfo) |
| | | { |
| | | Item tempItem = new Item(item.ItemID, item.Count, _useType: item.BeautyEx != 0 ? 2 : 0); |
| | | Item tempItem = new Item(item.ItemID, item.Count, _useType: item.IsBind); |
| | | showItems.Add(tempItem); |
| | | } |
| | | ItemLogicUtility.Instance.ShowGetItem(showItems, isMergeItem: false); |
| | |
| | | { |
| | | public int ItemID { get; set; } |
| | | public int Count { get; set; } |
| | | public int BeautyEx { get; set; } |
| | | public int IsBind { get; set; } |
| | | } |
| | | |
| | | public class ChallengeResultData |
| | |
| | | imgMask.SetActive(isBuy); |
| | | |
| | | imgBuy.SetSprite(!isBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2"); |
| | | txtBuy.text = !isBuy ? Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale) : Language.Get("storename11"); |
| | | txtBuy.text = !isBuy ? Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfoConfig.PayRMBNumOnSale)) : Language.Get("storename11"); |
| | | |
| | | imgGiftIcon.SetSprite(ctgConfig.Icon); |
| | | txtGiftTitle.text = ctgConfig.Title; |
| | |
| | | btnBuy.SetActive(!isBuy); |
| | | imgBuy.SetActive(isBuy); |
| | | |
| | | txtBuy.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale); |
| | | txtBuy.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfoConfig.PayRMBNumOnSale)); |
| | | |
| | | btnBuy.SetListener(() => |
| | | { |
| | |
| | | imgMask.SetActive(isBuy); |
| | | |
| | | imgBuy.SetSprite(!isBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2"); |
| | | txtBuy.text = !isBuy ? Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale) : Language.Get("storename11"); |
| | | txtBuy.text = !isBuy ? Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfoConfig.PayRMBNumOnSale)) : Language.Get("storename11"); |
| | | |
| | | imgGiftIcon.SetSprite(ctgConfig.Icon); |
| | | txtGiftTitle.text = ctgConfig.Title; |
| | |
| | | bool finalIsBuyAll = isBuyAll || hasAnySingleItemBought; |
| | | |
| | | imgAllBuyHave.SetActive(isBuyAll); |
| | | txtBuyAll.text = !finalIsBuyAll ? Language.Get("DailySpecials03", Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale)) : Language.Get("storename11"); |
| | | txtBuyAll.text = !finalIsBuyAll ? Language.Get("DailySpecials03", Language.Get("PayMoneyNum", |
| | | UIHelper.GetMoneyFormat(orderInfoConfig.PayRMBNumOnSale))) : Language.Get("storename11"); |
| | | btnBuyAll.interactable = !finalIsBuyAll; |
| | | imgBuyAll.gray = finalIsBuyAll; |
| | | for (int i = 0; i < items.Length; i++) |
| | |
| | | {
|
| | | var ctgID = BattlePassManager.Instance.GetCTGIDByType((int)BattlePassType.Week);
|
| | | RechargeManager.Instance.TryGetOrderInfo(ctgID, out var orderInfoConfig);
|
| | | buyText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale);
|
| | | buyText.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfoConfig.PayRMBNumOnSale));
|
| | | buyBtn.SetInteractable(true);
|
| | | }
|
| | | else
|
| | |
| | | OrderInfoConfig orderInfoConfig; |
| | | if (model.TryGetOrderInfoConfigByFirstID(firstID, out orderInfoConfig)) |
| | | { |
| | | txtTabTitles[i].text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale); |
| | | txtTabTitles[i].text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfoConfig.PayRMBNumOnSale)); |
| | | } |
| | | } |
| | | } |
| | |
| | | bool isBuy = firstChargeData.IsBuy(); |
| | | btnBuy.SetActive(!isBuy); |
| | | btnHave.SetActive(isBuy); |
| | | txtBuy.text = Language.Get("PayMoneyNum", orderInfo.PayRMBNumOnSale); |
| | | txtBuy.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfo.PayRMBNumOnSale)); |
| | | //领取 |
| | | int day = firstChargeData.GetNowBuyDay(); |
| | | //0: 已领取 1: 不可领取 2: 可领取 |
| | |
| | | public static int review_MainLevel; |
| | | public static int review_CD; |
| | | public static string[] noAdsChannels; |
| | | public static int[] heroSkinGiftList; |
| | | public static void Init() |
| | | { |
| | | try |
| | |
| | | review_MainLevel = int.Parse(config.Numerical3); |
| | | review_CD = int.Parse(config.Numerical4); |
| | | noAdsChannels = JsonMapper.ToObject<string[]>(config.Numerical5); |
| | | |
| | | config = FuncConfigConfig.Get("HeroSkinGift"); |
| | | heroSkinGiftList = JsonMapper.ToObject<int[]>(config.Numerical1); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | bool isCanBuy = manager.IsNoSellOutCTGID(ctgId); |
| | | titleText.text = config.Title; |
| | | buyImage.SetSprite(isCanBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2"); |
| | | buyText.text = !isCanBuy ? Language.Get("storename11") : Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNum)); |
| | | 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())); |
| | | buyButton.interactable = isCanBuy; |
| | |
| | | |
| | | bool isCanBuy = manager.IsNoSellOutCTGID(ctgId); |
| | | //buyImage.gray = !isCanBuy; |
| | | buyText.text = !isCanBuy ? Language.Get("storename11") : Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNum)); |
| | | buyText.text = !isCanBuy ? Language.Get("storename11") : Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNumOnSale)); |
| | | |
| | | buyButton.interactable = isCanBuy; |
| | | buyButton.SetListener(() => |
| | |
| | | } |
| | | }); |
| | | //buyImage.gray = state == 0 || !isNoSellOut; |
| | | buyText.text = !isNoSellOut ? Language.Get("storename11") : Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNum)); |
| | | buyText.text = !isNoSellOut ? Language.Get("storename11") : Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNumOnSale)); |
| | | limitText.text = Language.Get("TimeRush08", UIHelper.AppendColor(rechargeCount.totalCount >= ctgConfig.TotalBuyCount ? TextColType.Red : TextColType.DarkGreen, $"{rechargeCount.totalCount}/{ctgConfig.TotalBuyCount}")); |
| | | bool isHeroStarOk = manager.IsHeroStarCntOk(heroConfig.HeroID, config.NeedStar); |
| | | upProcssBGTransform.SetActive(!isFrist); |
| | |
| | | showFuncBtn.AddListener(() => |
| | | { |
| | | funcForm.SetActive(true); |
| | | UIManager.Instance.GetUI<HeroBestBaseWin>().GetCanvasGroup().alpha = 1; |
| | | }); |
| | | seeLhBtn.AddListener(() => |
| | | { |
| | | funcForm.SetActive(false); |
| | | UIManager.Instance.GetUI<HeroBestBaseWin>().GetCanvasGroup().alpha = 0; |
| | | }); |
| | | rightBtn.AddListener(() => |
| | | { |
| | |
| | | unfoldState = false; |
| | | allAttrScroll.verticalNormalizedPosition = 1; |
| | | Display(); |
| | | HeroUIManager.Instance.skinRedpoint.state = HeroUIManager.Instance.HeroAllSkinStateForRedpoint(HeroUIManager.Instance.selectForPreviewHeroID, true) > 0 ? RedPointState.Simple : RedPointState.None; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | trainStateImg.SetActive(false); |
| | | } |
| | | |
| | | starRedImg.SetActive(funcState == 2); |
| | | starRedImg.SetActive(funcState == 2 || HeroUIManager.Instance.HeroAllSkinStateForRedpoint(hero.heroId) > 0); |
| | | |
| | | nameText.text = hero.breakLevel == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, hero.breakLevel); |
| | | awakeImg.SetActive(hero.awakeLevel > 0); |
| | |
| | | showFuncBtn.AddListener(() => |
| | | { |
| | | funcForm.SetActive(true); |
| | | if (hero != null) |
| | | { |
| | | UIManager.Instance.GetUI<HeroTrainBaseWin>().GetCanvasGroup().alpha = 1; |
| | | } |
| | | ChangeParentWinAlpha(1); |
| | | }); |
| | | seeLhBtn.AddListener(() => |
| | | { |
| | | funcForm.SetActive(false); |
| | | if (hero != null) |
| | | { |
| | | UIManager.Instance.GetUI<HeroTrainBaseWin>().GetCanvasGroup().alpha = 0; |
| | | } |
| | | ChangeParentWinAlpha(0); |
| | | }); |
| | | previewFightBtn.AddListener(() => |
| | | { |
| | |
| | | { |
| | | showGetObj.SetActive(false); |
| | | showNormalObj.SetActive(true); |
| | | ChangeParentWinAlpha(1); |
| | | }); |
| | | |
| | | changeClothBtn.AddListener(() => |
| | |
| | | skinNameText.text = HeroSkinConfig.Get(skinID).SkinName; |
| | | RefreshAttr(); |
| | | ShowBtns(); |
| | | HeroUIManager.Instance.skinRedpoint.state = HeroUIManager.Instance.HeroAllSkinStateForRedpoint(heroID, hero == null) > 0 ? RedPointState.Simple : RedPointState.None; |
| | | } |
| | | |
| | | |
| | |
| | | if (activeSkinID == skinID && HeroUIManager.Instance.IsHeroSkinActive(heroID, skinID)) |
| | | { |
| | | showGetObj.SetActive(true); |
| | | ChangeParentWinAlpha(0); |
| | | showNormalObj.SetActive(false); |
| | | Display(); |
| | | skinScroller.m_Scorller.RefreshActiveCellViews(); |
| | |
| | | unlockBtn.SetActive(true); |
| | | int itemID = cfg.NeedItemID; |
| | | itemIcon.SetItemSprite(itemID); |
| | | itemCountText.text = UIHelper.ShowUseItem(PackType.Item, itemID, 1, bright:false); |
| | | itemCountText.text = UIHelper.ShowUseItem(PackType.Item, itemID, 1, bright: false); |
| | | } |
| | | putonBtn.SetActive(false); |
| | | putonYetObj.SetActive(false); |
| | |
| | | |
| | | putonBtn.SetActive(hero.SkinAttrID != skinID); |
| | | putonYetObj.SetActive(hero.SkinAttrID == skinID); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | void ChangeParentWinAlpha(float alpha) |
| | | { |
| | | if (hero != null) |
| | | { |
| | | UIManager.Instance.GetUI<HeroTrainBaseWin>().GetCanvasGroup().alpha = alpha; |
| | | } |
| | | else |
| | | { |
| | | UIManager.Instance.GetUI<HeroBestBaseWin>().GetCanvasGroup().alpha = alpha; |
| | | } |
| | | } |
| | | } |
| | |
| | | [SerializeField] HeroLVBreakCell heroLVBreakCell; //对应培养的 allAttrScroll 和 attrBtn |
| | | |
| | | |
| | | //入口伪红点用图片代替 |
| | | [SerializeField] Image trainMainRedImg; |
| | | [SerializeField] Image breakMainRedImg; |
| | | bool isTrainMainRed; |
| | | bool isBreakMainRed; |
| | | #endregion |
| | | |
| | | |
| | |
| | | RefreshAwake(); |
| | | RefreshFreeze(); |
| | | RefreshRedImg(); |
| | | HeroUIManager.Instance.UpdateTheHeroCardRedpoint(isTrainMainRed, isBreakMainRed, |
| | | HeroUIManager.Instance.HeroAllSkinStateForRedpoint(hero.heroId) > 0); |
| | | DisplayTrainOrBreak(hero); |
| | | ShowDeleteTip(); |
| | | |
| | |
| | | redpointAwake.SetActive(false); |
| | | redpointGift.SetActive(false); |
| | | redpointLVUP.SetActive(false); |
| | | trainMainRedImg.SetActive(false); |
| | | breakMainRedImg.SetActive(false); |
| | | isTrainMainRed = false; |
| | | isBreakMainRed = false; |
| | | redpointBreakLVUP.SetActive(false); |
| | | |
| | | |
| | |
| | | if (heroCnt > 1 && hero.heroStar < hero.GetCurMaxStar()) |
| | | { |
| | | redpointGift.SetActive(true); |
| | | trainMainRedImg.SetActive(true); |
| | | isTrainMainRed = true; |
| | | } |
| | | |
| | | |
| | |
| | | if (itemPack.GetCountById(lvupConfig.UPCostItem[0]) >= lvupConfig.UPCostItem[1]) |
| | | { |
| | | redpointLVUP.SetActive(true); |
| | | trainMainRedImg.SetActive(true); |
| | | isTrainMainRed = true; |
| | | } |
| | | } |
| | | |
| | |
| | | if (itemPack.GetCountById(config.UPCostItem[0]) >= config.UPCostItem[1]) |
| | | { |
| | | redpointAwake.SetActive(true); |
| | | trainMainRedImg.SetActive(true); |
| | | isTrainMainRed = true; |
| | | } |
| | | } |
| | | } |
| | |
| | | if (HeroUIManager.Instance.IsCanBreak(hero)) |
| | | { |
| | | redpointBreakLVUP.SetActive(true); |
| | | breakMainRedImg.SetActive(true); |
| | | isBreakMainRed = true; |
| | | } |
| | | |
| | | } |
| | |
| | | // allHeroBookPer = GetHeroCollectBookPer(); |
| | | UpdateHeroBookRedpoint(); |
| | | RefreshAllSkinAttr(); |
| | | UpdateHeroCardSkinRedpoint(); |
| | | UpdateHeroBookRedpoint(); |
| | | OnHeroCollectEvent?.Invoke(); |
| | | } |
| | | |
| | |
| | | refreshRedPoint = true; |
| | | } |
| | | |
| | | if (HeroSkinAttrConfig.itemIdList.Contains(itemID)) |
| | | if (HeroSkinAttrConfig.itemIdToSkinIDDict.ContainsKey(itemID)) |
| | | { |
| | | UpdateHeroCardSkinRedpoint(); |
| | | UpdateHeroBookRedpoint(); |
| | | } |
| | | |
| | | } |
| | |
| | | public Redpoint breakRedpoint = new Redpoint(MainRedDot.HeroCardRedpoint * 100 + 2); |
| | | public Redpoint skinRedpoint = new Redpoint(MainRedDot.HeroCardRedpoint * 100 + 3); |
| | | |
| | | |
| | | // public void UpdateHeroCardRedpoint() |
| | | // { |
| | | // trainRedpoint.state = RedPointState.None; |
| | | // breakRedpoint.state = RedPointState.None; |
| | | // skinRedpoint.state = RedPointState.None; |
| | | // } |
| | | //开培养/图鉴界面后的红点 |
| | | public void UpdateTheHeroCardRedpoint(bool isTrainRed, bool isBreakRed, bool isSkinRed) |
| | | { |
| | | trainRedpoint.state = isTrainRed ? RedPointState.Simple :RedPointState.None; |
| | | breakRedpoint.state = isBreakRed ? RedPointState.Simple : RedPointState.None; |
| | | skinRedpoint.state = isSkinRed ? RedPointState.Simple : RedPointState.None; |
| | | } |
| | | |
| | | //指定皮肤红点状态 0-无 1-有武将红点影响武将列表红点(假红点) 2-无武将红点影响图鉴界面红点 |
| | | public int HeroSkinStateForRedpoint(int skinID, bool isBook = false) |
| | |
| | | } |
| | | |
| | | //指定武将的所有皮肤红点状态 0-无 1-有武将红点影响武将列表红点(假红点) 2-无武将红点影响图鉴界面红点 |
| | | int HeroAllSkinStateForRedpoint(int heroID, bool isBook = false) |
| | | public int HeroAllSkinStateForRedpoint(int heroID, bool isBook = false) |
| | | { |
| | | var config = HeroConfig.Get(heroID); |
| | | for (int i = 0; i < config.SkinIDList.Length; i++) |
| | |
| | | //续费 |
| | | buyTipsText.text = Language.Get("GoldRush45", GoldRushManager.Instance.buyAutoDaysList[0]); |
| | | RechargeManager.Instance.TryGetOrderInfo(GoldRushManager.Instance.buyAutoCTGIDList[0], out var orderInfo); |
| | | buyText.text = Language.Get("PayMoneyNum", orderInfo.PayRMBNumOnSale); |
| | | buyText.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfo.PayRMBNumOnSale)); |
| | | timeText.text = Language.Get("GoldRush48") + TimeUtility.SecondsToShortDHMS(endTime - TimeUtility.AllSeconds); |
| | | } |
| | | } |
| | |
| | | buyBtn.SetActive(true); |
| | | buyTipsText.text = Language.Get("GoldRush45", GoldRushManager.Instance.buyAutoDaysList[0]); |
| | | RechargeManager.Instance.TryGetOrderInfo(GoldRushManager.Instance.buyAutoCTGIDList[0], out var orderInfo); |
| | | buyText.text = Language.Get("PayMoneyNum", orderInfo.PayRMBNumOnSale); |
| | | buyText.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfo.PayRMBNumOnSale)); |
| | | autoBtn.SetActive(false); |
| | | } |
| | | else |
| | |
| | | long expValue = netPack.Exp + netPack.ExpPoint * Constants.ExpPointValue;
|
| | | showItems.Add(new Item(GeneralDefine.expDisplayId, expValue));
|
| | | }
|
| | |
|
| | | bool isMergeItem = true; //同样的物品是否合并显示,比如额外获得做表现分开显示
|
| | |
|
| | | //特殊处理,时装有被分解成货币的情况,需要合并后去除原时装的显示
|
| | | List<int> deleteItemIDs = new List<int>();
|
| | | if (netPack.MoneyList.Length != 0)
|
| | | {
|
| | | for (int i = 0; i < netPack.MoneyLen; i++)
|
| | | {
|
| | | var moneyType = netPack.MoneyList[i].MoneyType;
|
| | | if (moneyType == 58 && !string.IsNullOrEmpty(netPack.DataEx))
|
| | | {
|
| | | //时装货币
|
| | | int deleteID;
|
| | | int.TryParse(netPack.DataEx, out deleteID);
|
| | | if (deleteID != 0)
|
| | | {
|
| | | deleteItemIDs.Add(int.Parse(netPack.DataEx));
|
| | | }
|
| | | }
|
| | | if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType) && netPack.MoneyList[i].MoneyValue != 0)
|
| | | {
|
| | | showItems.Add(new Item(GeneralDefine.MoneyDisplayModel[moneyType], netPack.MoneyList[i].MoneyValue));
|
| | | showItems.Add(new Item(GeneralDefine.MoneyDisplayModel[moneyType], netPack.MoneyList[i].MoneyValue, netPack.MoneyList[i].IsBind));
|
| | | if (netPack.MoneyList[i].IsBind >= 10)
|
| | | {
|
| | | isMergeItem = false;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | bool isMergeItem = true;
|
| | | //约定IsBind=10 为古宝额外增加
|
| | | |
| | | //约定IsBind 为角标的特殊显示 参考Item的useType定义
|
| | | if (netPack.ItemList.Length != 0)
|
| | | {
|
| | | for (int i = 0; i < netPack.ItemLen; i++)
|
| | |
| | | if (showItems.Count == 0)
|
| | | return;
|
| | |
|
| | | ItemLogicUtility.Instance.ShowGetItem(showItems, eventName, isMergeItem:isMergeItem);
|
| | | ItemLogicUtility.Instance.ShowGetItem(showItems, eventName, isMergeItem:isMergeItem, deleteItemIDs:deleteItemIDs);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | public int id; |
| | | public long countEx; |
| | | public int quality; |
| | | public int useType; //用途定义:0 无 1 预留 2 红颜增加 10 古宝增加 |
| | | public int useType; //用途定义:0 默认无 10 - 古宝 20 - 红颜 30 - 称号 40 -分解 |
| | | |
| | | public Item(int _id, long _count) |
| | | { |
| | |
| | | ItemLogicUtility.Instance.OnGetItemShowEvent -= OnGetItemShowEvent;
|
| | | scroller.OnRefreshCell -= OnRefreshCell;
|
| | | ItemLogicUtility.Instance.ClearGetItem();
|
| | |
|
| | | ItemLogicUtility.Instance.totalShowItems.Clear();
|
| | | ItemLogicUtility.Instance.totalDeleteItemIDs.Clear();
|
| | | }
|
| | |
|
| | | List<Item> showItems = new List<Item>();
|
| | |
| | |
|
| | | // 如果同时有多种奖励封包,同一个事件归集,不同事件直接顶掉显示最新
|
| | | public Dictionary<Int2, Item> totalShowItems = new Dictionary<Int2, Item>(); //Int2 物品ID+useType
|
| | | public List<int> totalDeleteItemIDs = new List<int>(); //删除的物品ID
|
| | | public event Action OnGetItemShowEvent;
|
| | | public string getItemEventName;
|
| | | public string sourceTip; //领奖原因
|
| | |
|
| | | // isMergeItem 是否合并相同ID的物品 默认合并
|
| | | // 通用显示获得的物品
|
| | | public void ShowGetItem(List<Item> items, string eventName = "default", bool isNameShow = true, bool isMergeItem = true)
|
| | | public void ShowGetItem(List<Item> items, string eventName = "default", bool isNameShow = true,
|
| | | bool isMergeItem = true, List<int> deleteItemIDs = null)
|
| | | {
|
| | | if (getItemEventName != eventName)
|
| | | {
|
| | | if (UIManager.Instance.IsOpenedInList<CommonGetItemWin>())
|
| | | {
|
| | | //----------------------记得改立即关闭
|
| | | //立即关闭
|
| | | UIManager.Instance.CloseWindow<CommonGetItemWin>();
|
| | | }
|
| | | totalShowItems.Clear();
|
| | | totalDeleteItemIDs.Clear();
|
| | | getItemEventName = eventName;
|
| | | }
|
| | | if (!deleteItemIDs.IsNullOrEmpty())
|
| | | {
|
| | | for (int i = 0; i < deleteItemIDs.Count; i++)
|
| | | {
|
| | | if (!totalDeleteItemIDs.Contains(deleteItemIDs[i]))
|
| | | {
|
| | | totalDeleteItemIDs.Add(deleteItemIDs[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | //相同ID 合并数量显示
|
| | | for (int i = 0; i < items.Count; i++)
|
| | | {
|
| | | var id = items[i].id;
|
| | | if (totalDeleteItemIDs.Contains(id))
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | var useType = isMergeItem ? 0 : items[i].useType;
|
| | | Int2 idInfo = new Int2(id, useType);
|
| | |
| | | break; |
| | | } |
| | | } |
| | | goodsName = Language.Get("DayGoods_1", UIHelper.GetMoneyFormat(orderInfo.PayRMBNum)); |
| | | goodsName = Language.Get("DayGoods_1", UIHelper.GetMoneyFormat(orderInfo.PayRMBNumOnSale)); |
| | | } |
| | | |
| | | return goodsName; |
| | |
| | | |
| | | RechargeManager.Instance.TryGetOrderInfo(id, out var orderInfo); |
| | | |
| | | moneyText.text = Language.Get("PayMoneyNum", orderInfo.PayRMBNumOnSale); |
| | | moneyText.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfo.PayRMBNumOnSale)); |
| | | moneyIcon.SetActive(false); |
| | | } |
| | | else |
| | |
| | | |
| | | RechargeManager.Instance.TryGetOrderInfo(id, out var orderInfo); |
| | | |
| | | moneyText.text = Language.Get("PayMoneyNum", orderInfo.PayRMBNumOnSale); |
| | | moneyText.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfo.PayRMBNumOnSale)); |
| | | moneyIcon.SetActive(false); |
| | | } |
| | | else |
| | |
| | | |
| | | buyBtn.SetActive(ExpSecretCollectionManager.Instance.m_MJLV == 0); |
| | | RechargeManager.Instance.TryGetOrderInfo(ExpSecretCollectionManager.Instance.ctgID, out var orderInfoConfig); |
| | | buyText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale); |
| | | buyText.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfoConfig.PayRMBNumOnSale)); |
| | | buyYetRect.SetActive(ExpSecretCollectionManager.Instance.m_MJLV != 0); |
| | | |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | |
| | | if (state == 0) |
| | | { |
| | | var orderInfo = InvestModel.Instance.GetOrderInfo(type); |
| | | opBtnText.text = Language.Get("PayMoneyNum", orderInfo.PayRMBNumOnSale); |
| | | opBtnText.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfo.PayRMBNumOnSale)); |
| | | opBtn.SetInteractable(true); |
| | | opBtn.AddListener(() => |
| | | { |
| | |
| | | if (type == 1) |
| | | { |
| | | var orderInfo = InvestModel.Instance.GetOrderInfo(type); |
| | | opBtnText.text = Language.Get("PayMore", orderInfo.PayRMBNumOnSale); |
| | | opBtnText.text = Language.Get("PayMore", UIHelper.GetMoneyFormat(orderInfo.PayRMBNumOnSale)); |
| | | opBtn.SetInteractable(true); |
| | | opBtn.AddListener(() => |
| | | { |
| | |
| | | } |
| | | normalNums.text = (config.GainGold/100).ToString(); |
| | | RechargeManager.Instance.TryGetOrderInfo(ctgID, out var orderInfoConfig); |
| | | priceText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale); |
| | | priceText.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfoConfig.PayRMBNumOnSale)); |
| | | icon.SetSprite(config.Icon); |
| | | icon.SetNativeSize(); |
| | | buyBtn.AddListener(() => |
| | |
| | | normalNums.text = config.GainGold.ToString(); |
| | | } |
| | | RechargeManager.Instance.TryGetOrderInfo(ctgID, out var orderInfoConfig); |
| | | priceText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale); |
| | | priceText.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfoConfig.PayRMBNumOnSale)); |
| | | icon.SetSprite(config.Icon); |
| | | icon.SetNativeSize(); |
| | | buyBtn.AddListener(() => |
| | |
| | | {
|
| | | return b.Time.CompareTo(a.Time);
|
| | | }
|
| | |
|
| | | //按不同限购规则进行判断
|
| | | public bool IsSellOut(int ctgID)
|
| | | {
|
| | | var cfg = CTGConfig.Get(ctgID);
|
| | | Instance.TryGetRechargeCount(ctgID, out RechargeCount _rechargeCount);
|
| | | if (cfg.DailyBuyCount != 0)
|
| | | {
|
| | | return _rechargeCount.todayCount >= cfg.DailyBuyCount;
|
| | | }
|
| | | else if (cfg.WeekBuyCount != 0)
|
| | | {
|
| | | return _rechargeCount.weekPayCount >= cfg.WeekBuyCount;
|
| | | }
|
| | |
|
| | | else if (cfg.MonthBuyCount != 0)
|
| | | {
|
| | | return _rechargeCount.monthPayCount >= cfg.MonthBuyCount;
|
| | | }
|
| | | else if (cfg.TotalBuyCount != 0)
|
| | | {
|
| | | return _rechargeCount.totalCount >= cfg.TotalBuyCount;
|
| | | }
|
| | |
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | //时装礼包 |
| | | public class HeroSkinGiftWin : UIBase |
| | | { |
| | | [SerializeField] GroupButtonEx[] giftBtns; |
| | | |
| | | [SerializeField] ItemCell[] itemCells; |
| | | [SerializeField] Text priceText; |
| | | [SerializeField] Button buyBtn; |
| | | [SerializeField] Transform saleOutObj; |
| | | [SerializeField] Image bg1; |
| | | [SerializeField] Image bg2; |
| | | |
| | | int index; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | buyBtn.AddListener(() => |
| | | { |
| | | RechargeManager.Instance.CTG(GeneralDefine.heroSkinGiftList[index]); |
| | | }); |
| | | for (int i = 0; i < giftBtns.Length; i++) |
| | | { |
| | | int _index = i; |
| | | giftBtns[i].AddListener(() => { |
| | | index = _index; |
| | | Display(); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | index = 0; |
| | | RechargeManager.Instance.rechargeCountEvent += OnRechargeCountEvent; |
| | | |
| | | for (int i = 0; i < giftBtns.Length; i++) |
| | | { |
| | | if (i < GeneralDefine.heroSkinGiftList.Length) |
| | | { |
| | | giftBtns[i].SetActive(true); |
| | | var cfg = CTGConfig.Get(GeneralDefine.heroSkinGiftList[i]); |
| | | RechargeManager.Instance.TryGetRechargeCount(GeneralDefine.heroSkinGiftList[i], out RechargeCount _rechargeCount); |
| | | if (_rechargeCount.todayCount < cfg.DailyBuyCount) |
| | | { |
| | | index = i; |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | giftBtns[i].SetActive(false); |
| | | } |
| | | } |
| | | giftBtns[index].SelectBtn(); |
| | | |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | RechargeManager.Instance.rechargeCountEvent -= OnRechargeCountEvent; |
| | | } |
| | | |
| | | void Display() |
| | | { |
| | | RechargeManager.Instance.TryGetRechargeItem(GeneralDefine.heroSkinGiftList[index], out var itemList); |
| | | for (int i = 0; i < itemCells.Length; i++) |
| | | { |
| | | if (i < itemList.Count) |
| | | { |
| | | itemCells[i].SetActive(true); |
| | | int itemID = itemList[i].id; |
| | | itemCells[i].Init(new ItemCellModel(itemID, true, itemList[i].countEx)); |
| | | itemCells[i].button.SetListener(() => ItemTipUtility.Show(itemID)); |
| | | } |
| | | else |
| | | { |
| | | itemCells[i].SetActive(false); |
| | | } |
| | | } |
| | | if (!RechargeManager.Instance.IsSellOut(GeneralDefine.heroSkinGiftList[index])) |
| | | { |
| | | buyBtn.SetActive(true); |
| | | saleOutObj.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | buyBtn.SetActive(false); |
| | | saleOutObj.SetActive(true); |
| | | } |
| | | |
| | | |
| | | RechargeManager.Instance.TryGetOrderInfo(GeneralDefine.heroSkinGiftList[index], out var orderInfoConfig); |
| | | priceText.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfoConfig.PayRMBNumOnSale)); |
| | | |
| | | bg1.SetSprite($"HeroSkinGiftBg{index}_1"); |
| | | bg2.SetSprite($"HeroSkinGiftBg{index}_2"); |
| | | bg1.SetNativeSize(); |
| | | bg2.SetNativeSize(); |
| | | } |
| | | private void OnRechargeCountEvent(int obj) |
| | | { |
| | | Display(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 99000a2eedd88ac40bbdf6f46e4a2aa0 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | //时装碎片商店购买界面 |
| | | public class SkinStoreBuyTipWin : UIBase |
| | | { |
| | | [SerializeField] Image skinImage; |
| | | [SerializeField] Image skinFrame; |
| | | [SerializeField] Text skinName; |
| | | [SerializeField] Text heroName; |
| | | [SerializeField] Text[] onAttrTexts; |
| | | [SerializeField] Text[] allAttrTexts; |
| | | [SerializeField] Image moneyIcon; |
| | | [SerializeField] Text moneyText; |
| | | [SerializeField] Button buyButton; |
| | | |
| | | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | buyButton.AddListener(BuyGoods); |
| | | } |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | |
| | | var storeConfig = StoreConfig.Get(StoreModel.Instance.buyShopID); |
| | | HeroSkinAttrConfig.itemIdToSkinIDDict.TryGetValue(storeConfig.ItemID, out var skinID); |
| | | |
| | | var skinConfig = HeroSkinConfig.Get(skinID); |
| | | var attrCfg = HeroSkinAttrConfig.Get(skinID); |
| | | skinImage.SetOrgSprite(skinConfig.CardPic, "HeroSkinCard"); |
| | | skinFrame.SetSprite("HeroSkinFrame" + (attrCfg== null ? 0 : attrCfg.Quality)); |
| | | skinName.text = skinConfig.SkinName == "" ? Language.Get("HeroSkin2") : skinConfig.SkinName; |
| | | |
| | | var heroID = HeroConfig.GetHeroIDBySkinID(skinID); |
| | | heroName.text = Language.Get("HeroSkin12", HeroConfig.Get(heroID).Name); |
| | | |
| | | var shopConfig = StoreConfig.Get(StoreModel.Instance.buyShopID); |
| | | moneyIcon.SetIconWithMoneyType(shopConfig.MoneyType); |
| | | moneyText.text = UIHelper.ShowUseMoney(shopConfig.MoneyType, shopConfig.MoneyNum); |
| | | |
| | | RefreshAttr(skinID); |
| | | } |
| | | |
| | | |
| | | void BuyGoods() |
| | | { |
| | | CloseWindow(); |
| | | StoreModel.Instance.SendBuyShopItem(StoreConfig.Get(StoreModel.Instance.buyShopID), 1); |
| | | } |
| | | |
| | | void RefreshAttr(int skinID) |
| | | { |
| | | var cfg = HeroSkinAttrConfig.Get(skinID); |
| | | |
| | | string format = "{0}" + UIHelper.AppendColor(TextColType.Green, "+{1}", false); |
| | | for (int i = 0; i < onAttrTexts.Length; i++) |
| | | { |
| | | if (i < cfg.WearAttrIDList.Length) |
| | | { |
| | | onAttrTexts[i].text = PlayerPropertyConfig.GetFullDescription(cfg.WearAttrIDList[i], cfg.WearAttrValueList[i], format); |
| | | } |
| | | else |
| | | { |
| | | onAttrTexts[i].text = ""; |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < allAttrTexts.Length; i++) |
| | | { |
| | | if (i < cfg.RoleAttrIDList.Length) |
| | | { |
| | | allAttrTexts[i].text = PlayerPropertyConfig.GetFullDescription(cfg.RoleAttrIDList[i], cfg.RoleAttrValueList[i], format); |
| | | } |
| | | else |
| | | { |
| | | allAttrTexts[i].text = ""; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: aa1386c1cdea3ae42a9057ac78623aa9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class SkinStoreCell : MonoBehaviour |
| | | { |
| | | [SerializeField] Image skinImage; |
| | | [SerializeField] Image skinFrame; |
| | | [SerializeField] Text skinName; |
| | | [SerializeField] Text heroName; |
| | | [SerializeField] Image priceIcon; |
| | | [SerializeField] Text priceText; |
| | | [SerializeField] Button buyButton; |
| | | [SerializeField] Transform gotYetObj; |
| | | |
| | | |
| | | |
| | | public void Display(int index) |
| | | { |
| | | var list = StoreModel.Instance.storeTypeDict[StoreModel.skinStoreType]; |
| | | var storeData = list[index]; |
| | | int shopID = storeData.shopId; |
| | | var itemID = storeData.storeConfig.ItemID; |
| | | HeroSkinAttrConfig.itemIdToSkinIDDict.TryGetValue(itemID, out var skinID); |
| | | if (skinID == 0) |
| | | { |
| | | Debug.LogError("时装商店配置错误 没有对应皮肤 商品:" + shopID); |
| | | return; |
| | | } |
| | | var skinConfig = HeroSkinConfig.Get(skinID); |
| | | var attrCfg = HeroSkinAttrConfig.Get(skinID); |
| | | skinImage.SetOrgSprite(skinConfig.CardPic, "HeroSkinCard"); |
| | | skinFrame.SetSprite("HeroSkinFrame" + (attrCfg== null ? 0 : attrCfg.Quality)); |
| | | skinName.text = skinConfig.SkinName == "" ? Language.Get("HeroSkin2") : skinConfig.SkinName; |
| | | |
| | | var heroID = HeroConfig.GetHeroIDBySkinID(skinID); |
| | | heroName.text = HeroConfig.Get(heroID).Name; |
| | | |
| | | //0可购买 1已售罄 2免费 3未解锁 |
| | | var state = StoreModel.Instance.GetShopIDState(shopID); |
| | | if (state == 0) |
| | | { |
| | | buyButton.SetActive(true); |
| | | gotYetObj.SetActive(false); |
| | | |
| | | buyButton.AddListener(() => { BuyGoods(shopID); }); |
| | | } |
| | | else |
| | | { |
| | | buyButton.SetActive(false); |
| | | gotYetObj.SetActive(true); |
| | | } |
| | | |
| | | priceIcon.SetIconWithMoneyType(storeData.storeConfig.MoneyType); |
| | | priceText.text = storeData.storeConfig.MoneyNum.ToString(); |
| | | |
| | | } |
| | | |
| | | void BuyGoods(int shopID) |
| | | { |
| | | StoreModel.Instance.buyShopID = shopID; |
| | | UIManager.Instance.OpenWindow<SkinStoreBuyTipWin>(); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 532a5bd8a17a88840927d2c86a99e6dd |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class SkinStoreLineCell : CellView |
| | | { |
| | | |
| | | [SerializeField] SkinStoreCell[] storeCells; |
| | | |
| | | public void Display(int index) |
| | | { |
| | | var list = StoreModel.Instance.storeTypeDict[StoreModel.skinStoreType]; |
| | | |
| | | for (int i = 0; i < storeCells.Length; i++) |
| | | { |
| | | if (index + i < list.Count) |
| | | { |
| | | storeCells[i].SetActive(true); |
| | | storeCells[i].Display(index + i); |
| | | } |
| | | else |
| | | { |
| | | storeCells[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 18ea07617fb14de4194068886378aa5c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | |
| | | public class SkinStoreWin : UIBase |
| | | { |
| | | [SerializeField] OwnMoneyCell ownMoneyCellWithShop; |
| | | //有刷新功能的商店 |
| | | [SerializeField] GameObject refreshGo; |
| | | [SerializeField] Image refreshMoneyIcon; |
| | | [SerializeField] Text refreshMoneyText; |
| | | [SerializeField] Button refreshButton; |
| | | |
| | | [SerializeField] GroupButtonEx normalShopBtn; |
| | | [SerializeField] GroupButtonEx guildShopBtn; |
| | | [SerializeField] GroupButtonEx heroShopBtn; |
| | | [SerializeField] Button giftBtn; |
| | | |
| | | [SerializeField] ScrollerController scroller; |
| | | |
| | | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | refreshButton.AddListener(RefreshStore); |
| | | normalShopBtn.AddListener(() => { OnSelectStoreFuncType(1); }); |
| | | guildShopBtn.AddListener(() => { OnSelectStoreFuncType(2); }); |
| | | heroShopBtn.AddListener(() => { OnSelectStoreFuncType(3); }); |
| | | giftBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroSkinGiftWin>(); |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | StoreModel.Instance.RefreshShopEvent += Display; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent += Display; |
| | | GuildManager.Instance.EnterOrQuitGuildEvent += EnterOrQuitGuildEvent; |
| | | StoreModel.Instance.RefreshShopEvent += Show; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent += Show; |
| | | |
| | | Display(); |
| | | } |
| | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | StoreModel.Instance.RefreshShopEvent -= Display; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent -= Display; |
| | | GuildManager.Instance.EnterOrQuitGuildEvent -= EnterOrQuitGuildEvent; |
| | | StoreModel.Instance.selectStoreFuncType = StoreFunc.Normal; |
| | | StoreModel.Instance.RefreshShopEvent -= Show; |
| | | StoreModel.Instance.RefreshBuyShopLimitEvent -= Show; |
| | | } |
| | | |
| | | void Display() |
| | | { |
| | | if (StoreModel.Instance.selectStoreFuncType == StoreFunc.Normal) |
| | | { |
| | | normalShopBtn.SelectBtn(); |
| | | } |
| | | else if (StoreModel.Instance.selectStoreFuncType == StoreFunc.Guild) |
| | | { |
| | | guildShopBtn.SelectBtn(); |
| | | } |
| | | else if (StoreModel.Instance.selectStoreFuncType == StoreFunc.Hero) |
| | | { |
| | | heroShopBtn.SelectBtn(); |
| | | } |
| | | |
| | | guildShopBtn.SetColorful(null, PlayerDatas.Instance.fairyData.HasFairy); |
| | | guildShopBtn.isLock = !PlayerDatas.Instance.fairyData.HasFairy; |
| | | |
| | | ShowMoney(); |
| | | CreateScroller(); |
| | | } |
| | | |
| | | void EnterOrQuitGuildEvent(bool isEnter) |
| | | void Show() |
| | | { |
| | | if (!isEnter && StoreModel.Instance.selectStoreFuncType == StoreFunc.Guild) |
| | | { |
| | | StoreModel.Instance.selectStoreFuncType = StoreFunc.Normal; |
| | | } |
| | | Display(); |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | void CreateScroller() |
| | | { |
| | | if (!StoreModel.Instance.storeTypeDict.ContainsKey((int)StoreModel.Instance.selectStoreFuncType)) |
| | | if (!StoreModel.Instance.storeTypeDict.ContainsKey(StoreModel.skinStoreType)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | scroller.Refresh(); |
| | | int jumpIndex = -1; |
| | | var list = StoreModel.Instance.storeTypeDict[(int)StoreModel.Instance.selectStoreFuncType]; |
| | | scroller.Refresh(); |
| | | var list = StoreModel.Instance.storeTypeDict[StoreModel.skinStoreType]; |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | if (i % 3 == 0) |
| | | if (i % 4 == 0) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | if (jumpIndex == -1 && list[i].shopId == StoreModel.Instance.jumpShopID) |
| | | { |
| | | jumpIndex = i / 3; |
| | | jumpIndex = i / 4; |
| | | } |
| | | } |
| | | scroller.Restart(); |
| | |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell as StoreLineCell; |
| | | var _cell = cell as SkinStoreLineCell; |
| | | _cell.Display(cell.index); |
| | | } |
| | | |
| | | |
| | | void ShowMoney() |
| | | { |
| | | if (!StoreModel.Instance.shopMoneyTypeDict.ContainsKey((int)StoreModel.Instance.selectStoreFuncType)) |
| | | { |
| | | return; |
| | | } |
| | | var moneyType = StoreModel.Instance.shopMoneyTypeDict[(int)StoreModel.Instance.selectStoreFuncType]; |
| | | ownMoneyCellWithShop.moneyType = moneyType; |
| | | ownMoneyCellWithShop.Display(true); |
| | | |
| | | if (StoreModel.Instance.selectStoreFuncType == StoreFunc.Hero) |
| | | { |
| | | refreshGo.SetActive(true); |
| | | refreshMoneyIcon.SetIconWithMoneyType(StoreModel.Instance.heroSoulRefreshMoneyType); |
| | | |
| | | if (StoreModel.Instance.shopRefreshCntDict.ContainsKey((int)StoreModel.Instance.selectStoreFuncType)) |
| | | { |
| | | if (StoreModel.Instance.shopRefreshCntDict[(int)StoreModel.Instance.selectStoreFuncType] >= |
| | | StoreModel.Instance.heroSoulRefreshFreeCount) |
| | | { |
| | | refreshMoneyText.text = StoreModel.Instance.heroSoulRefreshMoney.ToString(); |
| | | } |
| | | else |
| | | { |
| | | refreshMoneyText.text = Language.Get("L1127"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | refreshMoneyText.text = Language.Get("L1127"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | refreshGo.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | void RefreshStore() |
| | | { |
| | | if (StoreModel.Instance.selectStoreFuncType != StoreFunc.Hero) |
| | | { |
| | | return; |
| | | } |
| | | var useCnt = 0; |
| | | if (StoreModel.Instance.shopRefreshCntDict.ContainsKey((int)StoreModel.Instance.selectStoreFuncType)) |
| | | { |
| | | if (StoreModel.Instance.shopRefreshCntDict[(int)StoreModel.Instance.selectStoreFuncType] >= |
| | | StoreModel.Instance.heroSoulRefreshFreeCount) |
| | | { |
| | | useCnt = StoreModel.Instance.heroSoulRefreshMoney; |
| | | } |
| | | } |
| | | |
| | | if (UIHelper.CheckMoneyCount(StoreModel.Instance.heroSoulRefreshMoneyType, useCnt, 2)) |
| | | { |
| | | StoreModel.Instance.RefreshStore((int)StoreFunc.Hero); |
| | | } |
| | | } |
| | | |
| | | void OnSelectStoreFuncType(int index) |
| | | { |
| | | if (index == 2) |
| | | { |
| | | if (!PlayerDatas.Instance.fairyData.HasFairy) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("NoGuild"); |
| | | return; |
| | | } |
| | | } |
| | | StoreModel.Instance.selectStoreFuncType = (StoreFunc)index; |
| | | Display(); |
| | | } |
| | | } |
| | |
| | | public Dictionary<int, List<int>> freeShopDict = new Dictionary<int, List<int>>(); //免费商品 商店类型:商品列表
|
| | | public Dictionary<int, int> shopMoneyTypeDict = new Dictionary<int, int>();
|
| | |
|
| | | public const int skinStoreType = 16;
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += FuncStateChange;
|
| | |
| | | bool isCanBuy = manager.IsCanBuyCTG(ctgId); |
| | | titleText.text = config.Title; |
| | | buyImage.SetSprite(isCanBuy ? "DailySpecialsBuy1" : "DailySpecialsBuy2"); |
| | | buyText.text = !isCanBuy ? Language.Get("storename11") : Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNum)); |
| | | 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())); |
| | | buyButton.interactable = isCanBuy; |
| | |
| | | int ctgId = ctgIds[index]; |
| | | if (!RechargeManager.Instance.TryGetOrderInfo(ctgId, out var orderInfoConfig)) |
| | | return; |
| | | moneyText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale); |
| | | moneyText.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfoConfig.PayRMBNumOnSale)); |
| | | |
| | | bool isChoose = manager.selectCtgIdIndex == index; |
| | | tabIcon.SetSprite(isChoose ? "TimingGiftTab2_Select" : "TimingGiftTab2_UnSelect"); |
| | |
| | | giftText.SetVerticalGradient(manager.GetColor32(config.TopColor), manager.GetColor32(config.BottomColor)); |
| | | giftTextOutline.OutlineColor = manager.GetColor32(config.OutlineColor); |
| | | bool isBuy = manager.IsBuy(manager.selectCtgId); |
| | | buyText.text = !isBuy ? Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale) : Language.Get("L1133"); |
| | | buyText.text = !isBuy ? Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderInfoConfig.PayRMBNumOnSale)) : Language.Get("L1133"); |
| | | buyImage.SetSprite(isBuy ? "TimingGiftBuy" : "TimingGiftNoBuy"); |
| | | buyImage.raycastTarget = !isBuy; |
| | | RefreshTime(); |
| | |
| | | ChallengeVoucher = 286,//挑战凭证 |
| | | DailySpecials = 287, //特惠印绶 |
| | | OSGalaScore = 288, //开服庆典积分 |
| | | heroSkin = 291, // 用于皮肤商店购买 |
| | | }; |
| | | |
| | | |
| | |
| | | {53, PlayerDataType.ChallengeVoucher}, |
| | | {54, PlayerDataType.DailySpecials}, |
| | | {55, PlayerDataType.OSGalaScore}, |
| | | {58, PlayerDataType.heroSkin}, |
| | | {99, PlayerDataType.ExAttr11}, |
| | | }; |
| | | |
| | |
| | | //开服庆典积分 |
| | | return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.OSGalaScore); |
| | | } |
| | | case 58: |
| | | { |
| | | //时装货币 |
| | | return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.heroSkin); |
| | | } |
| | | case 98: |
| | | { |
| | | //过期型代金券 |