public static bool AddItemIDHook(int category, int id, byte flags, ChaListControl __instance) { int pid = ListLoader.CalculateGlobalID(category, id); byte result = __instance.CheckItemID(pid); if (result > 0) { __instance.AddItemID(pid, flags); return(false); } return(true); }
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); } } } }