Merge branch 'master' into ILRuntime
| | |
| | | Register(typeof(HAA42_tagMCFeastLoginInfo), typeof(DTCAA42_tagMCFeastLoginInfo));
|
| | | Register(typeof(HAA39_tagMCFeastLoginPlayerInfo), typeof(DTCAA39_tagMCFeastLoginPlayerInfo));
|
| | |
|
| | | Register(typeof(HAA43_tagMCFeastWishInfo), typeof(DTCAA43_tagMCFeastWishInfo));
|
| | | Register(typeof(HAA44_tagMCFeastWishPlayerInfo), typeof(DTCAA44_tagMCFeastWishPlayerInfo));
|
| | | Register(typeof(HAA45_tagMCFeastWishResult), typeof(DTCAA45_tagMCFeastWishResult));
|
| | | Register(typeof(HAA46_tagMCFeastTravelInfo), typeof(DTCAA46_tagMCFeastTravelInfo));
|
| | | Register(typeof(HAA47_tagMCFeastTravelPlayerInfo), typeof(DTCAA47_tagMCFeastTravelPlayerInfo));
|
| | | #endregion
|
| | | }
|
| | |
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: 2021年2月23日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public partial class ActFeastTravelTaskConfig |
| | | { |
| | | |
| | | public readonly int TraveTasklD; |
| | | public readonly string TaskDes; |
| | | public readonly int FuncID; |
| | | public readonly int JumpId; |
| | | public readonly string IconKey; |
| | | |
| | | public ActFeastTravelTaskConfig() |
| | | { |
| | | } |
| | | |
| | | public ActFeastTravelTaskConfig(string input) |
| | | { |
| | | try |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out TraveTasklD); |
| | | |
| | | TaskDes = tables[1]; |
| | | |
| | | int.TryParse(tables[2],out FuncID); |
| | | |
| | | int.TryParse(tables[3],out JumpId); |
| | | |
| | | IconKey = tables[4]; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | static Dictionary<string, ActFeastTravelTaskConfig> configs = new Dictionary<string, ActFeastTravelTaskConfig>(); |
| | | public static ActFeastTravelTaskConfig Get(string id) |
| | | { |
| | | if (!inited) |
| | | { |
| | | Debug.Log("ActFeastTravelTaskConfig 还未完成初始化。"); |
| | | return null; |
| | | } |
| | | |
| | | if (configs.ContainsKey(id)) |
| | | { |
| | | return configs[id]; |
| | | } |
| | | |
| | | ActFeastTravelTaskConfig config = null; |
| | | if (rawDatas.ContainsKey(id)) |
| | | { |
| | | config = configs[id] = new ActFeastTravelTaskConfig(rawDatas[id]); |
| | | rawDatas.Remove(id); |
| | | } |
| | | |
| | | return config; |
| | | } |
| | | |
| | | public static ActFeastTravelTaskConfig Get(int id) |
| | | { |
| | | return Get(id.ToString()); |
| | | } |
| | | |
| | | public static List<string> GetKeys() |
| | | { |
| | | var keys = new List<string>(); |
| | | keys.AddRange(configs.Keys); |
| | | keys.AddRange(rawDatas.Keys); |
| | | return keys; |
| | | } |
| | | |
| | | public static List<ActFeastTravelTaskConfig> GetValues() |
| | | { |
| | | var values = new List<ActFeastTravelTaskConfig>(); |
| | | values.AddRange(configs.Values); |
| | | |
| | | var keys = new List<string>(rawDatas.Keys); |
| | | foreach (var key in keys) |
| | | { |
| | | values.Add(Get(key)); |
| | | } |
| | | |
| | | return values; |
| | | } |
| | | |
| | | public static bool Has(string id) |
| | | { |
| | | return configs.ContainsKey(id) || rawDatas.ContainsKey(id); |
| | | } |
| | | |
| | | public static bool Has(int id) |
| | | { |
| | | return Has(id.ToString()); |
| | | } |
| | | |
| | | public static bool inited { get; private set; } |
| | | protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>(); |
| | | public static void Init(bool sync=false) |
| | | { |
| | | inited = false; |
| | | var path = string.Empty; |
| | | if (AssetSource.refdataFromEditor) |
| | | { |
| | | path = ResourcesPath.CONFIG_FODLER +"/ActFeastTravelTask.txt"; |
| | | } |
| | | else |
| | | { |
| | | path = AssetVersionUtility.GetAssetFilePath("config/ActFeastTravelTask.txt"); |
| | | } |
| | | |
| | | configs.Clear(); |
| | | var tempConfig = new ActFeastTravelTaskConfig(); |
| | | var preParse = tempConfig is IConfigPostProcess; |
| | | |
| | | if (sync) |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new ActFeastTravelTaskConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | inited = true; |
| | | } |
| | | else |
| | | { |
| | | ThreadPool.QueueUserWorkItem((object _object) => |
| | | { |
| | | var lines = File.ReadAllLines(path); |
| | | if (!preParse) |
| | | { |
| | | rawDatas = new Dictionary<string, string>(lines.Length - 3); |
| | | } |
| | | for (int i = 3; i < lines.Length; i++) |
| | | { |
| | | try |
| | | { |
| | | var line = lines[i]; |
| | | var index = line.IndexOf("\t"); |
| | | if (index == -1) |
| | | { |
| | | continue; |
| | | } |
| | | var id = line.Substring(0, index); |
| | | |
| | | if (preParse) |
| | | { |
| | | var config = new ActFeastTravelTaskConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | |
| | | inited = true; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0e8f016e7a9d6c441b35c4545ba503e3 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 10 节日祝福瓶选择奖励物品 #tagCMFeastWishBottleChooseItem |
| | | |
| | | public class CAA10_tagCMFeastWishBottleChooseItem : GameNetPackBasic { |
| | | public byte BottleNum; //瓶子编号 |
| | | public byte RecordIndex; //物品索引,用于选择及记录是否已选择 |
| | | |
| | | public CAA10_tagCMFeastWishBottleChooseItem () { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xAA10; |
| | | } |
| | | |
| | | public override void WriteToBytes () { |
| | | WriteBytes (BottleNum, NetDataType.BYTE); |
| | | WriteBytes (RecordIndex, NetDataType.BYTE); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 32de00e5247cfb842bf56a52aac81b2d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 11 节日祝福池祝福 #tagCMFeastWishPoolWish |
| | | |
| | | public class CAA11_tagCMFeastWishPoolWish : GameNetPackBasic { |
| | | public byte WishCount; //祝福次数 |
| | | |
| | | public CAA11_tagCMFeastWishPoolWish () { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xAA11; |
| | | } |
| | | |
| | | public override void WriteToBytes () { |
| | | WriteBytes (WishCount, NetDataType.BYTE); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6395715942de8c4468c36b2e8802649d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | var package = vNetPack as HAA1C_tagMCTotalRechargePlayerInfo;
|
| | | ModelCenter.Instance.GetModel<AccumulateRechargeModel>().UpdateAccumulateRecharge(package);
|
| | | ModelCenter.Instance.GetModel<DaysAccumulateRechargeModel>().UpdateAccumulateRecharge(package);
|
| | | ModelCenter.Instance.GetModel<HolidayMultiRechargeModel>().UpdateAccumulateRecharge(package);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using Snxxz.UI; |
| | | // AA 43 节日祝福活动信息 #tagMCFeastWishInfo |
| | | |
| | | public class DTCAA43_tagMCFeastWishInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HAA43_tagMCFeastWishInfo vNetData = vNetPack as HAA43_tagMCFeastWishInfo; |
| | | |
| | | OperationTimeHepler.Instance.UpdateHolidayWish(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6389daba18ea32b42bdfd2acda521382 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using Snxxz.UI; |
| | | |
| | | // AA 44 节日祝福活动玩家信息 #tagMCFeastWishPlayerInfo |
| | | |
| | | public class DTCAA44_tagMCFeastWishPlayerInfo : DtcBasic { |
| | | |
| | | HolidayWishPoolModel model { get { return ModelCenter.Instance.GetModel<HolidayWishPoolModel>(); } } |
| | | |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HAA44_tagMCFeastWishPlayerInfo vNetData = vNetPack as HAA44_tagMCFeastWishPlayerInfo; |
| | | |
| | | model.UpdateInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0f40199dfd060cf49ae1ec192afa4bdc |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using Snxxz.UI; |
| | | |
| | | // AA 45 节日祝福祝福结果 #tagMCFeastWishResult |
| | | |
| | | public class DTCAA45_tagMCFeastWishResult : DtcBasic { |
| | | |
| | | HolidayWishPoolModel model { get { return ModelCenter.Instance.GetModel<HolidayWishPoolModel>(); } } |
| | | |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HAA45_tagMCFeastWishResult vNetData = vNetPack as HAA45_tagMCFeastWishResult; |
| | | |
| | | model.OnAddWish(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73804b4fa0de1464da68194ab7d2c990 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using Snxxz.UI; |
| | | |
| | | // AA 46 节日游历活动信息 #tagMCFeastTravelInfo |
| | | |
| | | public class DTCAA46_tagMCFeastTravelInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HAA46_tagMCFeastTravelInfo vNetData = vNetPack as HAA46_tagMCFeastTravelInfo; |
| | | |
| | | OperationTimeHepler.Instance.UpdateHolidayTravel(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4d05cc65418f5a24fa1de5a55683b240 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using Snxxz.UI; |
| | | // AA 47 节日游历活动玩家信息 #tagMCFeastTravelPlayerInfo |
| | | |
| | | public class DTCAA47_tagMCFeastTravelPlayerInfo : DtcBasic { |
| | | |
| | | HolidayTravelModel model { get { return ModelCenter.Instance.GetModel<HolidayTravelModel>(); } } |
| | | |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HAA47_tagMCFeastTravelPlayerInfo vNetData = vNetPack as HAA47_tagMCFeastTravelPlayerInfo; |
| | | model.OnPlayerTravelInfo(vNetData); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6c2d194c7901ed544aa0579c4f8a825a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | for (int i = 0; i < ExchangeCount; i ++) { |
| | | ExchangeItemList[i] = new tagMCActCollectWordsExchangeItem(); |
| | | TransBytes (out ExchangeItemList[i].ExchangeNum, vBytes, NetDataType.BYTE); |
| | | TransBytes (out ExchangeItemList[i].ExchangeCountMax, vBytes, NetDataType.BYTE); |
| | | TransBytes (out ExchangeItemList[i].ExchangeCountMax, vBytes, NetDataType.WORD); |
| | | TransBytes (out ExchangeItemList[i].ItemID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out ExchangeItemList[i].ItemCount, vBytes, NetDataType.WORD); |
| | | TransBytes (out ExchangeItemList[i].IsBind, vBytes, NetDataType.BYTE); |
| | |
| | | |
| | | public struct tagMCActCollectWordsExchangeItem { |
| | | public byte ExchangeNum; //兑换编号 |
| | | public byte ExchangeCountMax; //最大兑换次数,0不限制 |
| | | public ushort ExchangeCountMax; //最大兑换次数,0不限制 |
| | | public uint ItemID; //目标物品 |
| | | public ushort ItemCount; |
| | | public byte IsBind; |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 43 节日祝福活动信息 #tagMCFeastWishInfo |
| | | |
| | | public class HAA43_tagMCFeastWishInfo : GameNetPackBasic { |
| | | public string StartDate; // 开始日期 y-m-d |
| | | public string EndtDate; // 结束日期 y-m-d |
| | | public byte ResetType; // 重置类型,0-0点重置;1-5点开,5点重置;2-5点开,0点重置 |
| | | public byte WishPoolShowCount; //祝福池展示物品数 |
| | | public uint[] WishPoolShowItemList; //祝福池展示物品ID列表 |
| | | public byte BottleCount; // 祝福瓶个数 |
| | | public tagMCFeastWishBottleInfo[] BottleInfoList; // 祝福瓶信息 |
| | | |
| | | public HAA43_tagMCFeastWishInfo () { |
| | | _cmd = (ushort)0xAA43; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out StartDate, vBytes, NetDataType.Chars, 10); |
| | | TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10); |
| | | TransBytes (out ResetType, vBytes, NetDataType.BYTE); |
| | | TransBytes (out WishPoolShowCount, vBytes, NetDataType.BYTE); |
| | | TransBytes (out WishPoolShowItemList, vBytes, NetDataType.DWORD, WishPoolShowCount); |
| | | TransBytes (out BottleCount, vBytes, NetDataType.BYTE); |
| | | BottleInfoList = new tagMCFeastWishBottleInfo[BottleCount]; |
| | | for (int i = 0; i < BottleCount; i ++) { |
| | | BottleInfoList[i] = new tagMCFeastWishBottleInfo(); |
| | | TransBytes (out BottleInfoList[i].BottleNum, vBytes, NetDataType.BYTE); |
| | | TransBytes (out BottleInfoList[i].NeedWishValue, vBytes, NetDataType.WORD); |
| | | TransBytes (out BottleInfoList[i].ChooseTimeMax, vBytes, NetDataType.BYTE); |
| | | TransBytes (out BottleInfoList[i].ChoosePrizeCount, vBytes, NetDataType.BYTE); |
| | | BottleInfoList[i].ChoosePrizeList = new tagMCFeastWishBottleItem[BottleInfoList[i].ChoosePrizeCount]; |
| | | for (int j = 0; j < BottleInfoList[i].ChoosePrizeCount; j ++) { |
| | | BottleInfoList[i].ChoosePrizeList[j] = new tagMCFeastWishBottleItem(); |
| | | TransBytes (out BottleInfoList[i].ChoosePrizeList[j].RecordIndex, vBytes, NetDataType.BYTE); |
| | | TransBytes (out BottleInfoList[i].ChoosePrizeList[j].ItemID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out BottleInfoList[i].ChoosePrizeList[j].ItemCount, vBytes, NetDataType.WORD); |
| | | TransBytes (out BottleInfoList[i].ChoosePrizeList[j].IsBind, vBytes, NetDataType.BYTE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public struct tagMCFeastWishBottleInfo { |
| | | public byte BottleNum; //瓶子编号 |
| | | public ushort NeedWishValue; //单次领奖所需祝福值 |
| | | public byte ChooseTimeMax; //最大可领奖次数 |
| | | public byte ChoosePrizeCount; //可选择奖励个数 |
| | | public tagMCFeastWishBottleItem[] ChoosePrizeList; // 选择奖励物品列表,已选过的无法再选 |
| | | } |
| | | |
| | | public struct tagMCFeastWishBottleItem { |
| | | public byte RecordIndex; //物品索引,用于选择及记录是否已选择 |
| | | public uint ItemID; |
| | | public ushort ItemCount; |
| | | public byte IsBind; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 493eeebd8fe9f8647a73248300a6bf63 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 44 节日祝福活动玩家信息 #tagMCFeastWishPlayerInfo |
| | | |
| | | public class HAA44_tagMCFeastWishPlayerInfo : GameNetPackBasic { |
| | | public byte BottleCount; // 祝福瓶个数 |
| | | public tagMCFeastWishPlayerBottle[] PlayerBottleInfo; // 祝福瓶信息 |
| | | |
| | | public HAA44_tagMCFeastWishPlayerInfo () { |
| | | _cmd = (ushort)0xAA44; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out BottleCount, vBytes, NetDataType.BYTE); |
| | | PlayerBottleInfo = new tagMCFeastWishPlayerBottle[BottleCount]; |
| | | for (int i = 0; i < BottleCount; i ++) { |
| | | PlayerBottleInfo[i] = new tagMCFeastWishPlayerBottle(); |
| | | TransBytes (out PlayerBottleInfo[i].BottleNum, vBytes, NetDataType.BYTE); |
| | | TransBytes (out PlayerBottleInfo[i].WishValue, vBytes, NetDataType.WORD); |
| | | TransBytes (out PlayerBottleInfo[i].ChooseRecord, vBytes, NetDataType.DWORD); |
| | | } |
| | | } |
| | | |
| | | public struct tagMCFeastWishPlayerBottle { |
| | | public byte BottleNum; //瓶子编号 |
| | | public ushort WishValue; //当前可用祝福值 |
| | | public uint ChooseRecord; //已选物品索引记录,与记录索引位运算判断是否已选择;累计已选择次数前端自己计算,通过该值可算出 |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: bbf6572f0f3ef834b95a2810b7b86847 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 45 节日祝福祝福结果 #tagMCFeastWishResult |
| | | |
| | | public class HAA45_tagMCFeastWishResult : GameNetPackBasic { |
| | | public ushort AddWishValue; // 本次增加的祝福值 |
| | | public ushort WishResultLen; |
| | | public string WishResult; // 获得物品结果[[物品ID,个数,是否绑定], ...] |
| | | |
| | | public HAA45_tagMCFeastWishResult () { |
| | | _cmd = (ushort)0xAA45; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out AddWishValue, vBytes, NetDataType.WORD); |
| | | TransBytes (out WishResultLen, vBytes, NetDataType.WORD); |
| | | TransBytes (out WishResult, vBytes, NetDataType.Chars, WishResultLen); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0ce5b0f0805bebe49ba639bc0022ea72 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 46 节日游历活动信息 #tagMCFeastTravelInfo |
| | | |
| | | public class HAA46_tagMCFeastTravelInfo : GameNetPackBasic { |
| | | public string StartDate; // 开始日期 y-m-d |
| | | public string EndtDate; // 结束日期 y-m-d |
| | | public byte ResetType; // 重置类型,0-0点重置;1-5点开,5点重置;2-5点开,0点重置 |
| | | public byte TravelTaskCount; // 游历任务数 |
| | | public tagMCFeastTravelTask[] TravelTaskList; //游历任务信息列表 |
| | | public byte TravelAwardCount; // 游历奖励数 |
| | | public tagMCFeastTravelAward[] TravelAwardList; //游历奖励信息列表 |
| | | |
| | | public HAA46_tagMCFeastTravelInfo () { |
| | | _cmd = (ushort)0xAA46; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out StartDate, vBytes, NetDataType.Chars, 10); |
| | | TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10); |
| | | TransBytes (out ResetType, vBytes, NetDataType.BYTE); |
| | | TransBytes (out TravelTaskCount, vBytes, NetDataType.BYTE); |
| | | TravelTaskList = new tagMCFeastTravelTask[TravelTaskCount]; |
| | | for (int i = 0; i < TravelTaskCount; i ++) { |
| | | TravelTaskList[i] = new tagMCFeastTravelTask(); |
| | | TransBytes (out TravelTaskList[i].TravelTaskID, vBytes, NetDataType.BYTE); |
| | | TransBytes (out TravelTaskList[i].FinishNeedValue, vBytes, NetDataType.WORD); |
| | | TransBytes (out TravelTaskList[i].FinishTimeMax, vBytes, NetDataType.WORD); |
| | | TransBytes (out TravelTaskList[i].AddTravelPoint, vBytes, NetDataType.WORD); |
| | | } |
| | | TransBytes (out TravelAwardCount, vBytes, NetDataType.BYTE); |
| | | TravelAwardList = new tagMCFeastTravelAward[TravelAwardCount]; |
| | | for (int i = 0; i < TravelAwardCount; i ++) { |
| | | TravelAwardList[i] = new tagMCFeastTravelAward(); |
| | | TransBytes (out TravelAwardList[i].AwardIndex, vBytes, NetDataType.BYTE); |
| | | TransBytes (out TravelAwardList[i].NeedTravelPoint, vBytes, NetDataType.WORD); |
| | | TransBytes (out TravelAwardList[i].AwardCountMax, vBytes, NetDataType.WORD); |
| | | TransBytes (out TravelAwardList[i].AwardItemCount, vBytes, NetDataType.BYTE); |
| | | TravelAwardList[i].AwardItemList = new tagMCFeastTravelAwardItem[TravelAwardList[i].AwardItemCount]; |
| | | for (int j = 0; j < TravelAwardList[i].AwardItemCount; j ++) { |
| | | TravelAwardList[i].AwardItemList[j] = new tagMCFeastTravelAwardItem(); |
| | | TransBytes (out TravelAwardList[i].AwardItemList[j].ItemID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out TravelAwardList[i].AwardItemList[j].ItemCount, vBytes, NetDataType.WORD); |
| | | TransBytes (out TravelAwardList[i].AwardItemList[j].IsBind, vBytes, NetDataType.BYTE); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public struct tagMCFeastTravelTask { |
| | | public byte TravelTaskID; //游历任务ID |
| | | public ushort FinishNeedValue; //单次完成所需进度 |
| | | public ushort FinishTimeMax; //最大可完成次数,0代表不限 |
| | | public ushort AddTravelPoint; //单次完成获得游历值 |
| | | } |
| | | |
| | | public struct tagMCFeastTravelAwardItem { |
| | | public uint ItemID; |
| | | public ushort ItemCount; |
| | | public byte IsBind; |
| | | } |
| | | |
| | | public struct tagMCFeastTravelAward { |
| | | public byte AwardIndex; //游历奖励索引 |
| | | public ushort NeedTravelPoint; //单次领奖所需游历值 |
| | | public ushort AwardCountMax; //最大可领取次数,0代表不限 |
| | | public byte AwardItemCount; //奖励物品数 |
| | | public tagMCFeastTravelAwardItem[] AwardItemList; //奖励物品列表 |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 841617357b5f2c54e8c09cf49436217f |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 47 节日游历活动玩家信息 #tagMCFeastTravelPlayerInfo |
| | | |
| | | public class HAA47_tagMCFeastTravelPlayerInfo : GameNetPackBasic { |
| | | public uint TravelPoint; //当前总游历值,一直累加,不会扣的 |
| | | public byte TravelPlayerTaskCount; // 游历任务数,不一定有同步,有同步数据则替换即可 |
| | | public tagMCFeastTravelPlayerTask[] TravelPlayerTaskList; //游历任务信息列表 |
| | | public byte TravelPlayerAwardCount; // 游历奖励数,不一定有同步,有同步数据则替换即可 |
| | | public tagMCFeastTravelPlayerAward[] TravelPlayerAwardList; //游历奖励信息列表 |
| | | |
| | | public HAA47_tagMCFeastTravelPlayerInfo () { |
| | | _cmd = (ushort)0xAA47; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out TravelPoint, vBytes, NetDataType.DWORD); |
| | | TransBytes (out TravelPlayerTaskCount, vBytes, NetDataType.BYTE); |
| | | TravelPlayerTaskList = new tagMCFeastTravelPlayerTask[TravelPlayerTaskCount]; |
| | | for (int i = 0; i < TravelPlayerTaskCount; i ++) { |
| | | TravelPlayerTaskList[i] = new tagMCFeastTravelPlayerTask(); |
| | | TransBytes (out TravelPlayerTaskList[i].TravelTaskID, vBytes, NetDataType.BYTE); |
| | | TransBytes (out TravelPlayerTaskList[i].TravelValue, vBytes, NetDataType.DWORD); |
| | | TransBytes (out TravelPlayerTaskList[i].FinishCount, vBytes, NetDataType.BYTE); |
| | | } |
| | | TransBytes (out TravelPlayerAwardCount, vBytes, NetDataType.BYTE); |
| | | TravelPlayerAwardList = new tagMCFeastTravelPlayerAward[TravelPlayerAwardCount]; |
| | | for (int i = 0; i < TravelPlayerAwardCount; i ++) { |
| | | TravelPlayerAwardList[i] = new tagMCFeastTravelPlayerAward(); |
| | | TransBytes (out TravelPlayerAwardList[i].AwardIndex, vBytes, NetDataType.BYTE); |
| | | TransBytes (out TravelPlayerAwardList[i].GetAwardCount, vBytes, NetDataType.BYTE); |
| | | } |
| | | } |
| | | |
| | | public struct tagMCFeastTravelPlayerAward { |
| | | public byte AwardIndex; //游历奖励索引 |
| | | public byte GetAwardCount; //已领取次数;前端判断是否可领取: 总游历值 >= (已领取次数 + 1) * 单次所需游历值 |
| | | } |
| | | |
| | | public struct tagMCFeastTravelPlayerTask { |
| | | public byte TravelTaskID; //游历任务ID |
| | | public uint TravelValue; //当前进度值,一直累加 |
| | | public byte FinishCount; //当前已完成次数; 前端计算未完成次数的进度值=max(0, 当前进度值 - (完成次数 * 单次所需进度)) |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 620a5671b06eb5a40aa7caaab6c077b4 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | OperationTimeHepler.Instance.TryGetOperation(Operation.HolidayLogin, out holiday); |
| | | redPoint.state = RedPointState.None; |
| | | |
| | | if (holiday == null) return; //封包顺序如果有问题 此处为空 |
| | | |
| | | for (int i = 0; i < holiday.loginAwards.Count; i++) |
| | | { |
| | | if (GetLoginAwardState(holiday.loginAwards[i].DayNum) == 1) |
| New file |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | namespace Snxxz.UI |
| | | { |
| | | public class HolidayMultiRechargeModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity |
| | | { |
| | | public const int redPointID = 28003; |
| | | public Redpoint redpoint = new Redpoint(MainRedDot.RedPoint_HolidayWishes, redPointID); |
| | | public Operation operationType = Operation.HolidayMultiRecharge; |
| | | |
| | | //节日祝福 id从101开始和精彩活动区分 |
| | | public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_JRZF; |
| | | public const int activityID = 103; |
| | | public bool IsOpen |
| | | { |
| | | get |
| | | { |
| | | return OperationTimeHepler.Instance.SatisfyOpenCondition(operationType); |
| | | } |
| | | } |
| | | |
| | | public bool IsAdvance |
| | | { |
| | | get |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public bool priorityOpen |
| | | { |
| | | get { return redpoint.state == RedPointState.Simple; } |
| | | } |
| | | |
| | | public event Action accumulateRechargeUpdate; |
| | | public event Action<int> onStateUpdate; |
| | | |
| | | public override void Init() |
| | | { |
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent; |
| | | OperationTimeHepler.Instance.dayResetEvent += DayResetEvent; |
| | | OpenServerActivityCenter.Instance.Register(activityID, this, activityType); |
| | | } |
| | | |
| | | public void OnBeforePlayerDataInitialize() |
| | | { |
| | | rechargeTotal = 0; |
| | | getRewardRecord = 0; |
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | public override void UnInit() |
| | | { |
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent; |
| | | OperationTimeHepler.Instance.dayResetEvent -= DayResetEvent; |
| | | } |
| | | |
| | | private void DayResetEvent(int resetType) |
| | | { |
| | | OperationBase operationBase; |
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(operationType, out operationBase)) |
| | | { |
| | | if (resetType == operationBase.resetType) |
| | | { |
| | | UpdateRedpoint(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OperationEndEvent(Operation operation, int state) |
| | | { |
| | | if (operation == operationType && state == 0) |
| | | { |
| | | UpdateRedpoint(); |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OperationStartEvent(Operation operation, int state) |
| | | { |
| | | if (operation == operationType && state == 0) |
| | | { |
| | | UpdateRedpoint(); |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | #region 服务端数据 |
| | | public uint rechargeTotal { get; private set; } //充值总额 |
| | | public uint getRewardRecord { get; private set; } //领取记录 |
| | | public uint ActNum { get; private set; } //累充类型 对应界面 |
| | | public void UpdateAccumulateRecharge(HAA1C_tagMCTotalRechargePlayerInfo package) |
| | | { |
| | | OperationBase operationBase; |
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(operationType, out operationBase)) |
| | | { |
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge; |
| | | if (operation.ActNum != package.ActNum) |
| | | { |
| | | return; |
| | | } |
| | | ActNum = package.ActNum; |
| | | rechargeTotal = package.GoldTotal; |
| | | getRewardRecord = package.AwardRecord; |
| | | UpdateRedpoint(); |
| | | if (accumulateRechargeUpdate != null) |
| | | { |
| | | accumulateRechargeUpdate(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //判断是否已领取 |
| | | public bool IsRewardGot(OperationAccumulateRecharge.Recharge recharge) |
| | | { |
| | | if (recharge != null) |
| | | { |
| | | return IsRewardGot(recharge.index); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | bool IsRewardGot(int index) |
| | | { |
| | | return (getRewardRecord & (1 << index)) != 0; |
| | | } |
| | | |
| | | // 累充中存在任意充值档位,独立界面处理,指定判断充值额度为0.01(requireGold=1) |
| | | // isAnyRecharge 判断是否任意充值档 |
| | | public bool SatisfyGetReward(OperationAccumulateRecharge.Recharge recharge, bool isAnyRecharge = false) |
| | | { |
| | | if (!IsOpen) |
| | | { |
| | | return false; |
| | | } |
| | | if (IsRewardGot(recharge)) |
| | | { |
| | | return false; |
| | | } |
| | | if (rechargeTotal >= recharge.requireGold) |
| | | { |
| | | if (isAnyRecharge == true && recharge.requireGold != 1) |
| | | { |
| | | //没有任意充值档位 |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | //判断是否有任意档位 |
| | | //累充中存在任意充值档位,独立界面处理,指定判断充值额度为0.01(requireGold=1) |
| | | public bool hasAnyRecharge() |
| | | { |
| | | OperationBase operationBase; |
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(operationType, out operationBase)) |
| | | { |
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge; |
| | | var reward = operation.GetReward(TimeUtility.ServerNow); |
| | | if (reward != null) |
| | | { |
| | | if (reward.recharges.Count > 0) |
| | | { |
| | | var recharge = reward.recharges[0]; |
| | | if (recharge.requireGold == 1) |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | //领取奖励封包 |
| | | public void GetAccumulateRechargeReward(OperationAccumulateRecharge.Recharge recharge) |
| | | { |
| | | OperationBase operationBase; |
| | | if (!OperationTimeHepler.Instance.InOperationTime(operationType)) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime"); |
| | | return; |
| | | } |
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(operationType, out operationBase)) |
| | | { |
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge; |
| | | if (IsRewardGot(recharge.index)) |
| | | { |
| | | return; |
| | | } |
| | | else if (rechargeTotal < recharge.requireGold) |
| | | { |
| | | return; |
| | | } |
| | | CA504_tagCMPlayerGetReward pak = new CA504_tagCMPlayerGetReward(); |
| | | pak.RewardType = (byte)GotServerRewardType.Def_RewardType_TotalRecharge; |
| | | pak.DataEx = (uint)recharge.index; |
| | | pak.DataExStrLen = (byte)ActNum.ToString().Length; |
| | | pak.DataExStr = ActNum.ToString(); |
| | | GameNetSystem.Instance.SendInfo(pak); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 红点 |
| | | |
| | | public void UpdateRedpoint() |
| | | { |
| | | redpoint.state = RedPointState.None; |
| | | if (!IsOpen) |
| | | { |
| | | return; |
| | | } |
| | | OperationBase operationBase; |
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(operationType, out operationBase)) |
| | | { |
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge; |
| | | var reward = operation.GetReward(TimeUtility.ServerNow); |
| | | if (reward != null) |
| | | { |
| | | for (int i = 0; i < reward.recharges.Count; i++) |
| | | { |
| | | var recharge = reward.recharges[i]; |
| | | if (i == 0) |
| | | { |
| | | //任意充值单独界面红点 |
| | | if (SatisfyGetReward(recharge, true)) |
| | | { |
| | | redpoint.state = RedPointState.Simple; |
| | | } |
| | | } |
| | | //累计充值界面红点 |
| | | //if (SatisfyGetReward(recharge)) |
| | | //{ |
| | | // redpoint.state = RedPointState.Simple; |
| | | // break; |
| | | //} |
| | | } |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f99dc5a91c3da8449939180fb30bcab5 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | using System; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class HolidayRechargeGiftWin : Window |
| | | { |
| | | ButtonEx receiveBtn; |
| | | Button rechargeBtn; |
| | | Text receiveBtnText; |
| | | Text TimeTxt; |
| | | List<ItemCell> itemBaiscs = new List<ItemCell>(); |
| | | |
| | | HolidayMultiRechargeModel rechargeModel { get { return ModelCenter.Instance.GetModel<HolidayMultiRechargeModel>(); } } |
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | | |
| | | protected override void BindController() |
| | | { |
| | | itemBaiscs.Add(GetWidgt<ItemCell>("ItemCell1")); |
| | | itemBaiscs.Add(GetWidgt<ItemCell>("ItemCell2")); |
| | | itemBaiscs.Add(GetWidgt<ItemCell>("ItemCell3")); |
| | | itemBaiscs.Add(GetWidgt<ItemCell>("ItemCell4")); |
| | | itemBaiscs.Add(GetWidgt<ItemCell>("ItemCell5")); |
| | | |
| | | receiveBtn = GetWidgt<ButtonEx>("ReceiveButton"); |
| | | rechargeBtn = GetWidgt<Button>("RechargeButton"); |
| | | TimeTxt = GetWidgt<Text>("ActivityDesText"); |
| | | receiveBtnText = GetWidgt<Text>("Text"); |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | rechargeBtn.AddListener(ClickRecharge); |
| | | receiveBtn.AddListener(OnReceiveGift); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | rechargeModel.accumulateRechargeUpdate += DisplayButton; |
| | | DisplayButton(); |
| | | DisplayItems(); |
| | | DisplayOpenTime(); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | rechargeModel.accumulateRechargeUpdate -= DisplayButton; |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | |
| | | } |
| | | |
| | | void DisplayOpenTime() |
| | | { |
| | | OperationAccumulateRecharge operation; |
| | | if (OperationTimeHepler.Instance.TryGetOperation(rechargeModel.operationType, out operation)) |
| | | { |
| | | TimeTxt.text = StringUtility.Contact(Language.Get("ExpActivity_Text1"), operation.ToDisplayTime()); |
| | | } |
| | | } |
| | | |
| | | void DisplayButton() |
| | | { |
| | | OperationBase operationBase; |
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(rechargeModel.operationType, out operationBase)) |
| | | { |
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge; |
| | | var reward = operation.GetReward(TimeUtility.ServerNow); |
| | | if (reward != null) |
| | | { |
| | | if (reward.recharges.Count > 0) |
| | | { |
| | | var recharge = reward.recharges[0]; |
| | | |
| | | if (rechargeModel.SatisfyGetReward(recharge, true)) |
| | | { |
| | | receiveBtnText.text = Language.Get("AccumulateRecharge_GetReward"); |
| | | receiveBtn.SetColorful(receiveBtnText, true); |
| | | receiveBtn.interactable = true; |
| | | } |
| | | else if (rechargeModel.IsRewardGot(recharge)) |
| | | { |
| | | receiveBtnText.text = Language.Get("Z1044"); |
| | | receiveBtn.SetColorful(receiveBtnText, false); |
| | | receiveBtn.interactable = false; |
| | | } |
| | | else |
| | | { |
| | | receiveBtnText.text = Language.Get("AccumulateRecharge_GetReward"); |
| | | receiveBtn.SetColorful(receiveBtnText, false); |
| | | receiveBtn.interactable = true; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void DisplayItems() |
| | | { |
| | | int index = 0; |
| | | OperationBase operationBase; |
| | | OperationAccumulateRecharge.Recharge recharge = null; |
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(rechargeModel.operationType, out operationBase)) |
| | | { |
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge; |
| | | var reward = operation.GetReward(TimeUtility.ServerNow); |
| | | if (index >= 0 && index < reward.recharges.Count) |
| | | { |
| | | recharge = reward.recharges[index]; |
| | | } |
| | | } |
| | | for (int i = 0; i < itemBaiscs.Count; i++) |
| | | { |
| | | if (recharge != null && i < recharge.items.Count) |
| | | { |
| | | var item = recharge.items[i]; |
| | | itemBaiscs[i].gameObject.SetActive(true); |
| | | ItemCellModel itemCellModel = new ItemCellModel(item.id, true, (ulong)item.count); |
| | | itemBaiscs[i].Init(itemCellModel); |
| | | itemBaiscs[i].button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(item.id); |
| | | }); |
| | | |
| | | itemBaiscs[i].auctionIcon.gameObject.SetActive(item.bind > 0 ? true : false); |
| | | } |
| | | else |
| | | { |
| | | itemBaiscs[i].gameObject.SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private void OnReceiveGift() |
| | | { |
| | | OperationBase operationBase; |
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(rechargeModel.operationType, out operationBase)) |
| | | { |
| | | OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge; |
| | | var reward = operation.GetReward(TimeUtility.ServerNow); |
| | | if (reward != null) |
| | | { |
| | | if (reward.recharges.Count > 0) |
| | | { |
| | | var recharge = reward.recharges[0]; |
| | | |
| | | if (rechargeModel.SatisfyGetReward(recharge, true)) |
| | | { |
| | | if (playerPack.GetEmptyGridCount(PackType.Item) > recharge.items.Count) |
| | | { |
| | | rechargeModel.GetAccumulateRechargeReward(recharge); |
| | | } |
| | | else |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("BagFull"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("FairylandCermonyRecharge1"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void ClickRecharge() |
| | | { |
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.VipRechargeFunc1); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e245118545ae7d84992e6d57923904db |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class HolidayTravelAwardCell : CellView |
| | | { |
| | | [SerializeField] Text titleText; |
| | | [SerializeField] Text remindText; |
| | | [SerializeField] Button receiveBtn; |
| | | [SerializeField] GameObject noReachImg; |
| | | [SerializeField] GameObject alreadyImg; |
| | | [SerializeField] List<ItemCell> itemBaiscs = new List<ItemCell>(); |
| | | |
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | | HolidayTravelModel model { get { return ModelCenter.Instance.GetModel<HolidayTravelModel>(); } } |
| | | |
| | | private void OnEnable() |
| | | { |
| | | } |
| | | |
| | | private void OnDisable() |
| | | { |
| | | } |
| | | public void Init(byte awardIndex) |
| | | { |
| | | OperationHolidayTravel holiday; |
| | | if (!OperationTimeHepler.Instance.TryGetOperation(model.operationType, out holiday)) |
| | | { |
| | | return; |
| | | } |
| | | titleText.text = Language.Get("HolidayTravel1", holiday.travelAwards[awardIndex].NeedTravelPoint); |
| | | |
| | | //maxCnt 0 无限制 1 只有1次不需要显示 大于1显示剩余次数 |
| | | //剩余次数为0 不显示 |
| | | var maxCnt = holiday.travelAwards[awardIndex].AwardCountMax; |
| | | if (maxCnt == 1) |
| | | { |
| | | remindText.text = string.Empty; |
| | | } |
| | | else if (maxCnt == 0) |
| | | { |
| | | remindText.text = Language.Get("HolidayTravel3", model.GetRemindTravelPoint(holiday, awardIndex), holiday.travelAwards[awardIndex].NeedTravelPoint); |
| | | } |
| | | else |
| | | { |
| | | var remindCnt = model.GetAwardRemindTimes(holiday, awardIndex); |
| | | if (remindCnt == 0) |
| | | { |
| | | remindText.text = string.Empty; |
| | | } |
| | | else |
| | | { |
| | | remindText.text = Language.Get("HolidayTravel2", remindCnt, model.GetRemindTravelPoint(holiday, awardIndex), holiday.travelAwards[awardIndex].NeedTravelPoint); |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < itemBaiscs.Count; i++) |
| | | { |
| | | if (i < holiday.travelAwards[awardIndex].AwardItemCount) |
| | | { |
| | | itemBaiscs[i].gameObject.SetActive(true); |
| | | var item = holiday.travelAwards[awardIndex].AwardItemList[i]; |
| | | ItemCellModel cellModel = new ItemCellModel((int)item.ItemID, false, item.ItemCount); |
| | | itemBaiscs[i].Init(cellModel); |
| | | itemBaiscs[i].auctionIcon.gameObject.SetActive(item.IsBind > 0 ? true : false); |
| | | itemBaiscs[i].button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show((int)item.ItemID); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | itemBaiscs[i].gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | RefreshAwardStateUI(holiday, awardIndex); |
| | | } |
| | | |
| | | |
| | | |
| | | private void RefreshAwardStateUI(OperationHolidayTravel holiday, byte awardIndex) |
| | | { |
| | | int state = model.GetAwardState(holiday, awardIndex); |
| | | switch (state) |
| | | { |
| | | case 0: |
| | | noReachImg.SetActive(true); |
| | | alreadyImg.SetActive(false); |
| | | receiveBtn.gameObject.SetActive(false); |
| | | break; |
| | | case 1: |
| | | noReachImg.SetActive(false); |
| | | alreadyImg.SetActive(false); |
| | | receiveBtn.gameObject.SetActive(true); |
| | | receiveBtn.AddListener(()=> { |
| | | if (playerPack.GetEmptyGridCount(PackType.Item) >= holiday.travelAwards[awardIndex].AwardItemCount) |
| | | { |
| | | model.SendGetAward(awardIndex); |
| | | } |
| | | else |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("BagFull"); |
| | | } |
| | | }); |
| | | break; |
| | | case 2: |
| | | noReachImg.SetActive(false); |
| | | alreadyImg.SetActive(true); |
| | | receiveBtn.gameObject.SetActive(false); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 11f55337171b68b4aa7f0dead27fd277 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class HolidayTravelModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity |
| | | { |
| | | public event Action<int> onStateUpdate; |
| | | public const int redPointID = 28004; |
| | | public Redpoint redPoint = new Redpoint(MainRedDot.RedPoint_HolidayWishes, redPointID); |
| | | public Operation operationType = Operation.HolidayTravel; |
| | | |
| | | //节日祝福 id从101开始和精彩活动区分 |
| | | public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_JRZF; |
| | | public const int activityID = 104; |
| | | |
| | | public int travelPoint; //当前获得的总游历值 |
| | | //奖励索引:此任务奖励已领取次数 |
| | | public Dictionary<byte, byte> playerTravelAwards = new Dictionary<byte, byte>(); |
| | | //【任务ID,此任务总进度,完成次数】 |
| | | public Dictionary<byte, List<int>> travelTaskProcess = new Dictionary<byte, List<int>>(); |
| | | //记录收包时的任务顺序 用于排序参考 |
| | | List<byte> taskPackSort = new List<byte>(); |
| | | //排序后 |
| | | public List<byte> travelTaskSort = new List<byte>(); |
| | | |
| | | public event Action onTravelAwards; |
| | | public event Action onTaskProcess; |
| | | |
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | | |
| | | public override void Init() |
| | | { |
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent; |
| | | OpenServerActivityCenter.Instance.Register(activityID, this, activityType); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public void OnBeforePlayerDataInitialize() |
| | | { |
| | | travelTaskProcess.Clear(); |
| | | travelTaskSort.Clear(); |
| | | taskPackSort.Clear(); |
| | | playerTravelAwards.Clear(); |
| | | travelPoint = 0; |
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | } |
| | | |
| | | public override void UnInit() |
| | | { |
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent; |
| | | } |
| | | |
| | | public bool IsOpen |
| | | { |
| | | get |
| | | { |
| | | return OperationTimeHepler.Instance.SatisfyOpenCondition(operationType); |
| | | } |
| | | } |
| | | |
| | | public bool priorityOpen |
| | | { |
| | | get |
| | | { |
| | | return redPoint.state == RedPointState.Simple; |
| | | } |
| | | } |
| | | |
| | | public bool IsAdvance |
| | | { |
| | | get |
| | | { |
| | | return OperationTimeHepler.Instance.SatisfyAdvanceCondition(operationType); |
| | | } |
| | | } |
| | | |
| | | private void OperationEndEvent(Operation type, int state) |
| | | { |
| | | if (type == operationType && state == 0) |
| | | { |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OperationAdvanceEvent(Operation type) |
| | | { |
| | | if (type == operationType) |
| | | { |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OperationStartEvent(Operation type, int state) |
| | | { |
| | | if (type == operationType && state == 0) |
| | | { |
| | | |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | void UpdateRedpoint() |
| | | { |
| | | redPoint.state = RedPointState.None; |
| | | |
| | | if (GetCanGetAwardIndex() != -1) |
| | | { |
| | | redPoint.state = RedPointState.Simple; |
| | | } |
| | | } |
| | | |
| | | |
| | | public void SendGetAward(uint index) |
| | | { |
| | | CA504_tagCMPlayerGetReward getReward = new CA504_tagCMPlayerGetReward(); |
| | | getReward.RewardType = (byte)GotServerRewardType.Def_RewardType_HolidayTravel; |
| | | getReward.DataEx = index; |
| | | getReward.DataExStrLen = 0; |
| | | getReward.DataExStr = string.Empty; |
| | | GameNetSystem.Instance.SendInfo(getReward); |
| | | } |
| | | |
| | | public void OnPlayerTravelInfo(HAA47_tagMCFeastTravelPlayerInfo netPack) |
| | | { |
| | | travelPoint = (int)netPack.TravelPoint; |
| | | if (netPack.TravelPlayerAwardCount != 0) |
| | | { |
| | | foreach (var award in netPack.TravelPlayerAwardList) |
| | | { |
| | | if (playerTravelAwards.ContainsKey(award.AwardIndex)) |
| | | { |
| | | playerTravelAwards[award.AwardIndex] = award.GetAwardCount; |
| | | } |
| | | else |
| | | { |
| | | playerTravelAwards.Add(award.AwardIndex, award.GetAwardCount); |
| | | } |
| | | } |
| | | |
| | | if (onTravelAwards != null) |
| | | { |
| | | //刷新领奖信息(打开界面比较少能完成任务不做及时刷新) |
| | | onTravelAwards(); |
| | | } |
| | | } |
| | | |
| | | if (netPack.TravelPlayerTaskCount != 0) |
| | | { |
| | | foreach (var task in netPack.TravelPlayerTaskList) |
| | | { |
| | | if (travelTaskProcess.ContainsKey(task.TravelTaskID)) |
| | | { |
| | | travelTaskProcess[task.TravelTaskID] = new List<int> { (int)task.TravelValue, (int)task.FinishCount }; |
| | | } |
| | | else |
| | | { |
| | | travelTaskProcess.Add(task.TravelTaskID, new List<int> { (int)task.TravelValue, (int)task.FinishCount }); |
| | | taskPackSort.Add(task.TravelTaskID); |
| | | travelTaskSort.Add(task.TravelTaskID); |
| | | } |
| | | } |
| | | travelTaskSort.Sort(CompareState); |
| | | |
| | | if (onTaskProcess != null) |
| | | { |
| | | onTaskProcess(); |
| | | } |
| | | } |
| | | |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | |
| | | // 已完成往后排 |
| | | int CompareState(byte x, byte y) |
| | | { |
| | | OperationHolidayTravel holiday; |
| | | if (OperationTimeHepler.Instance.TryGetOperation(operationType, out holiday)) |
| | | { |
| | | bool xfinish = IsTaskFinish(holiday, x); |
| | | bool yfinish = IsTaskFinish(holiday, y); |
| | | if (xfinish != yfinish) |
| | | return xfinish.CompareTo(yfinish); |
| | | |
| | | return taskPackSort.IndexOf(x).CompareTo(taskPackSort.IndexOf(y)); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public bool IsTaskFinish(OperationHolidayTravel holiday, byte taskID) |
| | | { |
| | | return holiday.travelTasks[taskID].FinishTimeMax <= travelTaskProcess[taskID][1]; |
| | | } |
| | | |
| | | |
| | | //指定任务的单次进度 |
| | | public int GetTaskProcess(OperationHolidayTravel holiday, byte taskID) |
| | | { |
| | | return Math.Max(0, travelTaskProcess[taskID][0] - travelTaskProcess[taskID][1]*holiday.travelTasks[taskID].FinishNeedValue); |
| | | } |
| | | |
| | | |
| | | //指定档位的剩余领取次数,-1不限制 |
| | | public int GetAwardRemindTimes(OperationHolidayTravel holiday, byte awardIndex) |
| | | { |
| | | var maxCnt = holiday.travelAwards[awardIndex].AwardCountMax; |
| | | if (maxCnt == 0) |
| | | { |
| | | return -1; |
| | | } |
| | | |
| | | return maxCnt - playerTravelAwards[awardIndex]; |
| | | } |
| | | |
| | | //指定档位的剩余游历值 |
| | | public int GetRemindTravelPoint(OperationHolidayTravel holiday, byte awardIndex) |
| | | { |
| | | return travelPoint - playerTravelAwards[awardIndex]*holiday.travelAwards[awardIndex].NeedTravelPoint; |
| | | } |
| | | |
| | | |
| | | // 指定档位领取状态0 未达成 1 可领取 2 已领取 |
| | | public int GetAwardState(OperationHolidayTravel holiday, byte awardIndex) |
| | | { |
| | | var maxCnt = holiday.travelAwards[awardIndex].AwardCountMax; |
| | | if (maxCnt == 0 || maxCnt > playerTravelAwards[awardIndex]) |
| | | { |
| | | if (travelPoint >= (playerTravelAwards[awardIndex] + 1) * holiday.travelAwards[awardIndex].NeedTravelPoint) |
| | | { |
| | | return 1; |
| | | } |
| | | else |
| | | { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | |
| | | return 2; |
| | | |
| | | } |
| | | |
| | | //获取第几个档位可领取 |
| | | public int GetCanGetAwardIndex() |
| | | { |
| | | OperationHolidayTravel holiday; |
| | | if (OperationTimeHepler.Instance.TryGetOperation(operationType, out holiday)) |
| | | { |
| | | int index = 0; |
| | | foreach (var award in holiday.travelAwards) |
| | | { |
| | | if (GetAwardState(holiday, award.Value.AwardIndex) == 1) |
| | | { |
| | | return index; |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | return -1; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: afe0851cfc564284e865e0b9cfd03987 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | using System; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class HolidayTravelTaskCell : CellView |
| | | { |
| | | [SerializeField] Image activeIcon; |
| | | [SerializeField] Text activeNameText; |
| | | [SerializeField] Text activeDesText; |
| | | [SerializeField] Text progressText; |
| | | [SerializeField] Button gobtn; |
| | | [SerializeField] GameObject completeImg; |
| | | |
| | | HolidayTravelModel model { get { return ModelCenter.Instance.GetModel<HolidayTravelModel>(); } } |
| | | |
| | | ActFeastTravelTaskConfig taskConfig; |
| | | private void OnEnable() |
| | | { |
| | | } |
| | | |
| | | private void OnDisable() |
| | | { |
| | | } |
| | | |
| | | public void Init(byte taskID) |
| | | { |
| | | OperationHolidayTravel holiday; |
| | | if (!OperationTimeHepler.Instance.TryGetOperation(model.operationType, out holiday)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | activeNameText.gameObject.SetActive(false); |
| | | taskConfig = ActFeastTravelTaskConfig.Get(taskID); |
| | | activeIcon.SetSprite(taskConfig.IconKey); |
| | | //改成总进度显示 非单次 |
| | | SetTaskState(holiday, taskID, model.travelTaskProcess[taskID][0], holiday.travelTasks[taskID].FinishTimeMax*holiday.travelTasks[taskID].FinishNeedValue); |
| | | activeDesText.text = string.Format(taskConfig.TaskDes, holiday.travelTasks[taskID].FinishNeedValue, holiday.travelTasks[taskID].AddTravelPoint); |
| | | } |
| | | |
| | | public void SetTaskState(OperationHolidayTravel holiday, byte taskID, int curProgress, int sumProgress) |
| | | { |
| | | gobtn.RemoveAllListeners(); |
| | | progressText.text = StringUtility.Contact(curProgress, "/", sumProgress); |
| | | if (model.IsTaskFinish(holiday, taskID)) |
| | | { |
| | | gobtn.gameObject.SetActive(false); |
| | | completeImg.SetActive(true); |
| | | progressText.color = UIHelper.GetUIColor(TextColType.Green); |
| | | } |
| | | if (curProgress < sumProgress) |
| | | { |
| | | gobtn.gameObject.SetActive(true); |
| | | completeImg.SetActive(false); |
| | | progressText.color = UIHelper.GetUIColor(TextColType.Red); |
| | | gobtn.AddListener(()=> |
| | | { |
| | | WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)taskConfig.JumpId); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e3786010e0a58f1498f31d4561f7ecd0 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | using System.Collections.Generic; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class HolidayTravelTaskWin : Window |
| | | { |
| | | ScrollerController awardCtrl; |
| | | ScrollerController taskCtrl; |
| | | Text travelPointText; |
| | | Text OpenTime; |
| | | |
| | | HolidayTravelModel model { get { return ModelCenter.Instance.GetModel<HolidayTravelModel>(); } } |
| | | |
| | | |
| | | protected override void BindController() |
| | | { |
| | | awardCtrl = GetWidgt<ScrollerController>("AwardCellCtrl"); |
| | | taskCtrl = GetWidgt<ScrollerController>("TaskCellCtrl"); |
| | | travelPointText = GetWidgt<Text>("valueText"); |
| | | OpenTime = GetWidgt<Text>("ActivityDesText"); |
| | | |
| | | awardCtrl.OnRefreshCell += RefreshAwardCell; |
| | | taskCtrl.OnRefreshCell += RefreshTaskCell; |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | model.onTravelAwards += CreateAwardCell; |
| | | model.onTaskProcess += CreateTaskCell; |
| | | Init(); |
| | | } |
| | | protected override void OnAfterOpen() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | model.onTravelAwards -= CreateAwardCell; |
| | | model.onTaskProcess -= CreateTaskCell; |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | |
| | | } |
| | | |
| | | private void Init() |
| | | { |
| | | travelPointText.text = model.travelPoint.ToString(); |
| | | CreateAwardCell(); |
| | | CreateTaskCell(); |
| | | DisplayOpenTime(); |
| | | taskCtrl.JumpIndex(0); |
| | | awardCtrl.JumpIndex(model.GetCanGetAwardIndex()); |
| | | } |
| | | |
| | | private void CreateTaskCell() |
| | | { |
| | | |
| | | taskCtrl.Refresh(); |
| | | foreach(var taskID in model.travelTaskSort) |
| | | { |
| | | taskCtrl.AddCell(ScrollerDataType.Header, taskID); |
| | | } |
| | | taskCtrl.Restart(); |
| | | |
| | | } |
| | | |
| | | private void RefreshTaskCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | HolidayTravelTaskCell taskCell = cell.GetComponent<HolidayTravelTaskCell>(); |
| | | if (taskCell == null) return; |
| | | |
| | | taskCell.Init((byte)cell.index); |
| | | } |
| | | |
| | | private void CreateAwardCell() |
| | | { |
| | | if (awardCtrl.GetNumberOfCells(awardCtrl.m_Scorller) > 0) |
| | | { |
| | | awardCtrl.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | else |
| | | { |
| | | awardCtrl.Refresh(); |
| | | foreach(var award in model.playerTravelAwards) |
| | | { |
| | | awardCtrl.AddCell(ScrollerDataType.Header, award.Key); |
| | | } |
| | | awardCtrl.Restart(); |
| | | } |
| | | } |
| | | |
| | | private void RefreshAwardCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | HolidayTravelAwardCell awardCell = cell.GetComponent<HolidayTravelAwardCell>(); |
| | | if (awardCell == null) return; |
| | | |
| | | awardCell.Init((byte)cell.index); |
| | | } |
| | | |
| | | void DisplayOpenTime() |
| | | { |
| | | OperationHolidayTravel operation; |
| | | if (OperationTimeHepler.Instance.TryGetOperation(model.operationType, out operation)) |
| | | { |
| | | OpenTime.text = StringUtility.Contact(Language.Get("ExpActivity_Text1"), operation.ToDisplayTime()); |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5047759803bd2a1489dbf2e1abf1085e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, April 18, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class HolidayWishBottle : MonoBehaviour |
| | | { |
| | | [SerializeField] Image bottleWater; |
| | | [SerializeField] Image bottleFull; |
| | | [SerializeField] UIAlphaTween m_AlphaTween; |
| | | [SerializeField] Text waterProcess; |
| | | [SerializeField] Text isOver; |
| | | [SerializeField] UIEffect AddWish; |
| | | [SerializeField] TextMove AddWishText; |
| | | [SerializeField] Button OpenAwards; |
| | | |
| | | HolidayWishPoolModel model { get { return ModelCenter.Instance.GetModel<HolidayWishPoolModel>(); } } |
| | | |
| | | private void Awake() |
| | | { |
| | | model.UpdateWishNum += ShowAddEffect; |
| | | } |
| | | |
| | | |
| | | public void Display(byte bottleNum, OperationHolidayWish holiday) |
| | | { |
| | | AddWish.gameObject.SetActive(true); |
| | | bottleFull.gameObject.SetActive(false); |
| | | m_AlphaTween.enabled = false; |
| | | |
| | | var process = Math.Min(model.GetBottleProcessState(bottleNum, holiday), 1); |
| | | if (process == -1) |
| | | { |
| | | //已领完 |
| | | isOver.gameObject.SetActive(true); |
| | | |
| | | bottleFull.gameObject.SetActive(false); |
| | | bottleWater.gameObject.SetActive(false); |
| | | waterProcess.gameObject.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | if (process == 1) |
| | | { |
| | | //已满 |
| | | bottleFull.gameObject.SetActive(true); |
| | | m_AlphaTween.enabled = true; |
| | | m_AlphaTween.Play(); |
| | | } |
| | | isOver.gameObject.SetActive(false); |
| | | |
| | | bottleWater.gameObject.SetActive(true); |
| | | bottleWater.fillAmount = process; |
| | | waterProcess.gameObject.SetActive(true); |
| | | waterProcess.text = (int)(process * 100) + "%"; |
| | | } |
| | | |
| | | OpenAwards.SetListener(() => |
| | | { |
| | | model.bottleNumSelect = bottleNum; |
| | | WindowCenter.Instance.Open<WishBottleAwardWin>(); |
| | | }); |
| | | } |
| | | |
| | | public void ShowAddEffect(int num) |
| | | { |
| | | AddWishText.Begin(Language.Get("SubWishInfo3", num)); |
| | | AddWish.Play(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ac8419ef66b74134787c567518e24609 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, September 26, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | namespace Snxxz.UI { |
| | | |
| | | public class HolidayWishPoolItemCell : CellView { |
| | | [SerializeField] ItemCell itemCell; |
| | | |
| | | public void Display(int index) |
| | | { |
| | | OperationHolidayWish holiday; |
| | | OperationTimeHepler.Instance.TryGetOperation(Operation.HolidayWish, out holiday); |
| | | |
| | | //第一个为标的物 |
| | | int itemID = (int)holiday.wishPool[index]; |
| | | var config = ItemConfig.Get(itemID); |
| | | var itemData = new ItemCellModel(itemID, false, 1); |
| | | itemCell.Init(itemData); |
| | | itemCell.button.SetListener(()=> { |
| | | ItemTipUtility.Show(itemID); |
| | | }); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ea4bf8da19778c4293fcf6b234c8360 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class HolidayWishPoolModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity |
| | | { |
| | | public event Action<int> onStateUpdate; |
| | | public const int redPointID = 28002; |
| | | public Redpoint redPoint = new Redpoint(MainRedDot.RedPoint_HolidayWishes, redPointID); |
| | | Operation operationType = Operation.HolidayWish; |
| | | |
| | | //节日祝福 id从101开始和精彩活动区分 |
| | | public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_JRZF; |
| | | public const int activityID = 102; |
| | | |
| | | //瓶子编号对应的int2<祝福值,领取情况> |
| | | public Dictionary<byte, Int2> bottleDict = new Dictionary<byte, Int2>(); |
| | | public event Action UpdateBottleInfo; // 瓶子信息变更 祝福值和领奖情况 |
| | | public event Action UpdateLegendMsg; |
| | | public event Action<int> UpdateWishNum; |
| | | |
| | | public byte bottleNumSelect; |
| | | public List<WishLegend> wishLegends = new List<WishLegend>(); |
| | | |
| | | public int wishItemID; //祝福需要的物品ID |
| | | public int wishCount1; // 祝福次数 |
| | | public int wishSingleNeedNum = 1; //单次祝福需要的物品数量 |
| | | public int wishCount2; |
| | | |
| | | bool IsRequestLegend = false; //首次启动界面请求 |
| | | int viewType = 17; |
| | | |
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | | |
| | | public override void Init() |
| | | { |
| | | playerPack.refreshItemCountEvent += RefreshItemCountEvent; |
| | | DTCA003_tagUniversalGameRecInfo.onGetUniversalGameInfo += OnGetUniversalGameInfo; |
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent; |
| | | OpenServerActivityCenter.Instance.Register(activityID, this, activityType); |
| | | |
| | | var funcCfg = FuncConfigConfig.Get("FeastWishCfg"); |
| | | wishItemID = int.Parse(funcCfg.Numerical1); |
| | | var _jsonDataC = LitJson.JsonMapper.ToObject(funcCfg.Numerical2); |
| | | if (_jsonDataC.Count > 0) |
| | | { |
| | | wishCount1 = int.Parse(_jsonDataC[0].ToString()); |
| | | wishCount2 = int.Parse(_jsonDataC[1].ToString()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public void OnBeforePlayerDataInitialize() |
| | | { |
| | | bottleDict.Clear(); |
| | | IsRequestLegend = false; |
| | | wishLegends.Clear(); |
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | } |
| | | |
| | | public override void UnInit() |
| | | { |
| | | playerPack.refreshItemCountEvent -= RefreshItemCountEvent; |
| | | DTCA003_tagUniversalGameRecInfo.onGetUniversalGameInfo -= OnGetUniversalGameInfo; |
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent; |
| | | } |
| | | |
| | | public bool IsOpen { |
| | | get { |
| | | return OperationTimeHepler.Instance.SatisfyOpenCondition(operationType); |
| | | } |
| | | } |
| | | |
| | | public bool priorityOpen { |
| | | get { |
| | | return redPoint.state == RedPointState.Simple; |
| | | } |
| | | } |
| | | |
| | | public bool IsAdvance { |
| | | get { |
| | | return OperationTimeHepler.Instance.SatisfyAdvanceCondition(operationType); |
| | | } |
| | | } |
| | | |
| | | private void OperationEndEvent(Operation type, int state) |
| | | { |
| | | if (type == operationType && state == 0) |
| | | { |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OperationAdvanceEvent(Operation type) |
| | | { |
| | | if (type == operationType) |
| | | { |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OperationStartEvent(Operation type, int state) |
| | | { |
| | | if (type == operationType && state == 0) |
| | | { |
| | | |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //0 可领取 1 已领取 |
| | | public int GetBottleAwardState(byte bottleNum, int index) |
| | | { |
| | | |
| | | OperationHolidayWish holiday; |
| | | OperationTimeHepler.Instance.TryGetOperation(operationType, out holiday); |
| | | |
| | | int recordIndex = holiday.wishBottles[bottleNumSelect].ChoosePrizeList[index].RecordIndex; |
| | | if (((int)Math.Pow(2, recordIndex) & bottleDict[bottleNum].y) == 0) |
| | | { |
| | | return 0; |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | void UpdateRedpoint() |
| | | { |
| | | OperationHolidayWish holiday; |
| | | OperationTimeHepler.Instance.TryGetOperation(operationType, out holiday); |
| | | redPoint.state = RedPointState.None; |
| | | |
| | | if (holiday == null) return; //封包顺序如果有问题 此处为空 |
| | | |
| | | // 瓶子的祝福值满 和 有祝福值可祈愿的情况 增加红点 |
| | | foreach (var bottle in bottleDict) |
| | | { |
| | | var state = GetBottleProcessState(bottle.Key, holiday); |
| | | if (state >= 1) |
| | | { |
| | | redPoint.state = RedPointState.Simple; |
| | | } |
| | | } |
| | | |
| | | if (playerPack.GetItemCountByID(PackType.Item, wishItemID) >= wishCount1) |
| | | { |
| | | redPoint.state = RedPointState.Simple; |
| | | } |
| | | |
| | | } |
| | | |
| | | //瓶子进度0到1, -1代表已领完 |
| | | public float GetBottleProcessState(byte bottleNum, OperationHolidayWish holiday) |
| | | { |
| | | if (holiday == null) return 0; |
| | | if (!bottleDict.ContainsKey(bottleNum) || !holiday.wishBottles.ContainsKey(bottleNum)) return 0; |
| | | |
| | | if (NumberOf1(bottleDict[bottleNum].y) >= holiday.wishBottles[bottleNum].ChooseTimeMax) |
| | | return -1; |
| | | |
| | | return bottleDict[bottleNum].x / (float)holiday.wishBottles[bottleNum].NeedWishValue; |
| | | } |
| | | |
| | | //遍历每次消除一个1,有多少次就多少个1 |
| | | private int NumberOf1(int n) |
| | | { |
| | | int count = 0; |
| | | while (n != 0) |
| | | { |
| | | count++; |
| | | n &= n - 1; |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | public void UpdateInfo(HAA44_tagMCFeastWishPlayerInfo netPack) |
| | | { |
| | | for (int i = 0; i < netPack.PlayerBottleInfo.Length; i++) |
| | | { |
| | | byte bottleNum = netPack.PlayerBottleInfo[i].BottleNum; |
| | | if (bottleDict.ContainsKey(bottleNum)) |
| | | { |
| | | bottleDict[bottleNum] = new Int2(netPack.PlayerBottleInfo[i].WishValue, (int)netPack.PlayerBottleInfo[i].ChooseRecord); |
| | | } |
| | | else |
| | | { |
| | | bottleDict.Add(bottleNum, new Int2(netPack.PlayerBottleInfo[i].WishValue, (int)netPack.PlayerBottleInfo[i].ChooseRecord)); |
| | | } |
| | | } |
| | | |
| | | if (UpdateBottleInfo != null) |
| | | UpdateBottleInfo(); |
| | | |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | public void SendWish(byte wishCount) |
| | | { |
| | | CAA11_tagCMFeastWishPoolWish wish = new CAA11_tagCMFeastWishPoolWish(); |
| | | wish.WishCount = wishCount; |
| | | GameNetSystem.Instance.SendInfo(wish); |
| | | } |
| | | |
| | | private void RefreshItemCountEvent(PackType packType, int index, int itemId) |
| | | { |
| | | if (itemId != wishItemID) return; |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | |
| | | //每次启动游戏 只在打开界面做一次请求,后续会收到服务端单条通知 |
| | | public void RequestLegend() |
| | | { |
| | | if (IsRequestLegend) return; |
| | | IsRequestLegend = true; |
| | | CA001_tagViewUniversalGameRec legend = new CA001_tagViewUniversalGameRec(); |
| | | legend.ViewType = (byte)viewType; |
| | | GameNetSystem.Instance.SendInfo(legend); |
| | | } |
| | | |
| | | public void OnAddWish(HAA45_tagMCFeastWishResult netPack) |
| | | { |
| | | if (UpdateWishNum != null) |
| | | { |
| | | UpdateWishNum((int)netPack.AddWishValue); |
| | | } |
| | | } |
| | | |
| | | private void OnGetUniversalGameInfo(HA003_tagUniversalGameRecInfo package) |
| | | { |
| | | if (!IsRequestLegend) |
| | | { |
| | | //界面首次启动后会获取一次总信息 |
| | | return; |
| | | } |
| | | |
| | | if (package.Type != viewType) return; |
| | | for (int i = 0; i < package.Count; i++) |
| | | { |
| | | WishLegend msg = new WishLegend() |
| | | { |
| | | name = package.UniversalGameRec[i].StrValue1, |
| | | itemID = (int)package.UniversalGameRec[i].Value1, |
| | | itemCount = (int)package.UniversalGameRec[i].Value2, |
| | | source = (int)package.UniversalGameRec[i].Value3, |
| | | }; |
| | | |
| | | wishLegends.Add(msg); |
| | | } |
| | | if (wishLegends.Count > 35) |
| | | wishLegends.RemoveRange(0, 5); |
| | | |
| | | if (UpdateLegendMsg != null) |
| | | UpdateLegendMsg(); |
| | | |
| | | } |
| | | |
| | | public struct WishLegend |
| | | { |
| | | public string name; |
| | | public int itemID; |
| | | public int itemCount; |
| | | public int source; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: cf43871e7f02e6c4da7abc3b4f7bb861 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, April 18, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class HolidayWishPoolWin : Window |
| | | { |
| | | List<HolidayWishBottle> bottleList = new List<HolidayWishBottle>(); |
| | | |
| | | ScrollerController m_Controller; // 物品 |
| | | Button wish1; |
| | | Text wishTxt1; |
| | | Text wishNeedNum1; |
| | | |
| | | Button wish2; |
| | | Text wishTxt2; |
| | | Text wishNeedNum2; |
| | | |
| | | Text allStarNum; //可祝福的物品总数 |
| | | RichText wishLegend; |
| | | Text OpenTime; |
| | | |
| | | Operation operationType = Operation.HolidayWish; |
| | | |
| | | HolidayWishPoolModel model { get { return ModelCenter.Instance.GetModel<HolidayWishPoolModel>(); } } |
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | | |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | bottleList.Add(GetWidgt<HolidayWishBottle>("light1")); |
| | | bottleList.Add(GetWidgt<HolidayWishBottle>("light2")); |
| | | bottleList.Add(GetWidgt<HolidayWishBottle>("light3")); |
| | | bottleList.Add(GetWidgt<HolidayWishBottle>("light4")); |
| | | bottleList.Add(GetWidgt<HolidayWishBottle>("light5")); |
| | | |
| | | m_Controller = GetWidgt<ScrollerController>("ScrollerControl"); |
| | | |
| | | wish1 = GetWidgt<Button>("wishbtn1"); |
| | | wishTxt1 = GetWidgt<Text>("Text1"); |
| | | wishNeedNum1 = GetWidgt<Text>("startnum1"); |
| | | |
| | | wish2 = GetWidgt<Button>("wishbtn2"); |
| | | wishTxt2 = GetWidgt<Text>("Text2"); |
| | | wishNeedNum2 = GetWidgt<Text>("startnum2"); |
| | | |
| | | allStarNum = GetWidgt<Text>("allstarnum"); |
| | | wishLegend = GetWidgt<RichText>("Content1"); |
| | | OpenTime = GetWidgt<Text>("OpenTime"); |
| | | } |
| | | |
| | | |
| | | void UseItemWish(int needEmpty, byte useCnt) |
| | | { |
| | | if (useCnt > playerPack.GetItemCountByID(PackType.Item, model.wishItemID)) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("RealmLevelUpError_3"); |
| | | return; |
| | | } |
| | | int emptyCnt = playerPack.GetEmptyGridCount(PackType.Item); |
| | | if (emptyCnt < needEmpty) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("GeRen_lhs_202580"); |
| | | return; |
| | | } |
| | | model.SendWish(useCnt); |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | wish1.SetListener(() => |
| | | { |
| | | UseItemWish(2, (byte)model.wishCount1); |
| | | }); |
| | | |
| | | wish2.SetListener(() => |
| | | { |
| | | UseItemWish(2, (byte)model.wishCount2); |
| | | }); |
| | | |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | model.RequestLegend(); |
| | | m_Controller.OnRefreshCell += OnRefreshCell; |
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent; |
| | | playerPack.refreshItemCountEvent += RefreshItemCountEvent; |
| | | model.UpdateLegendMsg += UpdateLegendMsg; |
| | | model.UpdateBottleInfo += Display; |
| | | |
| | | } |
| | | |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | m_Controller.OnRefreshCell -= OnRefreshCell; |
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent; |
| | | playerPack.refreshItemCountEvent -= RefreshItemCountEvent; |
| | | model.UpdateLegendMsg -= UpdateLegendMsg; |
| | | model.UpdateBottleInfo -= Display; |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | private void RefreshItemCountEvent(PackType packType, int index, int itemId) |
| | | { |
| | | if (itemId != model.wishItemID) return; |
| | | var itemCnt = playerPack.GetItemCountByID(PackType.Item, model.wishItemID); |
| | | allStarNum.text = itemCnt.ToString(); |
| | | |
| | | if (itemCnt < model.wishSingleNeedNum * model.wishCount1) |
| | | wishNeedNum1.color = UIHelper.GetUIColor(TextColType.Red, true); |
| | | else |
| | | wishNeedNum1.color = UIHelper.GetUIColor(TextColType.LightYellow, true); |
| | | |
| | | if (itemCnt < model.wishSingleNeedNum * model.wishCount2) |
| | | wishNeedNum2.color = UIHelper.GetUIColor(TextColType.Red, true); |
| | | else |
| | | wishNeedNum2.color = UIHelper.GetUIColor(TextColType.LightYellow, true); |
| | | } |
| | | |
| | | void DisplayOpenTime() |
| | | { |
| | | OperationHolidayWish operation; |
| | | if (OperationTimeHepler.Instance.TryGetOperation(operationType, out operation)) |
| | | { |
| | | OpenTime.text = StringUtility.Contact(Language.Get("ExpActivity_Text1"), operation.ToDisplayTime()); |
| | | } |
| | | } |
| | | |
| | | void Display() |
| | | { |
| | | OperationHolidayWish holiday; |
| | | OperationTimeHepler.Instance.TryGetOperation(operationType, out holiday); |
| | | |
| | | int index = 0; |
| | | foreach(var key in holiday.wishBottles.Keys) |
| | | { |
| | | if (index >= bottleList.Count) |
| | | { |
| | | break; |
| | | } |
| | | bottleList[index].gameObject.SetActive(true); |
| | | bottleList[index].Display(key, holiday); |
| | | index++; |
| | | } |
| | | for (int i = index; i < bottleList.Count; i++) |
| | | { |
| | | bottleList[i].gameObject.SetActive(false); |
| | | } |
| | | |
| | | DisplayScroll(); |
| | | DisplayOpenTime(); |
| | | |
| | | var itemCnt = playerPack.GetItemCountByID(PackType.Item, model.wishItemID); |
| | | |
| | | wishTxt1.text = Language.Get("SubWishInfo4", model.wishCount1); |
| | | wishNeedNum1.text = (model.wishSingleNeedNum * model.wishCount1).ToString(); |
| | | if (itemCnt < model.wishSingleNeedNum * model.wishCount1) |
| | | wishNeedNum1.color = UIHelper.GetUIColor(TextColType.Red, true); |
| | | else |
| | | wishNeedNum1.color = UIHelper.GetUIColor(TextColType.LightYellow, true); |
| | | |
| | | wishTxt2.text = Language.Get("SubWishInfo4", model.wishCount2); |
| | | wishNeedNum2.text = (model.wishSingleNeedNum * model.wishCount2).ToString(); |
| | | if (itemCnt < model.wishSingleNeedNum * model.wishCount2) |
| | | wishNeedNum2.color = UIHelper.GetUIColor(TextColType.Red, true); |
| | | else |
| | | wishNeedNum2.color = UIHelper.GetUIColor(TextColType.LightYellow, true); |
| | | |
| | | allStarNum.text = itemCnt.ToString(); |
| | | } |
| | | |
| | | void DisplayScroll() |
| | | { |
| | | m_Controller.Refresh(); |
| | | OperationHolidayWish holiday; |
| | | OperationTimeHepler.Instance.TryGetOperation(operationType, out holiday); |
| | | |
| | | for (int i = 0; i < holiday.wishPool.Count; i++) |
| | | { |
| | | m_Controller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | m_Controller.Restart(); |
| | | m_Controller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | if (type != ScrollerDataType.Header) return; |
| | | var _cell = cell as HolidayWishPoolItemCell; |
| | | _cell.Display(_cell.index); |
| | | } |
| | | |
| | | private void OperationTimeUpdateEvent(Operation type) |
| | | { |
| | | if (type == operationType) |
| | | { |
| | | Display(); |
| | | } |
| | | } |
| | | |
| | | void UpdateLegendMsg() |
| | | { |
| | | string msg = string.Empty; |
| | | foreach (var legend in model.wishLegends) |
| | | { |
| | | if (legend.source == 1) |
| | | { |
| | | //祝福瓶获得 |
| | | msg += Language.Get("SubWishInfo6", legend.name, legend.itemID, legend.itemCount); |
| | | } |
| | | else { |
| | | msg += Language.Get("SubWishInfo5", legend.name, legend.itemID, legend.itemCount); |
| | | } |
| | | } |
| | | |
| | | wishLegend.text = msg; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 833ff8bebd4e1004aa9a7c597fbd710e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | |
| | | public class HolidayWishesWin : OneLevelWin |
| | | { |
| | | HolidayMultiRechargeModel rechargeModel { get { return ModelCenter.Instance.GetModel<HolidayMultiRechargeModel>(); } } |
| | | |
| | | int wishOrder = 0; // 如果外部存在跳转或者期望打开界面,则不根据红点跳转 第一个界面会被影响 |
| | | |
| | | #region Built-in |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | base.AddListeners(); |
| | | SetFunctionListener(0, ShowLoginWin); |
| | | SetFunctionListener(1, ShowAlchemyNormalDrug); |
| | | SetFunctionListener(2, ShowAlchemyFairy); |
| | | SetFunctionListener(3, ShowAlchemyFairyDrug); |
| | | SetFunctionListener(1, ShowHolidayWishPoolWin); |
| | | SetFunctionListener(2, ShowHolidayRechargeGiftWin); |
| | | SetFunctionListener(3, ShowHolidayTravelTaskWin); |
| | | } |
| | | |
| | | protected override void OnActived() |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | wishOrder = functionOrder; |
| | | base.OnPreOpen(); |
| | | SetFunctionButtonActive(0, true); |
| | | SetFunctionButtonActive(1, true); |
| | |
| | | SetFunctionButtonActive(1, false); |
| | | } |
| | | |
| | | if (!OpenServerActivityCenter.Instance.IsActivityOpen(103, (int)OpenServerActivityCenter.ActivityType.AT_JRZF)) |
| | | if (!OpenServerActivityCenter.Instance.IsActivityOpen(103, (int)OpenServerActivityCenter.ActivityType.AT_JRZF) || |
| | | !rechargeModel.hasAnyRecharge()) |
| | | { |
| | | SetFunctionButtonActive(2, false); |
| | | } |
| | | else |
| | | { |
| | | if (wishOrder == 0) |
| | | { |
| | | //默认打开充值大礼界面 |
| | | functionOrder = 2; |
| | | } |
| | | } |
| | | |
| | | if (!OpenServerActivityCenter.Instance.IsActivityOpen(104, (int)OpenServerActivityCenter.ActivityType.AT_JRZF)) |
| | |
| | | SetFunctionButtonActive(3, false); |
| | | } |
| | | |
| | | SelectOrder(); |
| | | } |
| | | |
| | | |
| | | |
| | | protected void SelectOrder() |
| | | { |
| | | //wishOrder 如果非0代表外部有传入期望开启的界面 第一个界面会被影响 |
| | | if (wishOrder != 0) return; |
| | | var infos = WindowConfig.GetWindowFunctionInfos("HolidayWishesWin"); |
| | | foreach (var info in infos) |
| | | { |
| | | if (RedpointCenter.Instance.GetRedpointState(info.redPointId) != RedPointState.None) |
| | | { |
| | | functionOrder = info.order; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | CloseSubWindows(); |
| | | base.OnPreClose(); |
| | | wishOrder = 0; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | functionOrder = 0; |
| | | } |
| | | |
| | | private void ShowAlchemyNormalDrug() |
| | | private void ShowHolidayWishPoolWin() |
| | | { |
| | | CloseSubWindows(); |
| | | WindowCenter.Instance.Open<AlchemyNormalUseDrugWin>(); |
| | | WindowCenter.Instance.Open<HolidayWishPoolWin>(); |
| | | functionOrder = 1; |
| | | } |
| | | |
| | | private void ShowAlchemyFairy() |
| | | private void ShowHolidayRechargeGiftWin() |
| | | { |
| | | CloseSubWindows(); |
| | | WindowCenter.Instance.Open<AlchemyFairyDrugWin>(); |
| | | WindowCenter.Instance.Open<HolidayRechargeGiftWin>(); |
| | | functionOrder = 2; |
| | | } |
| | | |
| | | private void ShowAlchemyFairyDrug() |
| | | private void ShowHolidayTravelTaskWin() |
| | | { |
| | | CloseSubWindows(); |
| | | WindowCenter.Instance.Open<AlchemyFairyUseDrugWin>(); |
| | | WindowCenter.Instance.Open<HolidayTravelTaskWin>(); |
| | | functionOrder = 3; |
| | | } |
| | | } |
| New file |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | namespace Snxxz.UI |
| | | { |
| | | public class OperationHolidayTravel : OperationBase |
| | | { |
| | | //游历任务ID:任务信息 |
| | | public Dictionary<byte, HAA46_tagMCFeastTravelInfo.tagMCFeastTravelTask> travelTasks = new Dictionary<byte, HAA46_tagMCFeastTravelInfo.tagMCFeastTravelTask>(); |
| | | //奖励索引:奖励信息 |
| | | public Dictionary<byte, HAA46_tagMCFeastTravelInfo.tagMCFeastTravelAward> travelAwards = new Dictionary<byte, HAA46_tagMCFeastTravelInfo.tagMCFeastTravelAward>(); |
| | | public override bool SatisfyOpenCondition() |
| | | { |
| | | return PlayerDatas.Instance.baseData.LV >= limitLv; |
| | | } |
| | | |
| | | public override string ToDisplayTime() |
| | | { |
| | | var textBuilder = OperationTimeHepler.textBuilder; |
| | | textBuilder.Length = 0; |
| | | textBuilder.Append(startDate.ToDisplay()); |
| | | if (startDate != endDate) |
| | | { |
| | | textBuilder.Append("—"); |
| | | textBuilder.Append(endDate.ToDisplay()); |
| | | } |
| | | return textBuilder.ToString(); |
| | | } |
| | | |
| | | public override void Reset() |
| | | { |
| | | base.Reset(); |
| | | } |
| | | |
| | | public void ParsePackage(HAA46_tagMCFeastTravelInfo package) |
| | | { |
| | | travelTasks.Clear(); |
| | | travelAwards.Clear(); |
| | | for (int i = 0; i < package.TravelAwardCount; i++) |
| | | { |
| | | travelAwards.Add(package.TravelAwardList[i].AwardIndex, package.TravelAwardList[i]); |
| | | } |
| | | |
| | | for (int i = 0; i < package.TravelTaskCount; i++) |
| | | { |
| | | travelTasks.Add(package.TravelTaskList[i].TravelTaskID, package.TravelTaskList[i]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7a6f5638c4bfe7842ad9ca7a12688700 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | namespace Snxxz.UI |
| | | { |
| | | public class OperationHolidayWish : OperationBase |
| | | { |
| | | //瓶子编号对应的信息 |
| | | public Dictionary<byte, HAA43_tagMCFeastWishInfo.tagMCFeastWishBottleInfo> wishBottles = new Dictionary<byte, HAA43_tagMCFeastWishInfo.tagMCFeastWishBottleInfo>(); |
| | | public List<uint> wishPool = new List<uint>(); //展示奖池物品ID |
| | | |
| | | public override bool SatisfyOpenCondition() |
| | | { |
| | | return PlayerDatas.Instance.baseData.LV >= limitLv; |
| | | } |
| | | |
| | | public override string ToDisplayTime() |
| | | { |
| | | var textBuilder = OperationTimeHepler.textBuilder; |
| | | textBuilder.Length = 0; |
| | | textBuilder.Append(startDate.ToDisplay()); |
| | | if (startDate != endDate) |
| | | { |
| | | textBuilder.Append("—"); |
| | | textBuilder.Append(endDate.ToDisplay()); |
| | | } |
| | | return textBuilder.ToString(); |
| | | } |
| | | |
| | | public override void Reset() |
| | | { |
| | | base.Reset(); |
| | | } |
| | | |
| | | public void ParsePackage(HAA43_tagMCFeastWishInfo package) |
| | | { |
| | | wishPool.Clear(); |
| | | for (int i = 0; i < package.WishPoolShowItemList.Length; i++) |
| | | { |
| | | wishPool.Add(package.WishPoolShowItemList[i]); |
| | | } |
| | | |
| | | wishBottles.Clear(); |
| | | for (int i = 0; i < package.BottleInfoList.Length; i++) |
| | | { |
| | | wishBottles.Add(package.BottleInfoList[i].BottleNum, package.BottleInfoList[i]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4dd67f0928853d14eb487df8dfb9aa79 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, September 14, 2017 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class TextMove : MonoBehaviour |
| | | { |
| | | [SerializeField] ScreenMoveTo m_MoveTo; |
| | | [SerializeField] UIAlphaTween m_AlphaTween; |
| | | |
| | | [SerializeField] Text m_Text; |
| | | public float startX; |
| | | public float startY; |
| | | |
| | | |
| | | public void Begin(string content) |
| | | { |
| | | this.transform.SetActive(true); |
| | | SetEnable(true); |
| | | m_Text.text = content; |
| | | |
| | | this.transform.localPosition = new Vector3(startX, startY, 0); |
| | | m_MoveTo.Begin(OnFloatEnd); |
| | | m_Text.color = m_Text.color.SetA(1f); |
| | | m_AlphaTween.SetStartState(); |
| | | m_AlphaTween.Play(); |
| | | } |
| | | |
| | | public void SetEnable(bool _enable) |
| | | { |
| | | m_MoveTo.enabled = _enable; |
| | | m_AlphaTween.enabled = _enable; |
| | | } |
| | | |
| | | private void OnFloatEnd() |
| | | { |
| | | SetEnable(false); |
| | | this.transform.SetActive(false); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 533fe0e50f5571946a1462416c3d622b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, June 21, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class WishBottleAwardWin : Window |
| | | { |
| | | |
| | | List<ItemCell> itemList = new List<ItemCell>(); |
| | | List<Image> itemSelect = new List<Image>(); |
| | | List<Image> getYetList = new List<Image>(); |
| | | Button m_OKButton; |
| | | Text m_Text; |
| | | Button m_CloseButton; |
| | | |
| | | int SelectIndex = -1; |
| | | Operation operationType = Operation.HolidayWish; |
| | | |
| | | HolidayWishPoolModel model { get { return ModelCenter.Instance.GetModel<HolidayWishPoolModel>(); } } |
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | | |
| | | #region Built-in |
| | | |
| | | protected override void BindController() |
| | | { |
| | | itemList.Clear(); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell1")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell2")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell3")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell4")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell5")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell6")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell7")); |
| | | itemList.Add(GetWidgt<ItemCell>("ItemCell8")); |
| | | |
| | | itemSelect.Clear(); |
| | | itemSelect.Add(GetWidgt<Image>("select1")); |
| | | itemSelect.Add(GetWidgt<Image>("select2")); |
| | | itemSelect.Add(GetWidgt<Image>("select3")); |
| | | itemSelect.Add(GetWidgt<Image>("select4")); |
| | | itemSelect.Add(GetWidgt<Image>("select5")); |
| | | itemSelect.Add(GetWidgt<Image>("select6")); |
| | | itemSelect.Add(GetWidgt<Image>("select7")); |
| | | itemSelect.Add(GetWidgt<Image>("select8")); |
| | | |
| | | getYetList.Clear(); |
| | | getYetList.Add(GetWidgt<Image>("yet1")); |
| | | getYetList.Add(GetWidgt<Image>("yet2")); |
| | | getYetList.Add(GetWidgt<Image>("yet3")); |
| | | getYetList.Add(GetWidgt<Image>("yet4")); |
| | | getYetList.Add(GetWidgt<Image>("yet5")); |
| | | getYetList.Add(GetWidgt<Image>("yet6")); |
| | | getYetList.Add(GetWidgt<Image>("yet7")); |
| | | getYetList.Add(GetWidgt<Image>("yet8")); |
| | | |
| | | m_OKButton = GetWidgt<Button>("OK"); |
| | | m_CloseButton = GetWidgt<Button>("CloseBtn"); |
| | | m_Text = GetWidgt<Text>("wishText"); |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | m_CloseButton.AddListener(CloseClick); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | SelectIndex = -1; |
| | | model.UpdateBottleInfo += Display; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | model.UpdateBottleInfo -= Display; |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | void Display() |
| | | { |
| | | OperationHolidayWish holiday; |
| | | OperationTimeHepler.Instance.TryGetOperation(operationType, out holiday); |
| | | |
| | | |
| | | for (int i = 0; i < itemList.Count; i++) |
| | | { |
| | | var items = holiday.wishBottles[model.bottleNumSelect].ChoosePrizeList; |
| | | if (i < items.Length) |
| | | { |
| | | itemList[i].gameObject.SetActive(true); |
| | | |
| | | int itemID = (int)items[i].ItemID; |
| | | var config = ItemConfig.Get(itemID); |
| | | var itemData = new ItemCellModel(itemID, false, items[i].ItemCount); |
| | | itemList[i].Init(itemData); |
| | | itemList[i].auctionIcon.gameObject.SetActive(items[i].IsBind > 0 ? true : false); |
| | | |
| | | |
| | | //选中 |
| | | foreach (var select in itemSelect) |
| | | { |
| | | select.gameObject.SetActive(false); |
| | | } |
| | | if (SelectIndex != -1) |
| | | itemSelect[SelectIndex].gameObject.SetActive(true); |
| | | |
| | | int index = i; |
| | | itemList[i].button.SetListener(() => { |
| | | foreach (var select in itemSelect) |
| | | { |
| | | select.gameObject.SetActive(false); |
| | | } |
| | | itemSelect[index].gameObject.SetActive(true); |
| | | if (SelectIndex == index) |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | } |
| | | |
| | | SelectIndex = index; |
| | | }); |
| | | |
| | | //已领取 |
| | | getYetList[i].gameObject.SetActive(model.GetBottleAwardState(model.bottleNumSelect, i) == 1); |
| | | } |
| | | else |
| | | { |
| | | itemList[i].gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | var needNum = holiday.wishBottles[model.bottleNumSelect].NeedWishValue; |
| | | var curNum = model.bottleDict[model.bottleNumSelect].x; |
| | | string curNumStr = UIHelper.AppendColor(curNum >= needNum ? TextColType.DarkGreen:TextColType.Red, curNum.ToString()); |
| | | |
| | | m_Text.text = Language.Get("SubWishInfo7", curNumStr, needNum); |
| | | |
| | | m_OKButton.SetListener(() => { |
| | | if (SelectIndex == -1) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("WishBottle1"); |
| | | return; |
| | | } |
| | | if (model.GetBottleAwardState(model.bottleNumSelect, SelectIndex) == 1) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("WishBottle"); |
| | | return; |
| | | } |
| | | |
| | | if (playerPack.GetEmptyGridCount(PackType.Item) <= 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("BagFull"); |
| | | return; |
| | | } |
| | | |
| | | if (curNum < needNum) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("WishBottle2"); |
| | | return; |
| | | } |
| | | |
| | | int recordIndex = holiday.wishBottles[model.bottleNumSelect].ChoosePrizeList[SelectIndex].RecordIndex; |
| | | |
| | | CAA10_tagCMFeastWishBottleChooseItem wish = new CAA10_tagCMFeastWishBottleChooseItem(); |
| | | wish.BottleNum = model.bottleNumSelect; |
| | | wish.RecordIndex = (byte)recordIndex; |
| | | GameNetSystem.Instance.SendInfo(wish); |
| | | }); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6ce78a3b2fd4c5343ba3ac108ff81823 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | {
|
| | | OperationBase operationBase = null;
|
| | |
|
| | | var opreationType = package.ActNum == 1 ? Operation.AccumulateRecharge : Operation.DaysAccumulateRecharge;
|
| | | Operation opreationType = Operation.AccumulateRecharge;
|
| | | if (package.ActNum == 1)
|
| | | {
|
| | | opreationType = Operation.AccumulateRecharge;
|
| | | }
|
| | | else if (package.ActNum == 2)
|
| | | {
|
| | | opreationType = Operation.DaysAccumulateRecharge;
|
| | | }
|
| | | else if (package.ActNum == 3)
|
| | | {
|
| | | opreationType = Operation.HolidayMultiRecharge;
|
| | | }
|
| | |
|
| | | operationDict.TryGetValue(opreationType, out operationBase);
|
| | | if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateHolidayWish(HAA43_tagMCFeastWishInfo package)
|
| | | {
|
| | | OperationBase operationBase = null;
|
| | | operationDict.TryGetValue(Operation.HolidayWish, out operationBase);
|
| | | if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | {
|
| | | ForceStopOperation(Operation.HolidayWish);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (operationBase == null)
|
| | | {
|
| | | operationBase = new OperationHolidayWish();
|
| | | operationDict.Add(Operation.HolidayWish, operationBase);
|
| | | }
|
| | | var operation = operationBase as OperationHolidayWish;
|
| | | operation.Reset();
|
| | | operation.startDate = ParseOperationDate(package.StartDate);
|
| | | operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | operation.resetType = package.ResetType;
|
| | | operation.ParsePackage(package);
|
| | | if (operationTimeUpdateEvent != null)
|
| | | {
|
| | | operationTimeUpdateEvent(Operation.HolidayWish);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public void UpdateHolidayTravel(HAA46_tagMCFeastTravelInfo package)
|
| | | {
|
| | | OperationBase operationBase = null;
|
| | | operationDict.TryGetValue(Operation.HolidayTravel, out operationBase);
|
| | | if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | {
|
| | | ForceStopOperation(Operation.HolidayTravel);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (operationBase == null)
|
| | | {
|
| | | operationBase = new OperationHolidayTravel();
|
| | | operationDict.Add(Operation.HolidayTravel, operationBase);
|
| | | }
|
| | | var operation = operationBase as OperationHolidayTravel;
|
| | | operation.Reset();
|
| | | operation.startDate = ParseOperationDate(package.StartDate);
|
| | | operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | operation.resetType = package.ResetType;
|
| | | operation.ParsePackage(package);
|
| | | if (operationTimeUpdateEvent != null)
|
| | | {
|
| | | operationTimeUpdateEvent(Operation.HolidayTravel);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateMultiRechargePackage(HAA27_tagMCActRechargePrizeInfo package)
|
| | | {
|
| | |
| | | DaysAccumulateRecharge, //累计充值,多日
|
| | | CollectWords, //收集文字
|
| | | HolidayLogin, //节日登录
|
| | | HolidayWish, //节日祝福灯笼
|
| | | HolidayMultiRecharge,//节日祝福的多日累计充值
|
| | | HolidayTravel, //节日游历
|
| | | max,
|
| | | }
|
| | | }
|
| | |
| | | RegisterModel<CollectWordsModel>();
|
| | |
|
| | | RegisterModel<HolidayLoginModel>();
|
| | | RegisterModel<HolidayWishPoolModel>();
|
| | | RegisterModel<HolidayMultiRechargeModel>();
|
| | | RegisterModel<HolidayTravelModel>();
|
| | |
|
| | | inited = true;
|
| | | }
|
| | |
| | | |
| | | m_TitleIcon.SetSprite(WindowConfig.GetTitleIconKey(name)); |
| | | m_TitleIcon.SetNativeSize(); |
| | | |
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataUpdate; |
| | | |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | |
| | | m_Diamond = this.GetComponent<Text>("Pivot/Container_BackGround/FollowStoreBottom/GoldCountBG/CountText"); |
| | | m_BindDiamond = this.GetComponent<Text>("Pivot/Container_BackGround/FollowStoreBottom/GoldPaperCountBG/CountText"); |
| | | |
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataUpdate; |
| | | |
| | | UpdateMoney(); |
| | | } |
| | | |
| | |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataUpdate; |
| | | CloseSubWindows(); |
| | | } |
| | | |
| | |
| | | m_Group.SetFunctionButtonActive(order, isShow); |
| | | } |
| | | |
| | | public RedPointState GetFunctionButtonRedPointState(int order) |
| | | { |
| | | return m_Group.GetFunctionButtonRedPointState(order); |
| | | } |
| | | |
| | | public void FunctionButtonInvoke(int order) |
| | | { |
| | | m_Group.TriggerByOrder(order); |
| | | m_Group.GotoOrder(order); |
| | | } |
| | | |
| | | private void OnPlayerDataUpdate(PlayerDataType type) |
| | | { |
| | | switch (type) |
| | |
| | | ModelCenter.Instance.GetModel<ImpactRankModel>().gotoImpactRankType = type;
|
| | | SetJumpLogic<OpenServerActivityRankWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.HolidayWishBottle:
|
| | | SetJumpLogic<HolidayWishesWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.OpenServerActivityFunc2_1:
|
| | | case JumpUIType.OpenServerActivityFunc2_2:
|
| | | ModelCenter.Instance.GetModel<OSRedEnvelopeModel>().JumpType = int.Parse(_tagWinSearchModel.SelectActive) + 1;
|
| | |
| | | if (!OpenServerActivityCenter.Instance.IsActivityOpen(_tagWinSearchModel.TABID))
|
| | | {
|
| | | OperationTimeHepler.Instance.ProcessConditionError(Operation.DaysAccumulateRecharge);
|
| | | return false;
|
| | | }
|
| | | }
|
| | | break;
|
| | | case JumpUIType.HolidayWishBottle:
|
| | | {
|
| | | if (!OpenServerActivityCenter.Instance.IsActivityOpen(int.Parse(_tagWinSearchModel.SelectActive), (int)OpenServerActivityCenter.ActivityType.AT_JRZF))
|
| | | {
|
| | | OperationTimeHepler.Instance.ProcessConditionError(Operation.HolidayWish);
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | OpenServer_JZYY = 400, //集字 活动界面
|
| | | OpenServer_JZHF = 401, //集字 合服界面
|
| | | HolidayWishBottle = 402, //节日祝福-灯笼
|
| | |
|
| | | DhszTs = 1001,//定海神针功法提升界面
|
| | | HyqTs = 1002,//皓月枪功法提升界面
|
| | |
| | | { |
| | | functionButtons[order].gameObject.SetActive(isShow); |
| | | } |
| | | }
|
| | |
|
| | | public RedPointState GetFunctionButtonRedPointState(int order)
|
| | | { |
| | | if (functionButtons.ContainsKey(order)) |
| | | { |
| | | return RedpointCenter.Instance.GetRedpointState(functionButtons[order].redpoint.redpointId); |
| | | } |
| | | |
| | | return RedPointState.None; |
| | | } |
| | | } |
| | | |
| | |
| | | normalTasks.Add(new ConfigInitTask("HorseLVUpConfig", () => { HorseLVUpConfig.Init(); }, () => { return HorseLVUpConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("HorseSkinPlusConfig", () => { HorseSkinPlusConfig.Init(); }, () => { return HorseSkinPlusConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("FirstGoldConfig", () => { FirstGoldConfig.Init(); }, () => { return FirstGoldConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("ActFeastTravelTaskConfig", () => { ActFeastTravelTaskConfig.Init(); }, () => { return ActFeastTravelTaskConfig.inited; })); |
| | | } |
| | | |
| | | static List<ConfigInitTask> doingTasks = new List<ConfigInitTask>(); |
| | |
| | | Def_RewardType_ActivityPlace = 30,//活跃放置奖励
|
| | |
|
| | | Def_RewardType_HolidayLogin = 37,//节日登录奖励
|
| | | Def_RewardType_HolidayTravel = 38,//节日游历奖励
|
| | | }
|
| | |
|
| | | [XLua.LuaCallCSharp]
|