예제 #1
0
        private void DrawLoot()
        {
            // show loot overlay
            var showLootOverlay = _plugin.Configuration.ShowLootOverlay;

            if (ImGui.Checkbox(
                    Loc.Localize("ShowLootOverlay", "Show Loot Overlay") + "###Kapture_ShowLootOverlay_Checkbox",
                    ref showLootOverlay))
            {
                _plugin.Configuration.ShowLootOverlay = showLootOverlay;
                LootOverlayVisibilityUpdated?.Invoke(this, showLootOverlay);
                _plugin.SaveConfig();
            }

            CustomWidgets.HelpMarker(Loc.Localize("ShowLootOverlay_HelpMarker",
                                                  "show loot overlay window"));
            ImGui.Spacing();

            // display mode
            ImGui.Text(Loc.Localize("LootDisplayMode", "Display Mode"));
            CustomWidgets.HelpMarker(Loc.Localize("LootDisplayMode_HelpMarker",
                                                  "when to show loot overlay"));
            ImGui.Spacing();
            var pluginLootDisplayMode = _plugin.Configuration.LootDisplayMode;

            if (ImGui.Combo("###Kapture_LootDisplayMode_Combo", ref pluginLootDisplayMode,
                            DisplayMode.DisplayModeNames.ToArray(),
                            DisplayMode.DisplayModeNames.Count))
            {
                _plugin.Configuration.LootDisplayMode = pluginLootDisplayMode;
                _plugin.SaveConfig();
            }

            ImGui.Spacing();

            // loot name format
            ImGui.Text(Loc.Localize("LootNameFormat", "Name Format"));
            CustomWidgets.HelpMarker(Loc.Localize("LootNameFormat_HelpMarker",
                                                  "how to display player names in the loot overlay"));
            ImGui.Spacing();
            var pluginLootNameFormat = _plugin.Configuration.LootNameFormat;

            if (ImGui.Combo("###Kapture_LootNameFormat_Combo", ref pluginLootNameFormat,
                            NameFormat.NameFormatNames.ToArray(),
                            NameFormat.NameFormatNames.Count))
            {
                _plugin.Configuration.LootNameFormat = pluginLootNameFormat;
                _plugin.SaveConfig();
            }
        }
예제 #2
0
        private void DrawGeneral()
        {
            // plugin enabled
            var enabled = _plugin.Configuration.Enabled;

            if (ImGui.Checkbox(
                    Loc.Localize("PluginEnabled", "Plugin Enabled") + "###Kapture_PluginEnabled_Checkbox",
                    ref enabled))
            {
                _plugin.Configuration.Enabled = enabled;
                _plugin.SaveConfig();
            }

            CustomWidgets.HelpMarker(Loc.Localize("PluginEnabled_HelpMarker",
                                                  "toggle the plugin on/off"));
            ImGui.Spacing();

            // combat
            var restrictInCombat = _plugin.Configuration.RestrictInCombat;

            if (ImGui.Checkbox(
                    Loc.Localize("RestrictInCombat", "Don't process in combat") + "###Kapture_RestrictInCombat_Checkbox",
                    ref restrictInCombat))
            {
                _plugin.Configuration.RestrictInCombat = restrictInCombat;
                _plugin.SaveConfig();
            }

            CustomWidgets.HelpMarker(Loc.Localize("PluginEnabled_HelpMarker",
                                                  "stop processing data while in combat"));
            ImGui.Spacing();

            // language
            ImGui.Text(Loc.Localize("Language", "Language"));
            CustomWidgets.HelpMarker(Loc.Localize("Language_HelpMarker",
                                                  "use default or override plugin ui language"));
            ImGui.Spacing();
            var pluginLanguage = _plugin.Configuration.PluginLanguage;

            if (ImGui.Combo("###Kapture_Language_Combo", ref pluginLanguage,
                            PluginLanguage.LanguageNames.ToArray(),
                            PluginLanguage.LanguageNames.Count))
            {
                _plugin.Configuration.PluginLanguage = pluginLanguage;
                _plugin.SaveConfig();
                _plugin.Localization.SetLanguage(pluginLanguage);
            }
        }
