internal static void loadListInternal(this ChaListControl instance, Dictionary <int, ListInfoBase> dictData, ChaListData chaListData) { foreach (KeyValuePair <int, List <string> > keyValuePair in chaListData.dictList) { ListInfoBase listInfoBase = new ListInfoBase(); if (listInfoBase.Set(chaListData.categoryNo, chaListData.distributionNo, chaListData.lstKey, keyValuePair.Value)) { if (!dictData.ContainsKey(listInfoBase.Id)) { dictData[listInfoBase.Id] = listInfoBase; int infoInt = listInfoBase.GetInfoInt(ChaListDefine.KeyType.Possess); int item = CalculateGlobalID(listInfoBase.Category, listInfoBase.Id); instance.AddItemID(item, (byte)infoInt); } } } }
internal static void LoadList(this ChaListControl instance, ChaListDefine.CategoryNo category, ChaListData data) { var dictListInfo = r_dictListInfo.GetValue <Dictionary <int, Dictionary <int, ListInfoBase> > >(instance); if (dictListInfo.TryGetValue((int)category, out Dictionary <int, ListInfoBase> dictData)) { loadListInternal(instance, dictData, data); } }
internal static void LoadList(this ChaListControl instance, ChaListData data) => LoadList(instance, (ChaListDefine.CategoryNo)data.categoryNo, data);
public static void LoadList(this ChaListControl instance, ChaListData data) { LoadList(instance, (ChaListDefine.CategoryNo)data.categoryNo, data); }
internal static void GenerateResolutionInfo(Manifest manifest, ChaListData data, List <ResolveInfo> results) { var category = (ChaListDefine.CategoryNo)data.categoryNo; var propertyKeys = StructReference.CollatedStructValues.Keys.Where(x => x.Category == category).ToList(); foreach (var kv in data.dictList) { int newSlot = Interlocked.Increment(ref CurrentSlotID); #if KK || EC if (data.categoryNo == (int)ChaListDefine.CategoryNo.mt_ramp) { //Special handling for ramp stuff since it's the only thing that isn't saved to the character if (Sideloader.DebugLoggingResolveInfo.Value) { Sideloader.Logger.LogInfo($"ResolveInfo - " + $"GUID: {manifest.GUID} " + $"Slot: {int.Parse(kv.Value[0])} " + $"LocalSlot: {newSlot} " + $"Property: Ramp " + $"CategoryNo: {category} " + $"Count: {LoadedResolutionInfo.Count()}"); } results.Add(new ResolveInfo { GUID = manifest.GUID, Slot = int.Parse(kv.Value[0]), LocalSlot = newSlot, Property = "Ramp", CategoryNo = category }); } else #endif { results.AddRange(propertyKeys.Select(propertyKey => { if (Sideloader.DebugLoggingResolveInfo.Value) { Sideloader.Logger.LogInfo($"ResolveInfo - " + $"GUID: {manifest.GUID} " + $"Slot: {int.Parse(kv.Value[0])} " + $"LocalSlot: {newSlot} " + $"Property: {propertyKey.ToString()} " + $"CategoryNo: {category} " + $"Count: {LoadedResolutionInfo.Count()}"); } return(new ResolveInfo { GUID = manifest.GUID, Slot = int.Parse(kv.Value[0]), LocalSlot = newSlot, Property = propertyKey.ToString(), CategoryNo = category }); })); } kv.Value[0] = newSlot.ToString(); } }
private static void loadListInternal(this ChaListControl instance, Dictionary <int, ListInfoBase> dictData, ChaListData chaListData) { foreach (KeyValuePair <int, List <string> > keyValuePair in chaListData.dictList) { ListInfoBase listInfoBase = new ListInfoBase(); if (listInfoBase.Set(chaListData.categoryNo, chaListData.distributionNo, chaListData.lstKey, keyValuePair.Value)) { if (!dictData.ContainsKey(listInfoBase.Id)) { dictData[listInfoBase.Id] = listInfoBase; int infoInt = listInfoBase.GetInfoInt(ChaListDefine.KeyType.Possess); int item = (listInfoBase.Category * CategoryMultiplier) + listInfoBase.Id; if (infoInt == 1) { var lstItemIsInit = r_lstItemIsInit.GetValue <List <int> >(instance); lstItemIsInit.Add(item); } else if (infoInt == 2) { var lstItemIsNew = r_lstItemIsNew.GetValue <List <int> >(instance); lstItemIsNew.Add(item); } } } } }