You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.3 KiB

  1. using IPA;
  2. using UnityEngine.SceneManagement;
  3. using IPALogger = IPA.Logging.Logger;
  4. using BSIPA_ModList.UI;
  5. using UnityEngine;
  6. namespace BSIPA_ModList
  7. {
  8. internal static class Logger
  9. {
  10. internal static IPALogger log { get; set; }
  11. }
  12. public class Plugin : IBeatSaberPlugin
  13. {
  14. public void Init(IPALogger logger)
  15. {
  16. Logger.log = logger;
  17. Logger.log.Debug("Init");
  18. IPA.Updating.BeatMods.Updater.ModListPresent = true;
  19. }
  20. public void OnActiveSceneChanged(Scene prevScene, Scene nextScene)
  21. {
  22. }
  23. public void OnApplicationQuit()
  24. {
  25. }
  26. public void OnApplicationStart()
  27. {
  28. }
  29. public void OnFixedUpdate()
  30. {
  31. }
  32. public void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode)
  33. {
  34. if (scene.name == "MenuCore")
  35. {
  36. FloatingNotification.Create();
  37. if (ButtonUI.Instance == null)
  38. {
  39. Logger.log.Debug("Creating Menu");
  40. new GameObject("BSIPA Mod List Object").AddComponent<ButtonUI>().Init();
  41. }
  42. }
  43. }
  44. public void OnSceneUnloaded(Scene scene)
  45. {
  46. }
  47. public void OnUpdate()
  48. {
  49. }
  50. }
  51. }