private static bool NextPagePatch(ItemSpawnerV2 __instance) { ItemSpawnerData data = __instance.GetComponent <ItemSpawnerData>(); if (OtherLoader.SpawnerEntriesByPath[data.CurrentPath].childNodes.Count / __instance.IMG_SimpleTiles.Count > data.SavedPagePositions[__instance.PMode][data.CurrentDepth]) { data.SavedPagePositions[__instance.PMode][data.CurrentDepth] += 1; __instance.RedrawSimpleCanvas(); } return(false); }
private static bool PrevPagePatch(ItemSpawnerV2 __instance) { ItemSpawnerData data = __instance.GetComponent <ItemSpawnerData>(); if (data.SavedPagePositions[__instance.PMode][data.CurrentDepth] > 0) { data.SavedPagePositions[__instance.PMode][data.CurrentDepth] -= 1; __instance.RedrawSimpleCanvas(); } return(false); }
private static bool GoBackPatch(ItemSpawnerV2 __instance) { ItemSpawnerData data = __instance.GetComponent <ItemSpawnerData>(); if (!data.CurrentPath.Contains("/")) { return(false); } data.CurrentPath = data.CurrentPath.Substring(0, data.CurrentPath.LastIndexOf("/")); data.SavedPagePositions[__instance.PMode][data.CurrentDepth] = 0; data.CurrentDepth -= 1; OtherLogger.Log("Going back to path: " + data.CurrentPath, OtherLogger.LogType.General); __instance.RedrawSimpleCanvas(); return(false); }
private static bool SimpleButtonPatch(ItemSpawnerV2 __instance, int i) { ItemSpawnerData data = __instance.GetComponent <ItemSpawnerData>(); //If the entry that was selected has child entries, we should display the child entries if (OtherLoader.SpawnerEntriesByPath[data.VisibleEntries[i].EntryPath].childNodes.Count > 0) { data.CurrentPath = data.VisibleEntries[i].EntryPath; data.CurrentDepth += 1; data.SavedPagePositions[__instance.PMode][data.CurrentDepth] = 0; __instance.RedrawSimpleCanvas(); } else { OtherLogger.Log("Setting selected id to: " + data.VisibleEntries[i].MainObjectID, OtherLogger.LogType.General); __instance.SetSelectedID(data.VisibleEntries[i].MainObjectID); __instance.RedrawDetailsCanvas(); } return(false); }