Example #1
0
        /// <inheritdoc/>
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            this.pluginInterface = pluginInterface ?? throw new ArgumentNullException(nameof(pluginInterface));

            this.marketBoardWindow = new MarketBoardWindow(this.pluginInterface);

            // Set up command handlers
            pluginInterface.CommandManager.AddHandler("/pmb", new CommandInfo(this.OnOpenMarketBoardCommand)
            {
                HelpMessage = "Open the market board window.",
            });

            pluginInterface.UiBuilder.OnBuildUi += this.BuildMarketBoardUi;
            pluginInterface.Subscribe("ItemSearchPlugin", this.ItemSearchPluginIPC);

      #if DEBUG
            this.isImguiMarketBoardWindowOpen = true;
      #endif
        }
Example #2
0
        /// <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
        }