From bb463ef0b13236738a1da9cd04f57def3e7e2c7c Mon Sep 17 00:00:00 2001 From: yyl <yyl> Date: 星期五, 29 八月 2025 15:21:51 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts --- Main/Core/GameEngine/Player/PlayerBaseData.cs | 14 Main/Core/GameEngine/Player/PlayerDatas.cs | 7 Main/System/OfficialRank/OfficialUpWin.cs | 135 ++ Main/Core/NetworkPackage/ServerPack/HA7_Interaction/HA720_tagMCCreateRoleAwardState.cs.meta | 5 Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB223_tagCMTreeLVUP.cs.meta | 5 Main/System/Battle/Motion/MotionBase.cs | 1 Main/System/Equip/BlessLVManager.cs.meta | 5 Main/System/HappyXB/HappyXBModel.cs | 114 + Main/System/Invest/InvestModel.cs | 4 Main/System/Main/AutoFightWin.cs | 244 ++++ Main/System/Redpoint/MainRedDot.cs | 6 Main/System/HappyXB/HeroCallResultWin.cs | 12 Main/Component/UI/Common/FuncOpen.cs | 490 ++++---- Main/Component/UI/Common/UIFuncOpen.cs | 123 +- Main/Utility/ComponentExtersion.cs | 34 Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB121_tagMCTreeInfo.cs | 13 Main/Core/NetworkPackage/ServerPack/H01_System/H0102_tagCDBPlayer.cs | 8 Main/Core/NetworkPackage/ServerPack/HB1_Role/HB121_tagMCTreeInfo.cs.meta | 5 Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs.meta | 5 Main/System/Setting.meta | 8 Main/System/Guild/GuildBaseWin.cs.meta | 5 Main/System/Message/SysNotifyMgr.cs | 18 Main/Config/Configs/RealmLVUPTaskConfig.cs | 2 Main/System/OfficialRank/OfficialLVUPSuccessWin.cs | 62 + Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB224_tagCMUseTreeLVUPTimeItem.cs.meta | 5 Main/System/OfficialRank/OfficialUpWin.cs.meta | 5 Main/Utility/EnumHelper.cs | 6 Main/System/InternalAffairs/AffairBaseWin.cs | 22 Main/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs | 15 Main/System/Task/TaskManager.cs | 8 Main/System/ItemTip/BoxGetItemModel.cs | 4 Main/System/Main/AutoFightWin.cs.meta | 5 Main/System/OfficialRank/OfficialLVUPSuccessWin.cs.meta | 5 Main/System/Recharge/RechargeManager.cs | 18 Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB224_tagCMUseTreeLVUPTimeItem.cs | 20 Main/System/Equip/BlessLVTimeUpWin.cs.meta | 5 Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA720_tagMCCreateRoleAwardState.cs | 14 Main/System/CustomizedGift/CustomizedRechargeModel.cs | 6 Main/System/OfficialRank/OfficialUpCell.cs | 66 + Main/System/InternalAffairs.meta | 8 Main/Core/NetworkPackage/ServerPack/HA7_Interaction/HA720_tagMCCreateRoleAwardState.cs | 17 Main/System/Battle/BattleField/RecordActions/SkillRecordAction.cs | 4 Main/System/Guild.meta | 8 Main/System/Equip/EquipModel.cs | 27 Main/System/Main/FuncsBaseWin.cs | 2 Main/Config/PartialConfigs/ChestsAwardConfig.cs | 7 Main/System/Message/RichTextMgr.cs | 1 Main/Core/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs | 2 Main/System/Chat/ChatManager.cs | 2 Main/Utility/TimeUtility.cs | 15 Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs | 16 Main/System/Main/MoneyMoveByPath.cs | 2 Main/System/OfficialRank/OfficialRankManager.cs | 216 +++ Main/System/OfficialRank/OfficialUpCell.cs.meta | 5 Main/System/Login/LoginWin.cs | 7 Main/System/Message/ImgAnalysis.cs | 16 Main/System/CustomizedGift/CustomizedGiftModel.cs | 4 Main/Core/NetworkPackage/ClientPack/C03_MainCharacter/C0303_tagCSetShutCutData.cs.meta | 5 Main/System/SystemSetting/SystemSetting.cs | 2 Main/Component/UI/Effect/TimeMgr.cs | 10 Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB223_tagCMTreeLVUP.cs | 18 Main/Core/NetworkPackage/ClientPack/C03_MainCharacter/C0303_tagCSetShutCutData.cs | 17 Main/System/GeneralConfig/GeneralDefine.cs | 1 Main/System/Setting/QuickSetting.cs.meta | 5 Main/System/Main/HomeWin.cs | 95 + Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB121_tagMCTreeInfo.cs.meta | 5 Main/System/Equip/BlessLVTimeUpWin.cs | 112 ++ Main/Main.cs | 5 Main/Config/Configs/RealmConfig.cs | 2 Main/Config/Configs/FuncOpenLVConfig.cs | 14 Main/SDK/SDKUtils.cs | 10 Main/System/HeroUI/HeroTrainWin.cs | 2 Main/Config/Configs/HeroQualityConfig.cs | 51 Main/System/Main/AutoFightModel.cs | 121 ++ Main/System/Tip/ScrollTip.cs | 8 Main/System/Message/RichNormalEvent.cs | 2 Main/System/Tip/ToggleConfirmWin.cs | 6 Main/System/Battle/BattleManager.cs | 2 Main/System/HappyXB/HeroCallWin.cs | 7 Main/System/Setting/QuickSetting.cs | 166 +++ Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA720_tagMCCreateRoleAwardState.cs.meta | 5 Main/System/Equip/BlessLVManager.cs | 177 +++ Main/System/Equip/BlessLVWin.cs.meta | 5 /dev/null | 40 Main/Utility/UIHelper.cs | 84 Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs | 10 Main/System/Equip/BlessLVCell.cs.meta | 5 Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs | 2 Main/System/Equip/BlessLVWin.cs | 218 +++ Main/Core/NetworkPackage/ServerPack/HB1_Role/HB121_tagMCTreeInfo.cs | 25 Main/System/Main/MainWin.cs | 52 Main/System/Recharge/GotoChargeWin.cs | 5 Main/System/Equip/BlessLVCell.cs | 44 Main/System/Guild/GuildBaseWin.cs | 34 Main/System/InternalAffairs/AffairBaseWin.cs.meta | 5 Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs | 4 96 files changed, 2,550 insertions(+), 719 deletions(-) diff --git a/Main/Component/UI/Common/FuncEnable.cs b/Main/Component/UI/Common/FuncEnable.cs deleted file mode 100644 index f5e3877..0000000 --- a/Main/Component/UI/Common/FuncEnable.cs +++ /dev/null @@ -1,40 +0,0 @@ -锘縰sing System; -using System.Collections; -using System.Collections.Generic; - -using UnityEngine; - public class FuncEnable : MonoBehaviour - { - [SerializeField] int funcOpenKey; - - private void Awake() - { - FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; - } - - private void OnEnable() - { - SetState(); - } - - private void OnFuncStateChangeEvent(int _key) - { - if (funcOpenKey == _key) - { - SetState(); - } - } - - void SetState() - { - var _funcOpenCfg = FuncOpenLVConfig.Get(funcOpenKey); - if (_funcOpenCfg != null && _funcOpenCfg.open == 0) - { - gameObject.SetActive(false); - return; - } - - gameObject.SetActive(true); - } - } - diff --git a/Main/Component/UI/Common/FuncOpen.cs b/Main/Component/UI/Common/FuncOpen.cs index f5276a3..84ddee8 100644 --- a/Main/Component/UI/Common/FuncOpen.cs +++ b/Main/Component/UI/Common/FuncOpen.cs @@ -4,250 +4,258 @@ using UnityEngine; using LitJson; - public class FuncOpen - { - private static FuncOpen _inst = null; - public static FuncOpen Instance { - get { - if (_inst == null) - { - _inst = new FuncOpen(); - } - return _inst; - } - } - - protected FuncOpen() - { - if (Application.isEditor) +public class FuncOpen +{ + private static FuncOpen _inst = null; + public static FuncOpen Instance { + get { + if (_inst == null) { - if (!Application.isPlaying) return; + _inst = new FuncOpen(); } - - var allKeys = new List<int>(FuncOpenLVConfig.dic.Keys);//GetKeys(); - funcArray = new int[allKeys.Count]; - int _index = 0; - foreach (var key in allKeys) - { - int func = key; - funcOpenState[func] = false; - funcArray[_index] = func; - _index++; - } - - DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent; - DTC0102_tagCDBPlayer.switchAccountEvent += SwitchAccountEvent; - - funcClientLVLimitDict.Clear(); - var jsonConfig = JsonMapper.ToObject(FuncConfigConfig.Get("FuncLevelLimitClient").Numerical1); - foreach (var key in jsonConfig.Keys) - { - funcClientLVLimitDict[int.Parse(key)] = int.Parse(jsonConfig[key].ToString()); - } - } - - private void BeforePlayerDataInitializeEvent() - { - for (int i = 0; i < funcArray.Length; i++) - { - funcOpenState[funcArray[i]] = false; - } - } - - private void SwitchAccountEvent() - { - for (int i = 0; i < funcArray.Length; i++) - { - funcOpenState[funcArray[i]] = false; - if (OnFuncStateChangeEvent != null) - { - OnFuncStateChangeEvent(funcArray[i]); - } - } - } - - // TaskModel m_TaskModel; - // TaskModel taskmodel { get { return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<TaskModel>()); } } - private static Dictionary<int, bool> funcOpenState = new Dictionary<int, bool>(); - private int[] funcArray; - - public event Action<int> OnFuncStateChangeEvent; - - //绾鎴风鐨勫姛鑳界瓑绾ч檺鍒�, key 浠ュ姛鑳介厤缃〃鐨凢uncLevelLimitClient涓哄噯 - //1. 绮惧僵娲诲姩-鍏ㄦ湇绾㈠寘鏄剧ず绛夌骇 - public Dictionary<int, int> funcClientLVLimitDict = new Dictionary<int, int>(); - public bool IsClientLVLimit(int key) - { - if (!funcClientLVLimitDict.ContainsKey(key)) - return true; - - if (PlayerDatas.Instance.baseData.LV >= funcClientLVLimitDict[key]) - return true; - - return false; - } - - - public void UpdateFuncState(HA302_tagMCFuncOpenStateList vNetData) - { - for (int i = 0; i < vNetData.FuncCount; i++) - { - - var funcState = vNetData.FuncStateList[i]; - - bool bPerFuncIsOpen = false; - bool bAfterFuncIsOpen = false; - - if (!funcOpenState.ContainsKey(funcState.FuncID)) - { - funcOpenState.Add(funcState.FuncID, funcState.State == 1); - bAfterFuncIsOpen = true; - } - else - { - bPerFuncIsOpen = funcOpenState[funcState.FuncID]; - funcOpenState[funcState.FuncID] = funcState.State == 1; - bAfterFuncIsOpen = funcOpenState[funcState.FuncID]; - } - if (OnFuncStateChangeEvent != null) - { - OnFuncStateChangeEvent(funcState.FuncID); - } - } - } - - private bool IsFuncOpen(int key, out int errorCode) - { - - errorCode = 0; - var config = FuncOpenLVConfig.Get(key); - if (config == null) - { - return false; - } - // if (config.LimitMagicWeapon > 0) - // { - // Treasure treasure = null; - // var _stage = config.LimitMagicWeapon % 100; - // ModelCenter.Instance.GetModel<TreasureModel>().TryGetTreasure(config.LimitMagicWeapon / 100, out treasure); - // if (treasure == null || treasure.state != TreasureState.Collected || treasure.level < _stage) - // { - // errorCode = 2; - // return false; - // } - // } - // if (config.LimitMissionID > 0) - // { - // MissionDetailDates missionDetailDates = null; - // taskmodel.allMissionDict.TryGetValue(config.LimitMissionID, out missionDetailDates); - // if (missionDetailDates == null || missionDetailDates.MissionState != 3) - // { - // errorCode = 4; - // return false; - // } - // } - // if (config.LimiRealmLV > 0 && PlayerDatas.Instance.baseData.realmLevel < config.LimiRealmLV) - // { - // errorCode = 3; - // return false; - // } - if (config.LimitLV > 0 && PlayerDatas.Instance.baseData.LV < config.LimitLV) - { - errorCode = 1; - return false; - } - return true; - // return false; - } - - public bool IsFuncOpen(int key, bool tip = false) - { - bool isOpen = false; - if (funcOpenState.ContainsKey(key)) - isOpen = funcOpenState[key]; - if (!isOpen && tip) - ProcessorFuncErrorTip(key); - return isOpen; - } - - public void ProcessorFuncErrorTip(int key) - { - var config = FuncOpenLVConfig.Get(key); - if (config != null) - { - SoundPlayer.Instance.PlayUIAudio(SoundPlayer.defaultClickNegativeAudio); - if (config.Tip.Equals("FuncLimit_Level")) - { - SysNotifyMgr.Instance.ShowTip(config.Tip); - return; - } - var errorCode = 0; - if (!IsFuncOpen(key, out errorCode)) - { - switch (errorCode) - { - case 1: - SysNotifyMgr.Instance.ShowTip(config.Tip, Language.Get("OpenFunc4", config.LimitLV)); - break; - // TODO YYL - // case 2: - // var treasureConfig = TreasureConfig.Get(config.LimitMagicWeapon / 100); - // SysNotifyMgr.Instance.ShowTip(config.Tip, Language.Get("OpenFunc1", treasureConfig != null ? treasureConfig.Name : string.Empty)); - // break; - // case 3: - // SysNotifyMgr.Instance.ShowTip(config.Tip, UIHelper.GetRealmName(config.LimiRealmLV, true)); - // break; - case 4: - if (config.LimitLV > 0) - { - SysNotifyMgr.Instance.ShowTip(config.Tip, Language.Get("OpenFunc2", config.LimitLV)); - } - else - { - SysNotifyMgr.Instance.ShowTip(config.Tip, Language.Get("OpenFunc3")); - } - break; - } - } - } - } - - public int GetLimitLv(int key) - { - // FuncOpenLVConfig tagFuncOpenLVModel = FuncOpenLVConfig.Get(key); - // if (tagFuncOpenLVModel.LimitLV != 0) - // { - // return tagFuncOpenLVModel.LimitLV; - // } - // if (tagFuncOpenLVModel.LimitMissionID != 0) - // { - // var TaskConfig = PyTaskConfig.Get(tagFuncOpenLVModel.LimitMissionID); - // return TaskConfig.lv; - // } - - return 1; - } - - Dictionary<int, ICheckFuncOpen> m_CheckFuncDict = new Dictionary<int, ICheckFuncOpen>(); - public void Register(int _key, ICheckFuncOpen _check) - { - if (!m_CheckFuncDict.ContainsKey(_key)) - { - m_CheckFuncDict.Add(_key, _check); - } - } - - public bool CheckFuncOpen(int _key) - { - if (m_CheckFuncDict.ContainsKey(_key)) - { - return m_CheckFuncDict[_key].CheckFunc(); - } - return true; + return _inst; } } - public interface ICheckFuncOpen + protected FuncOpen() { - bool CheckFunc(); - } \ No newline at end of file + if (Application.isEditor) + { + if (!Application.isPlaying) return; + } + + var allKeys = new List<int>(FuncOpenLVConfig.dic.Keys);//GetKeys(); + funcArray = new int[allKeys.Count]; + int _index = 0; + foreach (var key in allKeys) + { + int func = key; + funcOpenState[func] = false; + funcArray[_index] = func; + _index++; + } + + DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent; + DTC0102_tagCDBPlayer.switchAccountEvent += SwitchAccountEvent; + + funcClientLVLimitDict.Clear(); + var jsonConfig = JsonMapper.ToObject(FuncConfigConfig.Get("FuncLevelLimitClient").Numerical1); + foreach (var key in jsonConfig.Keys) + { + funcClientLVLimitDict[int.Parse(key)] = int.Parse(jsonConfig[key].ToString()); + } + } + + private void BeforePlayerDataInitializeEvent() + { + for (int i = 0; i < funcArray.Length; i++) + { + funcOpenState[funcArray[i]] = false; + } + } + + private void SwitchAccountEvent() + { + for (int i = 0; i < funcArray.Length; i++) + { + funcOpenState[funcArray[i]] = false; + if (OnFuncStateChangeEvent != null) + { + OnFuncStateChangeEvent(funcArray[i]); + } + } + } + + // TaskModel m_TaskModel; + // TaskModel taskmodel { get { return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<TaskModel>()); } } + private static Dictionary<int, bool> funcOpenState = new Dictionary<int, bool>(); + private int[] funcArray; + + public event Action<int> OnFuncStateChangeEvent; + + //绾鎴风鐨勫姛鑳界瓑绾ч檺鍒�, key 浠ュ姛鑳介厤缃〃鐨凢uncLevelLimitClient涓哄噯 + //1. 绮惧僵娲诲姩-鍏ㄦ湇绾㈠寘鏄剧ず绛夌骇 + public Dictionary<int, int> funcClientLVLimitDict = new Dictionary<int, int>(); + public bool IsClientLVLimit(int key) + { + if (!funcClientLVLimitDict.ContainsKey(key)) + return true; + + if (PlayerDatas.Instance.baseData.LV >= funcClientLVLimitDict[key]) + return true; + + return false; + } + + + public void UpdateFuncState(HA302_tagMCFuncOpenStateList vNetData) + { + for (int i = 0; i < vNetData.FuncCount; i++) + { + + var funcState = vNetData.FuncStateList[i]; + + bool bPerFuncIsOpen = false; + bool bAfterFuncIsOpen = false; + + if (!funcOpenState.ContainsKey(funcState.FuncID)) + { + funcOpenState.Add(funcState.FuncID, funcState.State == 1); + bAfterFuncIsOpen = true; + } + else + { + bPerFuncIsOpen = funcOpenState[funcState.FuncID]; + funcOpenState[funcState.FuncID] = funcState.State == 1; + bAfterFuncIsOpen = funcOpenState[funcState.FuncID]; + } + if (OnFuncStateChangeEvent != null) + { + OnFuncStateChangeEvent(funcState.FuncID); + } + } + } + + private bool IsFuncOpen(int key, out int errorCode) + { + + errorCode = 0; + var config = FuncOpenLVConfig.Get(key); + if (config == null) + { + return false; + } + + if (config.OpenDay > 0) + { + if (config.OpenDay > TimeUtility.OpenDay + 1) + { + errorCode = 2; + return false; + } + } + + if (config.LimitMissionID > 0) + { + + if (TaskManager.Instance.GetNeedFinishTaskCount(config.LimitMissionID) > 0) + { + errorCode = 4; + return false; + } + } + if (config.LimiRealmLV > 0 && PlayerDatas.Instance.baseData.realmLevel < config.LimiRealmLV) + { + errorCode = 3; + return false; + } + if (config.LimitLV > 0 && PlayerDatas.Instance.baseData.LV < config.LimitLV) + { + errorCode = 1; + return false; + } + return true; + // return false; + } + + public bool IsFuncOpen(int key, bool tip = false) + { + bool isOpen = false; + if (funcOpenState.ContainsKey(key)) + isOpen = funcOpenState[key]; + if (!isOpen && tip) + ProcessorFuncErrorTip(key); + return isOpen; + } + + public void ProcessorFuncErrorTip(int key) + { + var config = FuncOpenLVConfig.Get(key); + if (config != null) + { + SoundPlayer.Instance.PlayUIAudio(SoundPlayer.defaultClickNegativeAudio); + + var errorCode = 0; + if (!IsFuncOpen(key, out errorCode)) + { + switch (errorCode) + { + case 1: + SysNotifyMgr.Instance.ShowStringTip(Language.Get("FuncLimit_Level", config.LimitLV) + + Language.Get("FuncLimitOpen1")); + break; + case 2: + //寮�鏈嶅灏戝ぉ 涓�鑸槸缁勫悎 + if (config.LimitLV != 0) + { + SysNotifyMgr.Instance.ShowStringTip(Language.Get("FuncLimit_OpenDay", config.OpenDay) + + Language.Get("FuncLimitOpen2") + + Language.Get("FuncLimit_Level", config.LimitLV) + + Language.Get("FuncLimitOpen1")); + + } + else if (config.LimitMissionID != 0) + { + SysNotifyMgr.Instance.ShowStringTip(Language.Get("FuncLimit_OpenDay", config.OpenDay) + + Language.Get("FuncLimitOpen2") + + Language.Get("FuncLimit_Mission", TaskManager.Instance.GetNeedFinishTaskCount(config.LimitMissionID)) + + Language.Get("FuncLimitOpen1")); + } + else + { + SysNotifyMgr.Instance.ShowStringTip(Language.Get("FuncLimit_OpenDay", config.OpenDay) + + Language.Get("FuncLimitOpen1")); + } + break; + case 3: + SysNotifyMgr.Instance.ShowStringTip(Language.Get("FuncLimit_Realm", RealmConfig.Get(config.LimiRealmLV).Name) + + Language.Get("FuncLimitOpen1")); + break; + case 4: + SysNotifyMgr.Instance.ShowStringTip(Language.Get("FuncLimit_Mission", TaskManager.Instance.GetNeedFinishTaskCount(config.LimitMissionID)) + + Language.Get("FuncLimitOpen1")); + break; + } + } + } + } + + public int GetLimitLv(int key) + { + // FuncOpenLVConfig tagFuncOpenLVModel = FuncOpenLVConfig.Get(key); + // if (tagFuncOpenLVModel.LimitLV != 0) + // { + // return tagFuncOpenLVModel.LimitLV; + // } + // if (tagFuncOpenLVModel.LimitMissionID != 0) + // { + // var TaskConfig = PyTaskConfig.Get(tagFuncOpenLVModel.LimitMissionID); + // return TaskConfig.lv; + // } + + return 1; + } + + Dictionary<int, ICheckFuncOpen> m_CheckFuncDict = new Dictionary<int, ICheckFuncOpen>(); + public void Register(int _key, ICheckFuncOpen _check) + { + if (!m_CheckFuncDict.ContainsKey(_key)) + { + m_CheckFuncDict.Add(_key, _check); + } + } + + public bool CheckFuncOpen(int _key) + { + if (m_CheckFuncDict.ContainsKey(_key)) + { + return m_CheckFuncDict[_key].CheckFunc(); + } + return true; + } +} + +public interface ICheckFuncOpen +{ + bool CheckFunc(); +} \ No newline at end of file diff --git a/Main/Component/UI/Common/UIFuncOpen.cs b/Main/Component/UI/Common/UIFuncOpen.cs index c4c0ce6..08e825e 100644 --- a/Main/Component/UI/Common/UIFuncOpen.cs +++ b/Main/Component/UI/Common/UIFuncOpen.cs @@ -8,86 +8,87 @@ using System; using UnityEngine.EventSystems; - public class UIFuncOpen : MonoBehaviour, IPointerClickHandler +public class UIFuncOpen : MonoBehaviour, IPointerClickHandler +{ + [SerializeField] int funcOpenKey; + [SerializeField] GameObject LockImg; + [SerializeField] bool active = true; + public int id { get { return funcOpenKey; } } + + private Button funcBtn; + + private void Awake() { - [SerializeField] int funcOpenKey; - [SerializeField] GameObject LockImg; - [SerializeField] bool active = true; - public int id { get { return funcOpenKey; } } + funcBtn = GetComponent<Button>(); - private Button funcBtn; + FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; + } - private void Awake() + public void OnPointerClick(PointerEventData eventData) + { + if (!FuncOpen.Instance.IsFuncOpen(funcOpenKey)) { - funcBtn = GetComponent<Button>(); - - FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; + FuncOpen.Instance.ProcessorFuncErrorTip(funcOpenKey); + return; } + } - public void OnPointerClick(PointerEventData eventData) - { - if (!FuncOpen.Instance.IsFuncOpen(funcOpenKey)) - { - FuncOpen.Instance.ProcessorFuncErrorTip(funcOpenKey); - return; - } - } + private void OnEnable() + { + SetState(); + } - private void OnEnable() + private void OnFuncStateChangeEvent(int func) + { + if (funcOpenKey == func) { SetState(); } + } - private void OnFuncStateChangeEvent(int func) + private void OnDestroy() + { + FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent; + } + private void SetState() + { + var IsOpen = FuncOpen.Instance.IsFuncOpen(funcOpenKey); + var _funcOpenCfg = FuncOpenLVConfig.Get(funcOpenKey); + + if (_funcOpenCfg == null) { - if (funcOpenKey == func) - { - SetState(); - } + IsOpen = true; + active = true; } - private void OnDestroy() + if (funcBtn != null) { - FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent; + funcBtn.interactable = IsOpen; } - private void SetState() + + + if (LockImg != null) { - var IsOpen = FuncOpen.Instance.IsFuncOpen(funcOpenKey); - var _funcOpenCfg = FuncOpenLVConfig.Get(funcOpenKey); + LockImg.SetActive(!IsOpen); + } - if (_funcOpenCfg == null) - { - IsOpen = true; - active = true; - } + // 鏈紑鍚槸鍚︽樉绀虹殑閰嶇疆 + // if (_funcOpenCfg != null && _funcOpenCfg.open == 0) + // { + // gameObject.SetActive(false); + // return; + // } - if (funcBtn != null) + if (!active) + { + gameObject.SetActive(IsOpen); + } + else + { + if (!gameObject.activeSelf) { - funcBtn.interactable = IsOpen; - } - - - if (LockImg != null) - { - LockImg.SetActive(!IsOpen); - } - - if (_funcOpenCfg != null && _funcOpenCfg.open == 0) - { - gameObject.SetActive(false); - return; - } - - if (!active) - { - gameObject.SetActive(IsOpen); - } - else - { - if (!gameObject.activeSelf) - { - gameObject.SetActive(true); - } + gameObject.SetActive(true); } } - } \ No newline at end of file + } +} \ No newline at end of file diff --git a/Main/Component/UI/Effect/TimeMgr.cs b/Main/Component/UI/Effect/TimeMgr.cs index f968fa8..e1be090 100644 --- a/Main/Component/UI/Effect/TimeMgr.cs +++ b/Main/Component/UI/Effect/TimeMgr.cs @@ -9,13 +9,11 @@ private Dictionary<Component, TimeItem> timeItems = new Dictionary<Component, TimeItem>(); private List<TimeItem> timeItemList = new List<TimeItem>(); private int hourBuff = -1; - private int minuteBuff = -1; public int dayBuff = -1; public int monthBuff { get { return LocalSave.GetInt("month"); } private set { LocalSave.SetInt("month", value); } } public int weekBuff { get { return LocalSave.GetInt("week"); } private set { LocalSave.SetInt("week", value); } } public event Action OnDayEvent; public event Action OnHourEvent; - public event Action OnMinuteEvent; public event Action OnMonthAfterPlayerDataInitializeEvent; public event Action OnWeekAfterPlayerDataInitializeEvent; @@ -55,14 +53,6 @@ OnHourEvent(); } hourBuff = TimeUtility.ServerNow.Hour; - } - if (minuteBuff != TimeUtility.ServerNow.Minute) - { - if (OnMinuteEvent != null) - { - OnMinuteEvent(); - } - minuteBuff = TimeUtility.ServerNow.Minute; } } catch (Exception e) diff --git a/Main/Config/Configs/FuncOpenLVConfig.cs b/Main/Config/Configs/FuncOpenLVConfig.cs index 49baa97..880e8a1 100644 --- a/Main/Config/Configs/FuncOpenLVConfig.cs +++ b/Main/Config/Configs/FuncOpenLVConfig.cs @@ -1,6 +1,6 @@ 锘�//-------------------------------------------------------- // [Author]: YYL -// [ Date ]: 2025骞�8鏈�20鏃� +// [ Date ]: 2025骞�8鏈�28鏃� //-------------------------------------------------------- using System.Collections.Generic; @@ -20,11 +20,11 @@ public int LimitLV; public int LimiRealmLV; public int LimitMissionID; + public int OpenDay; public string Name; public string Desc; - public string Tip; public string Icon; - public int open; + public Dictionary<int, int[][]> Award; public override int LoadKey(string _key) { @@ -44,15 +44,15 @@ int.TryParse(tables[3],out LimitMissionID); - Name = tables[4]; + int.TryParse(tables[4],out OpenDay); - Desc = tables[5]; + Name = tables[5]; - Tip = tables[6]; + Desc = tables[6]; Icon = tables[7]; - int.TryParse(tables[8],out open); + Award = ConfigParse.ParseIntArray2Dict(tables[8]); } catch (Exception exception) { diff --git a/Main/Config/Configs/HeroQualityConfig.cs b/Main/Config/Configs/HeroQualityConfig.cs index f2d715c..41e7b5a 100644 --- a/Main/Config/Configs/HeroQualityConfig.cs +++ b/Main/Config/Configs/HeroQualityConfig.cs @@ -1,6 +1,6 @@ 锘�//-------------------------------------------------------- // [Author]: YYL -// [ Date ]: 2025骞�8鏈�7鏃� +// [ Date ]: Thursday, August 28, 2025 //-------------------------------------------------------- using System.Collections.Generic; @@ -17,7 +17,6 @@ } public int Quality; - public int[] UPCostItem; public int InitStarUpper; public int InitAddPer; public int LVAddPer; @@ -41,37 +40,23 @@ string[] tables = input.Split('\t'); int.TryParse(tables[0],out Quality); - if (tables[1].Contains("[")) + int.TryParse(tables[1],out InitStarUpper); + + int.TryParse(tables[2],out InitAddPer); + + int.TryParse(tables[3],out LVAddPer); + + int.TryParse(tables[4],out BreakLVAddPer); + + int.TryParse(tables[5],out StarAddPer); + + if (tables[6].Contains("[")) { - UPCostItem = JsonMapper.ToObject<int[]>(tables[1]); + BookActAwardMoney = JsonMapper.ToObject<int[]>(tables[6]); } else { - string[] UPCostItemStringArray = tables[1].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); - UPCostItem = new int[UPCostItemStringArray.Length]; - for (int i=0;i<UPCostItemStringArray.Length;i++) - { - int.TryParse(UPCostItemStringArray[i],out UPCostItem[i]); - } - } - - int.TryParse(tables[2],out InitStarUpper); - - int.TryParse(tables[3],out InitAddPer); - - int.TryParse(tables[4],out LVAddPer); - - int.TryParse(tables[5],out BreakLVAddPer); - - int.TryParse(tables[6],out StarAddPer); - - if (tables[7].Contains("[")) - { - BookActAwardMoney = JsonMapper.ToObject<int[]>(tables[7]); - } - else - { - string[] BookActAwardMoneyStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); + string[] BookActAwardMoneyStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); BookActAwardMoney = new int[BookActAwardMoneyStringArray.Length]; for (int i=0;i<BookActAwardMoneyStringArray.Length;i++) { @@ -79,13 +64,13 @@ } } - int.TryParse(tables[8],out BookInitAddPer); + int.TryParse(tables[7],out BookInitAddPer); - int.TryParse(tables[9],out BookStarAddPer); + int.TryParse(tables[8],out BookStarAddPer); - int.TryParse(tables[10],out BookBreakLVAddPer); + int.TryParse(tables[9],out BookBreakLVAddPer); - DismissReturnItems = JsonMapper.ToObject<int[][]>(tables[11].Replace("(", "[").Replace(")", "]")); + DismissReturnItems = JsonMapper.ToObject<int[][]>(tables[10].Replace("(", "[").Replace(")", "]")); } catch (Exception exception) { diff --git a/Main/Config/Configs/RealmConfig.cs b/Main/Config/Configs/RealmConfig.cs index ff51fe3..2c8a21a 100644 --- a/Main/Config/Configs/RealmConfig.cs +++ b/Main/Config/Configs/RealmConfig.cs @@ -1,6 +1,6 @@ 锘�//-------------------------------------------------------- // [Author]: YYL -// [ Date ]: 2025骞�8鏈�5鏃� +// [ Date ]: 2025骞�8鏈�27鏃� //-------------------------------------------------------- using System.Collections.Generic; diff --git a/Main/Config/Configs/RealmLVUPTaskConfig.cs b/Main/Config/Configs/RealmLVUPTaskConfig.cs index f014c14..b1026cb 100644 --- a/Main/Config/Configs/RealmLVUPTaskConfig.cs +++ b/Main/Config/Configs/RealmLVUPTaskConfig.cs @@ -1,6 +1,6 @@ 锘�//-------------------------------------------------------- // [Author]: YYL -// [ Date ]: 2025骞�8鏈�5鏃� +// [ Date ]: 2025骞�8鏈�27鏃� //-------------------------------------------------------- using System.Collections.Generic; diff --git a/Main/Config/PartialConfigs/ChestsAwardConfig.cs b/Main/Config/PartialConfigs/ChestsAwardConfig.cs index f9d7212..22d599b 100644 --- a/Main/Config/PartialConfigs/ChestsAwardConfig.cs +++ b/Main/Config/PartialConfigs/ChestsAwardConfig.cs @@ -1,9 +1,4 @@ -锘�//-------------------------------------------------------- -// [Author]: 绗簩涓栫晫 -// [ Date ]: Sunday, February 04, 2018 -//-------------------------------------------------------- - -using System.Collections.Generic; +锘縰sing System.Collections.Generic; public partial class ChestsAwardConfig : ConfigBase<int, ChestsAwardConfig> { diff --git a/Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs b/Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs index 88afc81..1d26f9e 100644 --- a/Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs +++ b/Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs @@ -4,24 +4,24 @@ public partial class RealmLVUPTaskConfig : ConfigBase<int, RealmLVUPTaskConfig> { //瀹樿亴锛氫换鍔D锛氱储寮昳d - private static Dictionary<int, Dictionary<int, int>> missionDict = new Dictionary<int, Dictionary<int, int>>(); + private static Dictionary<int, Dictionary<int, RealmLVUPTaskConfig>> missionDict = new Dictionary<int, Dictionary<int, RealmLVUPTaskConfig>>(); protected override void OnConfigParseCompleted() { if (!missionDict.ContainsKey(Lv)) { - missionDict.Add(Lv, new Dictionary<int, int>()); + missionDict.Add(Lv, new Dictionary<int, RealmLVUPTaskConfig>()); } - missionDict[Lv][TaskID] = ID; + missionDict[Lv][TaskID] = this; } - public static int GetID(int realmLV, int taskID) + public static RealmLVUPTaskConfig GetID(int realmLV, int taskID) { if (missionDict.ContainsKey(realmLV) && missionDict[realmLV].ContainsKey(taskID)) { return missionDict[realmLV][taskID]; } - return -1; + return null; } public static List<int> GetMissionIDs(int lv) diff --git a/Main/Core/GameEngine/Player/PlayerBaseData.cs b/Main/Core/GameEngine/Player/PlayerBaseData.cs index 8c33b85..f0f8fe1 100644 --- a/Main/Core/GameEngine/Player/PlayerBaseData.cs +++ b/Main/Core/GameEngine/Player/PlayerBaseData.cs @@ -18,7 +18,7 @@ public uint bindDiamond; //鐏电煶 public uint copper; //閾滈挶 public long allCopper { get { return copper + copperExtend * Constants.ExpPointValue; } } - public long FightPoint; //鎴樻枟鍊� + public long UseHarmerCount; //娑堣�楅敜瀛愪釜鏁�(鍊嶆暟) public ushort MapID; //瑙掕壊鎵�鍦ㄥ湴鍥� 鍦板浘瑙勫垯锛欳/S涓�涓�瀵瑰簲鐨勫父瑙勫湴鍥撅紝C鍋囧湴鍥撅紙ExAttr14锛夛紝澶欳涓�涓猄鍦板浘锛圗xAttr3锛� public ushort PosX; //瑙掕壊鍧愭爣 public ushort PosY; @@ -34,7 +34,7 @@ public byte FBID; //fb id public byte realmLevel; //瀹樿亴 public byte VIPLv; //VIP绛夌骇 - public uint ExAttr1; // 鍗忓姪鐩爣鐜╁ID锛岄潪0鍙�0閫�鍑哄崗鍔� + public uint ExAttr1; // 绛栧垝閰嶇疆鍏冲崱ID涓�201锛屽嵆 杩囧叧2-1(0/1) ,浣跨敤 ExAttr1 鍊煎垽鏂紝濡侲xAttr1鍊间负20103浠h〃褰撳墠宸茬粡杩囦簡绗�2绔犵1鍏崇3娉紝鍖呭惈浜嗘尝锛岄渶瑕佸嚮璐ヨ鍏冲崱boss鍚庢墠绠楄鍏宠繃鍏� public uint teamAutoOperateFlag; //鎵╁睍灞炴��2锛屽悇椤圭洰涓撶敤 public int dungeonLineId; // 鍓湰绾胯矾id public int dungeonMapId; // 鍓湰鐢ㄤ綔 DataMapId,鍗曚汉鍓湰瀛樺湪1.鍋囧壇鏈� 2.鏈嶅姟绔�1瀵瑰鎴风澶氬湴鍥惧悓鍒嗙嚎 3.鏈嶅姟绔�1瀵瑰鎴风澶氬湴鍥句笉鍚屽垎绾� @@ -52,10 +52,13 @@ uint m_coinPointTotal; public int face;//澶村儚 public int facePic;//澶村儚澶栨 + public long FightPower; //鎴樻枟鍔� - public uint coinPointTotal { + public uint coinPointTotal + { private get { return m_coinPointTotal; } - set { + set + { CoinChangeEvent?.Invoke((int)m_coinPointTotal, (int)value); m_coinPointTotal = value; } @@ -164,7 +167,7 @@ CON = _serverInfo.CON; Setting = _serverInfo.Setting; FBID = _serverInfo.FBID; - ExAttr1 = _serverInfo.ExAttr1; + ExAttr1 = _serverInfo.ExAttr1; //绛栧垝閰嶇疆鍏冲崱ID涓�201锛屽嵆 杩囧叧2-1(0/1) ,浣跨敤 ExAttr1 鍊煎垽鏂紝濡侲xAttr1鍊间负20103浠h〃褰撳墠宸茬粡杩囦簡绗�2绔犵1鍏崇3娉紝鍖呭惈浜嗘尝锛岄渶瑕佸嚮璐ヨ鍏冲崱boss鍚庢墠绠楄鍏宠繃鍏� teamAutoOperateFlag = _serverInfo.ExAttr2; dungeonLineId = (int)_serverInfo.ExAttr3 % 1000; dungeonMapId = (int)_serverInfo.ExAttr3 / 1000; @@ -189,6 +192,7 @@ HP = _serverInfo.HP + _serverInfo.HPEx * Constants.ExpPointValue; AttackMode = _serverInfo.AttackMode; + UseHarmerCount = (int)_serverInfo.FightPoint; //閿ゅ瓙鍊嶆暟锛岄潪鎴樻枟鍔� } diff --git a/Main/Core/GameEngine/Player/PlayerDatas.cs b/Main/Core/GameEngine/Player/PlayerDatas.cs index 99522d5..99b278b 100644 --- a/Main/Core/GameEngine/Player/PlayerDatas.cs +++ b/Main/Core/GameEngine/Player/PlayerDatas.cs @@ -200,9 +200,12 @@ break; case PlayerDataType.TeamLV: break; + case PlayerDataType.UseHarmerCount: + baseData.UseHarmerCount = value; + break; case PlayerDataType.FightPower: - baseData.FightPoint = value + valueEx * Constants.ExpPointValue; - PlayerMainDate.Instance.PowerAdd(baseData.FightPoint); + baseData.FightPower = value + valueEx * Constants.ExpPointValue; + PlayerMainDate.Instance.PowerAdd(baseData.FightPower); break; case PlayerDataType.Tick: #if UNITY_EDITOR diff --git a/Main/Core/NetworkPackage/ClientPack/C03_MainCharacter/C0303_tagCSetShutCutData.cs b/Main/Core/NetworkPackage/ClientPack/C03_MainCharacter/C0303_tagCSetShutCutData.cs new file mode 100644 index 0000000..b7c175e --- /dev/null +++ b/Main/Core/NetworkPackage/ClientPack/C03_MainCharacter/C0303_tagCSetShutCutData.cs @@ -0,0 +1,17 @@ +using UnityEngine; +using System.Collections; + +//03 03 璁剧疆蹇嵎鏍忎繚瀛�#tagCSetShutCutData + +public class C0303_tagCSetShutCutData : GameNetPackBasic { + public string Setting; + + public C0303_tagCSetShutCutData () { + _cmd = (ushort)0x0303; + } + + public override void WriteToBytes () { + WriteBytes (Setting, NetDataType.Chars, 100); + } + +} diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/Core/NetworkPackage/ClientPack/C03_MainCharacter/C0303_tagCSetShutCutData.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/Core/NetworkPackage/ClientPack/C03_MainCharacter/C0303_tagCSetShutCutData.cs.meta index 383dea1..76a89a8 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/Core/NetworkPackage/ClientPack/C03_MainCharacter/C0303_tagCSetShutCutData.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: 35992e06ad8ed6049bbfca868849f3d1 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs b/Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs new file mode 100644 index 0000000..9af42fb --- /dev/null +++ b/Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs @@ -0,0 +1,16 @@ +using UnityEngine; +using System.Collections; + +// A5 23 鎻愬崌澧冪晫绛夌骇 # tagCMRealmLVUp + +public class CA523_tagCMRealmLVUp : GameNetPackBasic { + + public CA523_tagCMRealmLVUp () { + combineCmd = (ushort)0x03FE; + _cmd = (ushort)0xA523; + } + + public override void WriteToBytes () { + } + +} diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs.meta index 383dea1..afd2af5 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: 3a06990786c9e0942bdb91bbcb19914c MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB223_tagCMTreeLVUP.cs b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB223_tagCMTreeLVUP.cs new file mode 100644 index 0000000..4845a31 --- /dev/null +++ b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB223_tagCMTreeLVUP.cs @@ -0,0 +1,18 @@ +using UnityEngine; +using System.Collections; + +// B2 23 浠欐爲鍗囩骇 #tagCMTreeLVUP + +public class CB223_tagCMTreeLVUP : GameNetPackBasic { + public byte Type; // 0-寮�濮嬪崌绾э紙璇锋眰鎵i櫎娑堣�楋紝寮�濮嬪崌绾у�掕鏃讹級锛�1-鎵ц鍗囩骇锛堝墠绔嚜琛屽�掕鏃讹紝鏃堕棿鍒板悗鍙戦�佽绫诲瀷锛� + + public CB223_tagCMTreeLVUP () { + combineCmd = (ushort)0x03FE; + _cmd = (ushort)0xB223; + } + + public override void WriteToBytes () { + WriteBytes (Type, NetDataType.BYTE); + } + +} diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB223_tagCMTreeLVUP.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB223_tagCMTreeLVUP.cs.meta index 383dea1..cdadcb9 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB223_tagCMTreeLVUP.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: 647b6a53269ebc54ba1cdbbd2d5d3c79 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB224_tagCMUseTreeLVUPTimeItem.cs b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB224_tagCMUseTreeLVUPTimeItem.cs new file mode 100644 index 0000000..6bfbdef --- /dev/null +++ b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB224_tagCMUseTreeLVUPTimeItem.cs @@ -0,0 +1,20 @@ +using UnityEngine; +using System.Collections; + +// B2 24 浣跨敤浠欐爲鍗囩骇鍑忔椂鐗╁搧 #tagCMUseTreeLVUPTimeItem + +public class CB224_tagCMUseTreeLVUPTimeItem : GameNetPackBasic { + public uint UseCount; // 浣跨敤涓暟 + public byte IsAutoBuy; // 涓嶈冻涓暟鏄惁鑷姩璐拱 + + public CB224_tagCMUseTreeLVUPTimeItem () { + combineCmd = (ushort)0x03FE; + _cmd = (ushort)0xB224; + } + + public override void WriteToBytes () { + WriteBytes (UseCount, NetDataType.DWORD); + WriteBytes (IsAutoBuy, NetDataType.BYTE); + } + +} diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB224_tagCMUseTreeLVUPTimeItem.cs.meta similarity index 68% rename from Main/Component/UI/Common/FuncEnable.cs.meta rename to Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB224_tagCMUseTreeLVUPTimeItem.cs.meta index 383dea1..42d1f12 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB224_tagCMUseTreeLVUPTimeItem.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: 7fc725d02eee6f745bb03e23287408a0 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs index e1151d7..a87c36f 100644 --- a/Main/Core/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs +++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs @@ -37,7 +37,7 @@ PlayerDatas.Instance.InitPlayerData(package); PlayerDatas.Instance.RequestWorldTick(); - + QuickSetting.Instance.SetQuickSetting(package.Setting); if (playerIdBuf != 0 && playerIdBuf != PlayerDatas.Instance.baseData.PlayerID) { if (switchAccountEvent != null) diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs index 5a05687..d0642a0 100644 --- a/Main/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs +++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs @@ -31,8 +31,9 @@ playerLoginOkEvent?.Invoke(); } finishedLogin = true; - if (PlayerDatas.Instance.baseData.FightPoint == 0) - { + if (PlayerDatas.Instance.baseData.UseHarmerCount == 0) + { + //闃茶寖璇锋眰 BattleManager.Instance.MainFightRequest(1, 1); } //if (mapInitOkEvent != null) @@ -40,7 +41,17 @@ // mapInitOkEvent(); //} + GetCreateRoleAward(); + } + void GetCreateRoleAward() + { + if (DTCA720_tagMCCreateRoleAwardState.m_GetState == 0) + { + var pack = new CA504_tagCMPlayerGetReward(); + pack.RewardType = 32; + GameNetSystem.Instance.SendInfo(pack); + } } } diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA720_tagMCCreateRoleAwardState.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA720_tagMCCreateRoleAwardState.cs new file mode 100644 index 0000000..2f7dda4 --- /dev/null +++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA720_tagMCCreateRoleAwardState.cs @@ -0,0 +1,14 @@ +using UnityEngine; +using System.Collections; + +// A7 20 鍒涜濂栧姳棰嗗鐘舵�� #tagMCCreateRoleAwardState + +public class DTCA720_tagMCCreateRoleAwardState : DtcBasic { + public static int m_GetState; + public override void Done(GameNetPackBasic vNetPack) + { + base.Done(vNetPack); + HA720_tagMCCreateRoleAwardState vNetData = vNetPack as HA720_tagMCCreateRoleAwardState; + m_GetState = vNetData.GetState; + } +} diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA720_tagMCCreateRoleAwardState.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA720_tagMCCreateRoleAwardState.cs.meta index 383dea1..6e7c547 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA720_tagMCCreateRoleAwardState.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: 6303ee5b4a861ac419e36a73a138bf03 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB121_tagMCTreeInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB121_tagMCTreeInfo.cs new file mode 100644 index 0000000..de37929 --- /dev/null +++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB121_tagMCTreeInfo.cs @@ -0,0 +1,13 @@ +using UnityEngine; +using System.Collections; + +// B1 21 浠欐爲淇℃伅 #tagMCTreeInfo + +public class DTCB121_tagMCTreeInfo : DtcBasic { + public override void Done(GameNetPackBasic vNetPack) + { + base.Done(vNetPack); + HB121_tagMCTreeInfo vNetData = vNetPack as HB121_tagMCTreeInfo; + BlessLVManager.Instance.UpdateBlessLVInfo(vNetData); + } +} diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB121_tagMCTreeInfo.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB121_tagMCTreeInfo.cs.meta index 383dea1..738d4e8 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB121_tagMCTreeInfo.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: b2ffbbf1287918e4f964b34b469a7fec MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs index cb38be7..28dc512 100644 --- a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs +++ b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs @@ -110,6 +110,8 @@ Register(typeof(HA814_tagMCMakeItemAnswer), typeof(DTCA814_tagMCMakeItemAnswer)); Register(typeof(HB122_tagSCHeroInfo), typeof(DTCB122_tagSCHeroInfo)); Register(typeof(HA338_tagMCInvestInfo), typeof(DTCA338_tagMCInvestInfo)); + Register(typeof(HB121_tagMCTreeInfo), typeof(DTCB121_tagMCTreeInfo)); + Register(typeof(HA720_tagMCCreateRoleAwardState), typeof(DTCA720_tagMCCreateRoleAwardState)); } //涓诲伐绋嬫敞鍐屽皝鍖� diff --git a/Main/Core/NetworkPackage/ServerPack/H01_System/H0102_tagCDBPlayer.cs b/Main/Core/NetworkPackage/ServerPack/H01_System/H0102_tagCDBPlayer.cs index 50bbf52..fe5a8eb 100644 --- a/Main/Core/NetworkPackage/ServerPack/H01_System/H0102_tagCDBPlayer.cs +++ b/Main/Core/NetworkPackage/ServerPack/H01_System/H0102_tagCDBPlayer.cs @@ -1,6 +1,6 @@ -using UnityEngine; -using System.Collections; - +using UnityEngine; +using System.Collections; + //01 02 鐜╁鍒濆鍖�#tagCDBPlayer public class H0102_tagCDBPlayer : GameNetPackBasic { @@ -30,7 +30,7 @@ public uint GoldPaper; //閲戠エ public uint Silver; //閾跺瓙 public uint SilverPaper; //閾剁エ - public uint FightPoint; //鎴樻枟鍊� + public uint FightPoint; //閿ゅ瓙鍊嶆暟锛岄潪鎴樻枟鍔� public uint HappyPoint; // public byte LineID; //瑙掕壊鎵�鍦ㄧ嚎璺� public ushort MapID; //瑙掕壊鎵�鍦ㄥ湴鍥� diff --git a/Main/Core/NetworkPackage/ServerPack/HA7_Interaction/HA720_tagMCCreateRoleAwardState.cs b/Main/Core/NetworkPackage/ServerPack/HA7_Interaction/HA720_tagMCCreateRoleAwardState.cs new file mode 100644 index 0000000..1b535d7 --- /dev/null +++ b/Main/Core/NetworkPackage/ServerPack/HA7_Interaction/HA720_tagMCCreateRoleAwardState.cs @@ -0,0 +1,17 @@ +using UnityEngine; +using System.Collections; + +// A7 20 鍒涜濂栧姳棰嗗鐘舵�� #tagMCCreateRoleAwardState + +public class HA720_tagMCCreateRoleAwardState : GameNetPackBasic { + public byte GetState; // 鏄惁宸查鍙� + + public HA720_tagMCCreateRoleAwardState () { + _cmd = (ushort)0xA720; + } + + public override void ReadFromBytes (byte[] vBytes) { + TransBytes (out GetState, vBytes, NetDataType.BYTE); + } + +} diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/Core/NetworkPackage/ServerPack/HA7_Interaction/HA720_tagMCCreateRoleAwardState.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/Core/NetworkPackage/ServerPack/HA7_Interaction/HA720_tagMCCreateRoleAwardState.cs.meta index 383dea1..33e4af3 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/Core/NetworkPackage/ServerPack/HA7_Interaction/HA720_tagMCCreateRoleAwardState.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: 08539c9fea3d3ba46a95b13662b704ac MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB121_tagMCTreeInfo.cs b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB121_tagMCTreeInfo.cs new file mode 100644 index 0000000..89ad806 --- /dev/null +++ b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB121_tagMCTreeInfo.cs @@ -0,0 +1,25 @@ +using UnityEngine; +using System.Collections; + +// B1 21 浠欐爲淇℃伅 #tagMCTreeInfo + +public class HB121_tagMCTreeInfo : GameNetPackBasic { + public byte TreeLV; // 褰撳墠浠欐爲绛夌骇 + public byte LVUPState; // 0-闈炲崌绾т腑锛�1-鍗囩骇涓� + public uint LVUPRemainTime; // 鍗囩骇鍓╀綑鏃堕棿锛岀锛涘綋鍗囩骇涓笖鍊掕鏃朵负0鏃跺彲鍙戦�丅223鎵ц鍗囩骇鍖呰繘琛屽崌绾� + public byte FreeTimeCnt; // 浠婃棩宸插厤璐瑰噺鏃舵鏁� + public uint FreeTimeLast; // 涓婃鍏嶈垂鍑忔椂鏃堕棿鎴� + + public HB121_tagMCTreeInfo () { + _cmd = (ushort)0xB121; + } + + public override void ReadFromBytes (byte[] vBytes) { + TransBytes (out TreeLV, vBytes, NetDataType.BYTE); + TransBytes (out LVUPState, vBytes, NetDataType.BYTE); + TransBytes (out LVUPRemainTime, vBytes, NetDataType.DWORD); + TransBytes (out FreeTimeCnt, vBytes, NetDataType.BYTE); + TransBytes (out FreeTimeLast, vBytes, NetDataType.DWORD); + } + +} diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB121_tagMCTreeInfo.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/Core/NetworkPackage/ServerPack/HB1_Role/HB121_tagMCTreeInfo.cs.meta index 383dea1..bedc28c 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB121_tagMCTreeInfo.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: 5d4fec1aa2a73b64086988aef86ec5c6 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/Main.cs b/Main/Main.cs index 0ef8a01..7e634a8 100644 --- a/Main/Main.cs +++ b/Main/Main.cs @@ -33,6 +33,9 @@ Debug.Log("鍒囨崲鍒扮櫥褰曞満鏅�"); ConfigManager.Instance.Init(); GeneralDefine.Init(); +#if UNITY_EDITOR + SysNotifyMgr.Instance.BeforePlayerDataInitializeEvent(); +#endif StageManager.Instance.ToLoginScene(); DTC0403_tagPlayerLoginLoadOK.finishedLogin = false; @@ -73,6 +76,8 @@ managers.Add(PlayerMainDate.Instance); managers.Add(HeroUIManager.Instance); managers.Add(InvestModel.Instance); + managers.Add(BlessLVManager.Instance); + managers.Add(AutoFightModel.Instance); foreach (var manager in managers) { diff --git a/Main/SDK/SDKUtils.cs b/Main/SDK/SDKUtils.cs index 80c40dd..079b964 100644 --- a/Main/SDK/SDKUtils.cs +++ b/Main/SDK/SDKUtils.cs @@ -1054,7 +1054,7 @@ // m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString(); // m_Json["createTime"] = TimeUtility.CreateSeconds.ToString(); // m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); -// m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPoint.ToString(); +// m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); // #if UNITY_IOS // m_Json["identifier"] = VersionConfig.Get().bundleIdentifier; @@ -1252,7 +1252,7 @@ // m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString(); // m_Json["createTime"] = time; // m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); - // m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPoint.ToString(); + // m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); // SendMessageToSDK(m_Json); } @@ -1289,7 +1289,7 @@ // m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString(); // m_Json["createTime"] = TimeUtility.CreateSeconds.ToString(); // m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); - // m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPoint.ToString(); + // m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); // SendMessageToSDK(m_Json); } @@ -1311,7 +1311,7 @@ m_Json["levelUpTime"] = TimeUtility.AllSeconds.ToString(); m_Json["createTime"] = TimeUtility.CreateSeconds.ToString(); m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); - m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPoint.ToString(); + m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); SendMessageToSDK(m_Json); } @@ -1340,7 +1340,7 @@ m_Json["levelUpTime"] = TimeUtility.AllSeconds.ToString(); m_Json["createTime"] = TimeUtility.CreateSeconds.ToString(); m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); - m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPoint.ToString(); + m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); SendMessageToSDK(m_Json); } diff --git a/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs b/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs index 48e462d..228ea08 100644 --- a/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs +++ b/Main/System/Battle/BattleField/OperationAgent/HandModeOperationAgent.cs @@ -38,9 +38,9 @@ // 妫�鏌ヤ竴涓嬮敜瀛愮殑娑堣�� - //FightPoint 鐢ㄤ簬璁板綍娑堣�楁垬閿ゅ�嶆暟锛屽皬浜庣瓑浜�1鏃堕粯璁�1鍊嶏紝澶т簬1鏃朵负瀵瑰簲娑堣�楀�嶅�硷紝0418鍒锋柊绫诲瀷22 + //useHarmerCount 鐢ㄤ簬璁板綍娑堣�楁垬閿ゅ�嶆暟锛屽皬浜庣瓑浜�1鏃堕粯璁�1鍊嶏紝澶т簬1鏃朵负瀵瑰簲娑堣�楀�嶅�硷紝0418鍒锋柊绫诲瀷22 BattleDebug.LogError("HandModeOperationAgent DoNext 2"); - long costRate = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.FightPoint); + long costRate = PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.UseHarmerCount); long cost = (costRate > 1 ? costRate : 1) * 1; // 1鏄粯璁ゆ秷鑰� diff --git a/Main/System/Battle/BattleField/RecordActions/SkillRecordAction.cs b/Main/System/Battle/BattleField/RecordActions/SkillRecordAction.cs index 5a8d509..e56eb36 100644 --- a/Main/System/Battle/BattleField/RecordActions/SkillRecordAction.cs +++ b/Main/System/Battle/BattleField/RecordActions/SkillRecordAction.cs @@ -15,6 +15,10 @@ public override bool IsFinished() { + if (null == skillBase) + { + return true; + } return skillBase.IsFinished(); } diff --git a/Main/System/Battle/BattleManager.cs b/Main/System/Battle/BattleManager.cs index 45f1010..0467960 100644 --- a/Main/System/Battle/BattleManager.cs +++ b/Main/System/Battle/BattleManager.cs @@ -371,7 +371,7 @@ // 鐩墠鏀寔 BYTE ReqType; // 0-鍋滄鎴樻枟鍥炲煄锛�1-璁剧疆娑堣�楀�嶅�硷紱2-鎸戞垬鍏冲崱灏忔�紱3-鎸戞垬鍏冲崱boss锛�4-缁х画鎴樻枟锛� // 0-鍋滄鎴樻枟鍥炲煄 - 鐜╁涓诲姩鐐瑰嚮鍥炲煄鏃跺彂閫� - // 1-璁剧疆娑堣�楀�嶅�� - 鐜╁璁剧疆娑堣�楀�嶅�硷紝瀵瑰簲鍒扮帺瀹禙ightPoint鐨勫�� + // 1-璁剧疆娑堣�楀�嶅�� - 鐜╁璁剧疆娑堣�楀�嶅�硷紝瀵瑰簲鍒扮帺瀹秛seHarmerCount鐨勫�� // 2-鎸戞垬鍏冲崱灏忔�� - 鐜╁鐐瑰嚮寮�濮嬫垬鏂楁椂鍙戦�侊紝浠呬粠浼戞伅鐘舵�佸埌寮�濮嬫垬鏂楁椂鍙戦�佸嵆鍙� // 3-鎸戞垬鍏冲崱boss - 鐜╁璇锋眰鎸戞垬璇ュ叧鍗oss鏃跺彂閫� // 4-缁х画鎴樻枟 - 鐜╁涓荤嚎鎴樻枟涓紙鍖呭惈涓荤嚎灏忔��佷富绾縝oss锛夛紝鍓嶇琛ㄧ幇瀹屽悗绔悓姝ョ殑鎴樻枟鐗囨鍚庯紝鍙啀鍥炲璇ュ�硷紝鍚庣浼氭牴鎹垬鏂楅�昏緫鍙婃祦绋嬭嚜鍔ㄥ洖澶嶄笅涓�娈电殑鎴樻枟鐗囨灏佸寘锛屼竴鐩村惊鐜� diff --git a/Main/System/Battle/Motion/MotionBase.cs b/Main/System/Battle/Motion/MotionBase.cs index 306e2d3..1cb828c 100644 --- a/Main/System/Battle/Motion/MotionBase.cs +++ b/Main/System/Battle/Motion/MotionBase.cs @@ -152,6 +152,7 @@ if (anim == null) { BattleDebug.LogError($"鎵句笉鍒板姩鐢�: {skillConfig.SkillMotionName}"); + _onComplete?.Invoke(); return null; } diff --git a/Main/System/Chat/ChatManager.cs b/Main/System/Chat/ChatManager.cs index 105050c..e557ce9 100644 --- a/Main/System/Chat/ChatManager.cs +++ b/Main/System/Chat/ChatManager.cs @@ -1235,7 +1235,7 @@ } else { - return Language.Get(dungeonRandomChats[1], PlayerDatas.Instance.baseData.FightPoint); + return Language.Get(dungeonRandomChats[1], PlayerDatas.Instance.baseData.FightPower); } case ChatInfoType.Fairy: return Language.Get(realmRandomChats[_index]); diff --git a/Main/System/CustomizedGift/CustomizedGiftModel.cs b/Main/System/CustomizedGift/CustomizedGiftModel.cs index e1e8096..d4cfe40 100644 --- a/Main/System/CustomizedGift/CustomizedGiftModel.cs +++ b/Main/System/CustomizedGift/CustomizedGiftModel.cs @@ -127,7 +127,7 @@ for (int i = 0; i < act.ctgIDs.Count; i++) { int ctgID = act.ctgIDs[i]; - RechargeManager.RechargeCount rechargeCount; + RechargeCount rechargeCount; if (RechargeManager.Instance.TryGetRechargeCount(ctgID, out rechargeCount)) { total += rechargeCount.totalCount; @@ -142,7 +142,7 @@ OperationRechargeGiftAct act; OperationTimeHepler.Instance.TryGetOperation(operaType, out act); - RechargeManager.RechargeCount rechargeCount; + RechargeCount rechargeCount; RechargeManager.Instance.TryGetRechargeCount(ctgID, out rechargeCount); var ctgConfig = CTGConfig.Get(ctgID); diff --git a/Main/System/CustomizedGift/CustomizedRechargeModel.cs b/Main/System/CustomizedGift/CustomizedRechargeModel.cs index 261be8f..dd09e16 100644 --- a/Main/System/CustomizedGift/CustomizedRechargeModel.cs +++ b/Main/System/CustomizedGift/CustomizedRechargeModel.cs @@ -30,7 +30,7 @@ if (!RechargeManager.Instance.TryGetRechargeItem(ctgId, out awards)) return false; - RechargeManager.RechargeCount rechargeCount; + RechargeCount rechargeCount; if (!RechargeManager.Instance.TryGetRechargeCount(ctgId, out rechargeCount)) { return false; @@ -101,7 +101,7 @@ public void InitChoose() { - RechargeManager.RechargeCount rechargeCount; + RechargeCount rechargeCount; RechargeManager.Instance.TryGetRechargeCount(chooseCTGID, out rechargeCount); var selectedItemIndexs = CustomizedRechargeModel.Instance.GetSelectedItems(rechargeCount.selectItemValue); @@ -132,7 +132,7 @@ int goodsSumCount; //鍟嗗搧鎬绘暟閲� List<Item> awards = new List<Item>(); TryGetRechargeItemEx(ctgID, out awards, out goodsCount, out goodsSumCount); - RechargeManager.RechargeCount rechargeCount; + RechargeCount rechargeCount; RechargeManager.Instance.TryGetRechargeCount(ctgID, out rechargeCount); for (int i = 0; i < itemCells.Count; i++) { diff --git a/Main/System/Equip/BlessLVCell.cs b/Main/System/Equip/BlessLVCell.cs new file mode 100644 index 0000000..36f73a5 --- /dev/null +++ b/Main/System/Equip/BlessLVCell.cs @@ -0,0 +1,44 @@ +锘縰sing UnityEngine; +using UnityEngine.UI; + + +public class BlessLVCell : CellView +{ + [SerializeField] Text qualityName; + [SerializeField] Text qualityRate; + [SerializeField] Text qualityNextRate; + [SerializeField] Image qualityIcon; + + [SerializeField] OutlineEx qualityNameOutline; + + + public void Display(int index) + { + var startQuality = BlessLVManager.Instance.GetStartEquipQuality(); + var config = TreeLVConfig.Get(BlessLVManager.Instance.m_TreeLV); + var nextConfig = TreeLVConfig.Get(BlessLVManager.Instance.m_TreeLV + 1); + var quality = startQuality + index; + qualityName.text = Language.Get("equipQuality" + quality); + qualityName.color = UIHelper.GetUIColor(quality); + + float rate = 0; + if (config != null) + { + if (quality - 1 < config.EquipColorRateList.Length) + rate = config.EquipColorRateList[quality - 1] / 100.0f; + } + qualityRate.text = rate + "%"; + if (nextConfig != null) + { + if (quality - 1 < nextConfig.EquipColorRateList.Length) + rate = nextConfig.EquipColorRateList[quality - 1] / 100.0f; + } + qualityNextRate.text = rate + "%"; + qualityIcon.SetSprite("TreeItemQuality_" + quality); + qualityNameOutline.OutlineColor = UIHelper.GetUIOutlineColor(quality); + } + + +} + + diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/System/Equip/BlessLVCell.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/System/Equip/BlessLVCell.cs.meta index 383dea1..c0a2ef3 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/System/Equip/BlessLVCell.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: bcbe9f8e3b41b3049be9a08f505fde26 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/System/Equip/BlessLVManager.cs b/Main/System/Equip/BlessLVManager.cs new file mode 100644 index 0000000..8253544 --- /dev/null +++ b/Main/System/Equip/BlessLVManager.cs @@ -0,0 +1,177 @@ +锘縰sing System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System; + + +public class BlessLVManager : GameSystemManager<BlessLVManager> +{ + public int m_TreeLV { get; private set; } // 褰撳墠浠欐爲绛夌骇 + public int m_LVUPState { get; private set; } // 0-闈炲崌绾т腑锛�1-鍗囩骇涓� + public int m_LVUPRemainTime { get; private set; } // 鍗囩骇鍓╀綑鏃堕棿锛岀锛涘綋鍗囩骇涓笖鍊掕鏃朵负0鏃跺彲鍙戦�丅223鎵ц鍗囩骇鍖呰繘琛屽崌绾� + public int m_FreeTimeCnt { get; private set; } // 浠婃棩宸插厤璐瑰噺鏃舵鏁� + public int m_FreeTimeLast { get; private set; } // 涓婃鍏嶈垂鍑忔椂鏃堕棿鎴� + public event Action OnBlessLVUpdateEvent; + int m_LVPackTime; //鏀跺寘鏃堕棿鐢ㄤ簬璁$畻鍓╀綑鏃堕棿m_LVUPRemainTime + + public int upgradeTreeMoneyType; //鍗囩骇浠欐爲娑堣�楃殑璐у竵绫诲瀷 + public int timeUpTreeItemID; //鍔犻�熶粰鏍戝崌绾х殑閬撳叿ID + public int timeUpTreeItemSubTime; //鍑忓皯浠欐爲鍗囩骇鏃堕棿鐨勯亾鍏峰噺灏戠殑鏃堕棿 + public int dayFreeMaxTimes; //姣忔棩鍏嶈垂鍗囩骇娆℃暟 + public int freeTimeCD; //鍏嶈垂鍑忓皯鏃堕棿鐨勫喎鍗碈D 鍒� + public int freeSubTime; //鍏嶈垂鍑忓皯鐨勬椂闂� 鍒� + + public int lastTreeLV; //涓婁竴娆℃爲鐨勭瓑绾� 鐢ㄤ簬鎵撳紑鐣岄潰鐨勬椂鍊欐挱鏀句笅鍗囩骇鐗规晥 + + public override void Init() + { + m_TreeLV = 0; + m_LVUPState = 0; + m_LVUPRemainTime = 0; + m_LVPackTime = 0; + DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOK; + GlobalTimeEvent.Instance.fiveSecondEvent += OnTimeEvent; + + ParseConfig(); + } + + public override void Release() + { + DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOK; + GlobalTimeEvent.Instance.fiveSecondEvent -= OnTimeEvent; + } + + void OnPlayerLoginOK() + { + lastTreeLV = 0; + AutoUpgrade(); + UpdateTreeRedpoint(); + } + + + void ParseConfig() + { + var config = FuncConfigConfig.Get("TreeLVUP"); + upgradeTreeMoneyType = int.Parse(config.Numerical1); + var arr = config.Numerical2.Split('|'); + timeUpTreeItemID = int.Parse(arr[0]); + timeUpTreeItemSubTime = int.Parse(arr[1]); + dayFreeMaxTimes = int.Parse(config.Numerical3); + freeTimeCD = int.Parse(config.Numerical4); + freeSubTime = int.Parse(config.Numerical5); + } + + public void UpdateBlessLVInfo(HB121_tagMCTreeInfo netPack) + { + m_TreeLV = netPack.TreeLV; + m_LVUPState = netPack.LVUPState; + m_LVUPRemainTime = (int)netPack.LVUPRemainTime; + m_FreeTimeCnt = netPack.FreeTimeCnt; + m_FreeTimeLast = (int)netPack.FreeTimeLast; + m_LVPackTime = TimeUtility.AllSeconds; + if (lastTreeLV == 0) + { + lastTreeLV = m_TreeLV; + } + OnBlessLVUpdateEvent?.Invoke(); + UpdateTreeRedpoint(); + AutoUpgrade(); + } + + public int GetLVUPRemainTime() + { + if (m_LVUPState == 0) + return 0; + return m_LVUPRemainTime - (TimeUtility.AllSeconds - m_LVPackTime); + } + + public int GetFreeRemainTime() + { + if (m_LVUPState == 0) + return 0; + return m_FreeTimeLast + freeTimeCD * 60 - TimeUtility.AllSeconds; + } + + Redpoint redpointTree = new Redpoint(MainRedDot.BlessLVRedpoint); + Redpoint redpointTreeItem = new Redpoint(MainRedDot.BlessLVRedpoint, MainRedDot.BlessLVRedpoint * 10); + Redpoint redpointTreeFree = new Redpoint(MainRedDot.BlessLVRedpoint, MainRedDot.BlessLVRedpoint * 10 + 1); + void UpdateTreeRedpoint() + { + redpointTreeFree.state = RedPointState.None; + redpointTreeItem.state = RedPointState.None; + redpointTree.state = RedPointState.None; + var config = TreeLVConfig.Get(m_TreeLV); + if (config == null) return; + //闈炲崌绾т腑妫�鏌ュ崌绾ф潗鏂� + if (m_LVUPState == 0) + { + + if (UIHelper.GetMoneyCnt(upgradeTreeMoneyType) >= config.LVUPNeedMoney) + { + redpointTree.state = RedPointState.Simple; + } + } + else + { + //妫�鏌ユ椂闂撮亾鍏� 鍜� 鍏嶈垂鐨勬椂闂� + if (PackManager.Instance.GetSinglePack(PackType.Item).HasItem(timeUpTreeItemID)) + { + redpointTreeItem.state = RedPointState.Simple; + return; + } + if (m_FreeTimeCnt > 0 && GetFreeRemainTime() <= 0) + { + redpointTreeFree.state = RedPointState.Simple; + return; + } + + + } + } + + public void AutoUpgrade() + { + //鏃堕棿缁撴潫鑷姩閫氱煡鏈嶅姟绔崌绾э紝鎴栬�呮墦寮�鐣岄潰鏃讹紝鎴栬�呬笂绾� 閮藉仛妫�鏌� + if (m_LVUPState == 0) + { + return; + } + if (GetLVUPRemainTime() > 0) + { + return; + } + var pack = new CB223_tagCMTreeLVUP(); + pack.Type = 1; + GameNetSystem.Instance.SendInfo(pack); + } + + void OnTimeEvent() + { + //鍗囩骇涓鏌� 鍊掕鏃剁粨鏉燂紱闈炲崌绾т腑妫�鏌ュ厤璐规鏁版椂闂� 绾㈢偣 + if (m_LVUPState == 1) + { + //鍗囩骇 + AutoUpgrade(); + } + + UpdateTreeRedpoint(); + + } + + + //瑁呭鍝佽川鐨勮捣濮嬭〃鐜�,鏈�灏�1 + public int GetStartEquipQuality() + { + var rateList = TreeLVConfig.Get(m_TreeLV).EquipColorRateList; + for (int i = 0; i < rateList.Length; i++) + { + if (rateList[i] != 0) + return i + 1; + } + return 1; + } + + +} + + diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/System/Equip/BlessLVManager.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/System/Equip/BlessLVManager.cs.meta index 383dea1..49162d7 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/System/Equip/BlessLVManager.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: 4ec372b43a4e10e4798aa452c7c1f6aa MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/System/Equip/BlessLVTimeUpWin.cs b/Main/System/Equip/BlessLVTimeUpWin.cs new file mode 100644 index 0000000..47e2708 --- /dev/null +++ b/Main/System/Equip/BlessLVTimeUpWin.cs @@ -0,0 +1,112 @@ +锘� + +using System; +using UnityEngine; +using UnityEngine.UI; + +public class BlessLVTimeUpWin : UIBase +{ + [SerializeField] ItemCell itemCell; + [SerializeField] Text itemCntTxt; + [SerializeField] LongPressButton subBtn; + [SerializeField] LongPressButton addBtn; + [SerializeField] Text timeText; + [SerializeField] Button speedBtn; + + protected override void InitComponent() + { + addBtn.SetListener(OnClickPlus); + addBtn.onPress.AddListener(OnClickPlus); + subBtn.SetListener(OnClickReduce); + subBtn.onPress.AddListener(OnClickReduce); + speedBtn.AddListener(OnSpeedUP); + } + + protected override void OnPreOpen() + { + int count = (int)PackManager.Instance.GetItemCountByID(PackType.Item, BlessLVManager.Instance.timeUpTreeItemID); + itemCell.Init(new ItemCellModel(BlessLVManager.Instance.timeUpTreeItemID, false, count)); + itemCell.button.AddListener(() => + { + ItemTipUtility.Show(BlessLVManager.Instance.timeUpTreeItemID); + }); + + var remainTime = BlessLVManager.Instance.GetLVUPRemainTime(); + int needCount = (int)Math.Ceiling((float)remainTime / BlessLVManager.Instance.timeUpTreeItemSubTime); + showCount = Math.Min(count, needCount); + RefreshCount(needCount, remainTime); + RefreshBtn(showCount); + } + + int showCount; + void RefreshCount(int needCount, int remainTime) + { + + itemCntTxt.text = showCount + "/" + needCount; + timeText.text = Language.Get("L1100", Language.Get("BlessTree8"), TimeUtility.SecondsToDHMSEx(remainTime)) + + UIHelper.AppendColor(TextColType.DarkGreen, "(" + TimeUtility.SecondsToDHMSEx(showCount * BlessLVManager.Instance.timeUpTreeItemSubTime) + ")"); + + } + + void RefreshBtn(int maxCount) + { + if (showCount >= maxCount) + { + addBtn.interactable = false; + addBtn.SetColorful(null, false); + } + else + { + addBtn.interactable = true; + addBtn.SetColorful(null, true); + } + + if (showCount == 0) + { + subBtn.interactable = false; + subBtn.SetColorful(null, false); + } + else + { + subBtn.interactable = true; + subBtn.SetColorful(null, true); + } + } + + + void OnClickPlus() + { + int count = (int)PackManager.Instance.GetItemCountByID(PackType.Item, BlessLVManager.Instance.timeUpTreeItemID); + var remainTime = BlessLVManager.Instance.GetLVUPRemainTime(); + int needCount = (int)Math.Ceiling((float)remainTime / BlessLVManager.Instance.timeUpTreeItemSubTime); + if (showCount == Math.Min(count, needCount)) + return; + showCount++; + RefreshCount(needCount, remainTime); + RefreshBtn(Math.Min(count, needCount)); + } + + void OnClickReduce() + { + if (showCount == 0) + return; + var remainTime = BlessLVManager.Instance.GetLVUPRemainTime(); + showCount--; + itemCntTxt.text = showCount.ToString(); + int needCount = (int)Math.Ceiling((float)remainTime / BlessLVManager.Instance.timeUpTreeItemSubTime); + RefreshCount(needCount, remainTime); + + int count = (int)PackManager.Instance.GetItemCountByID(PackType.Item, BlessLVManager.Instance.timeUpTreeItemID); + RefreshBtn(Math.Min(count, needCount)); + } + + void OnSpeedUP() + { + var pack = new CB224_tagCMUseTreeLVUPTimeItem(); + pack.UseCount = (uint)showCount; + GameNetSystem.Instance.SendInfo(pack); + CloseWindow(); + } +} + + diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/System/Equip/BlessLVTimeUpWin.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/System/Equip/BlessLVTimeUpWin.cs.meta index 383dea1..65e7c76 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/System/Equip/BlessLVTimeUpWin.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: 71aa0a65d75dea04c9bded1f9bc01fc3 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/System/Equip/BlessLVWin.cs b/Main/System/Equip/BlessLVWin.cs new file mode 100644 index 0000000..64ceb5f --- /dev/null +++ b/Main/System/Equip/BlessLVWin.cs @@ -0,0 +1,218 @@ +锘� +using System; + +using UnityEngine; +using UnityEngine.UI; + + +public class BlessLVWin : UIBase +{ + [SerializeField] Text curLVTxt; + [SerializeField] Text nextLVTxt; + [SerializeField] ScrollerController scroller; + [SerializeField] Text leftTime; + [SerializeField] Transform upgradeOnState; //鍗囩骇涓寜閽� + [SerializeField] Text itemCntTxt; + [SerializeField] Image itemIcon; + [SerializeField] Button timeUpBtn; //鍔犻�熸椂闂存寜閽� + [SerializeField] Button freeBtn; + [SerializeField] Text freeLeftTime; + + [SerializeField] Transform upgradeWaiteState; //寰呭崌绾� + [SerializeField] Image processImg; //杩涘害 + [SerializeField] Text moneyText; + [SerializeField] Image moneyTypeImg; + [SerializeField] Button upgradeButton; + [SerializeField] UIEffectPlayer upgradeEffect; + [SerializeField] UIEffectPlayer btnEffect; + + + + + protected override void InitComponent() + { + + timeUpBtn.AddListener(() => + { + UIManager.Instance.OpenWindow<BlessLVTimeUpWin>(); + }); + + upgradeButton.AddListener(OnUpgrade); + + freeBtn.AddListener(() => + { + var pack = new CA504_tagCMPlayerGetReward(); + pack.RewardType = 82; + GameNetSystem.Instance.SendInfo(pack); + }); + } + + + protected override void OnPreOpen() + { + BlessLVManager.Instance.OnBlessLVUpdateEvent += Display; + PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataRefreshEvent; + GlobalTimeEvent.Instance.secondEvent += OnTimeEvent; + scroller.OnRefreshCell += OnRefreshCell; + CreateScroller(); + Display(); + BlessLVManager.Instance.AutoUpgrade(); + } + + + protected override void OnPreClose() + { + BlessLVManager.Instance.OnBlessLVUpdateEvent -= Display; + PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataRefreshEvent; + GlobalTimeEvent.Instance.secondEvent -= OnTimeEvent; + scroller.OnRefreshCell -= OnRefreshCell; + } + + + void DisplayLVUPEffect() + { + if (BlessLVManager.Instance.lastTreeLV != BlessLVManager.Instance.m_TreeLV) + { + BlessLVManager.Instance.lastTreeLV = BlessLVManager.Instance.m_TreeLV; + upgradeEffect.Play(); + } + else + { + upgradeEffect.Stop(); + } + } + + void OnTimeEvent() + { + if (BlessLVManager.Instance.m_LVUPState == 1) + { + if (BlessLVManager.Instance.GetLVUPRemainTime() > 0) + { + TimeUpShow(); + } + } + } + + + + + void Display() + { + curLVTxt.text = Language.Get("L1100", Language.Get("BlessTree2"), BlessLVManager.Instance.m_TreeLV); + nextLVTxt.text = Language.Get("L1100", Language.Get("BlessTree3"), BlessLVManager.Instance.m_TreeLV + 1); + var config = TreeLVConfig.Get(BlessLVManager.Instance.m_TreeLV); + itemIcon.SetItemSprite(BlessLVManager.Instance.timeUpTreeItemID); + + //寰呭崌绾� + if (BlessLVManager.Instance.m_LVUPState == 0) + { + upgradeOnState.SetActive(false); + upgradeWaiteState.SetActive(true); + leftTime.text = Language.Get("L1100", Language.Get("BlessTree8"), TimeUtility.SecondsToDHMSEx(config.LVUPNeedTime)); + ShowMoney(); + moneyTypeImg.SetIconWithMoneyType(BlessLVManager.Instance.upgradeTreeMoneyType); + } + else + { + upgradeOnState.SetActive(true); + upgradeWaiteState.SetActive(false); + TimeUpShow(); + } + DisplayLVUPEffect(); + scroller.m_Scorller.RefreshActiveCellViews(); + } + + void TimeUpShow() + { + var remainTime = BlessLVManager.Instance.GetLVUPRemainTime(); + leftTime.text = Language.Get("L1100", Language.Get("BlessTree8"), TimeUtility.SecondsToDHMSEx(remainTime)); + long itemCnt = PackManager.Instance.GetItemCountByID(PackType.Item, BlessLVManager.Instance.timeUpTreeItemID); + int needCount = (int)Math.Ceiling((float)remainTime / BlessLVManager.Instance.timeUpTreeItemSubTime); + itemCntTxt.text = itemCnt + "/" + needCount; + itemCntTxt.color = itemCnt >= needCount ? UIHelper.GetUIColor(TextColType.Green, true) : UIHelper.GetUIColor(TextColType.Red, true); + + if (BlessLVManager.Instance.m_FreeTimeCnt < BlessLVManager.Instance.dayFreeMaxTimes) + { + var freeeRemainTime = BlessLVManager.Instance.GetFreeRemainTime(); + if (freeeRemainTime > 0) + { + freeLeftTime.text = TimeUtility.SecondsToHMS(freeeRemainTime); + freeBtn.interactable = false; + } + else + { + freeLeftTime.text = ""; + freeBtn.interactable = true; + } + + } + else + { + freeLeftTime.text = ""; + freeBtn.interactable = false; + } + } + + void CreateScroller() + { + scroller.Refresh(); + for (int i = 0; i < 9; i++) + { + scroller.AddCell(ScrollerDataType.Header, i); + } + scroller.Restart(); + } + + void OnRefreshCell(ScrollerDataType type, CellView cell) + { + var _cell = cell as BlessLVCell; + _cell.Display(cell.index); + } + + private void OnPlayerDataRefreshEvent(PlayerDataType type) + { + if (type == UIHelper.moneyTypeToPlayerDataType[BlessLVManager.Instance.upgradeTreeMoneyType]) + { + ShowMoney(); + } + } + + + void ShowMoney() + { + var config = TreeLVConfig.Get(BlessLVManager.Instance.m_TreeLV); + string needMoney = config.LVUPNeedMoney.ToString(); + if (config.LVUPNeedMoney >= 1000000) + needMoney = UIHelper.ReplaceLargeNum(config.LVUPNeedMoney); + + long lsMoney = UIHelper.GetMoneyCnt(BlessLVManager.Instance.upgradeTreeMoneyType); + string money = lsMoney.ToString(); + if (lsMoney >= 1000000) + money = UIHelper.ReplaceLargeNum(lsMoney); + + moneyText.text = money + "/" + needMoney; + // moneyText.color = lsMoney >= config.LVUPNeedMoney ? UIHelper.GetUIColor(TextColType.Green, true) : UIHelper.GetUIColor(TextColType.Red, true); + moneyTypeImg.SetIconWithMoneyType(BlessLVManager.Instance.upgradeTreeMoneyType); + processImg.fillAmount = (float)lsMoney / config.LVUPNeedMoney; + if (lsMoney >= config.LVUPNeedMoney) + btnEffect.Play(); + else + btnEffect.Stop(); + } + + void OnUpgrade() + { + var config = TreeLVConfig.Get(BlessLVManager.Instance.m_TreeLV); + if (config.LVUPNeedMoney > UIHelper.GetMoneyCnt(BlessLVManager.Instance.upgradeTreeMoneyType)) + { + ItemTipUtility.ShowMoneyTip(BlessLVManager.Instance.upgradeTreeMoneyType); + return; + } + + var pack = new CB223_tagCMTreeLVUP(); + pack.Type = 0; + GameNetSystem.Instance.SendInfo(pack); + } +} + + diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/System/Equip/BlessLVWin.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/System/Equip/BlessLVWin.cs.meta index 383dea1..2e4667a 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/System/Equip/BlessLVWin.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: e9b4d07c3a38a1b4cb30eea29e82efa5 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/System/Equip/EquipModel.cs b/Main/System/Equip/EquipModel.cs index 5cf7211..b4c4148 100644 --- a/Main/System/Equip/EquipModel.cs +++ b/Main/System/Equip/EquipModel.cs @@ -9,7 +9,7 @@ public class EquipModel : GameSystemManager<EquipModel> { public const int TotleEquip = 12; //瑁呭鏍忓ぇ灏� - public bool waitEquipOPPack = false; + public bool waitEquipOPPack = false; // 绌挎埓瑁呭鐨勬搷浣� 涓嶅惈鍒嗚В public event Action<bool, int> OnEquipOPResultAction; //鏄惁鎹笂浜嗘柊瑁呭涓斿垎瑙d簡 瑁呭绱㈠紩 public event Action<List<int>, RectTransform> OnItemDropEvent; @@ -23,7 +23,7 @@ public int[] equipUIGirdEffects; //瑁呭鏍煎瓙鐗规晥 public ItemModel selectFloorEquip; //閫変腑鐨勫湴鏉胯澶� public int lastShowEquipIndex = -1; //涓婁竴娆$晫闈㈡樉绀鸿澶囩殑绱㈠紩锛屾嬀鍙栧悗鐗╁搧娑堝け闇�璁板綍涓嬪仛琛ㄧ幇 - public Queue<int> waitEquipOP = new Queue<int>(); //绛夊緟鎿嶄綔鐨勮澶囷紝闇�瑕佸拰UI浜や簰纭 + public Queue<int> waitEquipOP = new Queue<int>(); //绛夊緟鎿嶄綔鐨勮澶囷紝闇�瑕佸拰UI浜や簰纭 涓嶅惈鍒嗚В public override void Init() { @@ -238,6 +238,13 @@ // if (!IsEquip(equip)) // return false; + if (AutoFightModel.Instance.TryAutoFightDoEquip(equip)) + { + //鑷姩鎴樺姏瀵规瘮, 鏉′欢涓嶆弧瓒崇殑鍒嗚В + return false; + } + + // 濂藉嚑浠惰澶囬渶瑕佸鐞嗙殑鎯呭喌瀛樿捣鏉� waitEquipOP.Enqueue(equip.gridIndex); //鏈洖澶嶈澶囨搷浣滅粨鏋滐紝鍚﹀垯浼氭樉绀烘棫瑁呭 if (waitEquipOPPack) @@ -252,10 +259,12 @@ return false; } - + selectFloorEquip = GetSelectFloorEquip(); + if (selectFloorEquip == null) + return false; + UIManager.Instance.OpenWindow<EquipExchangeWin>(); - return true; } @@ -266,18 +275,12 @@ if (waitEquipOP.Count == 0) return null; - ItemModel item = PackManager.Instance.GetItemByIndex(PackType.DropItem, waitEquipOP.Dequeue()); - if (AutoFightModel.Instance.isAutoAttack) - { - //鑷姩鎴樺姏瀵规瘮, 鏉′欢涓嶆弧瓒崇殑鍒嗚В - return null; + return PackManager.Instance.GetItemByIndex(PackType.DropItem, waitEquipOP.Dequeue()); - } - - return item; } + //绛夌骇 public int GetEquipLV(ItemModel equip) { diff --git a/Main/System/GeneralConfig/GeneralDefine.cs b/Main/System/GeneralConfig/GeneralDefine.cs index dfd2bd8..70e3091 100644 --- a/Main/System/GeneralConfig/GeneralDefine.cs +++ b/Main/System/GeneralConfig/GeneralDefine.cs @@ -11,7 +11,6 @@ public static Dictionary<int, int> MoneyDisplayModel { get; private set; } public static int playerMaxLevel { get; private set; } - public static Dictionary<int, int> moneyDisplayIds { get; private set; } public static int expDisplayId { get; private set; } diff --git a/Main/System/Guild.meta b/Main/System/Guild.meta new file mode 100644 index 0000000..38042aa --- /dev/null +++ b/Main/System/Guild.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 265bf40707a44a641a810b3c675326d3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Main/System/Guild/GuildBaseWin.cs b/Main/System/Guild/GuildBaseWin.cs new file mode 100644 index 0000000..0615870 --- /dev/null +++ b/Main/System/Guild/GuildBaseWin.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +/// <summary> +/// 鍏細鍩虹鐣岄潰 +/// </summary> +public class GuildBaseWin : UIBase +{ + [SerializeField] Button rankBtn; + + protected override void InitComponent() + { + + } + + + protected override void OnPreOpen() + { + } + + protected override void OnPreClose() + { + } + + + public override void Refresh() + { + + } + + +} \ No newline at end of file diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/System/Guild/GuildBaseWin.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/System/Guild/GuildBaseWin.cs.meta index 383dea1..a6e22cf 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/System/Guild/GuildBaseWin.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: 3511d1c6da8ad9048ab85f89b04f9078 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/System/HappyXB/HappyXBModel.cs b/Main/System/HappyXB/HappyXBModel.cs index 0af1b07..f75a087 100644 --- a/Main/System/HappyXB/HappyXBModel.cs +++ b/Main/System/HappyXB/HappyXBModel.cs @@ -44,6 +44,9 @@ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize; FuncOpen.Instance.OnFuncStateChangeEvent += UpdateFuncState; PackManager.Instance.RefreshItemEvent += RefreshXBTool; + TimeMgr.Instance.OnDayEvent += OnDayEvent; + DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; + InvestModel.Instance.onInvestUpdate += OnInvestUpdate; xbGetItemDict.Clear(); xbTypeItemDict.Clear(); @@ -71,17 +74,30 @@ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize; FuncOpen.Instance.OnFuncStateChangeEvent -= UpdateFuncState; PackManager.Instance.RefreshItemEvent -= RefreshXBTool; + TimeMgr.Instance.OnDayEvent -= OnDayEvent; + DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; + InvestModel.Instance.onInvestUpdate -= OnInvestUpdate; } - public void OnBeforePlayerDataInitialize() + void OnBeforePlayerDataInitialize() { isXBCoolTime = false; xbTypeInfoDict.Clear(); } + void OnPlayerLoginOk() + { + HeroCallRedPoint(); + } + + void OnInvestUpdate(int type) + { + if (type == 7) + HeroCallRedPoint(); + } public XBGetItemConfig GetXBItemConfigByType(int type) { int lv = 0; @@ -307,27 +323,33 @@ //璐у竵瀵诲疂 int moneyType = funcSet.CostMoneyType; int xbOneMoney = funcSet.CostMoneyList[0]; - - if (UIHelper.GetMoneyCnt(moneyType) >= xbOneMoney) + //鏆傚畾鍏呭�艰揣甯侀渶瑕佷簩娆$‘璁� + if (moneyType == 1) { - //鏆傚畾鍏呭�艰揣甯侀渶瑕佷簩娆$‘璁� - if (moneyType == 1) + StoreModel.Instance.UseMoneyCheck(xbOneMoney, moneyType, () => { - StoreModel.Instance.UseMoneyCheck(xbOneMoney, moneyType, () => + if (UIHelper.GetMoneyCnt(moneyType) >= xbOneMoney) { SendXBQuest(xbType, 0, 0); - }, (int)BuyStoreItemCheckType.HeroCall, fullTip: Language.Get("CostMoneyForItem", funcSet.CostItemID, xbOneMoney, - UIHelper.GetIconNameWithMoneyType(moneyType), funcSet.CostItemCountList[0])); + } + else + { + ItemTipUtility.ShowMoneyTip(moneyType); + } + }, (int)BuyStoreItemCheckType.HeroCall, fullTip: Language.Get("CostMoneyForItem", funcSet.CostItemID, xbOneMoney, + UIHelper.GetIconNameWithMoneyType(moneyType), funcSet.CostItemCountList[0])); - } - else - { - SendXBQuest(xbType, 0, 0); - } } else { - ItemTipUtility.ShowMoneyTip(moneyType); + if (UIHelper.GetMoneyCnt(moneyType) >= xbOneMoney) + { + SendXBQuest(xbType, 0, 0); + } + else + { + ItemTipUtility.ShowMoneyTip(moneyType); + } } } } @@ -356,26 +378,34 @@ //璐у竵瀵诲疂 int moneyType = funcSet.CostMoneyType; - if (UIHelper.GetMoneyCnt(moneyType) >= needMoney) + + //鏆傚畾鍏呭�艰揣甯侀渶瑕佷簩娆$‘璁� + if (moneyType == 1) { - //鏆傚畾鍏呭�艰揣甯侀渶瑕佷簩娆$‘璁� - if (moneyType == 1) + StoreModel.Instance.UseMoneyCheck(needMoney, moneyType, () => { - StoreModel.Instance.UseMoneyCheck(needMoney, moneyType, () => + //鍙鏈夐亾鍏峰氨鏄亾鍏峰瀹濓紝涓嶈冻閮ㄥ垎鏈嶅姟绔墸璐у竵 + if (UIHelper.GetMoneyCnt(moneyType) >= needMoney) { - //鍙鏈夐亾鍏峰氨鏄亾鍏峰瀹濓紝涓嶈冻閮ㄥ垎鏈嶅姟绔墸璐у竵 SendXBQuest(xbType, 1, toolCnt > 0 ? 2 : 0); - }, (int)BuyStoreItemCheckType.HeroCall, fullTip: Language.Get("CostMoneyForItem", funcSet.CostItemID, needMoney, - UIHelper.GetIconNameWithMoneyType(moneyType), needToolCnt - toolCnt)); - } - else - { - SendXBQuest(xbType, 1, toolCnt > 0 ? 2 : 0); - } + } + else + { + ItemTipUtility.ShowMoneyTip(moneyType); + } + }, (int)BuyStoreItemCheckType.HeroCall, fullTip: Language.Get("CostMoneyForItem", funcSet.CostItemID, needMoney, + UIHelper.GetIconNameWithMoneyType(moneyType), needToolCnt - toolCnt)); } else { - ItemTipUtility.ShowMoneyTip(moneyType); + if (UIHelper.GetMoneyCnt(moneyType) >= needMoney) + { + SendXBQuest(xbType, 1, toolCnt > 0 ? 2 : 0); + } + else + { + ItemTipUtility.ShowMoneyTip(moneyType); + } } } @@ -479,10 +509,15 @@ #region 绾㈢偣閫昏緫 public const int HappyXB_RedKey = 203; public const int XBHeroCall1_RedKey = 20300; //姝﹀皢鍏嶈垂鍙敜 + public const int XBHeroCall10_RedKey = 20301; //姝﹀皢10鍙敜 + public const int XBHeroCallScore_RedKey = 20302; //姝﹀皢绉垎鍙敜 - public Redpoint happyXBRed = new Redpoint(HappyXB_RedKey); + public Redpoint happyXBRed = new Redpoint(MainRedDot.MainHerosRedpoint, HappyXB_RedKey); public Redpoint bestXBFreeRed = new Redpoint(HappyXB_RedKey, XBHeroCall1_RedKey); + public Redpoint bestXB10Red = new Redpoint(HappyXB_RedKey, XBHeroCall10_RedKey); + public Redpoint bestXBScoreRed = new Redpoint(HappyXB_RedKey, XBHeroCallScore_RedKey); + private void UpdateFuncState(int funcId) @@ -500,32 +535,39 @@ HeroCallRedPoint(); } + void OnDayEvent() + { + HeroCallRedPoint(); + } + //鑻遍泟鎷涘嫙 public void HeroCallRedPoint() { if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.HappyFindTreasure)) return; // 鍏嶈垂 10杩� 绉垎 - happyXBRed.state = RedPointState.None; + bestXB10Red.state = RedPointState.None; + bestXBFreeRed.state = RedPointState.None; + bestXBScoreRed.state = RedPointState.None; if (IsHaveFreeXB((int)HappXBTitle.HeroCallAdvanced)) { bestXBFreeRed.state = RedPointState.Simple; - return; - } - else - { - bestXBFreeRed.state = RedPointState.None; } if (IsHaveManyXBToolEx((int)HappXBTitle.HeroCallAdvanced, out int xbtoolCnt, out int needtoolCnt, out int needMoney)) { - happyXBRed.state = RedPointState.Simple; + bestXB10Red.state = RedPointState.Simple; return; } //绉垎瓒冲 - + if ((InvestModel.Instance.IsInvested(InvestModel.monthCardType) + || GetXBInfoByType((int)HappXBTitle.HeroCallScore)?.treasureCount == 0) + && UIHelper.GetMoneyCnt(51) >= TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0]) + { + bestXBScoreRed.state = RedPointState.Simple; + } } diff --git a/Main/System/HappyXB/HeroCallResultWin.cs b/Main/System/HappyXB/HeroCallResultWin.cs index 43add94..0c7a094 100644 --- a/Main/System/HappyXB/HeroCallResultWin.cs +++ b/Main/System/HappyXB/HeroCallResultWin.cs @@ -65,7 +65,6 @@ protected override void OnPreOpen() { isSkip = LocalSave.GetBool(HeroUIManager.skipKey, false); - UIManager.Instance.CloseWindow<ScrollTipWin>(); HappyXBModel.Instance.RefreshXBResultAct += UpdateState; HappyXBModel.Instance.RefreshXBTypeInfoAct += RefreshBtn; InitMoney(); @@ -179,7 +178,7 @@ { var funcSet = TreasureSetConfig.Get((int)HeroUIManager.Instance.selectCallType); if (funcSet.CostItemID == 0) - { + { call1ItemIcon.SetActive(false); call1Text.SetActive(false); call10ItemIcon.SetActive(false); @@ -191,11 +190,11 @@ call1Text.SetActive(true); call10ItemIcon.SetActive(true); call10Text.SetActive(true); - + var item = ItemConfig.Get(funcSet.CostItemID); var IconKey = item.IconKey; call1ItemIcon.SetOrgSprite(IconKey); - + var itemCount = PackManager.Instance.GetItemCountByID(PackType.Item, funcSet.CostItemID); if (HappyXBModel.Instance.IsHaveFreeXB((int)HeroUIManager.Instance.selectCallType)) { @@ -203,12 +202,13 @@ } else { - call1Text.text = Language.Get("L1100", item.ItemName, funcSet.CostItemCountList[0]); + call1Text.text = Language.Get("L1100", item.ItemName, UIHelper.AppendColor(funcSet.CostItemCountList[0] > itemCount ? TextColType.Red : TextColType.LightWhite, funcSet.CostItemCountList[0].ToString())); } call10ItemIcon.SetOrgSprite(IconKey); - call10Text.text = Language.Get("L1100", item.ItemName, funcSet.CostItemCountList[1]); + call10Text.text = Language.Get("L1100", item.ItemName, UIHelper.AppendColor(funcSet.CostItemCountList[1] > itemCount ? TextColType.Red : TextColType.LightWhite, funcSet.CostItemCountList[1].ToString())); + } void ShowMoney(bool show) diff --git a/Main/System/HappyXB/HeroCallWin.cs b/Main/System/HappyXB/HeroCallWin.cs index a87d3a9..423f39e 100644 --- a/Main/System/HappyXB/HeroCallWin.cs +++ b/Main/System/HappyXB/HeroCallWin.cs @@ -71,15 +71,16 @@ var IconKey = item.IconKey; call1ItemIcon.SetOrgSprite(IconKey); call10ItemIcon.SetOrgSprite(IconKey); + var itemCount = PackManager.Instance.GetItemCountByID(PackType.Item, funcSet.CostItemID); if (HappyXBModel.Instance.IsHaveFreeXB((int)HappXBTitle.HeroCallAdvanced)) { call1Text.text = Language.Get("L1127"); } else { - call1Text.text = Language.Get("L1100", item.ItemName, funcSet.CostItemCountList[0]); + call1Text.text = Language.Get("L1100", item.ItemName, UIHelper.AppendColor(funcSet.CostItemCountList[0] > itemCount ? TextColType.Red :TextColType.LightWhite, funcSet.CostItemCountList[0].ToString())); } - call10Text.text = Language.Get("L1100", item.ItemName, funcSet.CostItemCountList[1]); + call10Text.text = Language.Get("L1100", item.ItemName, UIHelper.AppendColor(funcSet.CostItemCountList[1] > itemCount ? TextColType.Red : TextColType.LightWhite, funcSet.CostItemCountList[1].ToString())); scoreText.text = UIHelper.GetMoneyCnt(51) + "/" + TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0]; @@ -109,7 +110,7 @@ void RefreshFreeTime() { - if (!HappyXBModel.Instance.IsHaveFreeXB((int)HappXBTitle.HeroCallAdvanced)) + if (HappyXBModel.Instance.IsHaveFreeXB((int)HappXBTitle.HeroCallAdvanced)) { freeCDTime.SetActive(false); } diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs index 08b9b17..6b688b3 100644 --- a/Main/System/HeroUI/HeroTrainWin.cs +++ b/Main/System/HeroUI/HeroTrainWin.cs @@ -204,7 +204,7 @@ if (hero.heroConfig.FetterIDList.Length > 0) { connetionForm.SetActive(true); - connetionForm.Display(hero.heroConfig.FetterIDList[0], Language.Get("herocard40"), true, guid); + connetionForm.Display(hero.heroConfig.FetterIDList[0], Language.Get("herocard38") + "\n", true, guid); } else { diff --git a/Main/System/InternalAffairs.meta b/Main/System/InternalAffairs.meta new file mode 100644 index 0000000..f7578c6 --- /dev/null +++ b/Main/System/InternalAffairs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6c6d94d09b5fc3546a5cb9c2488e37fa +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Main/System/InternalAffairs/AffairBaseWin.cs b/Main/System/InternalAffairs/AffairBaseWin.cs new file mode 100644 index 0000000..725d243 --- /dev/null +++ b/Main/System/InternalAffairs/AffairBaseWin.cs @@ -0,0 +1,22 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +/// <summary> +/// 鍐呮斂 +/// </summary> +public class AffairBaseWin : UIBase +{ + [SerializeField] Button bagBtn; + + protected override void InitComponent() + { + bagBtn.AddListener(() => + { + UIManager.Instance.OpenWindow<RolePackWin>(); + } + ); + } + +} \ No newline at end of file diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/System/InternalAffairs/AffairBaseWin.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/System/InternalAffairs/AffairBaseWin.cs.meta index 383dea1..b8fa858 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/System/InternalAffairs/AffairBaseWin.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: 670c8663456dd724497730fe8b72e23b MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/System/Invest/InvestModel.cs b/Main/System/Invest/InvestModel.cs index 161b1fb..e078acb 100644 --- a/Main/System/Invest/InvestModel.cs +++ b/Main/System/Invest/InvestModel.cs @@ -32,7 +32,7 @@ public event Action onSelectUpdate; - public event Action onInvestUpdate; + public event Action<int> onInvestUpdate; public const int redpointID = 20931; public Redpoint redpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, redpointID); @@ -305,7 +305,7 @@ if (onInvestUpdate != null) { - onInvestUpdate(); + onInvestUpdate(package.InvestType); } } diff --git a/Main/System/ItemTip/BoxGetItemModel.cs b/Main/System/ItemTip/BoxGetItemModel.cs index 522b6af..407c53f 100644 --- a/Main/System/ItemTip/BoxGetItemModel.cs +++ b/Main/System/ItemTip/BoxGetItemModel.cs @@ -97,9 +97,9 @@ for (int i = 0; i < netPack.MoneyLen; i++) { var moneyType = netPack.MoneyList[i].MoneyType; - if (GeneralDefine.moneyDisplayIds.ContainsKey(moneyType) && netPack.MoneyList[i].MoneyValue != 0) + if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType) && netPack.MoneyList[i].MoneyValue != 0) { - showItems.Add(new Item(GeneralDefine.moneyDisplayIds[moneyType], netPack.MoneyList[i].MoneyValue)); + showItems.Add(new Item(GeneralDefine.MoneyDisplayModel[moneyType], netPack.MoneyList[i].MoneyValue)); } } diff --git a/Main/System/Login/LoginWin.cs b/Main/System/Login/LoginWin.cs index 9599d70..282de81 100644 --- a/Main/System/Login/LoginWin.cs +++ b/Main/System/Login/LoginWin.cs @@ -99,6 +99,7 @@ // InGameDownLoad.Instance.downLoadGo = false; // DownloadMgr.MaxDownLoadTask = InGameDownLoad.Instance.GetMaxTask(); // }); + AutoFightModel.Instance.isAutoAttack = false; } protected override void OnOpenAnimationComplete() @@ -124,9 +125,9 @@ public override void Refresh() { base.Refresh(); - Debug.Log("鍒锋柊鐧诲綍绐楀彛"); - - //鎵撳寘鐗堟湰 + 鍔熻兘鐗堟湰 + 璇█ID + Debug.Log("鍒锋柊鐧诲綍绐楀彛"); + + //鎵撳寘鐗堟湰 + 鍔熻兘鐗堟湰 + 璇█ID verInfo.text = LoginManager.Instance.GetVersionStr(); var sprite = BuiltInLoader.LoadSprite("TB_DL_Logo"); diff --git a/Main/System/Main/AutoFightModel.cs b/Main/System/Main/AutoFightModel.cs index 1439254..ec225e4 100644 --- a/Main/System/Main/AutoFightModel.cs +++ b/Main/System/Main/AutoFightModel.cs @@ -2,25 +2,138 @@ using System.Collections; using System.Collections.Generic; using System.Text; +using LitJson; using UnityEngine; public class AutoFightModel : GameSystemManager<AutoFightModel> { - public int fightSpeed = 1; //鎴樻枟鍊嶆暟锛氬�艰秺澶ц秺蹇紝褰卞搷鎴樻枟琛ㄧ幇锛屾帀钀介�熷害绛� + //鎴樻枟鍊嶆暟锛氬�艰秺澶ц秺蹇紝褰卞搷鎴樻枟琛ㄧ幇锛屾帀钀介�熷害绛� + public int fightSpeed + { + get + { + int value = QuickSetting.Instance.GetQuickSettingValue<int>(QuickSettingType.AutoFight_Speed, 0); + return Math.Min(Math.Max(value, 1), maxSpeed); + } + set + { + QuickSetting.Instance.SetQuickSetting(QuickSettingType.AutoFight_Speed, value); + } + } - public bool isAutoAttack; //鑷姩鏀诲嚮 + //娑堣�楀�嶆暟 + public int fightCost + { + get + { + int value = QuickSetting.Instance.GetQuickSettingValue<int>(QuickSettingType.AutoFight_Cost, 0); + return Math.Min(Math.Max(value, 1), maxCost); + } + set + { + QuickSetting.Instance.SetQuickSetting(QuickSettingType.AutoFight_Cost, value); + } + } + + //鑷姩妯″紡, 鐪熸鐐瑰嚮鎴橀敜娑堣�楀紑鍚紝鍜屼紤鎭紙鎴栨棤鏉愭枡锛夊仠姝� + public bool isAutoAttack = false; + + //鏄惁寮�鍚嚜鍔ㄦ垬鏂楄缃� + public bool isAutoAttackSet + { + get + { + return QuickSetting.Instance.GetQuickSettingBool(QuickSettingType.AutoFight_Open, 0); + } + set + { + QuickSetting.Instance.SetQuickSetting(QuickSettingType.AutoFight_Open, value); + } + } + + //鏇村ソ瑁呭鍋滄鎴樻枟 + public bool isStopFightByBetterEquip + { + get + { + return QuickSetting.Instance.GetQuickSettingBool(QuickSettingType.AutoFight_FightPower, 0); + } + set + { + QuickSetting.Instance.SetQuickSetting(QuickSettingType.AutoFight_FightPower, value); + } + } + + + public event Action ChangeAutoEvent; + + public int maxSpeed = 3; //鏈�楂橀�熷害 + public int maxCost; //鏈�楂樻秷鑰� + public int[] autoCostWithBlessLV; //鑷姩鎴樻枟娑堣�楀�嶆暟鍏宠仈绁濈绛夌骇 + public int speed2UnlockMissionID; + public int speed3UnlockCTGID; public override void Init() { - + ParseConfig(); + DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; } public override void Release() { - + DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; } void ParseConfig() { + var config = FuncConfigConfig.Get("AutoGuaji"); + autoCostWithBlessLV = JsonMapper.ToObject<int[]>(config.Numerical1); + speed2UnlockMissionID = int.Parse(config.Numerical2); + speed3UnlockCTGID = int.Parse(config.Numerical3); + maxCost = autoCostWithBlessLV.Length; } + void OnPlayerLoginOk() + { + //鐧诲綍鏃舵湁瑁呭鐨勫鐞� + } + + public void SaveAutoFightSetting() + { + if (PlayerDatas.Instance.baseData.UseHarmerCount != fightCost) + { + PlayerDatas.Instance.baseData.UseHarmerCount = fightCost; + BattleManager.Instance.MainFightRequest(1, (uint)fightCost); + } + QuickSetting.Instance.SendPackage(); + ChangeAutoEvent?.Invoke(); + } + + + //鑷姩澶勭悊瑁呭锛岄渶瑕佺瓑寰呯┛鎴磋繑鍥瀎alse锛屽叾浠栨儏鍐佃繑鍥瀟rue + public bool TryAutoFightDoEquip(ItemModel item) + { + if (!isAutoAttack) + return false; + + if (item == null) + return true; + + long showFightPower = FightPowerManager.Instance.GetFightPowerChange(item); + + if (showFightPower < 0) + { + EquipModel.Instance.SendEquipOP(new ushort[] { (ushort)item.gridIndex }, 1); + return true; + } + else + { + if (isStopFightByBetterEquip) + return false; + + EquipModel.Instance.SendEquipOP(new ushort[] { (ushort)item.gridIndex }, 1); + return true; + + } + + } } diff --git a/Main/System/Main/AutoFightWin.cs b/Main/System/Main/AutoFightWin.cs new file mode 100644 index 0000000..6a915e5 --- /dev/null +++ b/Main/System/Main/AutoFightWin.cs @@ -0,0 +1,244 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + + +public class AutoFightWin : UIBase +{ + [SerializeField] Button autoStartBtn; + [SerializeField] GameObject usingAutoObj; + [SerializeField] Button autoStopBtn; + [SerializeField] Button autoSaveBtn; + + [SerializeField] Button changeCostBtn; + [SerializeField] Text costText; + [SerializeField] Image costArrow; + [SerializeField] Text costTip; + [SerializeField] ScrollerController costScroll; + + [SerializeField] Button changeSpeedBtn; + [SerializeField] Text speedText; + [SerializeField] Image speedArrow; + [SerializeField] ScrollerController speedScroll; + + [SerializeField] Toggle betterEquipToggle; + + + bool isOpenCostScroll = false; + bool isOpenSpeedScroll = false; + protected override void InitComponent() + { + autoStartBtn.AddListener(OnClickAutoStart); + autoStopBtn.AddListener(OnClickAutoStop); + autoSaveBtn.AddListener(OnClickAutoStart); + + changeCostBtn.AddListener(() => + { + isOpenCostScroll = !isOpenCostScroll; + costScroll.SetActive(isOpenCostScroll); + costArrow.transform.localRotation = Quaternion.Euler(0, 0, isOpenCostScroll ? 180 : 0); + }); + changeSpeedBtn.AddListener(() => + { + isOpenSpeedScroll = !isOpenSpeedScroll; + speedScroll.SetActive(isOpenSpeedScroll); + speedArrow.transform.localRotation = Quaternion.Euler(0, 0, isOpenSpeedScroll ? 180 : 0); + }); + + betterEquipToggle.AddListener((bool value) => + { + betterEquipToggle.isOn = value; + }); + + costScroll.GetComponent<ClickScreenOtherSpace>().AddListener(() => + { + isOpenCostScroll = false; + costArrow.transform.localRotation = Quaternion.Euler(0, 0, 0); + }); + + speedScroll.GetComponent<ClickScreenOtherSpace>().AddListener(() => + { + isOpenSpeedScroll = false; + speedArrow.transform.localRotation = Quaternion.Euler(0, 0, 0); + }); + } + + protected override void OnPreOpen() + { + costScroll.OnRefreshCell += OnRefreshCostCell; + speedScroll.OnRefreshCell += OnRefreshSpeedCell; + Display(); + } + + protected override void OnPreClose() + { + costScroll.OnRefreshCell -= OnRefreshCostCell; + speedScroll.OnRefreshCell -= OnRefreshSpeedCell; + } + + + void Display() + { + costText.text = AutoFightModel.Instance.fightCost.ToString(); + speedText.text = AutoFightModel.Instance.fightSpeed.ToString(); + betterEquipToggle.isOn = AutoFightModel.Instance.isStopFightByBetterEquip; + costTip.text = Language.Get("AutoFight2", ItemConfig.Get(GeneralDefine.MoneyDisplayModel[41]).ItemName, AutoFightModel.Instance.fightCost); + + if (AutoFightModel.Instance.isAutoAttackSet) + { + usingAutoObj.SetActive(true); + autoStartBtn.SetActive(false); + } + else + { + usingAutoObj.SetActive(false); + autoStartBtn.SetActive(true); + } + + costScroll.SetActive(false); + speedScroll.SetActive(false); + costArrow.transform.localRotation = Quaternion.Euler(0, 0, 0); + speedArrow.transform.localRotation = Quaternion.Euler(0, 0, 0); + + CreateCostScroll(); + CreateSpeedScroll(); + + } + + + void CreateCostScroll() + { + costScroll.Refresh(); + for (int i = 0; i < AutoFightModel.Instance.maxCost; i++) + { + costScroll.AddCell(ScrollerDataType.Header, i + 1); + } + costScroll.Restart(); + } + + void CreateSpeedScroll() + { + speedScroll.Refresh(); + for (int i = 0; i < AutoFightModel.Instance.maxSpeed; i++) + { + speedScroll.AddCell(ScrollerDataType.Header, i + 1); + } + speedScroll.Restart(); + } + + + void OnRefreshCostCell(ScrollerDataType type, CellView cell) + { + var btn = cell.GetComponent<Button>(); + + btn.AddListener(() => + { + if (AutoFightModel.Instance.autoCostWithBlessLV[cell.index - 1] > BlessLVManager.Instance.m_TreeLV) + { + SysNotifyMgr.Instance.ShowTip("autofight4", AutoFightModel.Instance.autoCostWithBlessLV[cell.index - 1]); + return; + } + isOpenCostScroll = false; + costScroll.SetActive(false); + costArrow.transform.localRotation = Quaternion.Euler(0, 0, 0); + costText.text = cell.index.ToString(); + costTip.text = Language.Get("AutoFight2", ItemConfig.Get(GeneralDefine.MoneyDisplayModel[41]).ItemName, cell.index); + + }); + + + + var cntText = cell.GetComponentInChildren<Text>(); + + if (AutoFightModel.Instance.autoCostWithBlessLV[cell.index - 1] <= BlessLVManager.Instance.m_TreeLV) + { + cntText.text = UIHelper.AppendColor(TextColType.LightWhite, cell.index.ToString()); + } + else + { + cntText.text = UIHelper.AppendColor(TextColType.Gray, cell.index.ToString()); + } + } + + + void OnRefreshSpeedCell(ScrollerDataType type, CellView cell) + { + var btn = cell.GetComponent<Button>(); + var needtaskCount = TaskManager.Instance.GetNeedFinishTaskCount(AutoFightModel.Instance.speed2UnlockMissionID); + RechargeCount _rechargeCount; + bool isbuy = false; + if (RechargeManager.Instance.TryGetRechargeCount(AutoFightModel.Instance.speed3UnlockCTGID, out _rechargeCount)) + { + isbuy = _rechargeCount.totalCount > 0; + } + + + btn.AddListener(() => + { + if (cell.index == 2) + { + if (needtaskCount > 0) + { + SysNotifyMgr.Instance.ShowTip("autofight2", needtaskCount); + return; + } + } + else if (cell.index == 3) + { + if (!isbuy) + { + SysNotifyMgr.Instance.ShowTip("autofight3"); + return; + } + } + isOpenSpeedScroll = false; + speedScroll.SetActive(false); + speedArrow.transform.localRotation = Quaternion.Euler(0, 0, 0); + speedText.text = cell.index.ToString(); + }); + + var cntText = cell.GetComponentInChildren<Text>(); + if (cell.index == 2) + { + cntText.text = UIHelper.AppendColor(needtaskCount > 0 ? TextColType.Gray : TextColType.LightWhite, cell.index.ToString()); + } + else if (cell.index == 3) + { + cntText.text = UIHelper.AppendColor(isbuy ? TextColType.LightWhite : TextColType.Gray, cell.index.ToString()); + } + else + { + cntText.text = cell.index.ToString(); + } + } + + void OnClickAutoStart() + { + AutoFightModel.Instance.isAutoAttackSet = true; + AutoFightModel.Instance.fightCost = int.Parse(costText.text); + AutoFightModel.Instance.fightSpeed = int.Parse(speedText.text); + AutoFightModel.Instance.isStopFightByBetterEquip = betterEquipToggle.isOn; + AutoFightModel.Instance.SaveAutoFightSetting(); + CloseWindow(); + SysNotifyMgr.Instance.ShowTip("autofight1"); + } + + void OnClickAutoStop() + { + ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), + Language.Get("AutoFight11"), (bool isOK) => + { + if (isOK) + { + AutoFightModel.Instance.isAutoAttackSet = false; + AutoFightModel.Instance.fightCost = int.Parse(costText.text); + AutoFightModel.Instance.fightSpeed = int.Parse(speedText.text); + AutoFightModel.Instance.isStopFightByBetterEquip = betterEquipToggle.isOn; + AutoFightModel.Instance.SaveAutoFightSetting(); + CloseWindow(); + } + }); + + } +} \ No newline at end of file diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/System/Main/AutoFightWin.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/System/Main/AutoFightWin.cs.meta index 383dea1..b726019 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/System/Main/AutoFightWin.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: eb3b2c8794aa61c4c95ea434c6baebbc MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/System/Main/FuncsBaseWin.cs b/Main/System/Main/FuncsBaseWin.cs index 2a2689c..f447b97 100644 --- a/Main/System/Main/FuncsBaseWin.cs +++ b/Main/System/Main/FuncsBaseWin.cs @@ -58,7 +58,7 @@ /// <summary> /// 閫夋嫨鏍囩 /// </summary> - protected void SelectBottomTab(int index) + protected virtual void SelectBottomTab(int index) { // 濡傛灉鐐瑰嚮褰撳墠宸查�変腑鐨勬爣绛撅紝涓嶅仛澶勭悊 if (functionOrder == index && currentSubUI != null) diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs index f4e73cd..eefb2ad 100644 --- a/Main/System/Main/HomeWin.cs +++ b/Main/System/Main/HomeWin.cs @@ -27,8 +27,16 @@ [SerializeField] Button changeHeroPosBtn; - [SerializeField] Button autoBtn; + //绛夌骇 + [SerializeField] Button officialUpBtn; + + //搴曢儴鍔熻兘 + [SerializeField] Button autoBtn; + [SerializeField] Image autoCloseImg; + [SerializeField] UIEffectPlayer autoOpenEffect; + [SerializeField] Button blessLVBtn; + [SerializeField] Text blessLVText; //鍏朵粬鍔熻兘鍏ュ彛 [SerializeField] Button monthCardBtn; @@ -52,25 +60,30 @@ autoBtn.AddListener(() => { - //娴嬭瘯鎷惧彇鎵�鏈夌墿鍝� - var items = PackManager.Instance.GetItems(PackType.DropItem); - List<int> dropindexs = new List<int>(); - for (int i = 0; i < items.Count; i++) - { - var item = items[i]; - if (dropindexs.Count > 5) - { - EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); - dropindexs.Clear(); - } + // //娴嬭瘯鎷惧彇鎵�鏈夌墿鍝� + // var items = PackManager.Instance.GetItems(PackType.DropItem); + // List<int> dropindexs = new List<int>(); + // for (int i = 0; i < items.Count; i++) + // { + // var item = items[i]; + // if (dropindexs.Count > 5) + // { + // EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); + // dropindexs.Clear(); + // } - dropindexs.Add(item.gridIndex); - } - if (dropindexs.Count > 0) + // dropindexs.Add(item.gridIndex); + // } + // if (dropindexs.Count > 0) + // { + // EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); + // dropindexs.Clear(); + // } + if (!FuncOpen.Instance.IsFuncOpen(108, true)) { - EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); - dropindexs.Clear(); + return; } + UIManager.Instance.OpenWindow<AutoFightWin>(); }); @@ -78,37 +91,51 @@ { InvestModel.Instance.BuyInvest(InvestModel.monthCardType); }); + + blessLVBtn.AddListener(() => + { + UIManager.Instance.OpenWindow<BlessLVWin>(); + }); + + officialUpBtn.AddListener(()=> + { + if (RealmConfig.GetKeys().Count <= PlayerDatas.Instance.baseData.realmLevel) + return; + UIManager.Instance.OpenWindow<OfficialUpWin>(); + }); } - public override void Refresh() + public void Display() { UpdatePlayerInfo(); UpdateTask(); RefreshRecharge(); + ShowBlessLV(); + DisplayAutoFight(); } protected override void OnPreOpen() { PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh; TaskManager.Instance.OnTaskUpdate += UpdateTask; - Refresh(); + BlessLVManager.Instance.OnBlessLVUpdateEvent += ShowBlessLV; + AutoFightModel.Instance.ChangeAutoEvent += DisplayAutoFight; + Display(); // var battleWin = UIManager.Instance.OpenWindow<BattleWin>(); // battleWin.SetBattleField(BattleManager.Instance.storyBattleField); } - protected override void OnOpen() - { - base.OnOpen(); - - } + protected override void OnPreClose() { PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh; TaskManager.Instance.OnTaskUpdate -= UpdateTask; + BlessLVManager.Instance.OnBlessLVUpdateEvent -= ShowBlessLV; + AutoFightModel.Instance.ChangeAutoEvent -= DisplayAutoFight; // 鍏抽棴鐨勬椂鍊欐妸鎴樻枟鐣岄潰涔熺粰鍏充簡 铏界劧鏄湪澶栭潰寮�鐨� UIManager.Instance.CloseWindow<BattleWin>(); @@ -135,6 +162,26 @@ monthCardBtn.SetActive(!InvestModel.Instance.IsInvested(InvestModel.monthCardType)); } + + void ShowBlessLV() + { + blessLVText.text = BlessLVManager.Instance.m_TreeLV.ToString(); + } + + void DisplayAutoFight() + { + if (AutoFightModel.Instance.isAutoAttackSet) + { + autoCloseImg.SetActive(false); + autoOpenEffect.Play(); + } + else + { + autoCloseImg.SetActive(true); + autoOpenEffect.Stop(); + } + } + /// <summary> /// 鏇存柊鐜╁淇℃伅 /// </summary> diff --git a/Main/System/Main/MainWin.cs b/Main/System/Main/MainWin.cs index 97b6c00..ba3322f 100644 --- a/Main/System/Main/MainWin.cs +++ b/Main/System/Main/MainWin.cs @@ -8,7 +8,8 @@ /// </summary> public class MainWin : FunctionsBaseWin { - //澶村儚鍖� + //澶村儚鍖� + [SerializeField] GameObject topBar; [SerializeField] AvatarCell avatarCell; [SerializeField] Text playerNameText; [SerializeField] Text powerText; @@ -46,6 +47,33 @@ } + protected override void SelectBottomTab(int index) + { + if (index == 3) + { + //鎸戞垬鐗规畩鏄剧ず閫昏緫 + return; + } + + topBar.SetActive(index == 0 || index == 2); + // 濡傛灉鐐瑰嚮褰撳墠宸查�変腑鐨勬爣绛撅紝涓嶅仛澶勭悊 + if (functionOrder == index && currentSubUI != null) + { + return; + } + + // 鏇存柊褰撳墠閫変腑鐨勬爣绛剧储寮� + functionOrder = index; + + // 鍏抽棴褰撳墠鎵撳紑鐨勫瓙鐣岄潰 + CloseCurrentSubUI(); + + // 鏍规嵁閫変腑鐨勬爣绛炬墦寮�瀵瑰簲鐨勭晫闈� + OpenSubUIByTabIndex(); + } + + + /// <summary> /// 鏇存柊鐜╁淇℃伅 /// </summary> @@ -57,7 +85,7 @@ PlayerDatas.Instance.baseData.facePic)); playerNameText.text = PlayerDatas.Instance.baseData.PlayerName; - powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPoint); + powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower); officialRankText.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID); } @@ -67,7 +95,7 @@ switch (type) { case PlayerDataType.FightPower: - powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPoint); + powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower); break; case PlayerDataType.RealmLevel: officialRankText.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID); @@ -104,7 +132,12 @@ { if (currentSubUI != null && currentSubUI.name == "HomeWin") { + Debug.Log("鐐瑰嚮涓荤晫闈㈡寜閽�"); //鎵撳紑涓荤晫闈㈢殑鎯呭喌涓嬪啀鐐瑰嚮鎸夐挳锛屾墽琛屾敾鍑婚�昏緫 + if (AutoFightModel.Instance.isAutoAttackSet) + { + AutoFightModel.Instance.isAutoAttack = true; + } StoryBattleField storyBattleField = BattleManager.Instance.storyBattleField; if (storyBattleField != null) { @@ -143,20 +176,19 @@ Debug.Log("鎵撳紑涓诲煄鐣岄潰"); break; case 1: - currentSubUI = UIManager.Instance.OpenWindow<RolePackWin>(); + currentSubUI = UIManager.Instance.OpenWindow<AffairBaseWin>(); Debug.Log("鎵撳紑鍐呮斂鐣岄潰"); break; case 2: currentSubUI = UIManager.Instance.OpenWindow<HeroBaseWin>(0); Debug.Log("鎵撳紑姝﹀皢鐣岄潰"); break; - case 3: - // currentSubUI = UIManager.Instance.OpenUI<QuestUI>(); - Debug.Log("鎵撳紑鎸戞垬鐣岄潰"); - break; + // case 3: + // // currentSubUI = UIManager.Instance.OpenUI<QuestUI>(); + // Debug.Log("鎵撳紑鎸戞垬鐣岄潰"); + // break; case 4: - //currentSubUI = UIManager.Instance.OpenWindow<PlaceWin>(); - Debug.Log("鎵撳紑鍏細鐣岄潰"); + currentSubUI = UIManager.Instance.OpenWindow<GuildBaseWin>(); break; default: Debug.LogWarning("鏈煡鐨勬爣绛剧储寮�: " + functionOrder); diff --git a/Main/System/Main/MoneyMoveByPath.cs b/Main/System/Main/MoneyMoveByPath.cs index fcef22c..bcd0f0f 100644 --- a/Main/System/Main/MoneyMoveByPath.cs +++ b/Main/System/Main/MoneyMoveByPath.cs @@ -46,7 +46,7 @@ //鎸傜埗鑺傜偣 imgMoney.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one); var moneyImg = imgMoney.GetComponent<ImageEx>(); - moneyImg.SetSprite(StringUtility.Contact("Money_Type_", moneyType)); + moneyImg.SetIconWithMoneyType(moneyType); moneyImg.raycastTarget = false; moneyImg.GetComponent<RectTransform>().sizeDelta = new Vector2(40, 40); imgMoneys.Add(moneyImg); diff --git a/Main/System/Message/ImgAnalysis.cs b/Main/System/Message/ImgAnalysis.cs index 5d6e268..bd82e5b 100644 --- a/Main/System/Message/ImgAnalysis.cs +++ b/Main/System/Message/ImgAnalysis.cs @@ -131,6 +131,11 @@ presentImgInfo.spriteName = array[1]; } break; + case "folder": + { + presentImgInfo.folderName = array[1]; + } + break; case "face": { presentImgInfo.spriteName = array[1]; @@ -143,7 +148,7 @@ height = (int)RichTextMgr.Inst.presentRichText.FaceSize; } else - { + { if (UIFrameMgr.Inst.ContainsDynamicImage(presentImgInfo.spriteName)) { var list = UIFrameMgr.Inst.GetDynamicImage(presentImgInfo.spriteName); @@ -189,7 +194,14 @@ if (presentImgInfo.IsFace) return; if (IconConfig.isInit) { - presentImgInfo.sprite = UILoader.LoadSprite(presentImgInfo.spriteName); + if (!string.IsNullOrEmpty(presentImgInfo.folderName)) + { + presentImgInfo.sprite = UILoader.LoadSprite(presentImgInfo.folderName, presentImgInfo.spriteName); + } + else + { + presentImgInfo.sprite = UILoader.LoadSprite(presentImgInfo.spriteName); + } } if (presentImgInfo.sprite != null) diff --git a/Main/System/Message/RichNormalEvent.cs b/Main/System/Message/RichNormalEvent.cs index 077acc6..97e8ad4 100644 --- a/Main/System/Message/RichNormalEvent.cs +++ b/Main/System/Message/RichNormalEvent.cs @@ -336,7 +336,7 @@ // { // colorType = RichTextMgr.Inst.presentRichText.colorType == RichText.ColorType.Dark ? 0 : 1; // } - // var fightPoint = PlayerDatas.Instance.baseData.FightPoint; + // var fightPoint = PlayerDatas.Instance.baseData.FightPower; // ulong targetValue = 0; // var infoArray = dic["myfightpoint"].Split('_'); // if (infoArray.Length > 1) diff --git a/Main/System/Message/RichTextMgr.cs b/Main/System/Message/RichTextMgr.cs index ea35079..991ffca 100644 --- a/Main/System/Message/RichTextMgr.cs +++ b/Main/System/Message/RichTextMgr.cs @@ -122,6 +122,7 @@ public Sprite sprite; public string spriteName; + public string folderName; //娌℃湁鍦╥con琛ㄤ腑閰嶇疆鐨勶紝鐩存帴閰嶇疆鍥剧墖鍚�,闇�閰嶇疆鏂囦欢澶硅矾寰� public bool IsFace; public float scale; //缂╂斁鍥剧墖鐨勫悓鏃讹紝浜屾缂╂斁浜嗗浘鐗囧湪鏂囨湰閽熺殑鍗犱綅澶у皬,鏌ョ湅鍑芥暟InverseToRichText diff --git a/Main/System/Message/SysNotifyMgr.cs b/Main/System/Message/SysNotifyMgr.cs index 8726da1..1e7710e 100644 --- a/Main/System/Message/SysNotifyMgr.cs +++ b/Main/System/Message/SysNotifyMgr.cs @@ -66,7 +66,7 @@ // BattleHint.Instance.OnStageLoadFinish(); } - private void BeforePlayerDataInitializeEvent() + public void BeforePlayerDataInitializeEvent() { ScrollTip.m_Hints.Clear(); ServerTipDetails.ClearHint(); @@ -149,6 +149,7 @@ } } + //淇℃伅鎻愮ず琛ㄧ殑鎻愮ず public void ShowTip(string key, params object[] msg) { SysInfoConfig cfg = SysInfoConfig.Get(key); @@ -159,11 +160,24 @@ AnalysisSysmsg(cfg); } else - { + { Debug.LogError("鏈壘鍒扮郴缁熸彁绀轰俊鎭�: " + key); } } + //璇█琛ㄧ殑鎻愮ず + public void ShowLangTip(string key, params object[] msg) + { + string hint = Language.Get(key, msg); + ScrollTip.ShowTip(hint); + } + + //鐩存帴浼犳枃瀛楃殑鎻愮ず + public void ShowStringTip(string hint) + { + ScrollTip.ShowTip(hint); + } + void AnalysisSysmsg(SysInfoConfig cfg) { SysNotifySound(cfg.sound); diff --git a/Main/System/OfficialRank/OfficialLVUPSuccessWin.cs b/Main/System/OfficialRank/OfficialLVUPSuccessWin.cs new file mode 100644 index 0000000..9a4e02b --- /dev/null +++ b/Main/System/OfficialRank/OfficialLVUPSuccessWin.cs @@ -0,0 +1,62 @@ +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEngine.UI; + + +/// <summary> +/// 瀹樿亴鍗囩骇鐣岄潰 +/// </summary> +public class OfficialLVUPSuccessWin : UIBase +{ + + [SerializeField] Text beforeNameText; + [SerializeField] Text nameText; + [SerializeField] Text lvText; + [SerializeField] Text nextLVText; + [SerializeField] Text[] attrNameText; + [SerializeField] Text[] attrPerTextArr; + [SerializeField] Text[] nextAttrPerTextArr; + [SerializeField] Button okBtn; + + + + protected override void InitComponent() + { + okBtn.AddListener(CloseWindow); + } + + + protected override void OnPreOpen() + { + + Refresh(); + } + + protected override void OnPreClose() + { + } + + + public override void Refresh() + { + var beforeConfig = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel - 1); + var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel); + beforeNameText.text = beforeConfig.Name; + beforeNameText.color = OfficialRankManager.Instance.GetOfficialRankColor(beforeConfig.Quality); + nameText.text = config.Name; + nameText.color = OfficialRankManager.Instance.GetOfficialRankColor(config.Quality); + lvText.text = beforeConfig.LVMax.ToString(); + nextLVText.text = config.LVMax.ToString(); + + for (int i = 0; i < attrNameText.Length; i++) + { + attrNameText[i].text = PlayerPropertyConfig.Get(config.AddAttrType[i]).Name; + attrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(config.AddAttrType[i], beforeConfig.AddAttrType[i]); + nextAttrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(config.AddAttrType[i], config.AddAttrType[i]); + } + + + } + +} \ No newline at end of file diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/System/OfficialRank/OfficialLVUPSuccessWin.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/System/OfficialRank/OfficialLVUPSuccessWin.cs.meta index 383dea1..342159f 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/System/OfficialRank/OfficialLVUPSuccessWin.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: e631511e7fa941d44911d5d592beb0ad MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/System/OfficialRank/OfficialRankManager.cs b/Main/System/OfficialRank/OfficialRankManager.cs index 2685526..21d4b12 100644 --- a/Main/System/OfficialRank/OfficialRankManager.cs +++ b/Main/System/OfficialRank/OfficialRankManager.cs @@ -2,17 +2,70 @@ using System; using System.Collections.Generic; +using System.Linq; +using UnityEngine; public class OfficialRankManager : GameSystemManager<OfficialRankManager> { - bool redpointDirty = false; #region 瀹樿亴浠诲姟 //褰撳墠瀹樿亴鐨勪换鍔$姸鎬� int taskAwardState; Dictionary<int, int> taskValues = new Dictionary<int, int>(); - public Dictionary<int, int[]> realMissionGuides = new Dictionary<int, int[]>(); public event Action RealmMissionRefreshEvent; + + public Dictionary<int, int> mainLevelDict = new Dictionary<int, int>(); //id锛氱储寮� 鐢ㄤ簬鍒ゆ柇杩橀渶澶氬皯鍏� + public override void Init() + { + PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh; + BlessLVManager.Instance.OnBlessLVUpdateEvent += UpdateRedpoint; + DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitialize; + DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += UpdateRedpoint; + + + var levelList = MainLevelConfig.GetKeys().ToList(); + levelList.Sort(); + for (int i = 0; i < levelList.Count; i++) + { + mainLevelDict[levelList[i]] = i; + } + } + + public override void Release() + { + PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh; + BlessLVManager.Instance.OnBlessLVUpdateEvent -= UpdateRedpoint; + DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerDataInitialize; + DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= UpdateRedpoint; + } + + void BeforePlayerDataInitialize() + { + taskValues.Clear(); + taskAwardState = 0; + } + + + void PlayerDataRefresh(PlayerDataType type) + { + if (type == PlayerDataType.LV || + type == PlayerDataType.ExAttr1 + ) + { + //绛夌骇 閫氬叧 + UpdateRedpoint(); + } + else if (type == PlayerDataType.RealmLevel) + { + if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin) + return; + //鍗囩骇鎴愬姛琛ㄧ幇 + if (!UIManager.Instance.IsOpened<OfficialLVUPSuccessWin>()) + { + UIManager.Instance.OpenWindow<OfficialLVUPSuccessWin>(); + } + } + } // 杩斿洖鏈嶅姟绔殑璁板綍浠诲姟濂栧姳鐘舵�� 0鏈鍙� 1宸查鍙� public int GetMissionAwardState(int id) @@ -20,16 +73,14 @@ return (taskAwardState & (int)Math.Pow(2, id)) != 0 ? 1 : 0; } - //浠诲姟绫诲瀷 浠诲姟璇存槑 鎵�闇�鍊� // 1 绛夌骇杈惧埌x绾� x绾� - // 2 閫氬叧x鍦板浘x灞� 鍦板浘ID|灞� - // 3 娑堣�楁垬閿� x涓� - + // 2 閫氳繃涓荤嚎鍏冲崱 鍏冲崱ID + // 3 娑堣�楁垬閿� x涓� (浠呴�氱煡杩欎釜) + // 4 绁濈鏍� 绛夌骇 //瀹㈡埛绔樉绀虹殑浠诲姟鐘舵�� 0 浠h〃杩涜涓� 1 浠h〃鍙鍙� 2 浠h〃宸查鍙� public int GetMissionState(int realm, int missionID) { - var id = RealmLVUPTaskConfig.GetID(realm, missionID); - var config = RealmLVUPTaskConfig.Get(id); + var config = RealmLVUPTaskConfig.GetID(realm, missionID); var type = config.TaskType; if (GetMissionAwardState(missionID) == 1) @@ -42,62 +93,49 @@ case 1: return PlayerDatas.Instance.baseData.LV >= config.NeedValueList[0] ? 1 : 0; case 2: - if (config.NeedValueList[0] == 0) - { - return 0; - } - return 0; + //绛栧垝閰嶇疆鍏冲崱ID涓�201锛屽嵆 杩囧叧2-1(0/1) ,浣跨敤 ExAttr1 鍊煎垽鏂紝濡侲xAttr1鍊间负20103浠h〃褰撳墠宸茬粡杩囦簡绗�2绔犵1鍏崇3娉紝鍖呭惈浜嗘尝锛岄渶瑕佸嚮璐ヨ鍏冲崱boss鍚庢墠绠楄鍏宠繃鍏� + return PlayerDatas.Instance.baseData.ExAttr1 / 100 > config.NeedValueList[0] ? 1 : 0; case 3: return taskValues.ContainsKey(missionID) && taskValues[missionID] >= config.NeedValueList[0] ? 1 : 0; - + + case 4: + return BlessLVManager.Instance.m_TreeLV >= config.NeedValueList[0] ? 1 : 0; + default: return 0; } } - public int GetMissionProcess(int id) + public void GetMissionProcess(int id, out int process, out int total) { - if (taskValues.ContainsKey(id)) + var config = RealmLVUPTaskConfig.GetID(PlayerDatas.Instance.baseData.realmLevel, id); + var type = config.TaskType; + process = 1; + total = 1; + switch (type) { - return taskValues[id]; - } - return 0; - } - - //type: 1绛夌骇 2閫氬叧 3娑堣�楁垬閿� - - public void RealMissionGuide(int type, int id = 0) - { - if (realMissionGuides.ContainsKey(type)) - { - - int guideIndex = 0; - if (type == 1) - { - - } - else if (type == 2) - { - if (!FuncOpen.Instance.IsFuncOpen(164, true)) - { - return; - } - } - else if (type == 3) - { - if (FuncOpen.Instance.IsFuncOpen(108)) - { - guideIndex = 1; - } - } - - - //NewBieCenter.Instance.StartNewBieGuideEx(guideID); + case 1: + process = PlayerDatas.Instance.baseData.LV; + total = config.NeedValueList[0]; + break; + case 2: + process = PlayerDatas.Instance.baseData.ExAttr1 / 100 > config.NeedValueList[0] ? 1 : 0; + total = 1; + break; + case 3: + process = taskValues.ContainsKey(id) ? taskValues[id] : 0; + total = config.NeedValueList[0]; + break; + case 4: + process = BlessLVManager.Instance.m_TreeLV; + total = config.NeedValueList[0]; + break; } } + public void RequestAllAwards() { @@ -126,6 +164,82 @@ } RealmMissionRefreshEvent?.Invoke(); - redpointDirty = true; + UpdateRedpoint(); } + + Redpoint redpoint = new Redpoint(MainRedDot.RedPoint_OfficialKey); + void UpdateRedpoint() + { + redpoint.state = RedPointState.None; + + var ids = RealmLVUPTaskConfig.GetMissionIDs(PlayerDatas.Instance.baseData.realmLevel); + bool finish = true; + foreach (var id in ids) + { + if (GetMissionAwardState(id) != 1) + { + if (GetMissionState(PlayerDatas.Instance.baseData.realmLevel, id) == 1) + { + redpoint.state = RedPointState.Simple; + } + + finish = false; + } + } + + if (finish) + redpoint.state = RedPointState.Simple; + } + + + + + public Color GetOfficialRankColor(int quality) + { + + switch (quality) + { + case 1: + // bbbbbb + return new Color32(187, 187, 187, 255); + case 2: + // ffffff + return new Color32(255, 255, 255, 255); + case 3: + // bbd5ff + return new Color32(187, 213, 255, 255); + case 4: + // e4bbfe + return new Color32(228, 187, 254, 255); + case 5: + // f7eba4 + return new Color32(247, 235, 164, 255); + case 6: + // ffc096 + return new Color32(255, 192, 150, 255); + case 7: + // fe9896 + return new Color32(254, 152, 150, 255); + case 8: + // ffaffe + return new Color32(255, 174, 254, 255); + case 9: + // ffefcl + return new Color32(255, 239, 203, 255); + case 10: + // e9fffa + return new Color32(233, 255, 250, 255); + case 11: + // f5ddff + return new Color32(245, 221, 255, 255); + case 12: + // b3fcfe + return new Color32(179, 252, 254, 255); + case 13: + // ffd0f7 + return new Color32(255, 208, 247, 255); + } + return Color.white; + } + } diff --git a/Main/System/OfficialRank/OfficialUpCell.cs b/Main/System/OfficialRank/OfficialUpCell.cs new file mode 100644 index 0000000..9a2987b --- /dev/null +++ b/Main/System/OfficialRank/OfficialUpCell.cs @@ -0,0 +1,66 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +/// <summary> +/// 瀹樿亴浠诲姟 +/// </summary> +public class OfficialUpCell : MonoBehaviour +{ + + [SerializeField] Text stateName; + [SerializeField] Image stateImg; + [SerializeField] Image bgImg; + [SerializeField] Image finishImg; + [SerializeField] Image getAwardImg; + [SerializeField] Text taskName; + [SerializeField] Image taskProcess; + [SerializeField] Text taskProcessText; + [SerializeField] ItemCell taskReward; + [SerializeField] Button getBtn; + + + public void Display(int id) + { + var config = RealmLVUPTaskConfig.GetID(PlayerDatas.Instance.baseData.realmLevel, id); + var state = OfficialRankManager.Instance.GetMissionState(PlayerDatas.Instance.baseData.realmLevel, id); + stateName.text = Language.Get("L1129_" + state); + stateImg.SetSprite("OfficialMisionState" + state); + finishImg.SetActive(state == 2); + getAwardImg.SetActive(state == 1); + bgImg.SetSprite(state == 0 ? "OfficialMissionBG0" : "OfficialMissionBG1"); + switch (config.TaskType) + { + case 1: + case 3: + case 4: + taskName.text = Language.Get("OfficialMission" + config.TaskType, config.NeedValueList[0]); + break; + case 2: + var mainLVConfig = MainLevelConfig.Get(config.NeedValueList[0]); + taskName.text = Language.Get("OfficialMission2", mainLVConfig.ChapterID, mainLVConfig.LevelNum); + break; + } + int process; + int total; + OfficialRankManager.Instance.GetMissionProcess(id, out process, out total); + taskProcess.fillAmount = (float)process / total; + taskProcessText.text = process + "/" + total; + int itemID = config.AwardItemList[0][0]; + taskReward.Init(new ItemCellModel(itemID, false, config.AwardItemList[0][1])); + taskReward.button.AddListener(() => + { + ItemTipUtility.Show(itemID); + }); + + getBtn.AddListener(() => + { + if (state != 1) + return; + OfficialRankManager.Instance.RequestAllAwards(); + }); + + } + +} \ No newline at end of file diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/System/OfficialRank/OfficialUpCell.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/System/OfficialRank/OfficialUpCell.cs.meta index 383dea1..28c7cc6 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/System/OfficialRank/OfficialUpCell.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: e58cf79fdccd0d54093f13a7cbf9868d MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/System/OfficialRank/OfficialUpWin.cs b/Main/System/OfficialRank/OfficialUpWin.cs new file mode 100644 index 0000000..3582835 --- /dev/null +++ b/Main/System/OfficialRank/OfficialUpWin.cs @@ -0,0 +1,135 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using DG.Tweening; +using System; + +/// <summary> +/// 瀹樿亴 +/// </summary> +public class OfficialUpWin : UIBase +{ + [SerializeField] Text officialNameText; + [SerializeField] Text officialNextNameText; + [SerializeField] Image officialIcon; + [SerializeField] Image officialNextIcon; + [SerializeField] Button closeBtn; + [SerializeField] PositionTween[] paopaoArr; + [SerializeField] Text[] paopaoTextArrName; + [SerializeField] Text[] paopaoTextArrValue; + [SerializeField] OfficialUpCell[] missionCellArr; + [SerializeField] ButtonEx lvUpBtn; + [SerializeField] UIEffectPlayer effectPlayer; + [SerializeField] UIEffectPlayer upEffect; + + protected override void InitComponent() + { + closeBtn.AddListener(CloseWindow); + lvUpBtn.AddListener(OnLvUp); + } + + // 1 绛夌骇杈惧埌x绾� x绾� + // 2 閫氳繃涓荤嚎鍏冲崱 鍏冲崱ID + // 3 娑堣�楁垬閿� x涓� + // 4 绁濈鏍� 绛夌骇 + protected override void OnPreOpen() + { + OfficialRankManager.Instance.RealmMissionRefreshEvent += Refresh; + PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh; + BlessLVManager.Instance.OnBlessLVUpdateEvent += RefreshBtn; + Refresh(); + } + + protected override void OnPreClose() + { + OfficialRankManager.Instance.RealmMissionRefreshEvent -= Refresh; + PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh; + BlessLVManager.Instance.OnBlessLVUpdateEvent -= RefreshBtn; + } + + public override void Refresh() + { + var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel); + officialNameText.text = config.Name; + officialNameText.color = OfficialRankManager.Instance.GetOfficialRankColor(config.Quality); + officialIcon.SetSprite("OfficialRank" + PlayerDatas.Instance.baseData.realmLevel); + var nextConfig = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel + 1); + officialNextNameText.text = nextConfig.Name; + officialNextNameText.color = OfficialRankManager.Instance.GetOfficialRankColor(nextConfig.Quality); + officialNextIcon.SetSprite("OfficialRank" + (PlayerDatas.Instance.baseData.realmLevel + 1)); + for (int i = 0; i < paopaoArr.Length; i++) + { + paopaoArr[i].Play(); + paopaoTextArrName[i].text = PlayerPropertyConfig.Get(nextConfig.AddAttrType[i]).Name; + paopaoTextArrValue[i].text = "+" + PlayerPropertyConfig.GetValueDescription(nextConfig.AddAttrType[i], nextConfig.AddAttrNum[i]); + } + + RefreshBtn(); + } + + + void OnLvUp() + { + var ids = RealmLVUPTaskConfig.GetMissionIDs(PlayerDatas.Instance.baseData.realmLevel); + foreach (var id in ids) + { + if (OfficialRankManager.Instance.GetMissionAwardState(id) != 1) + { + SysNotifyMgr.Instance.ShowTip("OfficialTask1"); + return; + } + } + + //鎵�鏈夋场娉¢鍚戞寜閽� + for (int i = 0; i < paopaoArr.Length; i++) + { + paopaoArr[i].Stop(); + paopaoArr[i].transform.DOLocalMove(lvUpBtn.transform.localPosition, 0.4f); + } + effectPlayer.Play(); + + upEffect.onComplete = () => + { + CA523_tagCMRealmLVUp pak = new CA523_tagCMRealmLVUp(); + GameNetSystem.Instance.SendInfo(pak); + }; + upEffect.Play(); + } + + + void RefreshBtn() + { + var ids = RealmLVUPTaskConfig.GetMissionIDs(PlayerDatas.Instance.baseData.realmLevel); + for (int i = 0; i < missionCellArr.Length; i++) + { + missionCellArr[i].Display(ids[i]); + } + + for (int i = 0; i < missionCellArr.Length; i++) + { + if (OfficialRankManager.Instance.GetMissionAwardState(i + 1) != 1) + { + lvUpBtn.SetColorful(null, false); + return; + } + } + lvUpBtn.SetColorful(null, true); + } + + + void PlayerDataRefresh(PlayerDataType type) + { + if (type == PlayerDataType.RealmLevel) + { + Refresh(); + } + else if (type == PlayerDataType.LV || + type == PlayerDataType.ExAttr1 + ) + { + //绛夌骇 閫氬叧 + RefreshBtn(); + } + } +} \ No newline at end of file diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/System/OfficialRank/OfficialUpWin.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/System/OfficialRank/OfficialUpWin.cs.meta index 383dea1..920ade3 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/System/OfficialRank/OfficialUpWin.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: 3c74d5be428f2324e910c232fb4e414b MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/System/Recharge/GotoChargeWin.cs b/Main/System/Recharge/GotoChargeWin.cs index c6189f7..1ae1f4b 100644 --- a/Main/System/Recharge/GotoChargeWin.cs +++ b/Main/System/Recharge/GotoChargeWin.cs @@ -1,8 +1,3 @@ -//-------------------------------------------------------- -// [Author]: 绗簩涓栫晫 -// [ Date ]: Wednesday, May 09, 2018 -//-------------------------------------------------------- - using System; using UnityEngine; using UnityEngine.UI; diff --git a/Main/System/Recharge/RechargeManager.cs b/Main/System/Recharge/RechargeManager.cs index 603b5d9..74707d9 100644 --- a/Main/System/Recharge/RechargeManager.cs +++ b/Main/System/Recharge/RechargeManager.cs @@ -613,15 +613,6 @@ } - public struct RechargeCount - { - public int todayCount; - public int totalCount; - public int weekPayCount; - public int monthPayCount; - public int selectItemValue; - - } public int FirstGoldServerDay = 0; //0琛ㄧず鏈厖鍊硷紝棣栧厖鏃朵负寮�鏈嶇鍑犲ぉ锛坥penday+1锛� @@ -768,3 +759,12 @@ } +public struct RechargeCount +{ + public int todayCount; + public int totalCount; + public int weekPayCount; + public int monthPayCount; + public int selectItemValue; + +} diff --git a/Main/System/Redpoint/MainRedDot.cs b/Main/System/Redpoint/MainRedDot.cs index 8e66132..baa25c4 100644 --- a/Main/System/Redpoint/MainRedDot.cs +++ b/Main/System/Redpoint/MainRedDot.cs @@ -48,7 +48,8 @@ public Redpoint redPointBagFunc = new Redpoint(RedPoint_MainPackKey, RedPoint_BagFuncKey); #endregion - + //瀹樿亴 + public const int RedPoint_OfficialKey = 101; #region 浠欑洘鍏敤绾㈢偣 @@ -78,7 +79,8 @@ #region 浠欑洘娲诲姩绾㈢偣 public readonly Redpoint fairyActivityRedpoint = new Redpoint(218); #endregion - + + public static int BlessLVRedpoint = 399; //绁濈绛夌骇绾㈢偣 public static int DailySpecialsRedpoint = 439; //姣忔棩鐗规儬鍏ュ彛绾㈢偣 public static int BlessedLandRedpoint = 444; //绂忓湴绾㈢偣 diff --git a/Main/System/Setting.meta b/Main/System/Setting.meta new file mode 100644 index 0000000..f6ad9bf --- /dev/null +++ b/Main/System/Setting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 629835bc583036c41a4e9cb04fc4fdb7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Main/System/Setting/QuickSetting.cs b/Main/System/Setting/QuickSetting.cs new file mode 100644 index 0000000..2a8972a --- /dev/null +++ b/Main/System/Setting/QuickSetting.cs @@ -0,0 +1,166 @@ +锘縰sing System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System.Text; +using System; +using System.Text.RegularExpressions; +/// <summary> +/// 鏈嶅姟绔疭etting閰嶇疆锛屽瓨鍌ㄤ竴浜涘揩鎹疯缃紝鐩墠闀垮害涓�100 +/// </summary> + +public class QuickSetting : Singleton<QuickSetting> +{ + public QuickSetting() + { + //鑷姩鎴樻枟 鍑犲�嶆秷鑰� 鍑犲�嶉�熷害 鏄惁楂樻垬鍔涘仠姝� 鏄惁寮�鍚嚜鍔ㄦ垬鏂� + quickSettingDic.Add(QuickSettingType.AutoFight_Cost, new QuickSettingRange(QuickSettingType.AutoFight_Cost, 0, 1)); + quickSettingDic.Add(QuickSettingType.AutoFight_Speed, new QuickSettingRange(QuickSettingType.AutoFight_Speed, 1, 1)); + quickSettingDic.Add(QuickSettingType.AutoFight_FightPower, new QuickSettingRange(QuickSettingType.AutoFight_FightPower, 2, 1)); + quickSettingDic.Add(QuickSettingType.AutoFight_Open, new QuickSettingRange(QuickSettingType.AutoFight_Open, 3, 1)); + setting = new string(UCharacter, 100); + DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent; + } + + public Dictionary<QuickSettingType, QuickSettingRange> quickSettingDic = new Dictionary<QuickSettingType, QuickSettingRange>(); + public const char UCharacter = '*'; + private string setting; + private string cacheSetting; + private StringBuilder textBuilder = new StringBuilder(); + + public event Action onQuickSettingUpdate; + + public void SetQuickSetting<T>(QuickSettingType type, T value, int index = 0) where T : struct + { + SetQuickSetting(type, value.ToString(), index); + } + public void SetQuickSetting(QuickSettingType type, bool value, int index = 0) + { + SetQuickSetting<int>(type, value ? 1 : 0, index); + } + + public void SetQuickSetting(int type, string value, int index) + { + SetQuickSetting((QuickSettingType)type, value, index); + } + + public void SetQuickSetting(QuickSettingType type, string value, int index) + { + var quickRange = quickSettingDic[type]; + + + if ((index - quickRange.index) * quickRange.single + value.Length > quickRange.length || value.Length > quickRange.single) + { + Debug.LogErrorFormat("瀛樺偍鐨勬暟鎹秴杩囨渶澶ч暱搴�!{0}", type); + return; + } + textBuilder.Length = 0; + var start = quickRange.index + index * quickRange.single; + var end = start + value.Length; + if (quickRange.length == quickRange.single) + { + end = start + quickRange.length; + } + textBuilder.Append(setting, 0, start); + textBuilder.Append(value); + if (quickRange.length == quickRange.single + && quickRange.length > value.Length) + { + textBuilder.Append('*', quickRange.length - value.Length); + } + textBuilder.Append(setting, end, setting.Length - end); + setting = textBuilder.ToString(); + PlayerDatas.Instance.baseData.Setting = setting; + } + public void SetQuickSetting(string value) + { + value = UIHelper.ServerStringTrim(value); + if (value != null && value.Length > 0) + { + setting = StringUtility.Contact(value, setting.Substring(value.Length, setting.Length - value.Length)); + cacheSetting = setting; + PlayerDatas.Instance.baseData.Setting = setting; + } + + if (onQuickSettingUpdate != null) + { + onQuickSettingUpdate(); + } + } + + public T GetQuickSettingValue<T>(QuickSettingType type, int index) where T : struct + { + string destinationStr = GetQuickSetting(type, index); + if (string.IsNullOrEmpty(destinationStr)) + { + return default(T); + } + return (T)Convert.ChangeType(destinationStr, typeof(T)); + } + public string GetQuickSetting(QuickSettingType type, int index) + { + var quickRange = quickSettingDic[type]; + var start = quickRange.index + index * quickRange.single; + var destinationStr = setting.Substring(start, quickRange.single); + destinationStr = Regex.Replace(destinationStr, @"\*", string.Empty); + return destinationStr; + } + public bool GetQuickSettingBool(QuickSettingType type, int index, bool _default = false) + { + string destinationStr = GetQuickSetting(type, index); + if (string.IsNullOrEmpty(destinationStr)) + { + return _default; + } + int _value = _default ? 1 : 0; + int.TryParse(destinationStr, out _value); + return _value == 1; + } + + public string GetQuickSetting(int type, int index) + { + return GetQuickSetting((QuickSettingType)type, index); + } + + public void SendPackage() + { + if (cacheSetting != setting) + { + cacheSetting = setting; + C0303_tagCSetShutCutData vNetData = new C0303_tagCSetShutCutData(); + vNetData.Setting = setting; + GameNetSystem.Instance.SendInfo(vNetData); + } + } + + private void BeforePlayerDataInitializeEvent() + { + setting = null; + setting = new string(UCharacter, 100); + PlayerDatas.Instance.baseData.Setting = setting; + } + +} + +public enum QuickSettingType +{ + AutoFight_Cost, //鑷姩鎴樻枟 鍑犲�嶆秷鑰� + AutoFight_Speed, //鍑犲�嶉�熷害 + AutoFight_FightPower, //鏄惁楂樻垬鍔涘仠姝� + AutoFight_Open, //鏄惁寮�鍚嚜鍔ㄦ垬鏂� +} + +public class QuickSettingRange +{ + public QuickSettingType type; + public int index; + public int length; + public int single; + + public QuickSettingRange(QuickSettingType type, int start, int length, int single = 0) + { + this.type = type; + this.index = start; + this.length = length; + this.single = single == 0 ? length : single; + } +} \ No newline at end of file diff --git a/Main/Component/UI/Common/FuncEnable.cs.meta b/Main/System/Setting/QuickSetting.cs.meta similarity index 68% copy from Main/Component/UI/Common/FuncEnable.cs.meta copy to Main/System/Setting/QuickSetting.cs.meta index 383dea1..6bea296 100644 --- a/Main/Component/UI/Common/FuncEnable.cs.meta +++ b/Main/System/Setting/QuickSetting.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e034d1a3f772bb44bbbcd4273f5084e1 -timeCreated: 1516430103 -licenseType: Free +guid: 591bd551698e54c42bb51c4b2af7ae0e MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Main/System/SystemSetting/SystemSetting.cs b/Main/System/SystemSetting/SystemSetting.cs index 7a24e2d..9bf7362 100644 --- a/Main/System/SystemSetting/SystemSetting.cs +++ b/Main/System/SystemSetting/SystemSetting.cs @@ -218,7 +218,7 @@ public void LetFPSUnLimit() { - Application.targetFrameRate = 1000; + // Application.targetFrameRate = 1000; } private void OnSwitchAccount() diff --git a/Main/System/Task/TaskManager.cs b/Main/System/Task/TaskManager.cs index 54c522b..50a481f 100644 --- a/Main/System/Task/TaskManager.cs +++ b/Main/System/Task/TaskManager.cs @@ -69,9 +69,15 @@ // 浠诲姟鐘舵�� 1-杩涜涓� 2-鍙鍙� public int GetMainTaskState() - { + { return mainTask.State; } + //杩橀渶瀹屾垚澶氬皯涓换鍔� + public int GetNeedFinishTaskCount(int taskID) + { + var taskConfig = TaskConfig.Get(taskID); + return taskConfig.Index - TaskConfig.Get(mainTask.TaskID).Index + 1; + } } diff --git a/Main/System/Tip/ScrollTip.cs b/Main/System/Tip/ScrollTip.cs index 9ce0213..6e6b2f9 100644 --- a/Main/System/Tip/ScrollTip.cs +++ b/Main/System/Tip/ScrollTip.cs @@ -50,6 +50,7 @@ //杩囨护涓嶆挱鏀剧殑鎯呭喌 if (!CanOpen()) { + m_Hints.Clear(); return; } @@ -61,12 +62,9 @@ static bool CanOpen() { - // if (UIManager.Instance.IsOpened<HeroCallResultWin>()) - // { + + // if (HappyXBModel.Instance.isXBCoolTime) // return false; - // } - if (HappyXBModel.Instance.isXBCoolTime) - return false; return true; } diff --git a/Main/System/Tip/ToggleConfirmWin.cs b/Main/System/Tip/ToggleConfirmWin.cs index 41d1f6c..dc97505 100644 --- a/Main/System/Tip/ToggleConfirmWin.cs +++ b/Main/System/Tip/ToggleConfirmWin.cs @@ -59,6 +59,7 @@ } private void OnConfirm() { + CloseWindow(); if (ConfirmCancel.OnToggleConfirmEvent != null) { ConfirmCancel.OnToggleConfirmEvent(true, m_Toggle.isOn); @@ -67,11 +68,11 @@ { ConfirmCancel.OnToggleSingleConfirmEvent(m_Toggle.isOn); } - CloseWindow(); } private void OnCancel() { + CloseWindow(); if (ConfirmCancel.OnToggleConfirmEvent != null) { ConfirmCancel.OnToggleConfirmEvent(false, m_Toggle.isOn); @@ -80,16 +81,15 @@ { ConfirmCancel.OnToggleSingleConfirmEvent(m_Toggle.isOn); } - CloseWindow(); } private void OnCancelEx() { + CloseWindow(); if (ConfirmCancel.OnToggleConfirmEventEx != null) { ConfirmCancel.OnToggleConfirmEventEx(false, m_Toggle.isOn); } - CloseWindow(); } } diff --git a/Main/Utility/ComponentExtersion.cs b/Main/Utility/ComponentExtersion.cs index 223e472..68c49cd 100644 --- a/Main/Utility/ComponentExtersion.cs +++ b/Main/Utility/ComponentExtersion.cs @@ -306,6 +306,40 @@ _image.overrideSprite = sprite; } + public static void SetItemSprite(this Image _image, int itemID) + { + if (_image == null) + { + return; + } + + var itemConfig = ItemConfig.Get(itemID); + if (itemConfig == null) + { + return; + } + + var sprite = UILoader.LoadSprite("icon", itemConfig.IconKey); + _image.overrideSprite = sprite; + } + + public static void SetSkillSprite(this Image _image, int skillID) + { + if (_image == null) + { + return; + } + + var skillConfig = SkillConfig.Get(skillID); + if (skillConfig == null) + { + return; + } + + var sprite = UILoader.LoadSprite("SkillIcon", skillConfig.IconName); + _image.overrideSprite = sprite; + } + public static void SetActive(this Component compoent, bool active) { if (compoent != null) diff --git a/Main/Utility/EnumHelper.cs b/Main/Utility/EnumHelper.cs index ad7e489..6395744 100644 --- a/Main/Utility/EnumHelper.cs +++ b/Main/Utility/EnumHelper.cs @@ -453,7 +453,7 @@ GoldPaper = 19, //閲戠エ 19, Silver = 20, //閾跺瓙 20, SilverPaper = 21, //閾剁エ 21, - FightPoint = 22, //鎴樻枟鍊�(閿ゅ瓙) 22, + UseHarmerCount = 22, //閿ゅ瓙娑堣�楀�嶆暟 22, HappyPoint = 23, //濞变箰鍊� 23, MapID = 24, //瑙掕壊鎵�鍦ㄥ湴鍥� 24, PosX = 25, //瑙掕壊鍧愭爣 25, @@ -537,8 +537,8 @@ WarehouseLV = 99, //浠撳簱绛夌骇 99 EquipShowSwitch = 100, //瑁呭鏄鹃殣寮�鍏� 100 LuckValue = 101, //骞歌繍鍊� 101 - ExAttr1 = 102, //鎵╁睍灞炴��1 102榄斾粏浼ゅ24 - ExAttr2 = 103, //鎵╁睍灞炴��2 103缁勯槦鏄惁闇�瑕佸鏍� + ExAttr1 = 102, //鎵╁睍灞炴��1 102 涓荤嚎宸查�氬叧鍏冲崱 + ExAttr2 = 103, //鎵╁睍灞炴��2 103 涓荤嚎褰撳墠鍒锋�墍鍦ㄧ珷鑺傚叧鍗¤褰� ExAttr3 = 104, //鎵╁睍灞炴��3 104鍏冪礌鏀诲嚮26 ExAttr4 = 105, //鎵╁睍灞炴��4 105鍏冪礌闃插尽27 ExAttr5 = 106, //鎵╁睍灞炴��5 106 diff --git a/Main/Utility/TimeUtility.cs b/Main/Utility/TimeUtility.cs index 6f2678a..e49d754 100644 --- a/Main/Utility/TimeUtility.cs +++ b/Main/Utility/TimeUtility.cs @@ -345,6 +345,21 @@ } //渚嬪瓙 + //澶т簬24灏忔椂鏄剧ず锛歺澶﹛x灏忔椂xx鍒� + //灏忎簬24灏忔椂鏄剧ず锛歺x:xx:xx + public static string SecondsToDHMSEx(int _seconds) + { + int days = _seconds / 86400; + int hours = _seconds % 86400 / 3600; + int mins = _seconds % 3600 / 60; + int seconds = _seconds % 60; + if (days > 0) + { + return StringUtility.Contact(days, Language.Get("L1074"), hours.ToString("D2"), Language.Get("L1072"), mins.ToString("D2"), Language.Get("L1073")); + } + return StringUtility.Contact(hours.ToString("D2"), ":", mins.ToString("D2"), ":", seconds.ToString("D2")); + } + //渚嬪瓙 //x澶� //x鏃� //x鍒唜绉� diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs index f28674e..2f6bf80 100644 --- a/Main/Utility/UIHelper.cs +++ b/Main/Utility/UIHelper.cs @@ -69,20 +69,28 @@ public static void SetIconWithMoneyType(this Image _image, int moneyType) { if (_image == null) return; - string iconKey = StringUtility.Contact("Money_Type_", moneyType); - _image.SetSprite(iconKey); - } - - public static void SetSmallIconWithMoneyType(this Image _image, int moneyType) - { - if (_image == null) return; - string iconKey = StringUtility.Contact("SmallMoney", moneyType); - _image.SetSprite(iconKey); + // string iconKey = StringUtility.Contact("Money_Type_", moneyType); + if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType)) + { + _image.SetOrgSprite(ItemConfig.Get(GeneralDefine.MoneyDisplayModel[moneyType]).IconKey); + } + else + { + Debug.LogError("MoneyDisplayModel 涓洪厤缃揣甯佺被鍨嬶細" + moneyType); + } } public static string GetIconNameWithMoneyType(int moneyType) { - return StringUtility.Contact("Money_Type_", moneyType); + if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType)) + { + return ItemConfig.Get(GeneralDefine.MoneyDisplayModel[moneyType]).IconKey; + } + else + { + Debug.LogError("MoneyDisplayModel 涓洪厤缃揣甯佺被鍨嬶細" + moneyType); + return ""; + } } /// <summary> @@ -364,7 +372,7 @@ public static readonly Color s_NavyYellow = new Color32(242, 238, 2, 255); //f2ee02 public static readonly Color s_LightGreen = new Color32(42, 227, 55, 255);//2ae337 public static readonly Color s_LightWhite = new Color32(245, 246, 230, 255); //f5f6e6 - public static readonly Color s_Gray = new Color32(132, 121, 123, 255); //84797b + public static readonly Color s_Gray = new Color32(104, 104, 104,255); //bbbbbb public static readonly Color s_Gold = new Color32(255, 239, 71, 255);//ffef47 public static readonly Color s_EarthYellow = new Color32(248, 152, 59, 255);//f8983b @@ -707,7 +715,7 @@ case TextColType.LightGreen: return StringUtility.Contact("<color=#8ddc11>", msg, "</color>"); case TextColType.Gray: - return StringUtility.Contact("<color=#84797b>", msg, "</color>"); + return StringUtility.Contact("<color=#bbbbbb>", msg, "</color>"); case TextColType.lightYellow: return StringUtility.Contact("<color=#fcedb9>", msg, "</color>"); case TextColType.NavyYellow: @@ -761,7 +769,7 @@ { return string.Empty; } - return GetRealmColorByLv(realmLv, config.Name, bright); + return AppendColor(realmLv, config.Name, bright); } //strFormat闄勫姞 澧冪晫鍚嶄互澶栫殑鏂囧瓧 @@ -780,31 +788,31 @@ // return GetRealmColorByLv(realmLv, string.Format(strFormat, config.Name), bright); // } - public static string GetRealmColorByLv(int realmLv, string msg, bool bright = true) - { - var config = RealmConfig.Get(realmLv); - if (config == null) - { - return string.Empty; - } - switch (config.Quality) - { - case 1: - return StringUtility.Contact("<color=#", bright ? "666666" : "dddddd", ">", msg, "</color>"); - case 2: - return StringUtility.Contact("<color=#", bright ? "00b337" : "66ff00", ">", msg, "</color>"); - case 3: - return StringUtility.Contact("<color=#", bright ? "0066ff" : "00c6ff", ">", msg, "</color>"); - case 4: - return StringUtility.Contact("<color=#", bright ? "ff00f6" : "f000ff", ">", msg, "</color>"); - case 5: - return StringUtility.Contact("<color=#", bright ? "ff6600" : "ff9000", ">", msg, "</color>"); - case 6: - return StringUtility.Contact("<color=#", bright ? "ff0000" : "ff0000", ">", msg, "</color>"); - default: - return msg; - } - } + // public static string GetRealmColorByLv(int realmLv, string msg, bool bright = true) + // { + // var config = RealmConfig.Get(realmLv); + // if (config == null) + // { + // return string.Empty; + // } + // switch (config.Quality) + // { + // case 1: + // return StringUtility.Contact("<color=#", bright ? "666666" : "dddddd", ">", msg, "</color>"); + // case 2: + // return StringUtility.Contact("<color=#", bright ? "00b337" : "66ff00", ">", msg, "</color>"); + // case 3: + // return StringUtility.Contact("<color=#", bright ? "0066ff" : "00c6ff", ">", msg, "</color>"); + // case 4: + // return StringUtility.Contact("<color=#", bright ? "ff00f6" : "f000ff", ">", msg, "</color>"); + // case 5: + // return StringUtility.Contact("<color=#", bright ? "ff6600" : "ff9000", ">", msg, "</color>"); + // case 6: + // return StringUtility.Contact("<color=#", bright ? "ff0000" : "ff0000", ">", msg, "</color>"); + // default: + // return msg; + // } + // } //鐗╁搧 鍚勫姛鑳藉搧璐� 浠庣簿鑹�1鍝佽川 瀵瑰簲 3寮�濮� /// <summary> -- Gitblit v1.8.0