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.

62 lines
1.3 KiB

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