예제 #3
0
        private void RestrictToContent()
        {
            var restrictToContent = _plugin.Configuration.RestrictToContent;

            if (ImGui.Checkbox(
                    Loc.Localize("RestrictToContent", "Content Only") + "###Kapture_RestrictToContent_Checkbox",
                    ref restrictToContent))
            {
                _plugin.Configuration.RestrictToContent = restrictToContent;
                _plugin.SaveConfig();
            }

            CustomWidgets.HelpMarker(Loc.Localize("RestrictToContent_HelpMarker",
                                                  "restrict to instanced content and exclude overworld encounters"));
            ImGui.Spacing();
        }
예제 #4
0
        private void RestrictToHighEndDuty()
        {
            var restrictToHighEndDuty = _plugin.Configuration.RestrictToHighEndDuty;

            if (ImGui.Checkbox(
                    Loc.Localize("RestrictToHighEndDuty", "High-End Duty Only") +
                    "###Kapture_RestrictToHighEndDuty_Checkbox",
                    ref restrictToHighEndDuty))
            {
                _plugin.Configuration.RestrictToHighEndDuty = restrictToHighEndDuty;
                _plugin.SaveConfig();
            }

            CustomWidgets.HelpMarker(Loc.Localize("RestrictToHighEndDuty_HelpMarker",
                                                  "restrict to high-end duties only (e.g. savage)"));
            ImGui.Spacing();
        }
예제 #5
0
        private void DrawLog()
        {
            // logging enabled
            var loggingEnabled = _plugin.Configuration.LoggingEnabled;

            if (ImGui.Checkbox(
                    Loc.Localize("LoggingEnabled", "Enable Loot Logging") +
                    "###Kapture_LoggingEnabled_Checkbox",
                    ref loggingEnabled))
            {
                _plugin.Configuration.LoggingEnabled = loggingEnabled;
                _plugin.SaveConfig();
                if (loggingEnabled)
                {
                    _plugin.LootLogger.SetLogFormat();
                }
            }

            CustomWidgets.HelpMarker(Loc.Localize("LoggingEnabled_HelpMarker",
                                                  "save your loot messages to a file in config (see links)"));
            ImGui.Spacing();

            // log format
            ImGui.Text(Loc.Localize("LogFormat", "Log Format"));
            CustomWidgets.HelpMarker(Loc.Localize("LogFormat_HelpMarker",
                                                  "set format for log file with loot info"));
            ImGui.Spacing();
            var pluginLogFormat = _plugin.Configuration.LogFormat;

            if (ImGui.Combo("###Kapture_LogFormat_Combo", ref pluginLogFormat,
                            LogFormat.LogFormatNames.ToArray(),
                            LogFormat.LogFormatNames.Count))
            {
                _plugin.Configuration.LogFormat = pluginLogFormat;
                _plugin.SaveConfig();
                _plugin.LootLogger.SetLogFormat();
            }
        }
