| | |
| | | HashSet<Type> configTypes = new HashSet<Type>() {
|
| | | typeof(ADAwardConfig),
|
| | | typeof(BattleMapConfig),
|
| | | typeof(BeautyConfig),
|
| | | typeof(BeautyQualityLVConfig),
|
| | | typeof(BeautySkinConfig),
|
| | | typeof(ChestsAwardConfig),
|
| | | typeof(CTGConfig),
|
| | | typeof(DailyTaskConfig),
|
| | |
| | | typeof(TianziConfig),
|
| | | typeof(TitleConfig),
|
| | | typeof(TitleStarUpConfig),
|
| | | typeof(TravelEventConfig),
|
| | | typeof(TravelSceneryConfig),
|
| | | typeof(TreasureSetConfig),
|
| | | typeof(TreeLVConfig),
|
| | | typeof(WindowSearchConfig),
|
| | |
| | | ClearConfigDictionary<ADAwardConfig>();
|
| | | // 清空 BattleMapConfig 字典
|
| | | ClearConfigDictionary<BattleMapConfig>();
|
| | | // 清空 BeautyConfig 字典
|
| | | ClearConfigDictionary<BeautyConfig>();
|
| | | // 清空 BeautyQualityLVConfig 字典
|
| | | ClearConfigDictionary<BeautyQualityLVConfig>();
|
| | | // 清空 BeautySkinConfig 字典
|
| | | ClearConfigDictionary<BeautySkinConfig>();
|
| | | // 清空 ChestsAwardConfig 字典
|
| | | ClearConfigDictionary<ChestsAwardConfig>();
|
| | | // 清空 CTGConfig 字典
|
| | |
| | | ClearConfigDictionary<TitleConfig>();
|
| | | // 清空 TitleStarUpConfig 字典
|
| | | ClearConfigDictionary<TitleStarUpConfig>();
|
| | | // 清空 TravelEventConfig 字典
|
| | | ClearConfigDictionary<TravelEventConfig>();
|
| | | // 清空 TravelSceneryConfig 字典
|
| | | ClearConfigDictionary<TravelSceneryConfig>();
|
| | | // 清空 TreasureSetConfig 字典
|
| | | ClearConfigDictionary<TreasureSetConfig>();
|
| | | // 清空 TreeLVConfig 字典
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年12月16日
|
| | | // [ Date ]: Monday, December 29, 2025
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int LibID;
|
| | | public int ItemID;
|
| | | public int ItemCount;
|
| | | public int WishOutCnt;
|
| | | public int IsWishitem;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | |
| | |
|
| | | int.TryParse(tables[3],out ItemCount);
|
| | |
|
| | | int.TryParse(tables[4],out WishOutCnt); |
| | | int.TryParse(tables[4],out IsWishitem); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年12月16日
|
| | | // [ Date ]: Monday, December 29, 2025
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int AwardMoneyType;
|
| | | public int AwardMoneyValue;
|
| | | public int WishOpen;
|
| | | public int WishReset;
|
| | | public Dictionary<int, int> WishLibSelect;
|
| | | public Dictionary<int, int> WishLibPubFreeCnt;
|
| | | public Dictionary<int, int> WishLibCard;
|
| | | public string ProbabilityDisplay;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | |
| | |
|
| | | int.TryParse(tables[15],out WishOpen);
|
| | |
|
| | | WishLibSelect = ConfigParse.ParseIntDict(tables[16]); |
| | | int.TryParse(tables[16],out WishReset); |
| | |
|
| | | ProbabilityDisplay = tables[17];
|
| | | WishLibSelect = ConfigParse.ParseIntDict(tables[17]); |
| | |
|
| | | WishLibPubFreeCnt = ConfigParse.ParseIntDict(tables[18]); |
| | |
|
| | | WishLibCard = ConfigParse.ParseIntDict(tables[19]); |
| | |
|
| | | ProbabilityDisplay = tables[20];
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | |
| | | { |
| | | resultWishIDDict[LibID] = new List<int>(); |
| | | } |
| | | if (WishOutCnt > 0) |
| | | if (IsWishitem > 0) |
| | | { |
| | | resultWishIDDict[LibID].Add(ID); |
| | | } |
| | |
| | | public byte TreasureType; //寻宝类型
|
| | | public byte WishCnt;
|
| | | public uint[] WishIDList; // 选择的寻宝物品库中的数据ID,注意不是库ID
|
| | | public byte WishCardUseCnt;
|
| | | public ushort[] WishCardUseLibIDList; // 使用心愿卡的库ID列表
|
| | |
|
| | | public CA569_tagCSTreasureWishSelect () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | |
| | | WriteBytes (TreasureType, NetDataType.BYTE);
|
| | | WriteBytes (WishCnt, NetDataType.BYTE);
|
| | | WriteBytes (WishIDList, NetDataType.DWORD, WishCnt);
|
| | | WriteBytes (WishCardUseCnt, NetDataType.BYTE);
|
| | | WriteBytes (WishCardUseLibIDList, NetDataType.WORD, WishCardUseCnt);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | TransBytes (out TreasuerInfoList[i].GridLimitCntList[j].GridNum, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out TreasuerInfoList[i].GridLimitCntList[j].GridCnt, vBytes, NetDataType.WORD);
|
| | | }
|
| | | TransBytes (out TreasuerInfoList[i].WishCnt, vBytes, NetDataType.BYTE);
|
| | | TreasuerInfoList[i].WishList = new tagMCTreasureWish[TreasuerInfoList[i].WishCnt];
|
| | | for (int j = 0; j < TreasuerInfoList[i].WishCnt; j ++) {
|
| | | TreasuerInfoList[i].WishList[j] = new tagMCTreasureWish();
|
| | | TransBytes (out TreasuerInfoList[i].WishList[j].WishID, vBytes, NetDataType.WORD);
|
| | | TransBytes (out TreasuerInfoList[i].WishList[j].OutCnt, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out TreasuerInfoList[i].WishLibCnt, vBytes, NetDataType.BYTE);
|
| | | TreasuerInfoList[i].WishLibList = new tagMCTreasureWishLib[TreasuerInfoList[i].WishLibCnt];
|
| | | for (int j = 0; j < TreasuerInfoList[i].WishLibCnt; j ++) {
|
| | | TreasuerInfoList[i].WishLibList[j] = new tagMCTreasureWishLib();
|
| | | TransBytes (out TreasuerInfoList[i].WishLibList[j].LibID, vBytes, NetDataType.WORD);
|
| | | TransBytes (out TreasuerInfoList[i].WishLibList[j].OutCntTotal, vBytes, NetDataType.WORD);
|
| | | TransBytes (out TreasuerInfoList[i].WishLibList[j].IsUseWishCard, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out TreasuerInfoList[i].WishLibList[j].WishCnt, vBytes, NetDataType.BYTE);
|
| | | TreasuerInfoList[i].WishLibList[j].WishList = new tagMCTreasureWish[TreasuerInfoList[i].WishLibList[j].WishCnt];
|
| | | for (int k = 0; k < TreasuerInfoList[i].WishLibList[j].WishCnt; k ++) {
|
| | | TreasuerInfoList[i].WishLibList[j].WishList[k] = new tagMCTreasureWish();
|
| | | TransBytes (out TreasuerInfoList[i].WishLibList[j].WishList[k].WishID, vBytes, NetDataType.WORD);
|
| | | TransBytes (out TreasuerInfoList[i].WishLibList[j].WishList[k].OutCnt, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public class tagMCTreasureWishLib {
|
| | | public ushort LibID; // 寻宝物品库ID
|
| | | public ushort OutCntTotal; // 本库累计产出心愿总次数
|
| | | public byte IsUseWishCard; // 是否勾选了自动使用心愿卡
|
| | | public byte WishCnt;
|
| | | public tagMCTreasureWish[] WishList; //已选心愿物品信息,只同步已选的
|
| | | }
|
| | |
|
| | | public class tagMCTreasureWish {
|
| | | public ushort WishID; // 寻宝物品库中的数据ID,注意不是库ID
|
| | | public byte OutCnt; // 该心愿物品已产出次数
|
| | | }
|
| | |
|
| | | public class tagMCTreasureTypeInfo {
|
| | |
| | | public uint TreasureCntAward; //累计寻宝次数对应奖励领奖状态,按奖励记录索引二进制记录是否已领取
|
| | | public byte GridLimitCnt;
|
| | | public tagMCTreasureGridLimit[] GridLimitCntList; //有限制抽取次数的格子次数信息
|
| | | public byte WishCnt;
|
| | | public tagMCTreasureWish[] WishList; //心愿物品信息
|
| | | }
|
| | |
|
| | | public class tagMCTreasureWish {
|
| | | public ushort WishID; // 寻宝物品库中的数据ID,注意不是库ID
|
| | | public byte OutCnt; // 做为心愿物品时已产出次数,有产出过的无法重新选择,未产出的可任意修改选择
|
| | | public byte WishLibCnt;
|
| | | public tagMCTreasureWishLib[] WishLibList; //心愿库信息
|
| | | }
|
| | |
|
| | | public class tagMCTreasureGridLimit {
|
| | |
| | | public Redpoint shWishRedpoint = new Redpoint(HappyXB_RedKey, XBHeroCallSH_RedKey);
|
| | | public Redpoint csWishRedpoint = new Redpoint(HappyXB_RedKey, XBHeroCallCS_RedKey);
|
| | |
|
| | | public const int wishMaxOutCnt = 1; //心愿最大出货数量,神话/传说各出一次
|
| | | public int selectWishQuality = 5; //心愿选中的品质
|
| | |
|
| | | public const int wishMaxOutCnt = 1; //心愿最大免费次数,神话/传说各出一次
|
| | |
|
| | | public int selectSHHeroWishID = 0; //心愿选中的神话武将心愿ID 客户端 -1代表取消
|
| | | public int selectCSHeroWishID = 0; //心愿选中的传说武将心愿ID 客户端 -1代表取消
|
| | |
| | |
|
| | | public int selectWishListTab = 0; //0:神话 1:传说 界面标签选择
|
| | |
|
| | | //匹配selectWishListTab
|
| | | public Dictionary<int, int> selectToLibIDDict = new Dictionary<int, int>()
|
| | | {
|
| | | { 0, 105 },
|
| | | { 1, 104 }
|
| | | };
|
| | |
|
| | | //心愿选中的武将ID
|
| | | public bool TryGetHeroWishIDByQuality(int type, int quality, out int wishID, out int wishCnt)
|
| | | public Dictionary<int, int> qualityToLibIDDict = new Dictionary<int, int>()
|
| | | {
|
| | | { 5, 105 },
|
| | | { 4, 104 }
|
| | | };
|
| | |
|
| | |
|
| | | //心愿选中的武将ID //心愿抽取情况 <LIBID:已抽到次数,是否勾选自动,当前心愿ID>
|
| | | public bool TryGetHeroWishIDByQuality(int type, int quality, out int wishID, out int wishCnt, out bool auto)
|
| | | {
|
| | | wishID = 0;
|
| | | wishCnt = 0;
|
| | | auto = false;
|
| | | var data = GetXBInfoByType((int)HappXBTitle.HeroCallAdvanced);
|
| | | if (data == null || data.wishCntDict.IsNullOrEmpty())
|
| | | {
|
| | | return false;
|
| | | }
|
| | | foreach (var id in data.wishCntDict.Keys)
|
| | | foreach (var info in data.wishCntDict.Values)
|
| | | {
|
| | | var id = info.wishID;
|
| | | if (id == 0)
|
| | | {
|
| | | continue;
|
| | |
| | | if (HeroConfig.Get(TreasureItemLibConfig.Get(id).ItemID).Quality == quality)
|
| | | {
|
| | | wishID = id;
|
| | | wishCnt = data.wishCntDict[id];
|
| | | wishCnt = info.wishCnt;
|
| | | auto = info.auto;
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsTodayWishFinish()
|
| | | //心愿抽取情况 <LIBID:已抽到次数,是否勾选自动,当前心愿ID>
|
| | | public XBWishInfo GetWishDataByQuality(int quality)
|
| | | {
|
| | | var data = GetXBInfoByType((int)HappXBTitle.HeroCallAdvanced);
|
| | | if (data == null || data.wishCntDict.IsNullOrEmpty())
|
| | | {
|
| | | return false;
|
| | | return null;
|
| | | }
|
| | | int wishCnt = 0;
|
| | | foreach (var id in data.wishCntDict.Keys)
|
| | | int libID = qualityToLibIDDict[quality];
|
| | | if (data.wishCntDict.ContainsKey(libID))
|
| | | {
|
| | | if (id == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | wishCnt += data.wishCntDict[id];
|
| | | return data.wishCntDict[libID];
|
| | | }
|
| | | if (wishCnt >= wishMaxOutCnt*2)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | return null;
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | |
|
| | | int wishID = 0;
|
| | | bool auto = false;
|
| | | int wishCnt = 0;
|
| | | if (!TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 5, out wishID, out wishCnt))
|
| | | if (!TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 5, out wishID, out wishCnt, out auto))
|
| | | {
|
| | | shWishRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | |
|
| | | if (!TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 4, out wishID, out wishCnt))
|
| | | if (!TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 4, out wishID, out wishCnt, out auto))
|
| | | {
|
| | | csWishRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | //获取心愿卡ID |
| | | /// <param name="quality">0 神话 1 传奇</param>
|
| | | public int GetWishCardItemID(int quality)
|
| | | {
|
| | | int libID = qualityToLibIDDict[quality];
|
| | | if (!TreasureSetConfig.Get((int)HappXBTitle.HeroCallAdvanced).WishLibCard.ContainsKey(libID))
|
| | | {
|
| | | Debug.LogError("GetWishCardItemID error: libID not found");
|
| | | return 0;
|
| | | }
|
| | | return TreasureSetConfig.Get((int)HappXBTitle.HeroCallAdvanced).WishLibCard[libID];
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | if (typeInfo.wishCntDict == null)
|
| | | {
|
| | | typeInfo.wishCntDict = new Dictionary<int, int>();
|
| | | typeInfo.wishCntDict = new Dictionary<int, XBWishInfo>();
|
| | | }
|
| | | typeInfo.wishCntDict.Clear();
|
| | | for (int j = 0; j < info.TreasuerInfoList[i].WishCnt; j++)
|
| | | for (int j = 0; j < info.TreasuerInfoList[i].WishLibCnt; j++)
|
| | | {
|
| | | int num = info.TreasuerInfoList[i].WishList[j].WishID;
|
| | | int cnt = info.TreasuerInfoList[i].WishList[j].OutCnt;
|
| | | typeInfo.wishCntDict[num] = cnt;
|
| | | int num = info.TreasuerInfoList[i].WishLibList[j].LibID;
|
| | | int wishID = 0;
|
| | | if (!info.TreasuerInfoList[i].WishLibList[j].WishList.IsNullOrEmpty())
|
| | | {
|
| | | wishID = info.TreasuerInfoList[i].WishLibList[j].WishList[0].WishID;
|
| | | }
|
| | | typeInfo.wishCntDict[num] = new XBWishInfo
|
| | | {
|
| | | wishCnt = info.TreasuerInfoList[i].WishLibList[j].OutCntTotal,
|
| | | auto = info.TreasuerInfoList[i].WishLibList[j].IsUseWishCard == 1,
|
| | | wishID = wishID
|
| | | };
|
| | | }
|
| | |
|
| | | xbTypeInfoDict.Add(info.TreasuerInfoList[i].TreasureType, typeInfo);
|
| | |
| | | }
|
| | |
|
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].wishCntDict.Clear();
|
| | | for (int j = 0; j < info.TreasuerInfoList[i].WishCnt; j++)
|
| | | for (int j = 0; j < info.TreasuerInfoList[i].WishLibCnt; j++)
|
| | | {
|
| | | int num = info.TreasuerInfoList[i].WishList[j].WishID;
|
| | | int cnt = info.TreasuerInfoList[i].WishList[j].OutCnt;
|
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].wishCntDict[num] = cnt;
|
| | | int num = info.TreasuerInfoList[i].WishLibList[j].LibID;
|
| | | int wishID = 0;
|
| | | if (!info.TreasuerInfoList[i].WishLibList[j].WishList.IsNullOrEmpty())
|
| | | {
|
| | | wishID = info.TreasuerInfoList[i].WishLibList[j].WishList[0].WishID;
|
| | | }
|
| | |
|
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].wishCntDict[num] = new XBWishInfo
|
| | | {
|
| | | wishCnt = info.TreasuerInfoList[i].WishLibList[j].OutCntTotal,
|
| | | auto = info.TreasuerInfoList[i].WishLibList[j].IsUseWishCard == 1,
|
| | | wishID = wishID
|
| | | };
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
|
| | | public class XBTypeInfo
|
| | | {
|
| | |
| | | public int treasureCountToday; //今日已寻宝总次数
|
| | | public int treasureCntAward; //累计寻宝次数对应奖励领奖状态,按奖励记录索引二进制记录是否已领取
|
| | | public Dictionary<int, int> gridLimitCntDict; //<有限制抽取次数的格子编号,已抽到次数> 有限制抽取次数的格子次数信息
|
| | | public Dictionary<int, int> wishCntDict; //心愿抽取情况 <心愿ID,已抽到次数>
|
| | | public Dictionary<int, XBWishInfo> wishCntDict; //心愿抽取情况 <LIBID:已抽到次数,是否勾选自动,当前心愿ID>
|
| | | }
|
| | |
|
| | | public class XBWishInfo
|
| | | {
|
| | | public int wishCnt;
|
| | | public bool auto;
|
| | | public int wishID;
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | public class XBGetItem
|
| | |
| | | [SerializeField] Image notOpenImg; |
| | | [SerializeField] Image addImg; |
| | | [SerializeField] Button addBtn; |
| | | [SerializeField] Transform tipRect; |
| | | [SerializeField] Text freeText; |
| | | [SerializeField] Text itemCntText; |
| | | [SerializeField] Image itemIcon; |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 显示心愿选择结果框 |
| | | /// </summary> |
| | | /// <param name="quality">5 神话 4 传奇</param> |
| | | /// <param name="addAction">默认打开心愿界面,可传入点击添加按钮事件 </param> |
| | | /// <param name="heroAction">默认打开心愿界面,可传入点击武将头像事件</param> |
| | | /// <param name="changeHeroID">预览英雄ID,-1取消预览</param> |
| | | public void Display(int quality, UnityAction<int> addAction = null, UnityAction<int> heroAction = null, int changeHeroID = 0) |
| | | { |
| | | var data = HappyXBModel.Instance.GetXBInfoByType((int)HappXBTitle.HeroCallAdvanced); |
| | | var config = TreasureSetConfig.Get((int)HappXBTitle.HeroCallAdvanced); |
| | | var needOpenCnt = config.WishOpen - data.treasureCount; |
| | | |
| | | bool headGray = false; |
| | | int itemID = HappyXBModel.Instance.GetWishCardItemID(quality); |
| | | //心愿抽取情况 <LIBID:已抽到次数,是否勾选自动,当前心愿ID> |
| | | var wishData = HappyXBModel.Instance.GetWishDataByQuality(quality); |
| | | |
| | | if (wishData.wishCnt < HappyXBModel.wishMaxOutCnt) |
| | | { |
| | | tipRect.SetActive(true); |
| | | freeText.SetActive(true); |
| | | itemCntText?.SetActive(false); |
| | | headGray = false; |
| | | } |
| | | else if (wishData.auto && PackManager.Instance.GetItemCountByID(PackType.Item, itemID) > 0) |
| | | { |
| | | if (itemCntText == null) |
| | | { |
| | | tipRect.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | tipRect.SetActive(true); |
| | | freeText.SetActive(false); |
| | | itemCntText.SetActive(true); |
| | | itemIcon.SetItemSprite(itemID); |
| | | itemCntText.text = UIHelper.ShowUseItem(PackType.Item, itemID, 1, bright: false); |
| | | } |
| | | headGray = false; |
| | | } |
| | | else |
| | | { |
| | | tipRect.SetActive(false); |
| | | headGray = true; |
| | | } |
| | | |
| | | |
| | | int wishID = 0; |
| | | bool auto = false; |
| | | int wishCnt = 0; |
| | | int heroID = 0; |
| | | if (needOpenCnt <= 0) |
| | |
| | | notOpenImg.SetActive(false); |
| | | |
| | | |
| | | if (HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, quality, out wishID, out wishCnt)) |
| | | if (HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, quality, out wishID, out wishCnt, out auto)) |
| | | { |
| | | if (heroAction == null) |
| | | { |
| | | heroAction = (quality) => |
| | | { |
| | | if (HappyXBModel.Instance.IsTodayWishFinish()) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroWishFinish"); |
| | | return; |
| | | } |
| | | // if (HappyXBModel.Instance.IsTodayWishFinish()) |
| | | // { |
| | | // SysNotifyMgr.Instance.ShowTip("HeroWishFinish"); |
| | | // return; |
| | | // } |
| | | |
| | | UIManager.Instance.OpenWindow<HeroCallHopeWin>(quality == 4 ? 1 : 0); |
| | | }; |
| | |
| | | { |
| | | head.SetActive(true); |
| | | addImg.SetActive(false); |
| | | head.Init(heroID, wishCnt >= HappyXBModel.wishMaxOutCnt, ()=> { heroAction.Invoke(quality); }); |
| | | head.Init(heroID, headGray, ()=> { heroAction.Invoke(quality); }); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | if (needOpenCnt <= 0) |
| | | { |
| | | if (HappyXBModel.Instance.IsTodayWishFinish()) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroWishFinish"); |
| | | return; |
| | | } |
| | | // if (HappyXBModel.Instance.IsTodayWishFinish()) |
| | | // { |
| | | // SysNotifyMgr.Instance.ShowTip("HeroWishFinish"); |
| | | // return; |
| | | // } |
| | | UIManager.Instance.OpenWindow<HeroCallHopeWin>(quality == 4 ? 1 : 0); |
| | | return; |
| | | } |
| | |
| | | return; |
| | | } |
| | | int quality = HappyXBModel.Instance.selectWishListTab == 0 ? 5 : 4; |
| | | if (HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, quality, out int _wishID, out int _wishCnt)) |
| | | if (HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, quality, out int _wishID, out int _wishCnt, out bool auto)) |
| | | { |
| | | if (_wishCnt >= HappyXBModel.wishMaxOutCnt) |
| | | { |
| | |
| | | [SerializeField] GroupButtonEx csBtn; |
| | | [SerializeField] Button cancleBtn; |
| | | [SerializeField] Button confirmBtn; |
| | | |
| | | [SerializeField] Toggle autoToggle1; |
| | | [SerializeField] Text itemCntText1; |
| | | [SerializeField] Image itemIcon1; |
| | | [SerializeField] Toggle autoToggle2; |
| | | [SerializeField] Text itemCntText2; |
| | | [SerializeField] Image itemIcon2; |
| | | |
| | | |
| | | Dictionary<int, int> qualityLibIDDict = new Dictionary<int, int>() |
| | | { |
| | | { 0, 105 }, |
| | | { 1, 104 } |
| | | }; |
| | | |
| | | |
| | | |
| | | protected override void InitComponent() |
| | |
| | | HappyXBModel.Instance.RefreshXBTypeInfoAct += RefreshXBTypeInfo; |
| | | HappyXBModel.Instance.OnSelectWishHeroEvent += OnSelectWishHeroEvent; |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 5, out HappyXBModel.Instance.selectSHHeroWishID, out int shWishCnt); |
| | | HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 4, out HappyXBModel.Instance.selectCSHeroWishID, out int csWishCnt); |
| | | HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 5, out HappyXBModel.Instance.selectSHHeroWishID, out int shWishCnt, out bool shAuto); |
| | | HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 4, out HappyXBModel.Instance.selectCSHeroWishID, out int csWishCnt, out bool cqAuto); |
| | | |
| | | tip.text = Language.Get("HeroCall7", HappyXBModel.wishMaxOutCnt); |
| | | Display(); |
| | |
| | | { |
| | | csBtn.SelectBtn(); |
| | | } |
| | | ShowToggle(); |
| | | } |
| | | |
| | | void ShowToggle() |
| | | { |
| | | var shData = HappyXBModel.Instance.GetWishDataByQuality(5); |
| | | int itemID = HappyXBModel.Instance.GetWishCardItemID(5); |
| | | autoToggle1.isOn = shData.auto; |
| | | itemIcon1.SetItemSprite(itemID); |
| | | itemCntText1.text = UIHelper.ShowUseItem(PackType.Item, itemID, 1); |
| | | |
| | | var csData = HappyXBModel.Instance.GetWishDataByQuality(4); |
| | | itemID = HappyXBModel.Instance.GetWishCardItemID(4); |
| | | autoToggle2.isOn = csData.auto; |
| | | itemIcon2.SetItemSprite(itemID); |
| | | itemCntText2.text = UIHelper.ShowUseItem(PackType.Item, itemID, 1); |
| | | } |
| | | |
| | | void CreateScroller() |
| | | { |
| | | int libID = qualityLibIDDict[HappyXBModel.Instance.selectWishListTab]; |
| | | int libID = HappyXBModel.Instance.selectToLibIDDict[HappyXBModel.Instance.selectWishListTab]; |
| | | if (!TreasureSetConfig.Get((int)HappXBTitle.HeroCallAdvanced).WishLibSelect.ContainsKey(libID)) |
| | | { |
| | | Debug.LogError("寻宝库ID变更,程序请核对qualityLibIDDict"); |
| | |
| | | |
| | | void RefreshXBTypeInfo() |
| | | { |
| | | HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 5, out HappyXBModel.Instance.selectSHHeroWishID, out int shWishCnt); |
| | | HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 4, out HappyXBModel.Instance.selectCSHeroWishID, out int csWishCnt); |
| | | HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 5, out HappyXBModel.Instance.selectSHHeroWishID, out int shWishCnt, out bool shAuto); |
| | | HappyXBModel.Instance.TryGetHeroWishIDByQuality((int)HappXBTitle.HeroCallAdvanced, 4, out HappyXBModel.Instance.selectCSHeroWishID, out int csWishCnt, out bool cqAuto); |
| | | Display(); |
| | | } |
| | | |
| | |
| | | } |
| | | var pack = new CA569_tagCSTreasureWishSelect(); |
| | | pack.TreasureType = (int)HappXBTitle.HeroCallAdvanced; |
| | | |
| | | |
| | | pack.WishIDList = new uint[] { (uint)Math.Max(0, HappyXBModel.Instance.selectSHHeroWishID), (uint)Math.Max(0, HappyXBModel.Instance.selectCSHeroWishID) }; |
| | | pack.WishCnt = 2; |
| | | pack.WishCardUseLibIDList = new ushort[] { |
| | | (ushort)(autoToggle1.isOn ? HappyXBModel.Instance.qualityToLibIDDict[5] : 0), |
| | | (ushort)(autoToggle2.isOn ? HappyXBModel.Instance.qualityToLibIDDict[4] : 0) |
| | | }; |
| | | pack.WishCardUseCnt = (byte)pack.WishCardUseLibIDList.Length; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | CloseWindow(); |
| | | } |
| | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<HeroCallHopeLineCell>(); |
| | | _cell.Display(qualityLibIDDict[HappyXBModel.Instance.selectWishListTab], cell.index); |
| | | _cell.Display(HappyXBModel.Instance.selectToLibIDDict[HappyXBModel.Instance.selectWishListTab], cell.index); |
| | | |
| | | } |
| | | |
| | |
| | | return AppendColor(useCnt <= cnt ? TextColType.Green : TextColType.Red, $"{cnt}/{useCnt}"); |
| | | } |
| | | |
| | | public static string ShowUseItem(PackType type, int itemId, long useCnt, bool showLargeNum = false) |
| | | public static string ShowUseItem(PackType type, int itemId, long useCnt, bool showLargeNum = false, bool bright = true) |
| | | { |
| | | long cnt = PackManager.Instance.GetItemCountByID(type, itemId); |
| | | if (showLargeNum) |
| | | return AppendColor(useCnt <= cnt ? TextColType.Green : TextColType.Red, $"{ReplaceLargeNum(cnt)}/{useCnt}"); |
| | | return AppendColor(useCnt <= cnt ? TextColType.Green : TextColType.Red, $"{ReplaceLargeNum(cnt)}/{useCnt}", bright); |
| | | else |
| | | return AppendColor(useCnt <= cnt ? TextColType.Green : TextColType.Red, $"{cnt}/{useCnt}"); |
| | | return AppendColor(useCnt <= cnt ? TextColType.Green : TextColType.Red, $"{cnt}/{useCnt}", bright); |
| | | } |
| | | |
| | | |