// Basic initialization and hiding overlay (triggered on plugin load) public QuestTracker(QuestOverlay _overlay) { this.overlay = _overlay; this.quest_list = new List <Quest>(); if (Config.Instance.HideInMenu && CoreAPI.Game.IsInMenu) { overlay.Hide(); } }
public void OnLoad() { // When it's loaded upon each restart/turned on by the user Log.Info("Hello from quest this is load"); // Overlay created and added on plugin load overlay = new QuestOverlay(); CoreAPI.OverlayCanvas.Children.Add(overlay); // Overlay added to tracker object on initialization so that it could be modified QuestTracker tracker = new QuestTracker(overlay); // Mapping GameEvents from API.GameEvents GameEvents.OnGameStart.Add(tracker.GameStart); GameEvents.OnTurnStart.Add(tracker.TurnStart); GameEvents.OnPlayerPlay.Add(tracker.CardPlay); GameEvents.OnGameEnd.Add(tracker.GameEnd); GameEvents.OnPlayerHeroPower.Add(tracker.HeroPower); GameEvents.OnPlayerDraw.Add(tracker.PlayerDraw); // Adding Choose Quest menu label this.menuItem = new MenuItem() { Header = "Choose Quests" }; // Adding Click event to menuitem which just initializes the QuestSelection overlay this.menuItem.Click += (sender, e) => { var x = new QuestSelection(tracker); }; /*var chooseclass = new MenuItem() {Header = "Class"}; * var warrior = new MenuItem() {Header = "Warrior"}; * warrior.Click += (sender, e) => tracker.SetQuest("Warrior"); * var shaman = new MenuItem() {Header = "Shaman"}; * shaman.Click += (sender, e) => tracker.SetQuest("Shaman"); * var rogue = new MenuItem() {Header = "Rogue"}; * rogue.Click += (sender, e) => tracker.SetQuest("Rogue"); * var paladin = new MenuItem() {Header = "Paladin"}; * paladin.Click += (sender, e) => tracker.SetQuest("Paladin"); * var hunter = new MenuItem() {Header = "Hunter"}; * hunter.Click += (sender, e) => tracker.SetQuest("Hunter"); * var druid = new MenuItem() {Header = "Druid"}; * druid.Click += (sender, e) => tracker.SetQuest("Druid"); * var warlock = new MenuItem() {Header = "Warlock"}; * warlock.Click += (sender, e) => tracker.SetQuest("Warlock"); * var mage = new MenuItem() {Header = "Mage"}; * mage.Click += (sender, e) => tracker.SetQuest("Mage"); * var priest = new MenuItem() {Header = "Priest"}; * priest.Click += (sender, e) => tracker.SetQuest("Priest"); * chooseclass.Items.Add(warrior); * chooseclass.Items.Add(shaman); * chooseclass.Items.Add(rogue); * chooseclass.Items.Add(paladin); * chooseclass.Items.Add(hunter); * chooseclass.Items.Add(druid); * chooseclass.Items.Add(warlock); * chooseclass.Items.Add(mage); * chooseclass.Items.Add(priest); * menuItem.Items.Add(chooseclass); */ }