예제 #1
0
        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);
                    }
                }
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
 internal static void LoadList(this ChaListControl instance, ChaListData data) => LoadList(instance, (ChaListDefine.CategoryNo)data.categoryNo, data);
예제 #4
0
 public static void LoadList(this ChaListControl instance, ChaListData data)
 {
     LoadList(instance, (ChaListDefine.CategoryNo)data.categoryNo, data);
 }
예제 #5
0
        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();
            }
        }
예제 #6
0
 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);
                 }
             }
         }
     }
 }