예제 #6
0
        private void DrawItems()
        {
            var offset = 110f * Scale;

            var restrictToCustomItemsList = _plugin.Configuration.RestrictToCustomItems;

            if (ImGui.Checkbox(
                    Loc.Localize("RestrictToCustomItems", "Restrict to Following Items") +
                    "###Kapture_RestrictToCustomItems_Checkbox",
                    ref restrictToCustomItemsList))
            {
                _plugin.Configuration.RestrictToCustomItems = restrictToCustomItemsList;
                _plugin.SaveConfig();
            }

            CustomWidgets.HelpMarker(Loc.Localize("RestrictToCustomItems_HelpMarker",
                                                  "add item to list by using dropdown or remove by clicking on them"));

            ImGui.SameLine();
            if (ImGui.SmallButton(Loc.Localize("Reset", "Reset") + "###Kapture_CustomItemReset_Button"))
            {
                _selectedItemIndex             = 0;
                _selectedItemCategoryItemIndex = 0;
                UpdateItemList();
                _plugin.Configuration.PermittedItems = new List <uint>();
                _plugin.SaveConfig();
            }

            ImGui.Spacing();

            // select category by item ui category
            ImGui.Text(Loc.Localize("SelectCategory", "Select Category"));
            ImGui.SameLine(offset);
            ImGui.SetNextItemWidth(ImGui.GetWindowSize().X / 2 * Scale);
            if (ImGui.Combo("###Kapture_ItemCategoryItems_Combo", ref _selectedItemCategoryItemIndex,
                            _plugin.ItemCategoryNames, _plugin.ItemCategoryIds.Length))
            {
                UpdateItemList();
            }

            // select item based on category
            ImGui.Text(Loc.Localize("SelectItem", "Select Item"));
            ImGui.SameLine(offset);
            ImGui.SetNextItemWidth(ImGui.GetWindowSize().X / 2 * Scale);
            ImGui.Combo("###Kapture_ItemItems_Combo", ref _selectedItemIndex,
                        ItemNames, ItemIds.Length);
            ImGui.SameLine();
            if (ImGui.SmallButton(Loc.Localize("Add", "Add") + "###Kapture_AddItemItem_Button"))
            {
                if (_plugin.Configuration.PermittedItems.Contains(
                        ItemIds[_selectedItemIndex]))
                {
                    ImGui.OpenPopup("###Kapture_DupeCustomItem_Popup");
                }
                else
                {
                    _plugin.Configuration.PermittedItems.Add(
                        ItemIds[_selectedItemIndex]);
                    _plugin.SaveConfig();
                }
            }

            // dupe popup
            if (ImGui.BeginPopup("###Kapture_DupeCustomItem_Popup"))
            {
                ImGui.Text(Loc.Localize("DupeCustomItem", "This item is already added!"));
                ImGui.EndPopup();
            }

            ImGui.Spacing();

            // item list
            ImGui.Text(Loc.Localize("PermittedItems", "Permitted Items"));
            ImGui.SameLine(offset - 5f * Scale);
            ImGui.Indent(offset - 5f * Scale);
            if (_plugin.Configuration.PermittedItems != null &&
                _plugin.Configuration.PermittedItems.Count > 0)
            {
                foreach (var permittedItem in _plugin.Configuration.PermittedItems.ToList())
                {
                    var index = Array.IndexOf(_plugin.ItemIds, permittedItem);
                    ImGui.Text(_plugin.ItemNames[index]);
                    if (ImGui.IsItemClicked())
                    {
                        _plugin.Configuration.PermittedItems.Remove(permittedItem);
                        _plugin.SaveConfig();
                    }
                }
            }
            else
            {
                ImGui.Text(Loc.Localize("NoPermittedItems", "None"));
            }


            ImGui.Spacing();
        }
예제 #7
0
        private void RestrictToCustom()
        {
            var restrictToCustomList = _plugin.Configuration.RestrictToCustomContent;

            if (ImGui.Checkbox(
                    Loc.Localize("RestrictToCustom", "Restrict to Following Content") +
                    "###Kapture_RestrictToCustom_Checkbox",
                    ref restrictToCustomList))
            {
                _plugin.Configuration.RestrictToCustomContent = restrictToCustomList;
                _plugin.SaveConfig();
            }

            CustomWidgets.HelpMarker(Loc.Localize("RestrictToCustom_HelpMarker",
                                                  "add content to list by using dropdown or remove by clicking on them"));
            ImGui.Spacing();

            ImGui.SetNextItemWidth(ImGui.GetWindowSize().X / 2 * Scale);
            ImGui.Combo("###Kapture_Content_Combo", ref _selectedContentIndex,
                        ContentNames, ContentIds.Length);
            ImGui.SameLine();

            if (ImGui.SmallButton(Loc.Localize("Add", "Add") + "###Kapture_ContentAdd_Button"))
            {
                if (_plugin.Configuration.PermittedContent.Contains(
                        ContentIds[_selectedContentIndex]))
                {
                    ImGui.OpenPopup("###Kapture_DupeContent_Popup");
                }
                else
                {
                    _plugin.Configuration.PermittedContent.Add(
                        ContentIds[_selectedContentIndex]);
                    _plugin.SaveConfig();
                }
            }

            ImGui.SameLine();
            if (ImGui.SmallButton(Loc.Localize("Reset", "Reset") + "###Kapture_ContentReset_Button"))
            {
                _selectedContentIndex = 0;
                _plugin.Configuration.PermittedContent = new List <uint>();
                _plugin.SaveConfig();
            }

            if (ImGui.BeginPopup("###Kapture_DupeContent_Popup"))
            {
                ImGui.Text(Loc.Localize("DupeContent", "This content is already added!"));
                ImGui.EndPopup();
            }

            ImGui.Spacing();

            foreach (var permittedContent in _plugin.Configuration.PermittedContent.ToList())
            {
                var index = Array.IndexOf(ContentIds, permittedContent);
                ImGui.Text(ContentNames[index]);
                if (ImGui.IsItemClicked())
                {
                    _plugin.Configuration.PermittedContent.Remove(permittedContent);
                    _plugin.SaveConfig();
                }
            }

            ImGui.Spacing();
        }
