Core/GameEngine/Model/Config/AlchemyConfig.cs
@@ -1,234 +1,232 @@ //-------------------------------------------------------- // [Author]: Fish // [ Date ]: Thursday, February 14, 2019 //-------------------------------------------------------- using System.Collections.Generic; using System.IO; using System.Threading; using System; using UnityEngine; [XLua.LuaCallCSharp] public partial class AlchemyConfig { public readonly int AlchemyID; //-------------------------------------------------------- // [Author]: Fish // [ Date ]: Wednesday, April 17, 2019 //-------------------------------------------------------- using System.Collections.Generic; using System.IO; using System.Threading; using System; using UnityEngine; [XLua.LuaCallCSharp] public partial class AlchemyConfig { public readonly int ID; public readonly string AlchemName; public readonly int AlchemItemID; public readonly int AlchemType; public readonly int AlchemyQuality; public readonly string MaterialAll; public readonly int AlchemyEXP; public readonly string AlchemyItem; public readonly int[] SpecialItem; public readonly string AlchemyIUp; public readonly string AlchemPreviewItem; public readonly int BlastFurnaceLV; public readonly string ICONID; public AlchemyConfig() { } public AlchemyConfig(string input) { try { var tables = input.Split('\t'); int.TryParse(tables[0],out AlchemyID); public readonly int LearnNeedItemID; public readonly int LearnNeedAlchemLV; public readonly int LearnNeedLuck; public readonly int NeedTime; public readonly int AlchemyExp; public readonly string Material; public readonly string ICONID; public AlchemyConfig() { } public AlchemyConfig(string input) { try { var tables = input.Split('\t'); int.TryParse(tables[0],out ID); AlchemName = tables[1]; int.TryParse(tables[2],out AlchemyQuality); int.TryParse(tables[2],out AlchemItemID); MaterialAll = tables[3]; int.TryParse(tables[3],out AlchemType); int.TryParse(tables[4],out AlchemyEXP); int.TryParse(tables[4],out AlchemyQuality); AlchemyItem = tables[5]; int.TryParse(tables[5],out LearnNeedItemID); string[] SpecialItemStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); SpecialItem = new int[SpecialItemStringArray.Length]; for (int i=0;i<SpecialItemStringArray.Length;i++) { int.TryParse(SpecialItemStringArray[i],out SpecialItem[i]); } int.TryParse(tables[6],out LearnNeedAlchemLV); AlchemyIUp = tables[7]; int.TryParse(tables[7],out LearnNeedLuck); AlchemPreviewItem = tables[8]; int.TryParse(tables[8],out NeedTime); int.TryParse(tables[9],out BlastFurnaceLV); int.TryParse(tables[9],out AlchemyExp); ICONID = tables[10]; } catch (Exception ex) { DebugEx.Log(ex); } } Material = tables[10]; static Dictionary<string, AlchemyConfig> configs = new Dictionary<string, AlchemyConfig>(); public static AlchemyConfig Get(string id) { if (!inited) { Debug.Log("AlchemyConfig 还未完成初始化。"); return null; } if (configs.ContainsKey(id)) { return configs[id]; } AlchemyConfig config = null; if (rawDatas.ContainsKey(id)) { config = configs[id] = new AlchemyConfig(rawDatas[id]); rawDatas.Remove(id); } return config; } public static AlchemyConfig Get(int id) { return Get(id.ToString()); } public static List<string> GetKeys() { var keys = new List<string>(); keys.AddRange(configs.Keys); keys.AddRange(rawDatas.Keys); return keys; } public static List<AlchemyConfig> GetValues() { var values = new List<AlchemyConfig>(); values.AddRange(configs.Values); var keys = new List<string>(rawDatas.Keys); foreach (var key in keys) { values.Add(Get(key)); } return values; } public static bool Has(string id) { return configs.ContainsKey(id) || rawDatas.ContainsKey(id); } public static bool Has(int id) { return Has(id.ToString()); } public static bool inited { get; private set; } protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>(); public static void Init(bool sync=false) { inited = false; var path = string.Empty; if (AssetSource.refdataFromEditor) { path = ResourcesPath.CONFIG_FODLER +"/Alchemy.txt"; } else { path = AssetVersionUtility.GetAssetFilePath("config/Alchemy.txt"); } var tempConfig = new AlchemyConfig(); var preParse = tempConfig is IConfigPostProcess; if (sync) { var lines = File.ReadAllLines(path); if (!preParse) { rawDatas = new Dictionary<string, string>(lines.Length - 3); } for (int i = 3; i < lines.Length; i++) { try { var line = lines[i]; var index = line.IndexOf("\t"); if (index == -1) { continue; } var id = line.Substring(0, index); if (preParse) { var config = new AlchemyConfig(line); configs[id] = config; (config as IConfigPostProcess).OnConfigParseCompleted(); } else { rawDatas[id] = line; } } catch (System.Exception ex) { Debug.LogError(ex); } } inited = true; } else { ThreadPool.QueueUserWorkItem((object _object) => { var lines = File.ReadAllLines(path); if (!preParse) { rawDatas = new Dictionary<string, string>(lines.Length - 3); } for (int i = 3; i < lines.Length; i++) { try { var line = lines[i]; var index = line.IndexOf("\t"); if (index == -1) { continue; } var id = line.Substring(0, index); if (preParse) { var config = new AlchemyConfig(line); configs[id] = config; (config as IConfigPostProcess).OnConfigParseCompleted(); } else { rawDatas[id] = line; } } catch (System.Exception ex) { Debug.LogError(ex); } } inited = true; }); } } } ICONID = tables[11]; } catch (Exception ex) { DebugEx.Log(ex); } } static Dictionary<string, AlchemyConfig> configs = new Dictionary<string, AlchemyConfig>(); public static AlchemyConfig Get(string id) { if (!inited) { Debug.Log("AlchemyConfig 还未完成初始化。"); return null; } if (configs.ContainsKey(id)) { return configs[id]; } AlchemyConfig config = null; if (rawDatas.ContainsKey(id)) { config = configs[id] = new AlchemyConfig(rawDatas[id]); rawDatas.Remove(id); } return config; } public static AlchemyConfig Get(int id) { return Get(id.ToString()); } public static List<string> GetKeys() { var keys = new List<string>(); keys.AddRange(configs.Keys); keys.AddRange(rawDatas.Keys); return keys; } public static List<AlchemyConfig> GetValues() { var values = new List<AlchemyConfig>(); values.AddRange(configs.Values); var keys = new List<string>(rawDatas.Keys); foreach (var key in keys) { values.Add(Get(key)); } return values; } public static bool Has(string id) { return configs.ContainsKey(id) || rawDatas.ContainsKey(id); } public static bool Has(int id) { return Has(id.ToString()); } public static bool inited { get; private set; } protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>(); public static void Init(bool sync=false) { inited = false; var path = string.Empty; if (AssetSource.refdataFromEditor) { path = ResourcesPath.CONFIG_FODLER +"/Alchemy.txt"; } else { path = AssetVersionUtility.GetAssetFilePath("config/Alchemy.txt"); } var tempConfig = new AlchemyConfig(); var preParse = tempConfig is IConfigPostProcess; if (sync) { var lines = File.ReadAllLines(path); if (!preParse) { rawDatas = new Dictionary<string, string>(lines.Length - 3); } for (int i = 3; i < lines.Length; i++) { try { var line = lines[i]; var index = line.IndexOf("\t"); if (index == -1) { continue; } var id = line.Substring(0, index); if (preParse) { var config = new AlchemyConfig(line); configs[id] = config; (config as IConfigPostProcess).OnConfigParseCompleted(); } else { rawDatas[id] = line; } } catch (System.Exception ex) { Debug.LogError(ex); } } inited = true; } else { ThreadPool.QueueUserWorkItem((object _object) => { var lines = File.ReadAllLines(path); if (!preParse) { rawDatas = new Dictionary<string, string>(lines.Length - 3); } for (int i = 3; i < lines.Length; i++) { try { var line = lines[i]; var index = line.IndexOf("\t"); if (index == -1) { continue; } var id = line.Substring(0, index); if (preParse) { var config = new AlchemyConfig(line); configs[id] = config; (config as IConfigPostProcess).OnConfigParseCompleted(); } else { rawDatas[id] = line; } } catch (System.Exception ex) { Debug.LogError(ex); } } inited = true; }); } } } Core/GameEngine/Model/Config/AlchemyConfig.cs.meta
@@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 93a73d5a5e9d51c4abc2515a6180cac4 timeCreated: 1550121897 timeCreated: 1555481595 licenseType: Pro MonoImporter: serializedVersion: 2 Core/GameEngine/Model/Config/AlchemyCountConfig.cs
New file @@ -0,0 +1,205 @@ //-------------------------------------------------------- // [Author]: Fish // [ Date ]: Wednesday, April 17, 2019 //-------------------------------------------------------- using System.Collections.Generic; using System.IO; using System.Threading; using System; using UnityEngine; [XLua.LuaCallCSharp] public partial class AlchemyCountConfig { public readonly int AlchemyQuality; public readonly int LuckValue; public readonly string CntRateList; public AlchemyCountConfig() { } public AlchemyCountConfig(string input) { try { var tables = input.Split('\t'); int.TryParse(tables[0],out AlchemyQuality); int.TryParse(tables[1],out LuckValue); CntRateList = tables[2]; } catch (Exception ex) { DebugEx.Log(ex); } } static Dictionary<string, AlchemyCountConfig> configs = new Dictionary<string, AlchemyCountConfig>(); public static AlchemyCountConfig Get(string id) { if (!inited) { Debug.Log("AlchemyCountConfig 还未完成初始化。"); return null; } if (configs.ContainsKey(id)) { return configs[id]; } AlchemyCountConfig config = null; if (rawDatas.ContainsKey(id)) { config = configs[id] = new AlchemyCountConfig(rawDatas[id]); rawDatas.Remove(id); } return config; } public static AlchemyCountConfig Get(int id) { return Get(id.ToString()); } public static List<string> GetKeys() { var keys = new List<string>(); keys.AddRange(configs.Keys); keys.AddRange(rawDatas.Keys); return keys; } public static List<AlchemyCountConfig> GetValues() { var values = new List<AlchemyCountConfig>(); values.AddRange(configs.Values); var keys = new List<string>(rawDatas.Keys); foreach (var key in keys) { values.Add(Get(key)); } return values; } public static bool Has(string id) { return configs.ContainsKey(id) || rawDatas.ContainsKey(id); } public static bool Has(int id) { return Has(id.ToString()); } public static bool inited { get; private set; } protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>(); public static void Init(bool sync=false) { inited = false; var path = string.Empty; if (AssetSource.refdataFromEditor) { path = ResourcesPath.CONFIG_FODLER +"/AlchemyCount.txt"; } else { path = AssetVersionUtility.GetAssetFilePath("config/AlchemyCount.txt"); } var tempConfig = new AlchemyCountConfig(); var preParse = tempConfig is IConfigPostProcess; if (sync) { var lines = File.ReadAllLines(path); if (!preParse) { rawDatas = new Dictionary<string, string>(lines.Length - 3); } for (int i = 3; i < lines.Length; i++) { try { var line = lines[i]; var index = line.IndexOf("\t"); if (index == -1) { continue; } var id = line.Substring(0, index); if (preParse) { var config = new AlchemyCountConfig(line); configs[id] = config; (config as IConfigPostProcess).OnConfigParseCompleted(); } else { rawDatas[id] = line; } } catch (System.Exception ex) { Debug.LogError(ex); } } inited = true; } else { ThreadPool.QueueUserWorkItem((object _object) => { var lines = File.ReadAllLines(path); if (!preParse) { rawDatas = new Dictionary<string, string>(lines.Length - 3); } for (int i = 3; i < lines.Length; i++) { try { var line = lines[i]; var index = line.IndexOf("\t"); if (index == -1) { continue; } var id = line.Substring(0, index); if (preParse) { var config = new AlchemyCountConfig(line); configs[id] = config; (config as IConfigPostProcess).OnConfigParseCompleted(); } else { rawDatas[id] = line; } } catch (System.Exception ex) { Debug.LogError(ex); } } inited = true; }); } } } Core/GameEngine/Model/Config/AlchemyCountConfig.cs.metacopy from Lua/Gen/AlchemyConfigWrap.cs.meta copy to Core/GameEngine/Model/Config/AlchemyCountConfig.cs.meta
File was copied from Lua/Gen/AlchemyConfigWrap.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 6505f3167ec49824a860a7a3491fb187 timeCreated: 1550122890 guid: 5f36f1c0496212c43ab7871e4d3d42dd timeCreated: 1555489466 licenseType: Pro MonoImporter: serializedVersion: 2 Core/GameEngine/Model/TelPartialConfig/tagAlchemyConfig.cs
@@ -3,29 +3,42 @@ public partial class AlchemyConfig : IConfigPostProcess { private static Dictionary<int, List<AlchemyConfig>> s_alchemyModelDict = new Dictionary<int, List<AlchemyConfig>>();//用于记录商城数据 private int type = 0; static Dictionary<int, Dictionary<int, List<int>>> m_Alchemies = new Dictionary<int, Dictionary<int, List<int>>>(); public void OnConfigParseCompleted() { type = (int)Math.Floor((double)AlchemyID / 100); if (!s_alchemyModelDict.ContainsKey(type)) Dictionary<int, List<int>> dict = null; if (!m_Alchemies.TryGetValue(AlchemType, out dict)) { List<AlchemyConfig> modellist = new List<AlchemyConfig>(); modellist.Add(this); s_alchemyModelDict.Add(type, modellist); dict = new Dictionary<int, List<int>>(); m_Alchemies.Add(AlchemType, dict); } else List<int> ids = null; if (!dict.TryGetValue(AlchemyQuality, out ids)) { s_alchemyModelDict[type].Add(this); ids = new List<int>(); dict.Add(AlchemyQuality, ids); } ids.Add(ID); } public static List<AlchemyConfig> GetTypeAlchemyModel(int type) public static List<int> GetAlchemies(int type, int quality) { List<AlchemyConfig> modellist = null; s_alchemyModelDict.TryGetValue(type, out modellist); return modellist; if (m_Alchemies.ContainsKey(type) && m_Alchemies[type].ContainsKey(quality)) { return m_Alchemies[type][quality]; } return null; } public static ICollection<int> GetAlchemyQualities(int type) { if (m_Alchemies.ContainsKey(type)) { return m_Alchemies[type].Keys; } return null; } } Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA576_tagCMPlayerRefine.cs
@@ -4,8 +4,8 @@ // A5 76 玩家炼丹 #tagCMPlayerRefine public class CA576_tagCMPlayerRefine : GameNetPackBasic { public ushort RefineNum; // 配方编号 public uint UseRateItem; // 附加材料ID public uint AlchemyID; // 丹药ID public byte DoType; // 0-学习 1-开始炼丹 2-停止炼丹 3-开炉取丹 public CA576_tagCMPlayerRefine () { combineCmd = (ushort)0x03FE; @@ -13,8 +13,8 @@ } public override void WriteToBytes () { WriteBytes (RefineNum, NetDataType.WORD); WriteBytes (UseRateItem, NetDataType.DWORD); WriteBytes (AlchemyID, NetDataType.DWORD); WriteBytes (DoType, NetDataType.BYTE); } } Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3BF_tagMCPlayerStoveMsg.cs
@@ -1,30 +1,23 @@ using UnityEngine; using System.Collections; using Snxxz.UI; // A3 BF 通知客户端炼丹炉信息 #tagMCPlayerStoveMsg public class DTCA3BF_tagMCPlayerStoveMsg : DtcBasic { BlastFurnaceModel _furnaceModel; BlastFurnaceModel FurnaceModel { get { return _furnaceModel ?? (_furnaceModel = ModelCenter.Instance.GetModel<BlastFurnaceModel>()); } } public override void Done(GameNetPackBasic vNetPack) { base.Done(vNetPack); HA3BF_tagMCPlayerStoveMsg vNetData = vNetPack as HA3BF_tagMCPlayerStoveMsg; FurnaceModel.RefreshBlastFurnaceModel(vNetData); } } using UnityEngine; using System.Collections; using Snxxz.UI; // A3 BF 通知客户端炼丹炉信息 #tagMCPlayerStoveMsg public class DTCA3BF_tagMCPlayerStoveMsg : DtcBasic { public override void Done(GameNetPackBasic vNetPack) { base.Done(vNetPack); var package = vNetPack as HA3BF_tagMCPlayerStoveMsg; ModelCenter.Instance.GetModel<AlchemyModel>().ReceivePackage(package); } } Core/NetworkPackage/DTCFile/ServerPack/HAD_SaleActivity.meta
File was deleted Core/NetworkPackage/DTCFile/ServerPack/HAE_Truck.meta
File was deleted Core/NetworkPackage/DTCFile/ServerPack/HB0_Event.meta
File was deleted Core/NetworkPackage/ServerPack/HA3_Function/HA3BF_tagMCPlayerStoveMsg.cs
@@ -1,39 +1,37 @@ using UnityEngine; using System.Collections; // A3 BF 通知客户端炼丹炉信息 #tagMCPlayerStoveMsg public class HA3BF_tagMCPlayerStoveMsg : GameNetPackBasic { public byte StoveLV; // 炼丹炉等级 public uint StoveExp; // 炼丹炉经验 public uint ItemID; // 合成物品id public HA3BF_tagMCPlayerStoveMsg () { _cmd = (ushort)0xA3BF; } public override void ReadFromBytes (byte[] vBytes) { TransBytes (out StoveLV, vBytes, NetDataType.BYTE); TransBytes (out StoveExp, vBytes, NetDataType.DWORD); TransBytes (out ItemID, vBytes, NetDataType.DWORD); } } using UnityEngine; using System.Collections; // A3 BF 通知客户端炼丹炉信息 #tagMCPlayerStoveMsg public class HA3BF_tagMCPlayerStoveMsg : GameNetPackBasic { public byte StoveLV; // 炼丹炉等级 public uint StoveExp; // 炼丹炉经验 public uint ItemID; // 合成物品id public byte ItemCnt; // 丹药数量 public ushort StoveCnt; // 丹药数量 public tagMCPlayerStoveInfo[] InfoList; public HA3BF_tagMCPlayerStoveMsg () { _cmd = (ushort)0xA3BF; } public override void ReadFromBytes (byte[] vBytes) { TransBytes (out StoveLV, vBytes, NetDataType.BYTE); TransBytes (out StoveExp, vBytes, NetDataType.DWORD); TransBytes (out ItemID, vBytes, NetDataType.DWORD); TransBytes (out ItemCnt, vBytes, NetDataType.BYTE); TransBytes (out StoveCnt, vBytes, NetDataType.WORD); InfoList = new tagMCPlayerStoveInfo[StoveCnt]; for (int i = 0; i < StoveCnt; i ++) { InfoList[i] = new tagMCPlayerStoveInfo(); TransBytes (out InfoList[i].AlchemyID, vBytes, NetDataType.DWORD); TransBytes (out InfoList[i].StartTime, vBytes, NetDataType.DWORD); } } public struct tagMCPlayerStoveInfo { public uint AlchemyID; // 丹 ID public uint StartTime; // 开始炼的时间 } } Core/NetworkPackage/ServerPack/HAD_SaleActivity.meta
File was deleted Core/NetworkPackage/ServerPack/HAE_Truck.meta
File was deleted Core/NetworkPackage/ServerPack/HAF_Merge.meta
File was deleted Core/NetworkPackage/ServerPack/HB0_Event.meta
File was deleted Lua/Gen/AlchemyConfigWrap.cs
File was deleted Lua/Gen/XLuaGenAutoRegister.cs
@@ -49,9 +49,6 @@ translator.DelayWrapLoader(typeof(ActorShowConfig), ActorShowConfigWrap.__Register); translator.DelayWrapLoader(typeof(AlchemyConfig), AlchemyConfigWrap.__Register); translator.DelayWrapLoader(typeof(AlchemySpecConfig), AlchemySpecConfigWrap.__Register); System/Alchemy.meta
File was renamed from Core/NetworkPackage/DTCFile/ServerPack/HAF_Merge.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 71e878ac60c49ad4f964dd2dbc725739 guid: 60b865c8d6df5cf41902dae9d6ea38b6 folderAsset: yes timeCreated: 1547643019 timeCreated: 1555052736 licenseType: Pro DefaultImporter: userData: System/Alchemy/AlchemyBasicDrugWin.cs
New file @@ -0,0 +1,57 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Wednesday, April 17, 2019 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class AlchemyBasicDrugWin : Window { [SerializeField] AlchemyBasicPanel m_AlchemyPanel; #region Built-in protected override void BindController() { } protected override void AddListeners() { } protected override void OnPreOpen() { Display(); m_AlchemyPanel.Display((int)AlchemyType.Normal); } protected override void OnAfterOpen() { } protected override void OnPreClose() { m_AlchemyPanel.Dispose(); } protected override void OnAfterClose() { } #endregion void Display() { } } } System/Alchemy/AlchemyBasicDrugWin.cs.meta
File was renamed from Lua/Gen/AlchemyConfigWrap.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 6505f3167ec49824a860a7a3491fb187 timeCreated: 1550122890 guid: 6d3deff49eaa78944ad224bbc59064d7 timeCreated: 1555482529 licenseType: Pro MonoImporter: serializedVersion: 2 System/Alchemy/AlchemyBasicPanel.cs
New file @@ -0,0 +1,78 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Snxxz.UI { public class AlchemyBasicPanel : MonoBehaviour { [SerializeField] ScrollerController m_Controller; int alchemyType = 0; AlchemyModel model { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } } private void Awake() { m_Controller.OnRefreshCell += OnRefreshCell; } public void Display(int type) { alchemyType = type; DisplayRecipes(); model.selectQualityRefresh += SelectQualityRefresh; model.selectAlchemyRefresh += SelectAlchemyRefresh; } void DisplayRecipes() { var qualities = AlchemyConfig.GetAlchemyQualities(alchemyType); foreach (var quality in qualities) { m_Controller.AddCell(ScrollerDataType.Header, quality); if (model.selectQuality == quality) { var recipes = AlchemyConfig.GetAlchemies(alchemyType, quality); foreach (var id in recipes) { m_Controller.AddCell(ScrollerDataType.Normal, id); } } } } private void OnRefreshCell(ScrollerDataType type, CellView cell) { if (type == ScrollerDataType.Header) { var qualityCell = cell as AlchemyQualityCell; qualityCell.Display(cell.index); } else if (type == ScrollerDataType.Normal) { var recipeCell = cell as AlchemyRecipeCell; recipeCell.Display(cell.index); } } private void SelectQualityRefresh() { DisplayRecipes(); } private void SelectAlchemyRefresh() { m_Controller.m_Scorller.RefreshActiveCellViews(); } public void Dispose() { model.selectQualityRefresh -= SelectQualityRefresh; model.selectAlchemyRefresh -= SelectAlchemyRefresh; } } } System/Alchemy/AlchemyBasicPanel.cs.metacopy from Lua/Gen/AlchemyConfigWrap.cs.meta copy to System/Alchemy/AlchemyBasicPanel.cs.meta
File was copied from Lua/Gen/AlchemyConfigWrap.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 6505f3167ec49824a860a7a3491fb187 timeCreated: 1550122890 guid: df2a59fcddbd1e44688ea53023de4bf7 timeCreated: 1555483025 licenseType: Pro MonoImporter: serializedVersion: 2 System/Alchemy/AlchemyBriefBehaviour.cs
New file @@ -0,0 +1,29 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class AlchemyBriefBehaviour : MonoBehaviour { [SerializeField] Text m_AlchemyTime; [SerializeField] Text m_AlchemyCount; [SerializeField] Text m_AlchemySuccRate; int alchemyId = 0; AlchemyModel model { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } } public void Display(int alchemyId) { this.alchemyId = alchemyId; } public void Dispose() { } } } System/Alchemy/AlchemyBriefBehaviour.cs.metacopy from Lua/Gen/AlchemyConfigWrap.cs.meta copy to System/Alchemy/AlchemyBriefBehaviour.cs.meta
File was copied from Lua/Gen/AlchemyConfigWrap.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 6505f3167ec49824a860a7a3491fb187 timeCreated: 1550122890 guid: e3b7248086741cd45bf5fc4ddd1fb48e timeCreated: 1555488329 licenseType: Pro MonoImporter: serializedVersion: 2 System/Alchemy/AlchemyModel.cs
New file @@ -0,0 +1,142 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Snxxz.UI { public class AlchemyModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk { Dictionary<int, uint> m_AlchemyTimes = new Dictionary<int, uint>(); Dictionary<int, AlchemyCount> m_AlchemyCounts = new Dictionary<int, AlchemyCount>(); int m_SelectQuality = 0; public int selectQuality { get { return m_SelectQuality; } set { if (m_SelectQuality != value) { m_SelectQuality = value; if (selectQualityRefresh != null) { selectQualityRefresh(); } } } } int m_SelectAlchemy = 0; public int selectAlchemy { get { return m_SelectAlchemy; } set { if (m_SelectAlchemy != value) { m_SelectAlchemy = value; if (selectAlchemyRefresh != null) { selectAlchemyRefresh(); } } } } public int stoveLevel { get; private set; } public int stoveExp { get; private set; } public event Action selectQualityRefresh; public event Action selectAlchemyRefresh; public event Action alchemyStateRefresh; public override void Init() { ParseConfig(); } public void OnBeforePlayerDataInitialize() { m_AlchemyTimes.Clear(); stoveLevel = 0; stoveExp = 0; } public void OnPlayerLoginOk() { } void ParseConfig() { { var configs = AlchemyCountConfig.GetValues(); foreach (var config in configs) { var intArray = LitJson.JsonMapper.ToObject<int[][]>(config.CntRateList); var min = intArray[0][1]; var max = intArray[intArray.Length - 1][1]; if (m_AlchemyCounts.ContainsKey(config.AlchemyQuality)) { } } } } public bool TryGetAlchemyStartTime(int alchemyId, out uint tick) { return m_AlchemyTimes.TryGetValue(alchemyId, out tick); } public bool IsGraspRecipe(int alchemyId) { return m_AlchemyTimes.ContainsKey(alchemyId); } public void ReceivePackage(HA3BF_tagMCPlayerStoveMsg package) { for (int i = 0; i < package.StoveCnt; i++) { var data = package.InfoList[i]; m_AlchemyTimes[(int)data.AlchemyID] = data.StartTime; } stoveLevel = package.StoveLV; stoveExp = (int)package.StoveExp; if (package.ItemID != 0) { if (package.ItemCnt > 0)//炼丹成功 { } else//炼丹失败 { } } if (alchemyStateRefresh != null) { alchemyStateRefresh(); } } public override void UnInit() { } } public enum AlchemyType { Normal, Fairy, } public struct AlchemyCount { public int min; public int max; } } System/Alchemy/AlchemyModel.cs.metacopy from Lua/Gen/AlchemyConfigWrap.cs.meta copy to System/Alchemy/AlchemyModel.cs.meta
File was copied from Lua/Gen/AlchemyConfigWrap.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 6505f3167ec49824a860a7a3491fb187 timeCreated: 1550122890 guid: 7b06704a3df2bf14fbf7225247f46297 timeCreated: 1555052742 licenseType: Pro MonoImporter: serializedVersion: 2 System/Alchemy/AlchemyQualityCell.cs
New file @@ -0,0 +1,38 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class AlchemyQualityCell : CellView { [SerializeField] Text m_QualityName; [SerializeField] Image m_Arrow; [SerializeField] Transform m_ContainerSelect; [SerializeField] Button m_Func; int quality = 0; AlchemyModel model { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } } private void Awake() { m_Func.SetListener(OnSelect); } public void Display(int quality) { this.quality = quality; m_QualityName.text = string.Format("{0}品丹方", Language.Get("Num_CHS_" + quality)); m_ContainerSelect.gameObject.SetActive(model.selectQuality == quality); } private void OnSelect() { model.selectQuality = quality; } } } System/Alchemy/AlchemyQualityCell.cs.metacopy from Lua/Gen/AlchemyConfigWrap.cs.meta copy to System/Alchemy/AlchemyQualityCell.cs.meta
File was copied from Lua/Gen/AlchemyConfigWrap.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 6505f3167ec49824a860a7a3491fb187 timeCreated: 1550122890 guid: cdac99ced8fa6b243a6255caaf4b196c timeCreated: 1555483987 licenseType: Pro MonoImporter: serializedVersion: 2 System/Alchemy/AlchemyRecipeCell.cs
New file @@ -0,0 +1,44 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class AlchemyRecipeCell : CellView { [SerializeField] Text m_AlchemyName; [SerializeField] Text m_UnGrasp; [SerializeField] Transform m_ContainerSelect; [SerializeField] Button m_Func; int id = 0; AlchemyModel model { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } } private void Awake() { m_Func.SetListener(OnSelect); } public void Display(int id) { this.id = id; var config = AlchemyConfig.Get(id); m_AlchemyName.text = config.AlchemName; m_UnGrasp.gameObject.SetActive(!model.IsGraspRecipe(id)); m_ContainerSelect.gameObject.SetActive(model.selectAlchemy == id); } private void OnSelect() { model.selectAlchemy = id; } } } System/Alchemy/AlchemyRecipeCell.cs.metacopy from Lua/Gen/AlchemyConfigWrap.cs.meta copy to System/Alchemy/AlchemyRecipeCell.cs.meta
File was copied from Lua/Gen/AlchemyConfigWrap.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 6505f3167ec49824a860a7a3491fb187 timeCreated: 1550122890 guid: 839a1604f72201b40b9ef629f1ecf608 timeCreated: 1555484746 licenseType: Pro MonoImporter: serializedVersion: 2 System/Alchemy/AlchemyStudyBehaviour.cs
New file @@ -0,0 +1,136 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class AlchemyStudyBehaviour : MonoBehaviour { [SerializeField] ItemBehaviour m_Item; [SerializeField] Text m_StoveCondition; [SerializeField] Text m_PropertyCondition; [SerializeField] Button m_Func; [SerializeField] Text m_FuncLabel; int alchemyId = 0; AlchemyModel model { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } } PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } private void Awake() { m_Func.SetListener(Learn); } public void Display(int alchemyId) { this.alchemyId = alchemyId; DisplayItem(); DisplayStoveCondition(); DisplayPropertyCondition(); DisplayFuncState(); } void DisplayItem() { var config = AlchemyConfig.Get(alchemyId); m_Item.SetItem(config.LearnNeedItemID, 1); } void DisplayStoveCondition() { var config = AlchemyConfig.Get(alchemyId); m_StoveCondition.gameObject.SetActive(config.LearnNeedAlchemLV > 0); if (config.LearnNeedAlchemLV > 0) { var satisfy = model.stoveLevel >= config.LearnNeedAlchemLV; m_StoveCondition.text = string.Format("炼丹炉达到{0}级", config.LearnNeedAlchemLV); m_StoveCondition.color = UIHelper.GetUIColor(satisfy ? TextColType.Green : TextColType.Red, true); } } void DisplayPropertyCondition() { var config = AlchemyConfig.Get(alchemyId); m_PropertyCondition.gameObject.SetActive(config.LearnNeedLuck > 0); if (config.LearnNeedLuck > 0) { var satisfy = PlayerDatas.Instance.extersion.luckValue >= config.LearnNeedLuck; var propertyConfig = PlayerPropertyConfig.Get((int)PropertyType.Luck); m_PropertyCondition.text = string.Format("{0}达到{1}级", propertyConfig.Name, config.LearnNeedLuck); m_PropertyCondition.color = UIHelper.GetUIColor(satisfy ? TextColType.Green : TextColType.Red, true); } } void DisplayFuncState() { var error = 0; var satisfyLearn = TryLearn(out error); m_Func.SetColorful(m_FuncLabel, satisfyLearn); } private void Learn() { var error = 0; if (TryLearn(out error)) { var pak = new CA576_tagCMPlayerRefine(); pak.AlchemyID = (uint)alchemyId; pak.DoType = 0; GameNetSystem.Instance.SendInfo(pak); } else { DisplayErrorTip(error); } } bool TryLearn(out int error) { error = 0; var config = AlchemyConfig.Get(alchemyId); var count = packModel.GetItemCountByID(PackType.Item, config.LearnNeedItemID); if (count <= 0) { error = 1; return false; } if (model.stoveLevel < config.LearnNeedAlchemLV) { error = 2; return false; } if (PlayerDatas.Instance.extersion.luckValue < config.LearnNeedLuck) { error = 3; return false; } return true; } void DisplayErrorTip(int error) { switch (error) { case 1: SysNotifyMgr.Instance.ShowTip("AlchemyLearnError_1"); break; case 2: SysNotifyMgr.Instance.ShowTip("AlchemyLearnError_2"); break; case 3: SysNotifyMgr.Instance.ShowTip("AlchemyLearnError_3"); break; } } public void Dispose() { } } } System/Alchemy/AlchemyStudyBehaviour.cs.metacopy from Lua/Gen/AlchemyConfigWrap.cs.meta copy to System/Alchemy/AlchemyStudyBehaviour.cs.meta
File was copied from Lua/Gen/AlchemyConfigWrap.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 6505f3167ec49824a860a7a3491fb187 timeCreated: 1550122890 guid: 99a3f66156f9e174aa2a7af35d1d6d14 timeCreated: 1555486605 licenseType: Pro MonoImporter: serializedVersion: 2 System/BlastFurnace/BlastFurnaceModel.cs
@@ -116,19 +116,19 @@ { alchemyDataDict = new Dictionary<int, AlchemyData>(); alchemyModellist = AlchemyConfig.GetValues(); for (int i = 0; i < alchemyModellist.Count; i++) { var alchemyConfig = alchemyModellist[i]; AlchemyData alchemyData = new AlchemyData(); alchemyData.id = alchemyConfig.AlchemyID; alchemyData.alchemyConfig = alchemyConfig; alchemyData.normalMatDic = ConfigParse.GetDic<int, int>(alchemyConfig.MaterialAll); alchemyData.previewDict = GetPreviewDict(alchemyConfig.AlchemPreviewItem); if (!alchemyDataDict.ContainsKey(alchemyConfig.AlchemyID)) { alchemyDataDict.Add(alchemyConfig.AlchemyID, alchemyData); } } //for (int i = 0; i < alchemyModellist.Count; i++) //{ // var alchemyConfig = alchemyModellist[i]; // AlchemyData alchemyData = new AlchemyData(); // alchemyData.id = alchemyConfig.AlchemyID; // alchemyData.alchemyConfig = alchemyConfig; // alchemyData.normalMatDic = ConfigParse.GetDic<int, int>(alchemyConfig.MaterialAll); // alchemyData.previewDict = GetPreviewDict(alchemyConfig.AlchemPreviewItem); // if (!alchemyDataDict.ContainsKey(alchemyConfig.AlchemyID)) // { // alchemyDataDict.Add(alchemyConfig.AlchemyID, alchemyData); // } //} } public Dictionary<int, AlchemySpecData> alchemySpecDataDict { get; private set; } private void ParseAlchemySpecConfig() @@ -456,11 +456,11 @@ /// </summary> public Dictionary<int, int> GetPreviewMakeDruglist(AlchemyConfig alchemyModel) { if (alchemyModel == null) return null; var alchmeyData = GetAlchemyData(alchemyModel.AlchemyID); if (alchmeyData == null) return null; //if (alchemyModel == null) return null; //var alchmeyData = GetAlchemyData(alchemyModel.AlchemyID); //if (alchmeyData == null) return null; return alchmeyData.previewDict; return null; } public Dictionary<int, int> GetPreviewSpecMakeDruglist(AlchemySpecConfig alchemyModel) @@ -520,10 +520,10 @@ #region 发送请求 public void SendMakerDrugQuest(ushort drugId, uint specConfigID) { CA576_tagCMPlayerRefine cMPlayerRefine = new CA576_tagCMPlayerRefine(); cMPlayerRefine.RefineNum = drugId; cMPlayerRefine.UseRateItem = specConfigID; GameNetSystem.Instance.SendInfo(cMPlayerRefine); //CA576_tagCMPlayerRefine cMPlayerRefine = new CA576_tagCMPlayerRefine(); //cMPlayerRefine.RefineNum = drugId; //cMPlayerRefine.UseRateItem = specConfigID; //GameNetSystem.Instance.SendInfo(cMPlayerRefine); } #endregion @@ -686,45 +686,45 @@ if (alchemyModellist == null || !FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.BlastFurnace)) return; for (int i = alchemyModellist.Count - 1; i > -1; i--) { if (StoveLV >= alchemyModellist[i].BlastFurnaceLV) { if (IsSpecMatEnough(alchemyModellist[i]) && IsNormalMatEnough(alchemyModellist[i]) && !CheckIsHavePetOrMount(alchemyModellist[i])) { danDrugRedPointlist[i].state = RedPointState.Simple; return; } } } //for (int i = alchemyModellist.Count - 1; i > -1; i--) //{ // if (StoveLV >= alchemyModellist[i].BlastFurnaceLV) // { // if (IsSpecMatEnough(alchemyModellist[i]) && IsNormalMatEnough(alchemyModellist[i]) // && !CheckIsHavePetOrMount(alchemyModellist[i])) // { // danDrugRedPointlist[i].state = RedPointState.Simple; // return; // } // } //} // //for (int i = alchemyModellist.Count - 1; i > -1; i--) //{ // if (StoveLV >= alchemyModellist[i].BlastFurnaceLV) // { // if (IsSpecMatEnough(alchemyModellist[i]) && IsNormalMatEnough(alchemyModellist[i])) // { // danDrugRedPointlist[i].state = RedPointState.Simple; // return; // } // } //} for (int i = alchemyModellist.Count - 1; i > -1; i--) { if (StoveLV >= alchemyModellist[i].BlastFurnaceLV) { if (IsSpecMatEnough(alchemyModellist[i]) && IsNormalMatEnough(alchemyModellist[i])) { danDrugRedPointlist[i].state = RedPointState.Simple; return; } } } for (int i = alchemyModellist.Count - 1; i > -1; i--) { if (StoveLV >= alchemyModellist[i].BlastFurnaceLV) { if (!CheckNormalAlchemyIsReachMaxUse(alchemyModellist[i])) { if (IsNormalMatEnough(alchemyModellist[i]) && !IsHaveReachFull(alchemyModellist[i])) { danDrugRedPointlist[i].state = RedPointState.Simple; return; } } } } //for (int i = alchemyModellist.Count - 1; i > -1; i--) //{ // if (StoveLV >= alchemyModellist[i].BlastFurnaceLV) // { // if (!CheckNormalAlchemyIsReachMaxUse(alchemyModellist[i])) // { // if (IsNormalMatEnough(alchemyModellist[i]) && !IsHaveReachFull(alchemyModellist[i])) // { // danDrugRedPointlist[i].state = RedPointState.Simple; // return; // } // } // } //} } @@ -767,60 +767,61 @@ public bool IsSpecMatEnough(AlchemyConfig alchemyConfig) { if (alchemyConfig == null) return false; if (alchemyConfig.SpecialItem == null || alchemyConfig.SpecialItem.Length < 1) return false; bool isEnough = false; for (int i = 0; i < alchemyConfig.SpecialItem.Length; i++) { AlchemySpecConfig specConfig = AlchemySpecConfig.Get(alchemyConfig.SpecialItem[i]); int haveCnt = playerPack.GetItemCountByID(PackType.Item, specConfig.SpecialMaterialD); if (haveCnt >= specConfig.SpecialMateriaNUM) { isEnough = true; break; } } return isEnough; //if (alchemyConfig == null) return false; //if (alchemyConfig.SpecialItem == null || alchemyConfig.SpecialItem.Length < 1) return false; // //bool isEnough = false; //for (int i = 0; i < alchemyConfig.SpecialItem.Length; i++) //{ // AlchemySpecConfig specConfig = AlchemySpecConfig.Get(alchemyConfig.SpecialItem[i]); // int haveCnt = playerPack.GetItemCountByID(PackType.Item, specConfig.SpecialMaterialD); // if (haveCnt >= specConfig.SpecialMateriaNUM) // { // isEnough = true; // break; // } //} return false; } public bool IsSpecMatEnough(AlchemyConfig alchemyConfig, out Dictionary<int, List<int>> specDurgDict) { specDurgDict = new Dictionary<int, List<int>>(); if (alchemyConfig == null) return false; if (alchemyConfig.SpecialItem == null || alchemyConfig.SpecialItem.Length < 1) return false; bool isEnough = false; for (int i = 0; i < alchemyConfig.SpecialItem.Length; i++) { AlchemySpecConfig specConfig = AlchemySpecConfig.Get(alchemyConfig.SpecialItem[i]); int haveCnt = playerPack.GetItemCountByID(PackType.Item, specConfig.SpecialMaterialD); if (haveCnt >= specConfig.SpecialMateriaNUM) { isEnough = true; List<int> specIdlist = GetSpecPreviewIdlist(specConfig); specDurgDict.Add(specConfig.SpecialMaterialD, specIdlist); } } return isEnough; specDurgDict = null; //specDurgDict = new Dictionary<int, List<int>>(); //if (alchemyConfig == null) return false; // //if (alchemyConfig.SpecialItem == null || alchemyConfig.SpecialItem.Length < 1) return false; // //bool isEnough = false; //for (int i = 0; i < alchemyConfig.SpecialItem.Length; i++) //{ // AlchemySpecConfig specConfig = AlchemySpecConfig.Get(alchemyConfig.SpecialItem[i]); // int haveCnt = playerPack.GetItemCountByID(PackType.Item, specConfig.SpecialMaterialD); // if (haveCnt >= specConfig.SpecialMateriaNUM) // { // isEnough = true; // List<int> specIdlist = GetSpecPreviewIdlist(specConfig); // specDurgDict.Add(specConfig.SpecialMaterialD, specIdlist); // } //} return false; } public bool IsNormalMatEnough(AlchemyConfig alchemyConfig) { if (alchemyConfig == null) return false; bool isEnough = true; var matDict = GetAlchemyData(alchemyConfig.AlchemyID).normalMatDic; foreach (var id in matDict.Keys) { int haveCnt = playerPack.GetItemCountByID(PackType.Item, id); if (haveCnt < matDict[id]) { isEnough = false; break; } } return isEnough; //if (alchemyConfig == null) return false; //bool isEnough = true; //var matDict = GetAlchemyData(alchemyConfig.AlchemyID).normalMatDic; //foreach (var id in matDict.Keys) //{ // int haveCnt = playerPack.GetItemCountByID(PackType.Item, id); // if (haveCnt < matDict[id]) // { // isEnough = false; // break; // } //} return false; } public bool IsHaveReachFull(AlchemyConfig alchemyConfig) @@ -866,14 +867,14 @@ { if (alchemyConfig == null) return; specMatRedpoint.state = RedPointState.None; if (isShow) { if (IsSpecMatEnough(alchemyConfig) && alchemyConfig.BlastFurnaceLV <= StoveLV) { specMatRedpoint.state = RedPointState.Simple; } } //specMatRedpoint.state = RedPointState.None; //if (isShow) //{ // if (IsSpecMatEnough(alchemyConfig) && alchemyConfig.BlastFurnaceLV <= StoveLV) // { // specMatRedpoint.state = RedPointState.Simple; // } //} } public void CheckRecycleStoreRed() System/BlastFurnace/DandrugCell.cs
@@ -44,27 +44,27 @@ danIcon.SetSprite(alchemyModel.ICONID); danBgIcon.SetItemBackGround(alchemyModel.AlchemyQuality); nameText.text = alchemyModel.AlchemName; if (FurnaceModel.StoveLV < alchemyModel.BlastFurnaceLV) { lockText.gameObject.SetActive(true); lockText.text = Language.Get("BlastFurnace104", alchemyModel.BlastFurnaceLV); progressObj.SetActive(false); } else { progressObj.SetActive(true); lockText.gameObject.SetActive(false); float progress = (float)Math.Round(playerPack.GetAlchemyProgress(alchemyModel), 2); if(progress > 0) { progressValue.text = UIHelper.AppendColor(TextColType.Green, StringUtility.Contact(progress, "%")); } else { progressValue.text = StringUtility.Contact(progress, "%"); progressValue.color = colorBlack; } } //if (FurnaceModel.StoveLV < alchemyModel.BlastFurnaceLV) //{ // lockText.gameObject.SetActive(true); // lockText.text = Language.Get("BlastFurnace104", alchemyModel.BlastFurnaceLV); // progressObj.SetActive(false); //} //else //{ // progressObj.SetActive(true); // lockText.gameObject.SetActive(false); // float progress = (float)Math.Round(playerPack.GetAlchemyProgress(alchemyModel), 2); // if(progress > 0) // { // progressValue.text = UIHelper.AppendColor(TextColType.Green, StringUtility.Contact(progress, "%")); // } // else // { // progressValue.text = StringUtility.Contact(progress, "%"); // progressValue.color = colorBlack; // } //} if (index == selectIndex) { @@ -77,17 +77,17 @@ selectImg.SetActive(false); } bool isReach = FurnaceModel.IsHaveReachFull(alchemyModel); int alchemyLv = alchemyModel.AlchemyID % 10; if(isReach) { progressObj.SetActive(false); achieveReachText.text = Language.Get("BlastFurnace116",Language.Get(StringUtility.Contact("Num_CHS_", alchemyLv))); achieveReach.SetActive(true); } else { achieveReach.SetActive(false); } //int alchemyLv = alchemyModel.AlchemyID % 10; //if(isReach) //{ // progressObj.SetActive(false); // achieveReachText.text = Language.Get("BlastFurnace116",Language.Get(StringUtility.Contact("Num_CHS_", alchemyLv))); // achieveReach.SetActive(true); //} //else //{ // achieveReach.SetActive(false); //} } } System/BlastFurnace/LingDanTips.cs
@@ -143,7 +143,7 @@ { if (FurnaceModel.danDrugRedPointlist[i].state == RedPointState.Simple) { isJumpToId = FurnaceModel.alchemyModellist[i].AlchemyID; //isJumpToId = FurnaceModel.alchemyModellist[i].AlchemyID; isMakeDan = true; presentIndex = i; int jumpIndex = presentIndex - 1 < 0 ? 0 : presentIndex - 1; @@ -170,11 +170,11 @@ { for (int i = 0; i < FurnaceModel.alchemyModellist.Count; i++) { if (FurnaceModel.jumpToPrescripe == FurnaceModel.alchemyModellist[i].AlchemyID) { presentIndex = i; break; } //if (FurnaceModel.jumpToPrescripe == FurnaceModel.alchemyModellist[i].AlchemyID) //{ // presentIndex = i; // break; //} } FurnaceModel.jumpToPrescripe = 0; } @@ -184,7 +184,7 @@ { if (FurnaceModel.danDrugRedPointlist[i].state == RedPointState.Simple) { isJumpToId = FurnaceModel.alchemyModellist[i].AlchemyID; //isJumpToId = FurnaceModel.alchemyModellist[i].AlchemyID; presentIndex = i; break; } @@ -293,22 +293,22 @@ AlchemyConfig alchemyModel = FurnaceModel.alchemyModellist[index]; noEnoughMatID = 0; curAlchemyModel = alchemyModel; if(curAlchemyModel.AlchemyID != isJumpToId) { isJumpToId = 0; if(guideEffect != null) { AchievementGuideEffectPool.Recycle(guideEffect); guideEffect = null; } } //if(curAlchemyModel.AlchemyID != isJumpToId) //{ // isJumpToId = 0; // if(guideEffect != null) // { // AchievementGuideEffectPool.Recycle(guideEffect); // guideEffect = null; // } //} int i = 0; int length = _materiallist.Count; for( i = 0;i < length;i++) { ItemCell itemCell = _materiallist[i].transform.Find("ItemCell").GetComponent<ItemCell>(); GameObject lockImage = _materiallist[i].transform.Find("LockImage").gameObject; FurnaceModel.SetAlchemyMaterial(alchemyModel.AlchemyID); //FurnaceModel.SetAlchemyMaterial(alchemyModel.AlchemyID); FurnaceModel.GetAlchemyMaterial(i); int materialId = FurnaceModel.materialId; int materialNum = FurnaceModel.materialNum; @@ -352,16 +352,16 @@ } _noEnoughLVText.SetActive(false); if (FurnaceModel.StoveLV < alchemyModel.BlastFurnaceLV) { _makeDanBtn.gameObject.SetActive(false); //_noEnoughLVText.SetActive(true); } else { _makeDanBtn.gameObject.SetActive(true); } //if (FurnaceModel.StoveLV < alchemyModel.BlastFurnaceLV) //{ // _makeDanBtn.gameObject.SetActive(false); // //_noEnoughLVText.SetActive(true); //} //else //{ // _makeDanBtn.gameObject.SetActive(true); // //} if(presentIndex != index) { chooseSpecModel = null; @@ -379,9 +379,9 @@ _addExp = 0; if (chooseSpecModel == null) { _addExp = curAlchemyModel.AlchemyEXP; _addSpecMatItemCell.gameObject.SetActive(false); FurnaceModel.SetAlchemySpecModellist(curAlchemyModel.SpecialItem); //_addExp = curAlchemyModel.AlchemyEXP; //_addSpecMatItemCell.gameObject.SetActive(false); //FurnaceModel.SetAlchemySpecModellist(curAlchemyModel.SpecialItem); if (FurnaceModel.GetAlchemySpecModellist().Count > 0) { _addSpecMatText.gameObject.SetActive(true); @@ -401,8 +401,8 @@ { FurnaceModel.SpecMatRedPointCtrl(curAlchemyModel,false); _addExp = specModel.AlchemyEXP + curAlchemyModel.AlchemyEXP; RefreshVirtualFill(curAlchemyModel.AlchemyEXP); //_addExp = specModel.AlchemyEXP + curAlchemyModel.AlchemyEXP; //RefreshVirtualFill(curAlchemyModel.AlchemyEXP); _addSpecMatText.gameObject.SetActive(false); _addSpecLockObj.SetActive(false); _addSpecMatItemCell.gameObject.SetActive(true); @@ -543,14 +543,14 @@ { //ChangeMakeDanBtn(false); makeDrugEffect.Play(); FurnaceModel.SendMakerDrugQuest((ushort)curAlchemyModel.AlchemyID, (uint)chooseSpecModel.ID); //FurnaceModel.SendMakerDrugQuest((ushort)curAlchemyModel.AlchemyID, (uint)chooseSpecModel.ID); } } else { //ChangeMakeDanBtn(false); makeDrugEffect.Play(); FurnaceModel.SendMakerDrugQuest((ushort)curAlchemyModel.AlchemyID, 0); //FurnaceModel.SendMakerDrugQuest((ushort)curAlchemyModel.AlchemyID, 0); } } } System/BlastFurnace/PrayForDurgModel.cs
@@ -239,19 +239,19 @@ { for (int i = 0; i < configs.Count; i++) { if (blastModel.StoveLV >= configs[i].BlastFurnaceLV) { List<int> idlist = blastModel.GetPreviewIdlist(configs[i]); if(idlist.Contains(key)) { AttrFruitConfig fruitConfig = AttrFruitConfig.Get(key); if (!playerPack.IsReachMaxUseDrug(fruitConfig)) { prayIdlist.Add(key); } break; } } //if (blastModel.StoveLV >= configs[i].BlastFurnaceLV) //{ // List<int> idlist = blastModel.GetPreviewIdlist(configs[i]); // if(idlist.Contains(key)) // { // AttrFruitConfig fruitConfig = AttrFruitConfig.Get(key); // if (!playerPack.IsReachMaxUseDrug(fruitConfig)) // { // prayIdlist.Add(key); // } // break; // } //} } } return prayIdlist; System/Realm/ActivateShow.cs
@@ -163,10 +163,10 @@ var model = ModelCenter.Instance.GetModel<BlastFurnaceModel>(); for(int i = 0; i < model.alchemyModellist.Count; i++) { if(stoveLv == model.alchemyModellist[i].BlastFurnaceLV) { skills.Add(model.alchemyModellist[i].AlchemyID); } //if(stoveLv == model.alchemyModellist[i].BlastFurnaceLV) //{ // skills.Add(model.alchemyModellist[i].AlchemyID); //} } var _beforeConfig = RefineStoveConfig.Get(beforeLv); System/WindowBase/ModelCenter.cs
@@ -235,6 +235,7 @@ RegisterModel<HazyDemonKingModel>(); RegisterModel<HazyGrassModel>(); RegisterModel<DungeonUseBuffModel>(); RegisterModel<AlchemyModel>(); inited = true; } Utility/ConfigInitiator.cs
@@ -292,7 +292,8 @@ normalTasks.Add(new ConfigInitTask("HazyRegionConfig", () => { HazyRegionConfig.Init(); }, () => { return HazyRegionConfig.inited; })); normalTasks.Add(new ConfigInitTask("AdventureDialogueConfig", () => { AdventureDialogueConfig.Init(); }, () => { return AdventureDialogueConfig.inited; })); normalTasks.Add(new ConfigInitTask("MapNpcRefreshConfig", () => { MapNpcRefreshConfig.Init(); }, () => { return MapNpcRefreshConfig.inited; })); normalTasks.Add(new ConfigInitTask("DungeonUseBuffConfig", () => { DungeonUseBuffConfig.Init(); }, () => { return DungeonUseBuffConfig.inited; })); normalTasks.Add(new ConfigInitTask("DungeonUseBuffConfig", () => { DungeonUseBuffConfig.Init(); }, () => { return DungeonUseBuffConfig.inited; })); normalTasks.Add(new ConfigInitTask("AlchemyCountConfig", () => { AlchemyCountConfig.Init(); }, () => { return AlchemyCountConfig.inited; })); } static List<ConfigInitTask> doingTasks = new List<ConfigInitTask>();