private static string checkForVariationPointer(string s) { if (ClassCreationEngine.ItemRemakeHash == null) { ClassCreationEngine.CreateRemakeUtil(false); } if (ClassCreationEngine.ItemRemakePointer == null) { ClassCreationEngine.CreateRemakeInfoData(false); } if (ClassCreationEngine.ItemRemakeHash.ContainsKey(s)) { string varId = ClassCreationEngine.ItemRemakeHash[s]; string pointerID = ClassCreationEngine.ItemRemakePointer[varId]; if (pointerID == s) // don't return self { return(string.Empty); } else { return(pointerID); } } return(string.Empty); }
static void DoEverything() { foreach (string k in PathHelper.Languages.Keys) { ItemCreationEngine.CreateItemList(k); ItemCreationEngine.CreateVillagerList(k); ItemCreationEngine.CreateBodyFabricColorPartsList(k); ItemCreationEngine.CreateVillagerPhraseList(k); } ClassCreationEngine.CreateItemKind(); ClassCreationEngine.CreateCustomColor(); ClassCreationEngine.CreateRCP(); ClassCreationEngine.CreateRCPC(); ClassCreationEngine.CreateRemakeInfoData(); ClassCreationEngine.CreateRemakeUtil(); ClassCreationEngine.CreateRecipeUtil(); ClassCreationEngine.CreateMenuIcon(); }
// previously used for bruteforcing, no longer needed public static string FindMenuIcon(string jap, string kind, DataTable menuIconTable, DataTable itemKindTable, List <string> paths, bool searchItemKind = true, bool reverseContains = false, int menuJapIndex = 2, int filenameIndex = 1, int itemKindNameIndex = 26, int itemKindJapIndex = 27) { if (jap == string.Empty) { return(string.Empty); } for (int i = menuIconTable.Rows.Count - 1; i > 0; --i) // reversed foreach { DataRow row = menuIconTable.Rows[i]; if (reverseContains ? row[menuJapIndex].ToString().Replace("\0", string.Empty).Contains(jap) : jap.Contains(row[menuJapIndex].ToString().Replace("\0", string.Empty))) { // try to get path string found = paths.Find(x => x.Contains(row[filenameIndex].ToString().Replace("\0", string.Empty))); if (found != string.Empty) { return(found); } } } // try to split by の for (int i = menuIconTable.Rows.Count - 1; i > 0; --i) // reversed foreach { DataRow row = menuIconTable.Rows[i]; if (reverseContains ? row[menuJapIndex].ToString().Replace("\0", string.Empty).Split("の")[0].Contains(jap) : jap.Contains(row[menuJapIndex].ToString().Replace("\0", string.Empty).Split("の")[0])) { // try to get path string found = paths.Find(x => x.Contains(row[filenameIndex].ToString().Replace("\0", string.Empty))); if (found != string.Empty) { return(found); } } } // ok let's look it up in the item kind list if (searchItemKind) { if (ClassCreationEngine.ItemKindList == null) { ClassCreationEngine.CreateItemKind(false); } List <string> ItemKindsUsed = ClassCreationEngine.ItemKindList; if (kind.StartsWith("Kind_")) { kind = kind.Substring(5); } foreach (DataRow row in itemKindTable.Rows) { if (row[itemKindNameIndex].ToString().Replace("\0", string.Empty) == kind) { return(FindMenuIcon(row[itemKindJapIndex].ToString().Replace("\0", string.Empty), kind, menuIconTable, itemKindTable, paths, false, true, menuJapIndex, filenameIndex, itemKindNameIndex, itemKindJapIndex)); } } } // nope return(string.Empty); }