public override void OnEnable()
        {
            App = new GifPlayerApp();
            App.Start();
            ConfigManager = new PluginConfigurationManager(this);
            Config        = new Configuration(App);
            ConfigManager.AddItem(Config);
            this.EventBus.BindEvent <PluginEvents.InitCommandEvent>((@event) =>
            {
                @event.Commands.Dispatch.bind("gif", _ =>
                {
                    App.ShowForm();
                    return(true);
                }, "Show or hide gif player window");
            });

            this.EventBus.BindEvent <PluginEvents.ProgramReadyEvent>((@event) =>
            {
                var ortdp = getHoster().EnumPluings().FirstOrDefault(p => p.Name == "OsuRTDataProvider") as OsuRTDataProviderPlugin;
                ortdp.ListenerManager.OnPlayingTimeChanged += ListenerManager_OnPlayingTimeChanged;
                ortdp.ListenerManager.OnBeatmapChanged     += ListenerManager_OnBeatmapChanged;
                ortdp.ListenerManager.OnModsChanged        += ListenerManager_OnModsChanged;
                ortdp.ListenerManager.OnStatusChanged      += ListenerManager_OnStatusChanged;
                App.LoadImage(Config.ImagePath);
            });
        }
Example #2
0
 public Configuration(GifPlayerApp app)
 {
     this.App = app;
 }