public void OnLoadingComplete()
        {
            // Do not allow multiple calling of this method
            if (FinishedLoading)
            {
                return;
            }
            FinishedLoading = true;

            // Check if this addon supports the current champion
            if (!SupportedChampions.ContainsKey(Player.Instance.Hero))
            {
                // Do not load further as we don't support the champion
                return;
            }

            // Initialize properties
            Menu        = MainMenu.AddMenu("The Support", "leSupport" + Player.Instance.ChampionName, "The Support - " + Player.Instance.ChampionName);
            ModeHandler = new ModeHandler(this);

            // Create a new instance of the played champion
            PlayedChampion = SupportedChampions[Player.Instance.Hero](this);

            // Register spells for the champion
            PlayedChampion.RegisterSpells(ModeHandler);

            // Finalize champion init
            PlayedChampion.OnPostInit();

            // Listen to required events
            Game.OnTick += OnTick;

            // Notify successfull loading
            Notifications.Show(new SimpleNotification(
                                   "TheSupport by Hellsing",
                                   string.Format("TheSupport has successfully loaded the champion '{0}' for you! Have fun playing!", Player.Instance.ChampionName)),
                               15000);
        }
Esempio n. 2
0
        public void OnLoadingComplete()
        {
            // Do not allow multiple calling of this method
            if (FinishedLoading)
            {
                return;
            }
            FinishedLoading = true;

            // Check if this addon supports the current champion
            if (!SupportedChampions.ContainsKey(Player.Instance.Hero))
            {
                // Do not load further as we don't support the champion
                return;
            }

            // Initialize properties
            Menu = MainMenu.AddMenu("The Support", "leSupport" + Player.Instance.ChampionName, "The Support - " + Player.Instance.ChampionName);
            ModeHandler = new ModeHandler(this);

            // Create a new instance of the played champion
            PlayedChampion = SupportedChampions[Player.Instance.Hero](this);

            // Register spells for the champion
            PlayedChampion.RegisterSpells(ModeHandler);

            // Finalize champion init
            PlayedChampion.OnPostInit();

            // Listen to required events
            Game.OnTick += OnTick;

            // Notify successfull loading
            Notifications.Show(new SimpleNotification(
                "TheSupport by Hellsing",
                string.Format("TheSupport has successfully loaded the champion '{0}' for you! Have fun playing!", Player.Instance.ChampionName)),
                15000);
        }
 private void OnTick(EventArgs args)
 {
     // Trigger mode handler
     ModeHandler.OnTick();
 }