From a39c35fc6449430cd02bccb681c4a0a880e46cd9 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期一, 16 十二月 2024 21:00:51 +0800
Subject: [PATCH] 10296 轮回殿修复bug
---
System/LoopAct/CycleHall/CycleHallGiftCell.cs.meta | 11
/dev/null | 312 ------------------------
System/LoopAct/CycleHall/CycleHallActModel.cs | 15 +
System/LoopAct/CycleHall/OperationCycleHall.cs | 6
System/LoopAct/CycleHall/CycleHallWin.cs | 70 ++--
System/LoopAct/CycleHall/CycleHallGiftCell.cs | 177 +++++++++++++
System/LoopAct/CycleHall/CycleHallMissionCell.cs | 145 +++++++++++
System/LoopAct/CycleHall/CycleHallMissionCell.cs.meta | 0
8 files changed, 383 insertions(+), 353 deletions(-)
diff --git a/System/LoopAct/CycleHall/CycleHallActModel.cs b/System/LoopAct/CycleHall/CycleHallActModel.cs
index 2008da4..96919bb 100644
--- a/System/LoopAct/CycleHall/CycleHallActModel.cs
+++ b/System/LoopAct/CycleHall/CycleHallActModel.cs
@@ -13,7 +13,8 @@
get { return m_NowTabId; }
set
{
- m_NowTabId = value;
+ if (m_NowTabId != value)
+ m_NowTabId = value;
UpdateRedpoint();
onNowTabIdUpdate?.Invoke();
}
@@ -50,6 +51,9 @@
//<轮回类型,界面ID>
public Dictionary<int, int> windowIDDict = new Dictionary<int, int>();
+ //<轮回类型,功能ID>
+ public Dictionary<int, int> funcIdDict = new Dictionary<int, int>();
+
public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_Activity2;
public const int activityID = (int)NewDayActivityID.CycleHallAct;
public static Operation operaType = Operation.default47;
@@ -76,6 +80,13 @@
{
windowIDDict.Add(int.Parse(keyList[i]), int.Parse(jsonData[keyList[i]].ToJson()));
}
+
+ jsonData = JsonMapper.ToObject(FuncConfigConfig.Get("CycleHall").Numerical2);
+ keyList = jsonData.Keys.ToList();
+ for (int i = 0; i < keyList.Count; i++)
+ {
+ funcIdDict.Add(int.Parse(keyList[i]), int.Parse(jsonData[keyList[i]].ToJson()));
+ }
}
public OperationCycleHall GetOperationInfo()
@@ -100,7 +111,7 @@
if (!CycleHallConfig.Has(id))
continue;
CycleHallConfig config = CycleHallConfig.Get(id);
- if (act.TryGetRound(config.RoundType, out var info))
+ if (act.TryGetRound(config.RoundType, out var info) && funcIdDict.TryGetValue(config.RoundType, out var funcId) && FuncOpen.Instance.IsFuncOpen(funcId))
{
if (!resList.Contains(id))
{
diff --git a/System/LoopAct/CycleHall/CycleHallCell.cs b/System/LoopAct/CycleHall/CycleHallCell.cs
deleted file mode 100644
index d0cae71..0000000
--- a/System/LoopAct/CycleHall/CycleHallCell.cs
+++ /dev/null
@@ -1,312 +0,0 @@
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.UI;
-
-namespace vnxbqy.UI
-{
- public class CycleHallCell : CellView
- {
- [SerializeField] Transform mission;
- [SerializeField] Transform gift;
- [SerializeField] ImageEx imgFinish;
- [SerializeField] TextEx txtTitle;
- [SerializeField] ButtonEx btnMissionHave;
- [SerializeField] List<ItemCell> missionItemCells = new List<ItemCell>();
- [SerializeField] List<ImageEx> missionHaves = new List<ImageEx>();
- [SerializeField] List<ImageEx> missionGreys = new List<ImageEx>();
- [SerializeField] List<RotationTween> missionTweens = new List<RotationTween>();
- [SerializeField] Slider buyCountGiftSlider;
- [SerializeField] Text buyCountGiftSliderText;
-
- [SerializeField] List<ItemCell> giftItemCells = new List<ItemCell>();
- [SerializeField] ButtonEx btnBuy;
- [SerializeField] ImageEx imgRed;
- [SerializeField] TextEx txtBuy;
- [SerializeField] ImageEx imgBuy;
- [SerializeField] TextEx txtLimitCount;
-
- [SerializeField] TextEx orgPrice;
- int roundType;
- int tabType;
- int index;
- CycleHallActModel model { get { return ModelCenter.Instance.GetModel<CycleHallActModel>(); } }
- VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
- BossTrialModel bossTrialModel { get { return ModelCenter.Instance.GetModel<BossTrialModel>(); } }
- StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
-
- private void OnEnable()
- {
- model.PlayAnimationSync += OnPlaySyncAnimation;
- for (int i = 0; i < missionTweens.Count; i++)
- {
- missionTweens[i].Stop();
- missionTweens[i].SetStartState();
- }
- if (tabType == 1)
- {
- int state = model.GetAwardState(roundType, index);//0 不可领取 1 可领取 2 已领取
- for (int i = 0; i < missionTweens.Count; i++)
- {
- var act = model.GetOperationInfo();
- if (act == null || !act.TryGetRound(roundType, out var round) || round.AwardList == null || round.AwardList.Length <= index || index < 0)
- return;
- var award = round.AwardList[index];
- if (award.AwardItemList == null)
- return;
- if (i < award.AwardItemList.Length)
- {
- if (state == 1)
- {
- missionTweens[i].Play();
- }
- }
- }
- }
- }
-
- private void OnDisable()
- {
- model.PlayAnimationSync -= OnPlaySyncAnimation;
- }
-
- public void Display(int index, CellView cellView)
- {
- this.index = index;
- roundType = cellView.info.Value.infoInt1;
- tabType = cellView.info.Value.infoInt2;
- mission.SetActive(tabType == 1);
- gift.SetActive(tabType == 2);
- btnMissionHave.enabled = false;
- imgRed.SetActive(false);
- if (model.playerInfoDict == null || !model.playerInfoDict.TryGetValue((byte)roundType, out var playerInfo) || playerInfo == null)
- return;
-
- if (tabType == 1)
- {
- var act = model.GetOperationInfo();
- if (act == null || !act.TryGetRound(roundType, out var round) || round.AwardList == null || round.AwardList.Length <= index || index < 0)
- return;
- var award = round.AwardList[index];
- int state = model.GetAwardState(roundType, index);//0 不可领取 1 可领取 2 已领取
- imgFinish.SetActive(state == 2);
- orgPrice.SetActive(false);
- txtTitle.text = Language.Get(StringUtility.Contact("CycleHallMissionTitle", "_", roundType), award.NeedValue);
- buyCountGiftSlider.value = playerInfo.CurValue / (float)award.NeedValue;
- buyCountGiftSliderText.text = string.Format("{0}/{1}", playerInfo.CurValue, award.NeedValue);
- btnMissionHave.enabled = true;
- btnMissionHave.SetListener(() =>
- {
- HaveMissionAward();
- });
- for (int i = 0; i < missionItemCells.Count; i++)
- {
- var itemBaisc = missionItemCells[i];
- if (i < award.AwardItemList.Length)
- {
- var itemInfo = award.AwardItemList[i];
- itemBaisc.SetActive(true);
- missionHaves[i].SetActive(state == 2);
- missionGreys[i].SetActive(state == 2);
- ItemCellModel cellModel = new ItemCellModel((int)itemInfo.ItemID, false, (ulong)itemInfo.ItemCount);
- itemBaisc.Init(cellModel);
- itemBaisc.button.AddListener(() =>
- {
- if (state == 1)
- {
- HaveMissionAward();
- }
- else
- {
- ItemTipUtility.Show((int)itemInfo.ItemID);
- }
- });
- }
- else
- {
- itemBaisc.SetActive(false);
- missionHaves[i].SetActive(false);
- missionGreys[i].SetActive(false);
- }
- }
- OnPlaySyncAnimation();
- }
- else if (tabType == 2)
- {
- var act = model.GetOperationInfo();
- if (act == null || !act.TryGetRound(roundType, out var round) || round.CTGIDList == null)
- return;
- List<StoreConfig> _list = null;
- StoreConfig.TryGetStoreConfigs(round.ShopType, out _list);
- if (_list != null && index < _list.Count)
- {
- DisplayStore(_list[index]);
- return;
- }
- index = index - (_list != null ? _list.Count : 0);
- if (round.CTGIDList.Length <= index || index < 0)
- return;
- int ctgId = round.CTGIDList[index];
- if (!CTGConfig.Has(ctgId))
- return;
- CTGConfig config = CTGConfig.Get(ctgId);
-
- var countInfo = GetBuyCntInfo(ctgId);
- int buyCnt = countInfo.x;
- int totalCnt = countInfo.y;
- btnBuy.SetActive(buyCnt < totalCnt);
- imgBuy.SetActive(buyCnt >= totalCnt);
- OrderInfoConfig orderConfig;
- vipModel.TryGetOrderInfo(ctgId, out orderConfig);
- txtBuy.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNum));
- txtLimitCount.SetActive(true);
- txtLimitCount.text = Language.Get("CycleHall05", UIHelper.AppendColor(buyCnt >= totalCnt ? TextColType.Red : TextColType.Green, Mathf.Max(0, totalCnt - buyCnt).ToString(), true));
- if (orgPrice != null)
- {
- orgPrice.SetActive(PlayerDatas.Instance.baseData.IsActive90Off);
- orgPrice.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.m_PayRMBNum));
- }
- btnBuy.SetListener(() =>
- {
- if (PlayerDatas.Instance.baseData.VIPLv < config.VipLevel)
- {
- SysNotifyMgr.Instance.ShowTip("VIPNotEnough", config.VipLevel);
- return;
- }
-
- if (bossTrialModel.IsOpen)
- {
- //参与时间结束前直接购买,时间结束后再购买需要弹窗提示
- if (bossTrialModel.IsPrepareTime || bossTrialModel.IsJoin)
- vipModel.CTG(ctgId);
- else
- {
- ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("BossTrial14"), (bool isOk) =>
- {
- if (isOk)
- {
- vipModel.CTG(ctgId);
- }
- });
- }
- }
- else
- {
- vipModel.CTG(ctgId);
- }
- });
-
- txtTitle.text = config.Title;
- if (vipModel.TryGetRechargeItem(ctgId, out var list) && list != null)
- {
- for (int i = 0; i < giftItemCells.Count; i++)
- {
- var itemBaisc = giftItemCells[i];
- if (i < list.Count)
- {
- var itemInfo = list[i];
- itemBaisc.SetActive(true);
- ItemCellModel cellModel = new ItemCellModel((int)itemInfo.id, false, (ulong)itemInfo.count);
- itemBaisc.Init(cellModel);
- itemBaisc.button.AddListener(() =>
- {
- ItemTipUtility.Show((int)itemInfo.id);
- });
- }
- else
- {
- itemBaisc.SetActive(false);
- }
- }
- }
- }
- }
-
- public void HaveMissionAward()
- {
- var act = model.GetOperationInfo();
- if (act == null || !act.TryGetRound(roundType, out var round) || round.AwardList == null || round.AwardList.Length <= index || index < 0)
- return;
- int state = model.GetAwardState(roundType, index);//0 不可领取 1 可领取 2 已领取
- if (state != 1)
- return;
- model.SendGetAward(roundType, (int)round.AwardList[index].NeedValue);
- }
-
- public Int2 GetBuyCntInfo(int ctgID)
- {
- VipModel.RechargeCount rechargeCount;
- vipModel.TryGetRechargeCount(ctgID, out rechargeCount);
-
- var ctgConfig = CTGConfig.Get(ctgID);
- int buyCnt = 0;
- int totalCnt = 0;
-
- buyCnt = rechargeCount.totalCount;
- totalCnt = ctgConfig.TotalBuyCount;
-
- return new Int2(buyCnt, totalCnt);
- }
-
- private void DisplayStore(StoreConfig storeConfig)
- {
- bool isFree = storeConfig.MoneyNumber == 0;
- txtTitle.text = isFree ? Language.Get("StoreName_free") : Language.Get("StoreName_money");
- //saleObj.SetActive(false);
- int remainNum;
- storeModel.TryGetIsSellOut(storeConfig, out remainNum);
- orgPrice.SetActive(false);
- txtLimitCount.SetActive(!isFree);
- txtLimitCount.text = Language.Get("CycleHall06", UIHelper.AppendColor(remainNum == 0 ? TextColType.Red : TextColType.Green, Mathf.Max(0, remainNum).ToString(), true));
-
- imgRed.SetActive(isFree);
- btnBuy.SetActive(remainNum > 0);
- btnBuy.SetListener(() =>
- {
- storeModel.SendBuyShopItemWithPopCheck(storeConfig, 1, (int)BuyStoreItemCheckType.ActGift);
- });
- imgBuy.SetActive(remainNum <= 0);
-
- txtBuy.text = isFree ? Language.Get("AloneFree") : Language.Get("ItemOverdue105", UIHelper.GetMoneyFormat(storeConfig.MoneyNumber));
-
- var items = storeModel.GetShopItemlistByIndex(storeConfig);
- for (int i = 0; i < giftItemCells.Count; i++)
- {
- var itemBaisc = giftItemCells[i];
- if (i < items.Count)
- {
- var itemInfo = items[i];
- itemBaisc.SetActive(true);
- ItemCellModel cellModel = new ItemCellModel(itemInfo.itemId, false, (ulong)itemInfo.count);
- itemBaisc.Init(cellModel);
- itemBaisc.button.AddListener(() =>
- {
- ItemTipUtility.Show(itemInfo.itemId);
- });
- }
- else
- {
- itemBaisc.SetActive(false);
- }
- }
- }
-
- private void OnPlaySyncAnimation()
- {
- if (tabType != 1)
- return;
- for (int i = 0; i < missionTweens.Count; i++)
- {
- missionTweens[i].Stop();
- missionTweens[i].SetStartState();
- }
- int state = model.GetAwardState(roundType, index);//0 不可领取 1 可领取 2 已领取
- for (int i = 0; i < missionTweens.Count; i++)
- {
- if (missionTweens[i].isActiveAndEnabled && state == 1)
- {
- missionTweens[i].Play();
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/System/LoopAct/CycleHall/CycleHallGiftCell.cs b/System/LoopAct/CycleHall/CycleHallGiftCell.cs
new file mode 100644
index 0000000..f5bb309
--- /dev/null
+++ b/System/LoopAct/CycleHall/CycleHallGiftCell.cs
@@ -0,0 +1,177 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace vnxbqy.UI
+{
+ public class CycleHallGiftCell : CellView
+ {
+ [SerializeField] TextEx txtTitle;
+ [SerializeField] List<ItemCell> giftItemCells = new List<ItemCell>();
+ [SerializeField] ButtonEx btnBuy;
+ [SerializeField] ImageEx imgRed;
+ [SerializeField] TextEx txtBuy;
+ [SerializeField] ImageEx imgBuy;
+ [SerializeField] TextEx txtLimitCount;
+
+ [SerializeField] TextEx orgPrice;
+ int roundType;
+
+ CycleHallActModel model { get { return ModelCenter.Instance.GetModel<CycleHallActModel>(); } }
+ VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
+ BossTrialModel bossTrialModel { get { return ModelCenter.Instance.GetModel<BossTrialModel>(); } }
+ StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
+
+ public void Display(int index, CellView cellView)
+ {
+ roundType = cellView.info.Value.infoInt1;
+ imgRed.SetActive(false);
+ if (model.playerInfoDict == null || !model.playerInfoDict.TryGetValue((byte)roundType, out var playerInfo) || playerInfo == null)
+ return;
+
+ var act = model.GetOperationInfo();
+ if (act == null || !act.TryGetRound(roundType, out var round) || round.CTGIDList == null)
+ return;
+ List<StoreConfig> _list = null;
+ StoreConfig.TryGetStoreConfigs(round.ShopType, out _list);
+ if (_list != null && index < _list.Count)
+ {
+ DisplayStore(_list[index]);
+ return;
+ }
+ index = index - (_list != null ? _list.Count : 0);
+ if (round.CTGIDList.Length <= index || index < 0)
+ return;
+ int ctgId = round.CTGIDList[index];
+ if (!CTGConfig.Has(ctgId))
+ return;
+ CTGConfig config = CTGConfig.Get(ctgId);
+
+ var countInfo = GetBuyCntInfo(ctgId);
+ int buyCnt = countInfo.x;
+ int totalCnt = countInfo.y;
+ btnBuy.SetActive(buyCnt < totalCnt);
+ imgBuy.SetActive(buyCnt >= totalCnt);
+ OrderInfoConfig orderConfig;
+ vipModel.TryGetOrderInfo(ctgId, out orderConfig);
+ txtBuy.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNum));
+ txtLimitCount.SetActive(true);
+ txtLimitCount.text = Language.Get("CycleHall05", UIHelper.AppendColor(buyCnt >= totalCnt ? TextColType.Red : TextColType.Green, Mathf.Max(0, totalCnt - buyCnt).ToString(), true));
+ if (orgPrice != null)
+ {
+ orgPrice.SetActive(PlayerDatas.Instance.baseData.IsActive90Off);
+ orgPrice.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.m_PayRMBNum));
+ }
+ btnBuy.SetListener(() =>
+ {
+ if (PlayerDatas.Instance.baseData.VIPLv < config.VipLevel)
+ {
+ SysNotifyMgr.Instance.ShowTip("VIPNotEnough", config.VipLevel);
+ return;
+ }
+
+ if (bossTrialModel.IsOpen)
+ {
+ //参与时间结束前直接购买,时间结束后再购买需要弹窗提示
+ if (bossTrialModel.IsPrepareTime || bossTrialModel.IsJoin)
+ vipModel.CTG(ctgId);
+ else
+ {
+ ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("BossTrial14"), (bool isOk) =>
+ {
+ if (isOk)
+ {
+ vipModel.CTG(ctgId);
+ }
+ });
+ }
+ }
+ else
+ {
+ vipModel.CTG(ctgId);
+ }
+ });
+
+ txtTitle.text = config.Title;
+ if (vipModel.TryGetRechargeItem(ctgId, out var list) && list != null)
+ {
+ for (int i = 0; i < giftItemCells.Count; i++)
+ {
+ var itemBaisc = giftItemCells[i];
+ if (i < list.Count)
+ {
+ var itemInfo = list[i];
+ itemBaisc.SetActive(true);
+ ItemCellModel cellModel = new ItemCellModel((int)itemInfo.id, false, (ulong)itemInfo.count);
+ itemBaisc.Init(cellModel);
+ itemBaisc.button.AddListener(() =>
+ {
+ ItemTipUtility.Show((int)itemInfo.id);
+ });
+ }
+ else
+ {
+ itemBaisc.SetActive(false);
+ }
+ }
+ }
+ }
+
+ public Int2 GetBuyCntInfo(int ctgID)
+ {
+ VipModel.RechargeCount rechargeCount;
+ vipModel.TryGetRechargeCount(ctgID, out rechargeCount);
+
+ var ctgConfig = CTGConfig.Get(ctgID);
+ int buyCnt = 0;
+ int totalCnt = 0;
+
+ buyCnt = rechargeCount.totalCount;
+ totalCnt = ctgConfig.TotalBuyCount;
+
+ return new Int2(buyCnt, totalCnt);
+ }
+
+ private void DisplayStore(StoreConfig storeConfig)
+ {
+ bool isFree = storeConfig.MoneyNumber == 0;
+ txtTitle.text = isFree ? Language.Get("StoreName_free") : Language.Get("StoreName_money");
+ //saleObj.SetActive(false);
+ int remainNum;
+ storeModel.TryGetIsSellOut(storeConfig, out remainNum);
+ orgPrice.SetActive(false);
+ txtLimitCount.SetActive(!isFree);
+ txtLimitCount.text = Language.Get("CycleHall06", UIHelper.AppendColor(remainNum == 0 ? TextColType.Red : TextColType.Green, Mathf.Max(0, remainNum).ToString(), true));
+
+ imgRed.SetActive(isFree);
+ btnBuy.SetActive(remainNum > 0);
+ btnBuy.SetListener(() =>
+ {
+ storeModel.SendBuyShopItemWithPopCheck(storeConfig, 1, (int)BuyStoreItemCheckType.ActGift);
+ });
+ imgBuy.SetActive(remainNum <= 0);
+
+ txtBuy.text = isFree ? Language.Get("AloneFree") : Language.Get("ItemOverdue105", UIHelper.GetMoneyFormat(storeConfig.MoneyNumber));
+
+ var items = storeModel.GetShopItemlistByIndex(storeConfig);
+ for (int i = 0; i < giftItemCells.Count; i++)
+ {
+ var itemBaisc = giftItemCells[i];
+ if (i < items.Count)
+ {
+ var itemInfo = items[i];
+ itemBaisc.SetActive(true);
+ ItemCellModel cellModel = new ItemCellModel(itemInfo.itemId, false, (ulong)itemInfo.count);
+ itemBaisc.Init(cellModel);
+ itemBaisc.button.AddListener(() =>
+ {
+ ItemTipUtility.Show(itemInfo.itemId);
+ });
+ }
+ else
+ {
+ itemBaisc.SetActive(false);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/System/LoopAct/CycleHall/CycleHallGiftCell.cs.meta b/System/LoopAct/CycleHall/CycleHallGiftCell.cs.meta
new file mode 100644
index 0000000..c341c45
--- /dev/null
+++ b/System/LoopAct/CycleHall/CycleHallGiftCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3c514e9b541f463468608db0a31460ad
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/LoopAct/CycleHall/CycleHallMissionCell.cs b/System/LoopAct/CycleHall/CycleHallMissionCell.cs
new file mode 100644
index 0000000..929ca02
--- /dev/null
+++ b/System/LoopAct/CycleHall/CycleHallMissionCell.cs
@@ -0,0 +1,145 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace vnxbqy.UI
+{
+ public class CycleHallMissionCell : CellView
+ {
+ [SerializeField] ImageEx imgFinish;
+ [SerializeField] TextEx txtTitle;
+ [SerializeField] ButtonEx btnMissionHave;
+ [SerializeField] List<ItemCell> missionItemCells = new List<ItemCell>();
+ [SerializeField] List<ImageEx> missionHaves = new List<ImageEx>();
+ [SerializeField] List<ImageEx> missionGreys = new List<ImageEx>();
+ [SerializeField] List<RotationTween> missionTweens = new List<RotationTween>();
+ [SerializeField] Slider buyCountGiftSlider;
+ [SerializeField] Text buyCountGiftSliderText;
+
+ int roundType;
+ int tabType;
+ int mIndex;
+ CycleHallActModel model { get { return ModelCenter.Instance.GetModel<CycleHallActModel>(); } }
+
+ private void OnEnable()
+ {
+ model.PlayAnimationSync += OnPlaySyncAnimation;
+ for (int i = 0; i < missionTweens.Count; i++)
+ {
+ missionTweens[i].Stop();
+ missionTweens[i].SetStartState();
+ }
+ if (tabType == 1)
+ {
+ int state = model.GetAwardState(roundType, mIndex);//0 不可领取 1 可领取 2 已领取
+ for (int i = 0; i < missionTweens.Count; i++)
+ {
+ var act = model.GetOperationInfo();
+ if (act == null || !act.TryGetRound(roundType, out var round) || round.AwardList == null || round.AwardList.Length <= mIndex || mIndex < 0)
+ return;
+ var award = round.AwardList[mIndex];
+ if (award.AwardItemList == null)
+ return;
+ if (i < award.AwardItemList.Length)
+ {
+ if (state == 1)
+ {
+ missionTweens[i].Play();
+ }
+ }
+ }
+ }
+ }
+
+ private void OnDisable()
+ {
+ model.PlayAnimationSync -= OnPlaySyncAnimation;
+ }
+
+ public void Display(int index, CellView cellView)
+ {
+ this.mIndex = index;
+ roundType = cellView.info.Value.infoInt1;
+ tabType = cellView.info.Value.infoInt2;
+ btnMissionHave.enabled = false;
+ if (model.playerInfoDict == null || !model.playerInfoDict.TryGetValue((byte)roundType, out var playerInfo) || playerInfo == null)
+ return;
+
+ var act = model.GetOperationInfo();
+ if (act == null || !act.TryGetRound(roundType, out var round) || round.AwardList == null || round.AwardList.Length <= index || index < 0)
+ return;
+ var award = round.AwardList[index];
+ int state = model.GetAwardState(roundType, index);//0 不可领取 1 可领取 2 已领取
+ imgFinish.SetActive(state == 2);
+ txtTitle.text = Language.Get(StringUtility.Contact("CycleHallMissionTitle", "_", round.AwardType, "_", round.AwardTypeValue), award.NeedValue);
+ buyCountGiftSlider.value = playerInfo.CurValue / (float)award.NeedValue;
+ buyCountGiftSliderText.text = string.Format("{0}/{1}", playerInfo.CurValue, award.NeedValue);
+ btnMissionHave.enabled = true;
+ btnMissionHave.SetListener(() =>
+ {
+ HaveMissionAward();
+ });
+ for (int i = 0; i < missionItemCells.Count; i++)
+ {
+ var itemBaisc = missionItemCells[i];
+ if (i < award.AwardItemList.Length)
+ {
+ var itemInfo = award.AwardItemList[i];
+ itemBaisc.SetActive(true);
+ missionHaves[i].SetActive(state == 2);
+ missionGreys[i].SetActive(state == 2);
+ ItemCellModel cellModel = new ItemCellModel((int)itemInfo.ItemID, false, (ulong)itemInfo.ItemCount);
+ itemBaisc.Init(cellModel);
+ itemBaisc.button.AddListener(() =>
+ {
+ if (state == 1)
+ {
+ HaveMissionAward();
+ }
+ else
+ {
+ ItemTipUtility.Show((int)itemInfo.ItemID);
+ }
+ });
+ }
+ else
+ {
+ itemBaisc.SetActive(false);
+ missionHaves[i].SetActive(false);
+ missionGreys[i].SetActive(false);
+ }
+ }
+ OnPlaySyncAnimation();
+ }
+
+ public void HaveMissionAward()
+ {
+ var act = model.GetOperationInfo();
+ if (act == null || !act.TryGetRound(roundType, out var round) || round.AwardList == null || round.AwardList.Length <= mIndex || mIndex < 0)
+ return;
+ int state = model.GetAwardState(roundType, mIndex);//0 不可领取 1 可领取 2 已领取
+ if (state != 1)
+ return;
+ model.SendGetAward(roundType, (int)round.AwardList[mIndex].NeedValue);
+ }
+
+ private void OnPlaySyncAnimation()
+ {
+ if (tabType != 1)
+ return;
+ for (int i = 0; i < missionTweens.Count; i++)
+ {
+ missionTweens[i].Stop();
+ missionTweens[i].SetStartState();
+ }
+ int state = model.GetAwardState(roundType, mIndex);//0 不可领取 1 可领取 2 已领取
+ for (int i = 0; i < missionTweens.Count; i++)
+ {
+ if (missionTweens[i].isActiveAndEnabled && state == 1)
+ {
+ missionTweens[i].Play();
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/System/LoopAct/CycleHall/CycleHallCell.cs.meta b/System/LoopAct/CycleHall/CycleHallMissionCell.cs.meta
similarity index 100%
rename from System/LoopAct/CycleHall/CycleHallCell.cs.meta
rename to System/LoopAct/CycleHall/CycleHallMissionCell.cs.meta
diff --git a/System/LoopAct/CycleHall/CycleHallWin.cs b/System/LoopAct/CycleHall/CycleHallWin.cs
index c89c89a..e45d0c3 100644
--- a/System/LoopAct/CycleHall/CycleHallWin.cs
+++ b/System/LoopAct/CycleHall/CycleHallWin.cs
@@ -8,6 +8,8 @@
public class CycleHallWin : Window
{
[SerializeField] ScrollerController tabScroller;
+ [SerializeField] ScrollerController missionScroller;
+ [SerializeField] ScrollerController giftScroller;
[SerializeField] ImageEx imgTitle;
[SerializeField] ImageEx imgInfo;
@@ -17,7 +19,6 @@
[SerializeField] ButtonEx btnGo;
[SerializeField] ButtonEx btnClose;
- [SerializeField] ScrollerController scroller;
RechargeGiftActModel rechargeGiftActModel { get { return ModelCenter.Instance.GetModel<RechargeGiftActModel>(); } }
CycleHallActModel model { get { return ModelCenter.Instance.GetModel<CycleHallActModel>(); } }
StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
@@ -37,7 +38,8 @@
{
GlobalTimeEvent.Instance.secondEvent += SecondEvent;
tabScroller.OnRefreshCell += OnScrollerRefreshTabCell;
- scroller.OnRefreshCell += OnScrollerRefreshCell;
+ missionScroller.OnRefreshCell += OnScrollerRefreshMissionCell;
+ giftScroller.OnRefreshCell += OnScrollerRefreshGiftCell;
model.onNowTabIdUpdate += OnNowTabIdUpdate;
vipModel.rechargeCountEvent += VipModel_rechargeCountEvent;
storeModel.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
@@ -50,7 +52,7 @@
}
else
{
- model.nowTabId = int.Parse(CycleHallConfig.GetKeys()[0]);
+ WindowCenter.Instance.Close<CycleHallWin>();
}
Display();
}
@@ -59,7 +61,8 @@
{
GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
tabScroller.OnRefreshCell -= OnScrollerRefreshTabCell;
- scroller.OnRefreshCell -= OnScrollerRefreshCell;
+ missionScroller.OnRefreshCell -= OnScrollerRefreshMissionCell;
+ giftScroller.OnRefreshCell -= OnScrollerRefreshGiftCell;
model.onNowTabIdUpdate -= OnNowTabIdUpdate;
vipModel.rechargeCountEvent -= VipModel_rechargeCountEvent;
storeModel.RefreshBuyShopLimitEvent -= RefreshBuyShopLimitEvent;
@@ -72,7 +75,8 @@
if (operation == Operation.default47)
{
tabScroller.m_Scorller.RefreshActiveCellViews();
- scroller.m_Scorller.RefreshActiveCellViews();
+ missionScroller.m_Scorller.RefreshActiveCellViews();
+ giftScroller.m_Scorller.RefreshActiveCellViews();
Display();
}
}
@@ -80,19 +84,20 @@
private void OnUpdatePlayerInfoAction()
{
tabScroller.m_Scorller.RefreshActiveCellViews();
- scroller.m_Scorller.RefreshActiveCellViews();
+ missionScroller.m_Scorller.RefreshActiveCellViews();
+ giftScroller.m_Scorller.RefreshActiveCellViews();
Display();
}
private void RefreshBuyShopLimitEvent()
{
- scroller.m_Scorller.RefreshActiveCellViews();
+ giftScroller.m_Scorller.RefreshActiveCellViews();
model.IsPlayAnimation = true;
}
private void VipModel_rechargeCountEvent(int obj)
{
- scroller.m_Scorller.RefreshActiveCellViews();
+ giftScroller.m_Scorller.RefreshActiveCellViews();
model.IsPlayAnimation = true;
}
@@ -100,7 +105,8 @@
{
tabScroller.m_Scorller.RefreshActiveCellViews();
CreateScroller();
- scroller.JumpIndex(JumpIndex());
+ missionScroller.JumpIndex(JumpMissionIndex());
+ giftScroller.JumpIndex(JumpGiftIndex());
Display();
}
@@ -110,11 +116,17 @@
_cell.Display(_cell.index);
}
- private void OnScrollerRefreshCell(ScrollerDataType type, CellView cell)
+ private void OnScrollerRefreshMissionCell(ScrollerDataType type, CellView cell)
{
- var _cell = cell as CycleHallCell;
+ var _cell = cell as CycleHallMissionCell;
_cell.Display(_cell.index, cell);
model.IsPlayAnimation = true;
+ }
+
+ private void OnScrollerRefreshGiftCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as CycleHallGiftCell;
+ _cell.Display(_cell.index, cell);
}
protected override void OnAfterOpen()
@@ -122,7 +134,8 @@
CreateTabScroller();
tabScroller.JumpIndex(JumpTabIndex());
CreateScroller();
- scroller.JumpIndex(JumpIndex());
+ missionScroller.JumpIndex(JumpMissionIndex());
+ giftScroller.JumpIndex(JumpGiftIndex());
}
protected override void OnAfterClose()
@@ -179,6 +192,8 @@
private void CreateScroller()
{
+ missionScroller.SetActive(false);
+ giftScroller.SetActive(false);
int id = model.nowTabId;
if (!CycleHallConfig.Has(id))
return;
@@ -189,20 +204,22 @@
if (config.TabType == 1)
{
- scroller.Refresh();
+ missionScroller.SetActive(true);
+ missionScroller.Refresh();
var act = model.GetOperationInfo();
if (act != null && act.TryGetRound(config.RoundType, out var round) && round.AwardList != null)
{
for (int i = 0; i < round.AwardList.Length; i++)
{
- scroller.AddCell(ScrollerDataType.Header, i, cellInfo);
+ missionScroller.AddCell(ScrollerDataType.Header, i, cellInfo);
}
}
- scroller.Restart();
+ missionScroller.Restart();
}
else if (config.TabType == 2)
{
- scroller.Refresh();
+ giftScroller.SetActive(true);
+ giftScroller.Refresh();
var act = model.GetOperationInfo();
if (act != null && act.TryGetRound(config.RoundType, out var round) && round.CTGIDList != null)
{
@@ -211,10 +228,10 @@
int totaleCnt = (_list == null ? 0 : _list.Count) + round.CTGIDList.Length;
for (int i = 0; i < totaleCnt; i++)
{
- scroller.AddCell(ScrollerDataType.Header, i, cellInfo);
+ giftScroller.AddCell(ScrollerDataType.Header, i, cellInfo);
}
}
- scroller.Restart();
+ giftScroller.Restart();
}
}
@@ -285,23 +302,6 @@
}
}
}
- }
- return 0;
- }
-
- private int JumpIndex()
- {
- int id = model.nowTabId;
- if (!CycleHallConfig.Has(id))
- return 0;
- CycleHallConfig config = CycleHallConfig.Get(id);
- if (config.TabType == 1)
- {
- return JumpMissionIndex();
- }
- else if (config.TabType == 2)
- {
- return JumpGiftIndex();
}
return 0;
}
diff --git a/System/LoopAct/CycleHall/OperationCycleHall.cs b/System/LoopAct/CycleHall/OperationCycleHall.cs
index 77a66f3..3d253ab 100644
--- a/System/LoopAct/CycleHall/OperationCycleHall.cs
+++ b/System/LoopAct/CycleHall/OperationCycleHall.cs
@@ -10,10 +10,7 @@
public bool TryGetRound(int roundType, out HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianRound round)
{
- round = new HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianRound { };
- if (roundInfoDict == null || !roundInfoDict.TryGetValue(roundType, out round))
- return false;
- return true;
+ return roundInfoDict.TryGetValue(roundType, out round);
}
public bool TryGetRoundInfoByIndex(int roundType, int index, out HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward awardInfo)
@@ -69,6 +66,7 @@
public override void Reset()
{
base.Reset();
+ roundInfoDict.Clear();
}
public void ParseCycleHallInfo(HAA88_tagMCActLunhuidianInfo package)
--
Gitblit v1.8.0