コード例 #1
0
        public CraftableSearchFilter(ItemSearchPluginConfig pluginConfig, DataManager data) : base(pluginConfig)
        {
            this.craftableItems = new Dictionary <uint, RecipeLookup>();
            this.data           = data;
            string craftableJobFormat = Loc.Localize("CraftableJobFormat", "Craftable: {0}");

            options = new string[11];

            options[0] = "";
            options[1] = Loc.Localize("NotCraftable", "Not Craftable");
            options[2] = string.Format(craftableJobFormat, Loc.Localize("SearchFilterAny", "Any"));

            Task.Run(() => {
                var cj = data.GetExcelSheet <ClassJob>();

                for (uint i = 0; i < 8; i++)
                {
                    var job        = cj.GetRow(i + 8);
                    options[3 + i] = string.Format(craftableJobFormat, job.Abbreviation);
                }

                foreach (var recipeLookup in data.GetExcelSheet <RecipeLookup>())
                {
                    craftableItems.Add(recipeLookup.RowId, recipeLookup);
                }

                finishedLoading = true;
                Modified        = true;
            });
        }
コード例 #2
0
        public LevelItemSearchFilter(ItemSearchPluginConfig config) : base(config)
        {
            minLevel = lastMinLevel = MinItemLevel;
            maxLevel = lastMaxLevel = maxItemLevel;

            maxItemLevel = Math.Max(maxItemLevel, config.MaxItemLevel);
        }
コード例 #3
0
 public BooleanSearchFilter(ItemSearchPluginConfig pluginConfig, string name, string trueString, string falseString, Func <Item, bool> checkFunction) : base(pluginConfig)
 {
     this.Name          = name;
     this.trueString    = trueString;
     this.falseString   = falseString;
     this.checkFunction = checkFunction;
 }
コード例 #4
0
        public ItemUICategorySearchFilter(ItemSearchPluginConfig config, DataManager data) : base(config)
        {
            uiCategories = new List <ItemUICategory> {
                null
            };
            uiCategories.AddRange(data.GetExcelSheet <ItemUICategory>().ToList().Where(x => !string.IsNullOrEmpty(x.Name)).OrderBy(x => x.Name.ToString()));
            string nullName = Loc.Localize("ItemUiCategorySearchFilterAll", "All");

            uiCategoriesArray = uiCategories.Select(x => x == null ? nullName : x.Name.ToString().Replace("\u0002\u001F\u0001\u0003", "-")).ToArray();
        }
