3 文件已复制
3个文件已删除
1 文件已重命名
10个文件已修改
4个文件已添加
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: Fish
|
| | | // [ Date ]: Wednesday, May 15, 2019
|
| | | // [ Date ]: Friday, April 10, 2020
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public readonly string Condition2;
|
| | | public readonly int Condition3;
|
| | | public readonly string AwardItemList;
|
| | | public readonly string AwardItemList2;
|
| | | public readonly string Money;
|
| | | public readonly int Exp;
|
| | | public readonly int[] AwardAttribute;
|
| | |
| | |
|
| | | AwardItemList = tables[7];
|
| | |
|
| | | Money = tables[8];
|
| | | AwardItemList2 = tables[8];
|
| | |
|
| | | int.TryParse(tables[9],out Exp); |
| | | Money = tables[9];
|
| | |
|
| | | string[] AwardAttributeStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | int.TryParse(tables[10],out Exp); |
| | |
|
| | | string[] AwardAttributeStringArray = tables[11].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | AwardAttribute = new int[AwardAttributeStringArray.Length]; |
| | | for (int i=0;i<AwardAttributeStringArray.Length;i++) |
| | | { |
| | | int.TryParse(AwardAttributeStringArray[i],out AwardAttribute[i]); |
| | | }
|
| | |
|
| | | int.TryParse(tables[11],out RedPacketID); |
| | | int.TryParse(tables[12],out RedPacketID); |
| | |
|
| | | int.TryParse(tables[12],out MagicWeaponID); |
| | | int.TryParse(tables[13],out MagicWeaponID); |
| | |
|
| | | MagicWeaponExp = tables[13];
|
| | | MagicWeaponExp = tables[14];
|
| | |
|
| | | Describe = tables[14];
|
| | | Describe = tables[15];
|
| | |
|
| | | int.TryParse(tables[15],out NeedGoto); |
| | | int.TryParse(tables[16],out NeedGoto); |
| | |
|
| | | int.TryParse(tables[16],out Jump); |
| | | int.TryParse(tables[17],out Jump); |
| | |
|
| | | int.TryParse(tables[17],out ReOrder); |
| | | int.TryParse(tables[18],out ReOrder); |
| | |
|
| | | int.TryParse(tables[18],out RealmPracticeID); |
| | | int.TryParse(tables[19],out RealmPracticeID); |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5d5d6e9a9f92bca4a882d34931ec3dce |
| | | timeCreated: 1557892654 |
| | | timeCreated: 1586517385 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A5 42 领取成就奖励 #tagMCGetSuccessAward
|
| | |
|
| | | public class CA542_tagMCGetSuccessAward : GameNetPackBasic {
|
| | | public uint SuccID; //成就ID
|
| | | public byte IsPassport; //是否通行证奖励
|
| | |
|
| | | public CA542_tagMCGetSuccessAward () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA542;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (SuccID, NetDataType.DWORD);
|
| | | WriteBytes (IsPassport, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| File was renamed from Core/NetworkPackage/ClientPack/ClientToMapServer/A5_Function/CA542_tagMCGetSuccessAward.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b6d5b9631112cfd42980e7e34d8ae486 |
| | | timeCreated: 1507866924 |
| | | guid: 7e82207a2db764f488679a970e612e0e |
| | | timeCreated: 1586426655 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | { |
| | | model.UpdateAchievementProgress(_list[k], (int)successInfo.CntValue); |
| | | } |
| | | model.UpdateSuccessBPRedpoint(0, successInfo.SuccType); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (model.TryGetAchievement(achievementId, out achievement)) |
| | | { |
| | | var completed = MathUtility.GetBitValue(record.Record, (ushort)j); |
| | | model.UpdateAchievementCompleteState(achievement.id, completed); |
| | | var completedBP = MathUtility.GetBitValue(record.PassportRecord, (ushort)j); |
| | | model.UpdateAchievementCompleteState(achievement.id, completed, completedBP); |
| | | } |
| | | } |
| | | } |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //A3 42 成就完成领奖记录列表 #tagMCSuccessFinishAwardRecordList
|
| | |
|
| | | public class HA342_tagMCSuccessFinishAwardRecordList : GameNetPackBasic {
|
| | | public ushort RecordCnt; //记录个数
|
| | | public tagMCSuccessFinishAwardRecord[] RecordList; //记录列表
|
| | |
|
| | | public HA342_tagMCSuccessFinishAwardRecordList () {
|
| | | _cmd = (ushort)0xA342;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out RecordCnt, vBytes, NetDataType.WORD);
|
| | | RecordList = new tagMCSuccessFinishAwardRecord[RecordCnt];
|
| | | for (int i = 0; i < RecordCnt; i ++) {
|
| | | RecordList[i] = new tagMCSuccessFinishAwardRecord();
|
| | | TransBytes (out RecordList[i].RecordIndex, vBytes, NetDataType.WORD);
|
| | | TransBytes (out RecordList[i].Record, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCSuccessFinishAwardRecord {
|
| | | public ushort RecordIndex; //第几个记录值 每个key存31个succid 0-30为0, 31-61为1..
|
| | | public uint Record; //对应是否领取值
|
| | | }
|
| | |
|
| | | }
|
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //A3 42 成就完成领奖记录列表 #tagMCSuccessFinishAwardRecordList |
| | | |
| | | public class HA342_tagMCSuccessFinishAwardRecordList : GameNetPackBasic |
| | | { |
| | | public ushort RecordCnt; //记录个数 |
| | | public tagMCSuccessFinishAwardRecord[] RecordList; //记录列表 |
| | | |
| | | public HA342_tagMCSuccessFinishAwardRecordList() |
| | | { |
| | | _cmd = (ushort)0xA342; |
| | | } |
| | | |
| | | public override void ReadFromBytes(byte[] vBytes) |
| | | { |
| | | TransBytes(out RecordCnt, vBytes, NetDataType.WORD); |
| | | RecordList = new tagMCSuccessFinishAwardRecord[RecordCnt]; |
| | | for (int i = 0; i < RecordCnt; i++) |
| | | { |
| | | RecordList[i] = new tagMCSuccessFinishAwardRecord(); |
| | | TransBytes(out RecordList[i].RecordIndex, vBytes, NetDataType.WORD); |
| | | TransBytes(out RecordList[i].Record, vBytes, NetDataType.DWORD); |
| | | TransBytes(out RecordList[i].PassportRecord, vBytes, NetDataType.DWORD); |
| | | } |
| | | } |
| | | |
| | | public struct tagMCSuccessFinishAwardRecord |
| | | { |
| | | public ushort RecordIndex; //第几个记录值 每个key存31个succid 0-30为0, 31-61为1.. |
| | | public uint Record; //对应是否领取值 |
| | | public uint PassportRecord; //通行证奖励是否领取值 |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | public readonly int id; |
| | | public readonly AchievementRewardItem[] rewardItem = new AchievementRewardItem[] { }; |
| | | public readonly AchievementRewardItem[] rewardItemBP = new AchievementRewardItem[] { }; |
| | | public readonly AchievementRewardCurrency[] rewardCurrency = new AchievementRewardCurrency[] { }; |
| | | public readonly int rewardExp = 0; |
| | | |
| | |
| | | set { m_Completed = value; } |
| | | } |
| | | |
| | | bool m_CompletedBP = false;//战令 true表示已经领了奖 |
| | | public bool completedBP |
| | | { |
| | | get |
| | | { |
| | | return m_CompletedBP; |
| | | } |
| | | set { m_CompletedBP = value; } |
| | | } |
| | | |
| | | |
| | | int m_Progress = 0; |
| | | public int progress { |
| | | get { |
| | |
| | | } |
| | | } |
| | | |
| | | public Achievement(int _id, string _itemReward, string _currencyReward, int _exp) |
| | | public Achievement(SuccessConfig config) |
| | | { |
| | | this.id = _id; |
| | | string _itemReward = config.AwardItemList; |
| | | string _itemRewardBP = config.AwardItemList2; |
| | | string _currencyReward = config.Money; |
| | | int _exp = config.Exp; |
| | | this.id = config.ID; |
| | | |
| | | if (!string.IsNullOrEmpty(_itemReward) && _itemReward.Length > 1) |
| | | { |
| | |
| | | rewardItem[i] = new AchievementRewardItem(itemRewardArray[i]); |
| | | } |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(_itemRewardBP) && _itemRewardBP.Length > 1) |
| | | { |
| | | var itemRewardArray = _itemRewardBP.Split('|'); |
| | | rewardItemBP = new AchievementRewardItem[itemRewardArray.Length]; |
| | | for (var i = 0; i < itemRewardArray.Length; i++) |
| | | { |
| | | rewardItemBP[i] = new AchievementRewardItem(itemRewardArray[i]); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (!string.IsNullOrEmpty(_currencyReward) && _currencyReward.Length > 1) |
| | | { |
| | |
| | | |
| | | public void ResetAchievementState() |
| | | { |
| | | completedBP = false; |
| | | completed = false; |
| | | progress = 0; |
| | | } |
| | |
| | | Dictionary<int, Achievement> achievements = new Dictionary<int, Achievement>();
|
| | | Dictionary<int, List<int>> achievementCategorys = new Dictionary<int, List<int>>();
|
| | |
|
| | | VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
|
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | TaskModel taskmodel { get { return ModelCenter.Instance.GetModel<TaskModel>(); } }
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | | Dictionary<int, int> equipQualityItemIdTables = new Dictionary<int, int>() { { 1, 2110 }, { 2, 2111 }, { 3, 2112 }, { 4, 2113 }, { 5, 2114 } };
|
| | | public Dictionary<int, Redpoint> SuccessBPRedPoint = new Dictionary<int, Redpoint>();
|
| | | public string[] SuccessBPArray;
|
| | | LogicUpdate logicUpdate = new LogicUpdate(0.4f);
|
| | |
|
| | | public Redpoint redpoint = new Redpoint(201, 20111);
|
| | |
|
| | | #region
|
| | | //修行之路
|
| | | public event Action OnUpdateBPDataEvent;
|
| | | public int BPCTGID = 117;
|
| | | private int m_selectSuccessType = 0;
|
| | | public event Action selectSuccessTypeRefresh;
|
| | | public int selectSuccessType |
| | | {
|
| | | get { return m_selectSuccessType;
|
| | | }
|
| | | set
|
| | | {
|
| | | if (m_selectSuccessType != value)
|
| | | {
|
| | | m_selectSuccessType = value;
|
| | | if (selectSuccessTypeRefresh != null)
|
| | | {
|
| | | selectSuccessTypeRefresh();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | // 修行之路 战令购买
|
| | | public bool isBuyBP()
|
| | | {
|
| | | VipModel.RechargeCount rechargeCount;
|
| | | if (vipModel.TryGetRechargeCount(BPCTGID, out rechargeCount))
|
| | | {
|
| | | return rechargeCount.totalCount >= 1;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | | #endregion
|
| | | public override void Init()
|
| | | {
|
| | | ParseAchievementConfig();
|
| | | InitRedPoint();
|
| | | logicUpdate.Start(OnUpdate);
|
| | | }
|
| | |
|
| | | public void InitRedPoint()
|
| | | {
|
| | | SuccessBPRedPoint.Clear();
|
| | | foreach (var ids in SuccessBPArray)
|
| | | {
|
| | | int id = int.Parse(ids);
|
| | | //按类型分红点
|
| | | SuccessBPRedPoint[id] = new Redpoint(20111, 20111*1000 + id);
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | | List<int> refreshType = new List<int>();
|
| | | //进度和领取变化
|
| | | public void UpdateSuccessBPRedpoint(int successID, int successType)
|
| | | {
|
| | | if (successType != 0)
|
| | | {
|
| | | if (refreshType.Contains(successType))
|
| | | {
|
| | | return;
|
| | | }
|
| | | refreshType.Add(successType);
|
| | | return;
|
| | | }
|
| | | var config = SuccessConfig.Get(successID);
|
| | | if (config == null)
|
| | | return;
|
| | |
|
| | | if (refreshType.Contains(config.Type))
|
| | | {
|
| | | return;
|
| | | }
|
| | | refreshType.Add(config.Type);
|
| | | return;
|
| | | }
|
| | |
|
| | |
|
| | | public void RefreshSuccessBPRedpoint()
|
| | | {
|
| | | if (refreshType.Count == 0)
|
| | | return;
|
| | |
|
| | | foreach (int successType in refreshType)
|
| | | {
|
| | | if (!SuccessBPRedPoint.ContainsKey(successType))
|
| | | continue;
|
| | | var idList = GetAchievementsByCategory(successType);
|
| | |
|
| | | bool state = false;
|
| | | foreach (var successID in idList)
|
| | | {
|
| | | if (!achievements.ContainsKey(successID))
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (!Achievement.IsReach(successID, achievements[successID].progress))
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (achievements[successID].completed == false || achievements[successID].completedBP == false)
|
| | | {
|
| | | state = true;
|
| | | break;
|
| | | }
|
| | | }
|
| | | SuccessBPRedPoint[successType].state = state == true ? RedPointState.Simple : RedPointState.None;
|
| | | if (successType == selectSuccessType)
|
| | | {
|
| | | if (OnUpdateBPDataEvent != null)
|
| | | OnUpdateBPDataEvent();
|
| | | }
|
| | | }
|
| | | refreshType.Clear();
|
| | | }
|
| | |
|
| | | private void OnUpdate()
|
| | | {
|
| | | RefreshSuccessBPRedpoint();
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | GameNetSystem.Instance.SendInfo(sendInfo);
|
| | | }
|
| | |
|
| | | public void UpdateAchievementCompleteState(int _achievementId, bool _completed)
|
| | | public void UpdateAchievementCompleteState(int _achievementId, bool _completed, bool _completedBP)
|
| | | {
|
| | | Achievement achievement;
|
| | | if (TryGetAchievement(_achievementId, out achievement))
|
| | |
| | | achievementCompletedEvent(_achievementId);
|
| | | }
|
| | | }
|
| | | if (achievement.completedBP != _completedBP)
|
| | | {
|
| | | achievement.completedBP = _completedBP;
|
| | | if (achievementCompletedEvent != null)
|
| | | {
|
| | | achievementCompletedEvent(_achievementId);
|
| | | }
|
| | | }
|
| | |
|
| | | UpdateSuccessBPRedpoint(_achievementId, 0);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void SortAchievementCategorys()
|
| | | {
|
| | | foreach (var achievementCategory in achievementCategorys)
|
| | | {
|
| | | achievementCategory.Value.Sort(CompareOrder);
|
| | | }
|
| | | }
|
| | | private int CompareOrder(int x, int y)
|
| | | {
|
| | | var xconfig = SuccessConfig.Get(x);
|
| | | var yconfig = SuccessConfig.Get(y);
|
| | |
|
| | | return xconfig.ReOrder.CompareTo(yconfig.ReOrder);
|
| | | }
|
| | |
|
| | | private void ParseAchievementConfig()
|
| | | {
|
| | | var allconfig = SuccessConfig.GetValues();
|
| | | foreach (var config in allconfig)
|
| | | {
|
| | | this.achievements[config.ID] = new Achievement(config.ID, config.AwardItemList, config.Money, config.Exp);
|
| | | this.achievements[config.ID] = new Achievement(config);
|
| | |
|
| | | List<int> achievements;
|
| | | if (achievementCategorys.ContainsKey(config.Type))
|
| | |
| | | _list.Add(config.ID);
|
| | |
|
| | | }
|
| | |
|
| | | SuccessBPArray = FuncConfigConfig.Get("PracticeSuccess").Numerical1.Split('|');
|
| | | SortAchievementCategorys();
|
| | | }
|
| | |
|
| | | const string conditionPattern = "@Condition@";
|
| | |
| | | |
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | | EquipStarModel starModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } } |
| | | EquipStrengthModel strengthModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } } |
| | | EquipTrainModel trainModel { get { return ModelCenter.Instance.GetModel<EquipTrainModel>(); } } |
| | | |
| | | public event Action appearanceChangeEvent; |
| | | public event Action<int> OnSelectSetEvent; |
| | |
| | | return realmEquipTypes.Contains(equipPlace); |
| | | } |
| | | |
| | | |
| | | //获得符合条件的装备件数(8件套) |
| | | public int GetEquipCountByCond(int level, int color = 0, bool isSuit = false) |
| | | { |
| | | int count = 0; |
| | | for (int i = 1; i <= 8; i++) |
| | | { |
| | | var equipGuid = GetEquip(new Int2(level, i)); |
| | | var itemModel = packModel.GetItemByGuid(equipGuid); |
| | | if (itemModel != null) |
| | | { |
| | | if (itemModel.config.ItemColor < color) |
| | | continue; |
| | | |
| | | if (isSuit && itemModel.config.SuiteiD == 0) |
| | | continue; |
| | | |
| | | count++; |
| | | } |
| | | } |
| | | |
| | | return count; |
| | | } |
| | | |
| | | //获得符合条件的装备部位数(8件套) |
| | | public int GetEquipSetCountByCond(int level, int star = 0, int plusLV = 0, int trainLV = 0) |
| | | { |
| | | int count = 0; |
| | | for (int i = 1; i <= 8; i++) |
| | | { |
| | | if (starModel.GetStarLevel(new Int2(level, i)) < star) |
| | | continue; |
| | | |
| | | if (strengthModel.GetStrengthLevel(level, i) < plusLV) |
| | | continue; |
| | | |
| | | if (trainModel.GetTrainLevelEx(new Int2(level, i)) < trainLV) |
| | | continue; |
| | | |
| | | count++; |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | public struct EquipSuitPropertyEntry |
| | |
| | | return Mathf.Min(maxLevel, equipTrains[equipPosition.x].GetTrainLevel(equipPosition.y)); |
| | | } |
| | | |
| | | public int GetTrainLevelEx(Int2 equipPosition) |
| | | { |
| | | var equip = equipModel.GetEquip(equipPosition); |
| | | if (string.IsNullOrEmpty(equip)) |
| | | { |
| | | return 0; |
| | | } |
| | | |
| | | if (!equipTrains.ContainsKey(equipPosition.x)) |
| | | { |
| | | return 0; |
| | | } |
| | | |
| | | return equipTrains[equipPosition.x].GetTrainLevel(equipPosition.y); |
| | | } |
| | | |
| | | |
| | | public int GetMaterialNeed(Int2 equipPosition) |
| | | { |
| | | var level = GetTrainLevel(equipPosition); |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class SuccessBPCell : CellView |
| | | { |
| | | [SerializeField] ItemCell[] m_Items; |
| | | [SerializeField] ItemCell[] m_BPItems; |
| | | [SerializeField] Image[] m_GotImages; |
| | | [SerializeField] Text SuccessCond; |
| | | [SerializeField] Text SuccessProcess; |
| | | [SerializeField] Button m_GetBtn; |
| | | [SerializeField] Text m_GetText; |
| | | [SerializeField] Image m_GetYetImg; |
| | | [SerializeField] UIEffect m_GetEffect; |
| | | |
| | | AchievementModel model { get { return ModelCenter.Instance.GetModel<AchievementModel>(); } } |
| | | VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } } |
| | | public void Display(int successID) |
| | | { |
| | | Achievement achievement; |
| | | if (!model.TryGetAchievement(successID, out achievement)) |
| | | { |
| | | return; |
| | | } |
| | | var config = SuccessConfig.Get(successID); |
| | | |
| | | SuccessCond.text = AchievementModel.ParseAchievementDescription(successID); |
| | | if (achievement.progress >= config.NeedCnt) |
| | | { |
| | | SuccessProcess.text = "(" + UIHelper.AppendColor(TextColType.Green, achievement.progress.ToString()) + "/" + config.NeedCnt + ")"; |
| | | } |
| | | else |
| | | { |
| | | SuccessProcess.text = "(" + UIHelper.AppendColor(TextColType.Red, achievement.progress.ToString()) + "/" + config.NeedCnt + ")"; |
| | | } |
| | | for (int i = 0; i < m_Items.Length; i++) |
| | | { |
| | | if (i < achievement.rewardItem.Length) |
| | | { |
| | | m_Items[i].gameObject.SetActive(true); |
| | | m_GotImages[i].gameObject.SetActive(achievement.completed); |
| | | var _item = achievement.rewardItem[i]; |
| | | ItemCellModel _ItemData = new ItemCellModel(_item.id, true, (ulong)_item.count); |
| | | m_Items[i].Init(_ItemData); |
| | | m_Items[i].button.RemoveAllListeners(); |
| | | m_Items[i].button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(_item.id); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | m_Items[i].gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | //战令道具 |
| | | for (int i = 0; i < m_BPItems.Length; i++) |
| | | { |
| | | if (i < achievement.rewardItemBP.Length) |
| | | { |
| | | m_BPItems[i].gameObject.SetActive(true); |
| | | m_GotImages[achievement.rewardItem.Length + i].gameObject.SetActive(achievement.completedBP); |
| | | var _item = achievement.rewardItemBP[i]; |
| | | ItemCellModel _ItemData = new ItemCellModel(_item.id, true, (ulong)_item.count); |
| | | m_BPItems[i].Init(_ItemData); |
| | | m_BPItems[i].button.RemoveAllListeners(); |
| | | m_BPItems[i].button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(_item.id); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | m_BPItems[i].gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | m_GetYetImg.SetActive(achievement.completedBP && achievement.completed); |
| | | m_GetBtn.SetActive(!(achievement.completedBP && achievement.completed)); |
| | | // 1. 提交不满足两个奖励都不可领取 - 灰色 |
| | | // 2. 可以领取1-2个奖励 -亮+特效 |
| | | // 3. 普通及奖励已领取 但不能领取高级 显示继续领取 - 亮无特效 |
| | | |
| | | bool isBuy = model.isBuyBP(); |
| | | |
| | | m_GetText.text = Language.Get("Z1043"); |
| | | m_GetEffect.gameObject.SetActive(false); |
| | | m_GetEffect.Stop(); |
| | | bool isReach = false; |
| | | if (!Achievement.IsReach(successID, achievement.progress)) |
| | | { |
| | | m_GetBtn.SetColorful(m_GetText, false); |
| | | } |
| | | else |
| | | { |
| | | isReach = true; |
| | | m_GetBtn.SetColorful(m_GetText, true); |
| | | if (!achievement.completed || (isBuy && !achievement.completedBP)) |
| | | { |
| | | m_GetEffect.gameObject.SetActive(true); |
| | | m_GetEffect.Play(); |
| | | } |
| | | if (achievement.completed && !achievement.completedBP) |
| | | { |
| | | m_GetText.text = Language.Get("Z1049"); |
| | | } |
| | | } |
| | | |
| | | m_GetBtn.SetListener(()=> { |
| | | GetGift(successID, isBuy, isReach, achievement.completed, achievement.completedBP); |
| | | } |
| | | ); |
| | | } |
| | | |
| | | private void GetGift(int successID, bool isBuy, bool isReach, bool completed, bool completedBP) |
| | | { |
| | | if (!isReach) |
| | | { |
| | | return; |
| | | } |
| | | if (!completed) |
| | | { |
| | | GetAchievementReward(successID, 0); |
| | | } |
| | | if (isBuy && !completedBP) |
| | | { |
| | | GetAchievementReward(successID, 1); |
| | | } |
| | | if (completed && !isBuy) |
| | | { |
| | | ConfirmCancel.ShowPopConfirm( |
| | | Language.Get("Mail101"), |
| | | Language.Get("SuccessBuyTip"), |
| | | (bool _ok) => |
| | | { |
| | | if (_ok) |
| | | { |
| | | vipModel.CTG(model.BPCTGID); |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | } |
| | | |
| | | public void GetAchievementReward(int _achievementId, byte getBP) |
| | | { |
| | | var sendInfo = new CA542_tagMCGetSuccessAward(); |
| | | sendInfo.SuccID = (uint)_achievementId; |
| | | sendInfo.IsPassport = getBP; |
| | | GameNetSystem.Instance.SendInfo(sendInfo); |
| | | } |
| | | } |
| | | } |
| | | |
copy from Core/NetworkPackage/ClientPack/ClientToMapServer/A5_Function/CA542_tagMCGetSuccessAward.cs.meta
copy to System/Welfare/SuccessBPCell.cs.meta
| File was copied from Core/NetworkPackage/ClientPack/ClientToMapServer/A5_Function/CA542_tagMCGetSuccessAward.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b6d5b9631112cfd42980e7e34d8ae486 |
| | | timeCreated: 1507866924 |
| | | guid: a97214c649f0ca848b2d7a7dbe5bbb65 |
| | | timeCreated: 1586427490 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class SuccessBPTypeCell : CellView |
| | | { |
| | | [SerializeField] Image m_SelectImg; |
| | | [SerializeField] Image m_UnSelectImg; |
| | | [SerializeField] Button m_SelectBtn; |
| | | [SerializeField] Text m_SuccessType; |
| | | [SerializeField] RedpointBehaviour m_Redpoint; |
| | | |
| | | AchievementModel model { get { return ModelCenter.Instance.GetModel<AchievementModel>(); } } |
| | | |
| | | public void Display(int successType) |
| | | { |
| | | m_SelectImg.SetActive(successType == model.selectSuccessType); |
| | | m_UnSelectImg.SetActive(successType != model.selectSuccessType); |
| | | m_SuccessType.text = Language.Get("Success_" + successType); |
| | | m_Redpoint.redpointId = 20111 * 1000 + successType; |
| | | m_SelectBtn.SetListener(()=>{ |
| | | model.selectSuccessType = successType; |
| | | |
| | | }); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
copy from Core/NetworkPackage/ClientPack/ClientToMapServer/A5_Function/CA542_tagMCGetSuccessAward.cs.meta
copy to System/Welfare/SuccessBPTypeCell.cs.meta
| File was copied from Core/NetworkPackage/ClientPack/ClientToMapServer/A5_Function/CA542_tagMCGetSuccessAward.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b6d5b9631112cfd42980e7e34d8ae486 |
| | | timeCreated: 1507866924 |
| | | guid: 136268c35ffc3fb48aef4d545c8cba31 |
| | | timeCreated: 1586451241 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, March 07, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI { |
| | | |
| | | public class SuccessBattlePassWin : Window |
| | | { |
| | | [SerializeField] ScrollerController m_SuccessType; |
| | | [SerializeField] ScrollerController m_SuccessLine; |
| | | [SerializeField] Button m_BuyBattelPass; |
| | | [SerializeField] ImageEx m_BattelPassImg; |
| | | |
| | | AchievementModel model { get { return ModelCenter.Instance.GetModel<AchievementModel>(); } } |
| | | VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } } |
| | | |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | m_SuccessType.OnRefreshCell += OnRefreshCell; |
| | | m_SuccessLine.OnRefreshCell += OnRefreshBPCell; |
| | | m_BuyBattelPass.SetListener(()=> { |
| | | vipModel.CTG(model.BPCTGID); |
| | | |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | vipModel.rechargeCountEvent += RechargeCountEvent; |
| | | model.OnUpdateBPDataEvent += UpdateBPDataEvent; |
| | | model.selectSuccessTypeRefresh += OnSelectSuccessTypeRefresh; |
| | | model.selectSuccessType = GetDefaultSuccesType(); |
| | | m_SuccessType.Refresh(); |
| | | foreach (var successType in model.SuccessBPArray) |
| | | { |
| | | m_SuccessType.AddCell(ScrollerDataType.Header, int.Parse(successType)); |
| | | } |
| | | m_SuccessType.Restart(); |
| | | m_SuccessType.JumpIndex(Array.IndexOf(model.SuccessBPArray, model.selectSuccessType.ToString())); |
| | | |
| | | ShowBuyButton(); |
| | | m_SuccessLine.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | private void UpdateBPDataEvent() |
| | | { |
| | | m_SuccessLine.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | private void RechargeCountEvent(int id) |
| | | { |
| | | if (id != model.BPCTGID) |
| | | { |
| | | return; |
| | | } |
| | | foreach (var succType in model.SuccessBPArray) |
| | | { |
| | | model.UpdateSuccessBPRedpoint(0, int.Parse(succType)); |
| | | } |
| | | |
| | | ShowBuyButton(); |
| | | } |
| | | |
| | | private void ShowBuyButton() |
| | | { |
| | | m_BuyBattelPass.SetActive(!model.isBuyBP()); |
| | | } |
| | | |
| | | // 获取最靠前的可领取 |
| | | public int GetDefaultSuccesType() |
| | | { |
| | | //Array.IndexOf(SuccessBPArray, 1); |
| | | if (model.redpoint.state == RedPointState.None) |
| | | { |
| | | return int.Parse(model.SuccessBPArray[0]); |
| | | } |
| | | foreach (var point in model.SuccessBPRedPoint) |
| | | { |
| | | if (point.Value.state == RedPointState.None) |
| | | continue; |
| | | return point.Key; |
| | | |
| | | } |
| | | return int.Parse(model.SuccessBPArray[0]); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | model.selectSuccessTypeRefresh -= OnSelectSuccessTypeRefresh; |
| | | vipModel.rechargeCountEvent -= RechargeCountEvent; |
| | | model.OnUpdateBPDataEvent -= UpdateBPDataEvent; |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | #endregion |
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var curCell = cell as SuccessBPTypeCell; |
| | | curCell.Display(cell.index); |
| | | } |
| | | |
| | | private void OnRefreshBPCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var curCell = cell as SuccessBPCell; |
| | | curCell.Display(cell.index); |
| | | } |
| | | |
| | | |
| | | private int SuccessBPSort(int x, int y) |
| | | { |
| | | //表顺序-战令已领取 |
| | | Achievement achievementX; |
| | | model.TryGetAchievement(x, out achievementX); |
| | | Achievement achievementY; |
| | | model.TryGetAchievement(x, out achievementY); |
| | | |
| | | if (achievementX.completedBP == achievementY.completedBP) |
| | | { |
| | | return x.CompareTo(y); |
| | | } |
| | | |
| | | return achievementX.completedBP.CompareTo(achievementY.completedBP); |
| | | } |
| | | |
| | | private void OnSelectSuccessTypeRefresh() |
| | | { |
| | | m_SuccessType.m_Scorller.RefreshActiveCellViews(); |
| | | m_SuccessLine.Refresh(); |
| | | var idList = model.GetAchievementsByCategory(model.selectSuccessType); |
| | | |
| | | idList.Sort(SuccessBPSort); |
| | | int jumpIndex = 0; |
| | | Achievement achievement; |
| | | |
| | | int index = 0; |
| | | foreach (var successID in idList) |
| | | { |
| | | m_SuccessLine.AddCell(ScrollerDataType.Header, successID); |
| | | |
| | | if (jumpIndex == 0 && model.TryGetAchievement(successID, out achievement)) |
| | | { |
| | | if (Achievement.IsReach(successID, achievement.progress)) |
| | | { |
| | | if (achievement.completed == false || achievement.completedBP == false) |
| | | { |
| | | jumpIndex = index; |
| | | } |
| | | } |
| | | } |
| | | |
| | | index++; |
| | | } |
| | | jumpIndex = Math.Max(0, jumpIndex - 1); |
| | | m_SuccessLine.Restart(); |
| | | m_SuccessLine.JumpIndex(jumpIndex); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
copy from Core/NetworkPackage/ClientPack/ClientToMapServer/A5_Function/CA542_tagMCGetSuccessAward.cs.meta
copy to System/Welfare/SuccessBattlePassWin.cs.meta
| File was copied from Core/NetworkPackage/ClientPack/ClientToMapServer/A5_Function/CA542_tagMCGetSuccessAward.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b6d5b9631112cfd42980e7e34d8ae486 |
| | | timeCreated: 1507866924 |
| | | guid: dcdad03a38a40844d8d8cad8fc571abd |
| | | timeCreated: 1586424310 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | [SerializeField] FunctionButton Btn_InSeven;
|
| | | [SerializeField] FunctionButton m_LevelGiftBtn;
|
| | | [SerializeField] FunctionButton m_ExchangeBtn;
|
| | | [SerializeField] FunctionButton m_SuccessBP;
|
| | |
|
| | | [SerializeField] FunctionButton m_Month1;
|
| | | [SerializeField] FunctionButton m_Month2;
|
| | |
| | | m_LevelGiftBtn.onClick.AddListener(OnLevelGift);
|
| | | m_ExchangeBtn.onClick.AddListener(OnExchange);
|
| | | close.onClick.AddListener(CloseClick);
|
| | | m_SuccessBP.onClick.AddListener(OnSuccessBP);
|
| | |
|
| | | m_Month1.onClick.AddListener(OnMonthCard1);
|
| | | m_Month2.onClick.AddListener(OnMonthCard2);
|
| | |
| | | functionOrder = 0;
|
| | | }
|
| | |
|
| | | private void OnSuccessBP()
|
| | | {
|
| | | CloseChildWin();
|
| | | WindowCenter.Instance.Open<SuccessBattlePassWin>();
|
| | | functionOrder = 11;
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | |
|
| | |
| | | prayerTitleBtn.gameObject.SetActive(true);
|
| | | Btn_InSeven.gameObject.SetActive(false);
|
| | | m_LevelGiftBtn.gameObject.SetActive(true);
|
| | | m_SuccessBP.gameObject.SetActive(true);
|
| | |
|
| | | m_Month1.gameObject.SetActive(true);
|
| | | m_Month2.gameObject.SetActive(true);
|
| | |
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | //此处未处理 已领取完毕的
|
| | | signInTitleBtn.gameObject.SetActive(signInTitleBtn.state != TitleBtnState.Locked);
|
| | | prayerTitleBtn.gameObject.SetActive(prayerTitleBtn.state != TitleBtnState.Locked);
|
| | | Btn_InSeven.gameObject.SetActive(false);//Btn_InSeven.state != TitleBtnState.Locked);
|