예제 #8
0
        private void DrawRolls()
        {
            // show roll overlay
            var showRollOverlay = _plugin.Configuration.ShowRollMonitorOverlay;

            if (ImGui.Checkbox(
                    Loc.Localize("ShowRollOverlay", "Show Roll Monitor Overlay") + "###Kapture_ShowRollOverlay_Checkbox",
                    ref showRollOverlay))
            {
                _plugin.Configuration.ShowRollMonitorOverlay = showRollOverlay;
                RollMonitorOverlayVisibilityUpdated?.Invoke(this, showRollOverlay);
                _plugin.SaveConfig();
            }

            CustomWidgets.HelpMarker(Loc.Localize("ShowRollOverlay_HelpMarker",
                                                  "show roll monitor overlay window"));
            ImGui.Spacing();

            // display mode
            ImGui.Text(Loc.Localize("RollDisplayMode", "Display Mode"));
            CustomWidgets.HelpMarker(Loc.Localize("RollDisplayMode_HelpMarker",
                                                  "when to show roll monitor overlay"));
            ImGui.Spacing();
            var pluginRollDisplayMode = _plugin.Configuration.RollDisplayMode;

            if (ImGui.Combo("###Kapture_RollDisplayMode_Combo", ref pluginRollDisplayMode,
                            DisplayMode.DisplayModeNames.ToArray(),
                            DisplayMode.DisplayModeNames.Count))
            {
                _plugin.Configuration.RollDisplayMode = pluginRollDisplayMode;
                _plugin.SaveConfig();
            }

            ImGui.Spacing();

            // roll name format
            ImGui.Text(Loc.Localize("RollNameFormat", "Name Format"));
            CustomWidgets.HelpMarker(Loc.Localize("RollNameFormat_HelpMarker",
                                                  "how to display player names in the roll monitor overlay"));
            ImGui.Spacing();
            var pluginRollNameFormat = _plugin.Configuration.RollNameFormat;

            if (ImGui.Combo("###Kapture_RollNameFormat_Combo", ref pluginRollNameFormat,
                            NameFormat.NameFormatNames.ToArray(),
                            NameFormat.NameFormatNames.Count))
            {
                _plugin.Configuration.RollNameFormat = pluginRollNameFormat;
                _plugin.SaveConfig();
            }

            ImGui.Spacing();

            // roll timeout
            ImGui.Text(Loc.Localize("RollMonitorAddedTimeout", "Show Added Items (minutes)"));
            CustomWidgets.HelpMarker(Loc.Localize("RollMonitorAddedTimeout_HelpMarker",
                                                  "amount of time before removing added items from roll monitor"));
            var RollMonitorAddedTimeout =
                _plugin.Configuration.RollMonitorAddedTimeout.FromMillisecondsToMinutes();

            if (ImGui.SliderInt("###PlayerTrack_RollMonitorAddedTimeout_Slider", ref RollMonitorAddedTimeout, 5, 60))
            {
                _plugin.Configuration.RollMonitorAddedTimeout =
                    RollMonitorAddedTimeout.FromMinutesToMilliseconds();
                _plugin.SaveConfig();
            }

            ImGui.Spacing();

            // roll timeout
            ImGui.Text(Loc.Localize("RollMonitorObtainedTimeout", "Show Obtained Items (seconds)"));
            CustomWidgets.HelpMarker(Loc.Localize("RollMonitorObtainedTimeout_HelpMarker",
                                                  "amount of time before removing obtained/lost items from roll monitor"));
            var RollMonitorObtainedTimeout =
                _plugin.Configuration.RollMonitorObtainedTimeout.FromMillisecondsToSeconds();

            if (ImGui.SliderInt("###PlayerTrack_RollMonitorObtainedTimeout_Slider", ref RollMonitorObtainedTimeout, 5, 300))
            {
                _plugin.Configuration.RollMonitorObtainedTimeout =
                    RollMonitorObtainedTimeout.FromSecondsToMilliseconds();
                _plugin.SaveConfig();
            }

            ImGui.Spacing();
        }