コード例 #5
0
 public EquipAsSearchFilter(ItemSearchPluginConfig config, DataManager data) : base(config)
 {
     this.selectedClassJobs  = new List <uint>();
     this.classJobCategories = data.GetExcelSheet <ClassJobCategory>().ToList();
     this.classJobs          = data.GetExcelSheet <ClassJob>()
                               .Where(cj => cj.RowId != 0)
                               .OrderBy(cj => {
         return(cj.Role switch {
             0 => 3,
             1 => 0,
             2 => 2,
             3 => 2,
             4 => 1,
             _ => 4
         });
     }).ToList();
コード例 #6
0
        public DesynthableSearchFilter(ItemSearchPluginConfig pluginConfig, DataManager data) : base(pluginConfig)
        {
            string craftableJobFormat = Loc.Localize("DesynthableJobFormat", "Desynthable: {0}");

            options = new string[11];

            options[0] = "";
            options[1] = Loc.Localize("NotDesynthable", "Not Desynthable");
            options[2] = string.Format(craftableJobFormat, Loc.Localize("SearchFilterAny", "Any"));

            Task.Run(() => {
                var cj = data.GetExcelSheet <ClassJob>();

                for (uint i = 0; i < 8; i++)
                {
                    var job        = cj.GetRow(i + 8);
                    options[3 + i] = string.Format(craftableJobFormat, job.Abbreviation);
                }

                finishedLoading = true;
                Modified        = true;
            });
        }
コード例 #7
0
        public MarketBoardActionButton(Dalamud.Plugin.DalamudPluginInterface pluginInterface, ItemSearchPluginConfig pluginConfig)
        {
            this.pluginInterface = pluginInterface;
            this.pluginConfig    = pluginConfig;

            try {
                pluginInterface.Subscribe("MarketBoardPlugin", (o) => {
                    PluginLog.Log("Recieved Message from MarketBoardPlugin");
                    dynamic msg = o;
                    if (msg.Target == "ItemSearchPlugin" && msg.Action == "pong")
                    {
                        marketBoardResponsed = true;
                    }
                });
            } catch (Exception ex) {
                PluginLog.LogError($"Exception Subscribing to MarketBoardPlugin: {ex.Message}");
            }

            dynamic areYouThereMarketBoard = new ExpandoObject();

            areYouThereMarketBoard.Target = "MarketBoardPlugin";
            areYouThereMarketBoard.Action = "ping";
            pluginInterface.SendMessage(areYouThereMarketBoard);
        }
コード例 #8
0
        public StatSearchFilter(ItemSearchPluginConfig config, DataManager data) : base(config)
        {
            while (!data.IsDataReady)
            {
                Thread.Sleep(1);
            }

            Task.Run(() => {
                var baseParamCounts = new Dictionary <byte, int>();

                foreach (var p in data.GetExcelSheet <Item>().ToList().SelectMany(i => i.UnkStruct59))
                {
                    if (!baseParamCounts.ContainsKey(p.BaseParam))
                    {
                        baseParamCounts.Add(p.BaseParam, 0);
                    }

                    baseParamCounts[p.BaseParam] += 1;
                }

                var sheet  = data.GetExcelSheet <BaseParam>();
                baseParams = baseParamCounts.OrderBy(p => p.Value).Reverse().Select(pair => sheet.GetRow(pair.Key)).ToArray();
            });
        }
コード例 #9
0
 public TeamcraftDataSite(ItemSearchPluginConfig config)
 {
     this.config = config;
 }
コード例 #10
0
 public DataSiteActionButton(ItemSearchPluginConfig pluginConfig)
 {
     this.pluginConfig = pluginConfig;
 }
コード例 #11
0
 public ItemNameSearchFilter(ItemSearchPluginConfig config, string startingValue = "") : base(config)
 {
     searchText     = startingValue;
     lastSearchText = string.Empty;
 }
コード例 #12
0
 public LevelEquipSearchFilter(ItemSearchPluginConfig config) : base(config)
 {
     minLevel = lastMinLevel = MinLevel;
     maxLevel = lastMaxLevel = MaxLevel;
 }
コード例 #13
0
        public SoldByNPCSearchFilter(ItemSearchPluginConfig config, DataManager dataManager) : base(config)
        {
            this.data = dataManager;

            notSoldByNpcOption = new CurrencyOption {
                Invert = true, Name = "Not sold by NPC", ItemHashSet = soldForAnything, HideIfEmpty = false
            };
            soldByAnyNpcOption = new CurrencyOption {
                Name = "Any Currency", ItemHashSet = soldForAnything, HideIfEmpty = false
            };


            availableOptions.Add(null); // Not Selected Option
            availableOptions.Add(notSoldByNpcOption);
            availableOptions.Add(soldByAnyNpcOption);

            availableOptions.Add(GetCurrencyOption(1, "gil"));
            availableOptions.Add(GetCurrencyOption(29, "mgp"));

            soldForCurrency.Add((uint)SpecialCurrency.GrandCompany, new HashSet <uint>()); // Grand Company Seal
            availableOptions.Add(new CurrencyOption {
                Name        = "Grand Company Seals",
                ItemHashSet = soldForCurrency[(uint)SpecialCurrency.GrandCompany],
                Tag         = "gc",
                SubOptions  = GetGrandCompanyCurrencies()
            });

            soldForCurrency.Add((uint)SpecialCurrency.BeastTribe, new HashSet <uint>()); // Beast Tribe
            availableOptions.Add(new CurrencyOption {
                Name        = "Beast Tribe Currencies",
                ItemHashSet = soldForCurrency[(uint)SpecialCurrency.BeastTribe],
                Tag         = "beasttribe",
                SubOptions  = GetBeastTribeCurrencies()
            });

            availableOptions.Add(GetCurrencyOption(28, "poetics"));
            availableOptions.Add(GetCurrencyOption(40, "allegory"));
            availableOptions.Add(GetCurrencyOption(41, "revelation"));

            Task.Run(() => {
                try {
                    foreach (var gilShopItem in dataManager.Excel.GetSheet <GilShopItem>())
                    {
                        if (!soldForAnything.Contains(gilShopItem.Item.Row))
                        {
                            soldForAnything.Add(gilShopItem.Item.Row);
                        }
                        if (!soldForCurrency[1].Contains(gilShopItem.Item.Row))
                        {
                            soldForCurrency[1].Add(gilShopItem.Item.Row);
                        }
                    }

                    foreach (var gcScripShopItem in dataManager.Excel.GetSheet <GCScripShopItem>())
                    {
                        if (!soldForAnything.Contains(gcScripShopItem.Item.Row))
                        {
                            soldForAnything.Add(gcScripShopItem.Item.Row);
                        }
                        if (!soldForCurrency[(uint)SpecialCurrency.GrandCompany].Contains(gcScripShopItem.Item.Row))
                        {
                            soldForCurrency[(uint)SpecialCurrency.GrandCompany].Add(gcScripShopItem.Item.Row);
                        }

                        var gcScripShopCategory = data.Excel.GetSheet <GCScripShopCategory>().GetRow(gcScripShopItem.RowId);
                        if (gcScripShopCategory == null)
                        {
                            continue;
                        }
                        var grandCompanyID = gcScripShopCategory.GrandCompany.Row;
                        if (grandCompanyID < 1 || grandCompanyID > 3)
                        {
                            continue;
                        }
                        if (!soldForCurrency[19 + grandCompanyID].Contains(gcScripShopItem.Item.Row))
                        {
                            soldForCurrency[19 + grandCompanyID].Add(gcScripShopItem.Item.Row);
                        }
                    }

                    foreach (var specialShop in dataManager.Excel.GetSheet <SpecialShopCustom>())
                    {
                        foreach (var entry in specialShop.Entries)
                        {
                            foreach (var c in entry.Cost)
                            {
                                if (!soldForCurrency.ContainsKey(c.Item.Row))
                                {
                                    continue;
                                }
                                foreach (var r in entry.Result)
                                {
                                    if (!soldForAnything.Contains(r.Item.Row))
                                    {
                                        soldForAnything.Add(r.Item.Row);
                                    }
                                    if (beastTribeCurrencies.Contains(c.Item.Row))
                                    {
                                        if (!soldForCurrency[(uint)SpecialCurrency.BeastTribe].Contains(r.Item.Row))
                                        {
                                            soldForCurrency[(uint)SpecialCurrency.BeastTribe].Add(r.Item.Row);
                                        }
                                    }
                                    if (!soldForCurrency[c.Item.Row].Contains(r.Item.Row))
                                    {
                                        soldForCurrency[c.Item.Row].Add(r.Item.Row);
                                    }
                                }
                            }
                        }
                    }

                    availableOptions.RemoveAll(o => {
                        if (o == null)
                        {
                            return(false);
                        }
                        if (!o.HideIfEmpty)
                        {
                            return(false);
                        }
                        return(o.ItemHashSet.Count == 0);
                    });

                    availableOptions.ForEach(o => {
                        if (o == null)
                        {
                            return;
                        }
                        o.SubOptions.RemoveAll(so => {
                            if (so == null)
                            {
                                return(false);
                            }
                            if (!so.HideIfEmpty)
                            {
                                return(false);
                            }
                            return(so.ItemHashSet.Count == 0);
                        });
                    });

                    ready = true;
                } catch (Exception ex) {
                    error = true;
                    PluginLog.LogError($"{ex}");
                }
            });
        }
コード例 #14
0
 public DyeableSearchFilter(ItemSearchPluginConfig pluginConfig) : base(pluginConfig)
 {
 }
コード例 #15
0
 public CollectableSearchFilter(ItemSearchPluginConfig config, ItemSearchPlugin plugin) : base(config)
 {
     this.plugin = plugin;
 }
コード例 #16
0
 public RaritySearchFilter(ItemSearchPluginConfig config) : base(config)
 {
 }
コード例 #17
0
 public ItemNameSearchFilter(ItemSearchPluginConfig config, ItemSearchWindow window, string startingValue = "") : base(config)
 {
     searchText     = startingValue;
     lastSearchText = string.Empty;
     this.window    = window;
 }