public static bool Prefix(ASDatabase __instance, ref Song[] __result) { if (HasPendingQuery()) { // If we have a pending query, return that instead of the actual favorite songs List <Song> songs = new List <Song>(); __result = songs.ToArray(); ResetDBString(); return(true); } else { // otherwise just run the original function return(false); } }
public static bool Prefix(ASDatabase __instance, ref Song[] __result, ref SQLiteDB ___db) { if (HasPendingQuery()) { // If we have a pending query, return that instead of the actual favorite songs SQLiteQuery query = new SQLiteQuery(___db, NextDBString); List <Song> songs = ReverseMethods.ExtractSongsFromQuery(__instance, query); __result = songs.ToArray(); ResetDBString(); return(false); } else { // otherwise just run the original function return(true); } }