| Core/GameEngine/Model/Config/MarketConfig.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/GameEngine/Model/Config/MarketConfig.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/GameEngine/Model/Config/MarketQueryConfig.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/GameEngine/Model/Config/MarketQueryConfig.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/GameEngine/Model/ConfigManager.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/KnapSack/FBHelpPointExchageModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/KnapSack/FBHelpPointExchageModel.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Market/MarketDealWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Market/MarketPutawayWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Store/StoreModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Treasure/TreasureModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Utility/EnumHelper.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Core/GameEngine/Model/Config/MarketConfig.cs
@@ -1,6 +1,6 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Saturday, January 06, 2018 // [ Date ]: Tuesday, November 13, 2018 //-------------------------------------------------------- using UnityEngine; @@ -15,7 +15,6 @@ public string name { get ; private set; } public int limitLv { get ; private set ; } public int[] queryType; public int[] ChooseType; public string[] ChooseName; public int[] ChooseItem1; public int[] ChooseItem2; @@ -44,39 +43,32 @@ int.TryParse(queryTypeStringArray[i],out queryType[i]); } string[] ChooseTypeStringArray = rawContents[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); ChooseType = new int[ChooseTypeStringArray.Length]; for (int i=0;i<ChooseTypeStringArray.Length;i++) { int.TryParse(ChooseTypeStringArray[i],out ChooseType[i]); } ChooseName = rawContents[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); ChooseName = rawContents[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); string[] ChooseItem1StringArray = rawContents[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); string[] ChooseItem1StringArray = rawContents[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); ChooseItem1 = new int[ChooseItem1StringArray.Length]; for (int i=0;i<ChooseItem1StringArray.Length;i++) { int.TryParse(ChooseItem1StringArray[i],out ChooseItem1[i]); } string[] ChooseItem2StringArray = rawContents[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); string[] ChooseItem2StringArray = rawContents[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); ChooseItem2 = new int[ChooseItem2StringArray.Length]; for (int i=0;i<ChooseItem2StringArray.Length;i++) { int.TryParse(ChooseItem2StringArray[i],out ChooseItem2[i]); } string[] ChooseItem3StringArray = rawContents[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); string[] ChooseItem3StringArray = rawContents[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); ChooseItem3 = new int[ChooseItem3StringArray.Length]; for (int i=0;i<ChooseItem3StringArray.Length;i++) { int.TryParse(ChooseItem3StringArray[i],out ChooseItem3[i]); } itemTypeName = rawContents[9].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); itemTypeName = rawContents[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); itemTypeIcon = rawContents[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); itemTypeIcon = rawContents[9].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); } catch (Exception ex) { Core/GameEngine/Model/Config/MarketConfig.cs.meta
@@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 4c474987e54f6844b990bac5c188fc0b timeCreated: 1515213657 timeCreated: 1542089923 licenseType: Pro MonoImporter: serializedVersion: 2 Core/GameEngine/Model/Config/MarketQueryConfig.cs
New file @@ -0,0 +1,46 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Tuesday, November 13, 2018 //-------------------------------------------------------- using UnityEngine; using System; namespace TableConfig { public partial class MarketQueryConfig : ConfigBase { public int queryType { get ; private set ; } public int[] ChooseType; public override string getKey() { return queryType.ToString(); } public override void Parse() { try { queryType=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; string[] ChooseTypeStringArray = rawContents[1].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); ChooseType = new int[ChooseTypeStringArray.Length]; for (int i=0;i<ChooseTypeStringArray.Length;i++) { int.TryParse(ChooseTypeStringArray[i],out ChooseType[i]); } } catch (Exception ex) { DebugEx.Log(ex); } } } } Core/GameEngine/Model/Config/MarketQueryConfig.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 71726fd0d29eb4741960c18955afd917 timeCreated: 1542090094 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/GameEngine/Model/ConfigManager.cs
@@ -203,6 +203,7 @@ AddAsyncTask<TalentConfig>(); AddAsyncTask<ChatBubbleBoxConfig>(); AddAsyncTask<GuardConfig>(); AddAsyncTask<MarketQueryConfig>(); while (!AllCompleted()) { var completedCount = 0; System/KnapSack/FBHelpPointExchageModel.cs
New file @@ -0,0 +1,207 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; using TableConfig; namespace Snxxz.UI { [XLua.LuaCallCSharp] public class FBHelpPointExchageModel : Model,IBeforePlayerDataInitialize,IPlayerLoginOk { public List<int> todayShoplist { get; private set; } public List<int> lifeShoplist { get; private set; } public List<int> helpPointShoplist = new List<int>(); public string shopDayLocalSave { get; private set;} public string shopLifeLocalSave { get; private set;} public string curDayLocalSave { get; private set; } public int currentShopId { get; private set; } public event Action UpdateHelpPointShopEvent; StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } } public override void Init() { } public void OnBeforePlayerDataInitialize() { currentShopId = 0; helpPointShoplist.Clear(); PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= UpdateFBHelpPoint; storeModel.UpdateHelpPointExchangeEvent -= UpdateHelpPointShop; TimeMgr.Instance.OnDayEvent -= UpdateDay; } public void OnPlayerLoginOk() { int playerId = (int)PlayerDatas.Instance.baseData.PlayerID; shopDayLocalSave = StringUtility.Contact("ShopDayLocalSave",playerId); shopLifeLocalSave = StringUtility.Contact("ShopLifeLocalSave",playerId); curDayLocalSave = StringUtility.Contact("CurDayLocalSave",playerId); PlayerDatas.Instance.PlayerDataRefreshInfoEvent += UpdateFBHelpPoint; TimeMgr.Instance.OnDayEvent += UpdateDay; storeModel.UpdateHelpPointExchangeEvent += UpdateHelpPointShop; GetLocalSaveData(); } public override void UnInit() { } #region 本地记录数据的存储 private bool IsNewDay() { if(!PlayerPrefs.HasKey(curDayLocalSave)) { return true; } int saveDay = LocalSave.GetInt(curDayLocalSave); int serverDay = TimeUtility.ServerNow.Day; return serverDay != saveDay ? true : false; } private void SetCurDayLocalSave() { LocalSave.SetInt(curDayLocalSave,TimeUtility.ServerNow.Day); } /// <summary> /// 获取本地记录数据 /// </summary> private void GetLocalSaveData() { int[] dayShops = LocalSave.GetIntArray(shopDayLocalSave); todayShoplist = dayShops == null ? null : dayShops.ToList(); int[] lifeShops = LocalSave.GetIntArray(shopLifeLocalSave); lifeShoplist = lifeShops == null ? null : lifeShops.ToList(); if(IsNewDay()) { ClearShopDayLocalSave(); SetCurDayLocalSave(); } } public void SetLocalSaveData(int type,int shopId) { switch(type) { case 1: todayShoplist = todayShoplist == null ? new List<int>() : todayShoplist; if(!todayShoplist.Contains(shopId)) { todayShoplist.Add(shopId); LocalSave.SetIntArray(shopDayLocalSave,todayShoplist.ToArray()); } break; case 2: lifeShoplist = lifeShoplist == null ? new List<int>() : lifeShoplist; if (!lifeShoplist.Contains(shopId)) { lifeShoplist.Add(shopId); LocalSave.SetIntArray(shopLifeLocalSave, lifeShoplist.ToArray()); } break; } } public void ClearShopDayLocalSave() { PlayerPrefs.DeleteKey(shopDayLocalSave); if(todayShoplist != null) { todayShoplist.Clear(); } } #endregion private void UpdateDay() { ClearShopDayLocalSave(); } private void UpdateFBHelpPoint(PlayerDataRefresh type) { if (type != PlayerDataRefresh.FBHelpPoint) return; for(int i = 0; i < helpPointShoplist.Count; i++) { var shopId = helpPointShoplist[i]; if (!CheckShopIsCanBuy(shopId)) { RemoveHelpPointShop(shopId); } } } public void AddHelpPointShop(int shopId) { if(!helpPointShoplist.Contains(shopId)) { helpPointShoplist.Add(shopId); } } public void RemoveHelpPointShop(int shopId) { if (helpPointShoplist.Contains(shopId)) { helpPointShoplist.Remove(shopId); } } private void UpdateHelpPointShop(int shopId) { StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(shopId); if (storeConfig == null) return; currentShopId = shopId; AddHelpPointShop(shopId); if(UpdateHelpPointShopEvent != null) { UpdateHelpPointShopEvent(); } } public bool IsAlreadPush(int shopId) { StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(shopId); if (storeConfig == null) return false; ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(storeConfig.ItemID); switch((ItemType)itemConfig.Type) { case ItemType.OfflineCard: break; case ItemType.MountDan: break; default: break; } return true; } public bool CheckShopIsCanBuy(int shopId) { StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(shopId); if (storeConfig == null) return false; int canBuyCnt = 0; int addBuyCnt = 0; bool isLimitBuy = BuyItemPopModel.Instance.CheckIsLimitBuyCnt(storeConfig, out canBuyCnt, out addBuyCnt); BuyShopItemLimit shopItemLimit = storeModel.GetBuyShopLimit((uint)storeConfig.ID); int remainNum = canBuyCnt; if (shopItemLimit != null) { remainNum -= shopItemLimit.BuyCnt; } List<StoreConfig> list = StoreConfig.GetSellShoplist(); if (remainNum > 0 && list.Contains(storeConfig)) { return true; } return false; } } } System/KnapSack/FBHelpPointExchageModel.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 86c457f98558ec44aa458b9a5bad445d timeCreated: 1542090743 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/Market/MarketDealWin.cs
@@ -49,6 +49,11 @@ return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<MarketModel>()); } } RolePromoteModel promoteModel { get { return ModelCenter.Instance.GetModel<RolePromoteModel>(); } } #region Built-in protected override void BindController() { @@ -186,17 +191,24 @@ { if (fitterDic[type] >= 0) { ItemConfig cfg = Config.Instance.Get<ItemConfig>((int)list[i].ItemTypeID); if (cfg != null) var config = Config.Instance.Get<ItemConfig>((int)list[i].ItemTypeID); if (config != null) { if (cfg.LV != fitterDic[type]) throughFitter = false; if (!promoteModel.wingLv2GenerDict.ContainsKey(config.LV) || promoteModel.wingLv2GenerDict[config.LV] != fitterDic[type]) { throughFitter = false; } } } } break; } } if (!throughFitter) continue; if (!throughFitter) { continue; } model.marketDealItems.Add(list[i]); } model.marketDealItems.Sort(Compare); @@ -322,12 +334,22 @@ OpenPwdFitterWin(); return; } MarketConfig cfg = model.marketCfgDict[model.presentType]; int type = cfg.ChooseType[id]; MarketQueryConfig queryConfig = Config.Instance.Get<MarketQueryConfig>(model.presentItemType); int type = queryConfig.ChooseType[id]; var config = model.marketCfgDict[model.presentType]; int[] intarray = null; if (id == 0) intarray = cfg.ChooseItem1; else if (id == 1) intarray = cfg.ChooseItem2; else if (id == 2) intarray = cfg.ChooseItem3; if (id == 0) { intarray = config.ChooseItem1; } else if (id == 1) { intarray = config.ChooseItem2; } else if (id == 2) { intarray = config.ChooseItem3; } fitterTypeDic.Clear(); presentFitterType = (MarketDealFitterType)type; presentFitterIndex = id; @@ -348,7 +370,7 @@ break; case MarketDealFitterType.Quality: { if (model.presentItemType == cfg.queryType[0]) if (model.presentItemType == config.queryType[0]) { fitterTypeDic.Add(-1, Language.Get("Market_Text_53")); if (model.fitters != null) @@ -512,23 +534,24 @@ } else { MarketConfig cfg = model.marketCfgDict[model.presentType]; MarketConfig config = model.marketCfgDict[model.presentType]; MarketQueryConfig queryConfig = Config.Instance.Get<MarketQueryConfig>(model.presentItemType); fitterDic.Clear(); for (int i = 0; i < m_FitterImgs.Count; i++) { if (i < cfg.ChooseType.Length) if (i < queryConfig.ChooseType.Length) { if (cfg.ChooseType[i] != 0) if (queryConfig.ChooseType[i] != 0) { fitterDic.Add((MarketDealFitterType)cfg.ChooseType[i], -1); fitterDic.Add((MarketDealFitterType)queryConfig.ChooseType[i], -1); m_FitterImgs[i].transform.parent.gameObject.SetActive(true); switch ((MarketDealFitterType)cfg.ChooseType[i]) switch ((MarketDealFitterType)queryConfig.ChooseType[i]) { case MarketDealFitterType.Password: m_FitterTxts[i].text = cfg.ChooseName[i]; m_FitterTxts[i].text = config.ChooseName[i]; break; case MarketDealFitterType.Quality: if (model.presentItemType == cfg.queryType[0]) if (model.presentItemType == config.queryType[0]) { m_FitterTxts[i].text = Language.Get("Market_Text_53"); } System/Market/MarketPutawayWin.cs
@@ -52,6 +52,7 @@ { putawayItemCtrl.OnRefreshCell += OnRefreshPutawayItemCell; bagItemCtrl.OnRefreshCell += OnRefreshBagItemCell; bagItemCtrl.lockType = EnhanceLockType.KeepVertical; } protected override void AddListeners() System/Store/StoreModel.cs
@@ -877,7 +877,7 @@ } } } public event Action<int> UpdateHelpPointExchangeEvent; public void UpdateCanBuyRedpoint() { if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)) return; @@ -892,6 +892,13 @@ if (UIHelper.GetMoneyCnt(storeConfig.MoneyType) >= (ulong)storeConfig.MoneyNumber) { shopRedDict[storeConfig.ID].state = RedPointState.Simple; if(storeConfig.ShopType == (int)StoreFunc.IntegralStore) { if(UpdateHelpPointExchangeEvent != null) { UpdateHelpPointExchangeEvent(key); } } } else { System/Treasure/TreasureModel.cs
@@ -363,6 +363,16 @@ { return false; } Treasure treasure; if (TryGetTreasure(_treasureId, out treasure)) { var potential = treasure.GetPotentialByIndex(1); if (potential != null && IsPotentialUnlock(_treasureId, potential.id)) { SetSpAnim(_treasureId); return true; } } uint value = 0; uint.TryParse(QuickSetting.Instance.GetQuickSetting(QuickSetting.QuickSettingType.SpAnim, 0), out value); return MathUtility.GetBitValue(value, (ushort)index); Utility/EnumHelper.cs
@@ -666,6 +666,8 @@ public enum ItemType { Buff = 9, //Buff类型 OfflineCard = 10, //离线挂机卡 MountDan = 21,//坐骑丹 MakerEquipSuitMat = 34, //装备套装材料 ComposeSuitStone = 35, //套装石碎片 WingsMat = 39, //合成翅膀材料,羽翼精炼材料