/// <summary> /// Initializes a new instance of the <see cref="ContextMenuManager"/> class. /// </summary> /// <param name="plugin">plugin.</param> public ContextMenuManager(PriceCheckPlugin plugin) { this.plugin = plugin; this.contextMenuItem = new InventoryContextMenuItem( Loc.Localize("ContextMenuItem", "Check Marketboard Price"), this.ContextItemChanged); this.plugin.XivCommon.Functions.ContextMenu.OpenInventoryContextMenu += this.OnOpenInventoryContextMenu; }
/// <summary> /// Initializes a new instance of the <see cref="MBPlugin"/> class. /// This is the plugin's entry point. /// </summary> public MBPlugin() { this.config = (MBPluginConfig)PluginInterface.GetPluginConfig() ?? new MBPluginConfig(); this.marketBoardWindow = new MarketBoardWindow(this.config); // Set up command handlers CommandManager.AddHandler("/pmb", new CommandInfo(this.OnOpenMarketBoardCommand) { HelpMessage = "Open the market board window.", }); PluginInterface.UiBuilder.Draw += this.BuildMarketBoardUi; // Set up context menu this.contextMenuBase = new DalamudContextMenuBase(); this.inventoryContextMenuItem = new InventoryContextMenuItem( new SeString(new TextPayload("Search with Market Board Plugin")), this.OnSelectContextMenuItem); this.contextMenuBase.Functions.ContextMenu.OnOpenInventoryContextMenu += this.OnContextMenuOpened; #if DEBUG this.marketBoardWindow.IsOpen = true; #endif }