Ejemplo n.º 1
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            Version           = Assembly.GetExecutingAssembly().GetName().Version.ToString();
            PluginInterface   = pluginInterface;
            this.PluginConfig = (ItemSearchPluginConfig)pluginInterface.GetPluginConfig() ?? new ItemSearchPluginConfig();

            ItemSearchPlugin.DataSites = new DataSite[] {
                new GarlandToolsDataSite(),
                new TeamcraftDataSite(PluginConfig),
                new GamerEscapeDatasite(),
            };

            this.PluginConfig.Init(pluginInterface, this);


            SetupGameFunctions();

            ReloadLocalization();

            FittingRoomUI = new FittingRoomUI(this);

            CraftingRecipeFinder = new CraftingRecipeFinder(this);

            PluginInterface.UiBuilder.OnBuildUi += this.BuildUI;
            SetupCommands();

#if DEBUG
            OnItemSearchCommand("", "");
#endif
        }
Ejemplo n.º 2
0
 public void Dispose()
 {
     PluginInterface.UiBuilder.OnBuildUi -= this.BuildUI;
     FittingRoomUI?.Dispose();
     itemSearchWindow?.Dispose();
     RemoveCommands();
     PluginInterface.Dispose();
 }
Ejemplo n.º 3
0
        public void Dispose()
        {
            PluginInterface.UiBuilder.OnBuildUi -= this.BuildUI;
            FittingRoomUI?.Dispose();
            itemSearchWindow?.Dispose();
            RemoveCommands();
            PluginInterface.Dispose();

            foreach (var t in textureDictionary)
            {
                t.Value?.Dispose();
            }

            textureDictionary.Clear();
        }
Ejemplo n.º 4
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            Version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
            this.PluginInterface = pluginInterface;
            this.PluginConfig    = (ItemSearchPluginConfig)pluginInterface.GetPluginConfig() ?? new ItemSearchPluginConfig();
            this.PluginConfig.Init(pluginInterface, this);

            ReloadLocalization();

            FittingRoomUI = new FittingRoomUI(this);

            PluginInterface.UiBuilder.OnBuildUi += this.BuildUI;
            SetupCommands();

#if DEBUG
            OnItemSearchCommand("", "");
#endif
        }
Ejemplo n.º 5
0
        private void BuildUI()
        {
            if (drawItemSearchWindow)
            {
                drawItemSearchWindow = itemSearchWindow != null && itemSearchWindow.Draw();
                drawConfigWindow     = drawItemSearchWindow && drawConfigWindow && PluginConfig.DrawConfigUI();

                if (drawItemSearchWindow == false)
                {
                    itemSearchWindow?.Dispose();
                    itemSearchWindow = null;
                    drawConfigWindow = false;
                }
            }


            debugStopwatch.Restart();
            if (PluginConfig.EnableFittingRoomSaves || PluginConfig.ShowItemID)
            {
                if (FittingRoomUI == null)
                {
                    FittingRoomUI = new FittingRoomUI(this);
                }
                else
                {
                    if (PluginConfig.EnableFittingRoomSaves)
                    {
                        FittingRoomUI?.Draw();
                    }
                }
            }

#if DEBUG
            ImGui.BeginMainMenuBar();
            if (ImGui.MenuItem("ItemSearch"))
            {
                itemSearchWindow?.Dispose();
                itemSearchWindow     = new ItemSearchWindow(this);
                drawItemSearchWindow = true;
            }

            ImGui.EndMainMenuBar();
#endif
        }