internal UIElement CreateItemCataloguePanel()
        {
            mainPanel = new ItemCatalogueUIPanel();
            mainPanel.SetPadding(6);
            mainPanel.BackgroundColor = color;

            mainPanel.Top.Set(20, 0f);
            mainPanel.Height.Set(-20, 1f);
            mainPanel.Width.Set(0, 1f);

            /*var inlaidPanel = new UIPanel();
             * inlaidPanel.SetPadding(6);
             * inlaidPanel.Width.Set(0, .8f);
             * inlaidPanel.Height.Set(65, 0f);
             * inlaidPanel.HAlign = 0.5f;
             * inlaidPanel.VAlign = 0.5f;
             * inlaidPanel.BackgroundColor = Color.DarkBlue;
             * mainPanel.Append(inlaidPanel);
             *
             * var text = new UIText("Coming Soon", 1.8f);
             * text.HAlign = 0.5f;
             * text.VAlign = 0.5f;
             * inlaidPanel.Append(text);*/

            itemNameFilter = new NewUITextBox(RBText("FilterByName", "Common"));
            itemNameFilter.OnTextChanged += () => { ValidateItemFilter(); updateNeeded = true; };
            itemNameFilter.OnTabPressed  += () => { itemDescriptionFilter.Focus(); };
            itemNameFilter.Top.Pixels     = 0f;
            itemNameFilter.Left.Set(-150, 1f);
            itemNameFilter.Width.Set(150, 0f);
            itemNameFilter.Height.Set(25, 0f);
            mainPanel.Append(itemNameFilter);

            itemDescriptionFilter = new NewUITextBox(RBText("FilterByTooltip", "Common"));
            itemDescriptionFilter.OnTextChanged += () => { ValidateItemDescription(); updateNeeded = true; };
            itemDescriptionFilter.OnTabPressed  += () => { itemNameFilter.Focus(); };
            itemDescriptionFilter.Top.Pixels     = 30f;
            itemDescriptionFilter.Left.Set(-150, 1f);
            itemDescriptionFilter.Width.Set(150, 0f);
            itemDescriptionFilter.Height.Set(25, 0f);
            mainPanel.Append(itemDescriptionFilter);

            CraftedRadioButton = new UICheckbox(RBText("Crafted"), RBText("OnlyShowCraftedItems"));
            CraftedRadioButton.Top.Set(0, 0f);
            CraftedRadioButton.Left.Set(-270, 1f);
            CraftedRadioButton.OnSelectedChanged += (a, b) => updateNeeded = true;
            mainPanel.Append(CraftedRadioButton);

            LootRadioButton = new UICheckbox(RBText("Loot"), RBText("ShowOnlyLootItems"));
            LootRadioButton.Top.Set(20, 0f);
            LootRadioButton.Left.Set(-270, 1f);
            LootRadioButton.OnSelectedChanged += (a, b) => updateNeeded = true;
            mainPanel.Append(LootRadioButton);

            UnobtainedRadioButton = new UICheckbox(RBText("Unobtained"), "???");
            UnobtainedRadioButton.Top.Set(40, 0f);
            UnobtainedRadioButton.Left.Set(-270, 1f);
            UnobtainedRadioButton.OnSelectedChanged += (a, b) => { updateNeeded = true; /*HasLootRadioButton.Selected = true;*/ };
            mainPanel.Append(UnobtainedRadioButton);

            if (RecipeBrowser.itemChecklistInstance != null)
            {
                UnobtainedRadioButton.OnSelectedChanged += UnobtainedRadioButton_OnSelectedChanged;
                UnobtainedRadioButton.SetHoverText(RBText("OnlyUnobtainedItems"));
            }
            else
            {
                UnobtainedRadioButton.SetDisabled();
                UnobtainedRadioButton.SetHoverText(RBText("InstallItemChecklistToUse", "Common"));
            }

            //updateNeeded = true;

            itemGridPanel = new UIPanel();
            itemGridPanel.SetPadding(6);
            itemGridPanel.Top.Pixels = 60;
            itemGridPanel.Width.Set(0, 1f);
            itemGridPanel.Left.Set(0, 0f);
            itemGridPanel.Height.Set(-76, 1f);
            itemGridPanel.BackgroundColor = Color.CornflowerBlue;
            mainPanel.Append(itemGridPanel);

            itemGrid = new UIGrid();
            itemGrid.alternateSort = ItemGridSort;
            itemGrid.Width.Set(-20, 1f);
            itemGrid.Height.Set(0, 1f);
            itemGrid.ListPadding    = 2f;
            itemGrid.OnScrollWheel += RecipeBrowserUI.OnScrollWheel_FixHotbarScroll;
            itemGridPanel.Append(itemGrid);

            var itemGridScrollbar = new FixedUIScrollbar(RecipeBrowserUI.instance.userInterface);

            itemGridScrollbar.SetView(100f, 1000f);
            itemGridScrollbar.Height.Set(0, 1f);
            itemGridScrollbar.Left.Set(-20, 1f);
            itemGridPanel.Append(itemGridScrollbar);
            itemGrid.SetScrollbar(itemGridScrollbar);

            //"2x LMB: View Recipes  ---  2x RMB: See dropping NPCs"
            UIText text = new UIText(RBText("BottomInstructions"), 0.85f);

            text.Top.Set(-14, 1f);
            text.HAlign = 0.5f;
            mainPanel.Append(text);
            additionalDragTargets.Add(text);

            additionalDragTargets.Add(SharedUI.instance.sortsAndFiltersPanel);

            return(mainPanel);
        }
        internal UIElement CreateBestiaryPanel()
        {
            mainPanel = new UIPanel();
            mainPanel.SetPadding(6);
            mainPanel.BackgroundColor = color;

            mainPanel.Top.Set(20, 0f);
            mainPanel.Height.Set(-20, 1f);
            mainPanel.Width.Set(0, 1f);

            UIPanel npcGridPanel = new UIPanel();

            npcGridPanel.SetPadding(6);
            npcGridPanel.Top.Pixels = 46;
            npcGridPanel.Width.Set(0, 1f);
            npcGridPanel.Left.Set(0, 0f);
            npcGridPanel.Height.Set(-52 - 46, 1f);
            npcGridPanel.BackgroundColor = Color.CornflowerBlue;
            mainPanel.Append(npcGridPanel);

            npcGrid = new UIGrid();
            npcGrid.Width.Set(-20, 1f);
            npcGrid.Height.Set(0, 1f);
            npcGrid.ListPadding    = 2f;
            npcGrid.OnScrollWheel += RecipeBrowserUI.OnScrollWheel_FixHotbarScroll;
            npcGridPanel.Append(npcGrid);

            var npcGridScrollbar = new FixedUIScrollbar(RecipeBrowserUI.instance.userInterface);

            npcGridScrollbar.SetView(100f, 1000f);
            npcGridScrollbar.Height.Set(0, 1f);
            npcGridScrollbar.Left.Set(-20, 1f);
            npcGridPanel.Append(npcGridScrollbar);
            npcGrid.SetScrollbar(npcGridScrollbar);

            UIPanel lootPanel = new UIPanel();

            lootPanel.SetPadding(6);
            lootPanel.Top.Set(-50, 1f);
            lootPanel.Width.Set(0, .5f);
            lootPanel.Height.Set(50, 0f);
            lootPanel.BackgroundColor = Color.CornflowerBlue;
            mainPanel.Append(lootPanel);

            lootGrid = new UIHorizontalGrid();
            lootGrid.Width.Set(0, 1f);
            lootGrid.Height.Set(0, 1f);
            lootGrid.ListPadding    = 2f;
            lootGrid.OnScrollWheel += RecipeBrowserUI.OnScrollWheel_FixHotbarScroll;
            lootPanel.Append(lootGrid);

            var lootGridScrollbar = new InvisibleFixedUIHorizontalScrollbar(RecipeBrowserUI.instance.userInterface);

            lootGridScrollbar.SetView(100f, 1000f);
            lootGridScrollbar.Width.Set(0, 1f);
            lootGridScrollbar.Top.Set(-20, 1f);
            lootPanel.Append(lootGridScrollbar);
            lootGrid.SetScrollbar(lootGridScrollbar);

            queryItem = new UIBestiaryQueryItemSlot(new Item());
            queryItem.emptyHintText = RBText("EmptyQuerySlotHint");
            mainPanel.Append(queryItem);

            npcNameFilter = new NewUITextBox(RBText("FilterByName", "Common"));
            npcNameFilter.OnTextChanged += () => { ValidateNPCFilter(); updateNeeded = true; };
            npcNameFilter.Top.Set(0, 0f);
            npcNameFilter.Left.Set(-150, 1f);
            npcNameFilter.Width.Set(150, 0f);
            npcNameFilter.Height.Set(25, 0f);
            mainPanel.Append(npcNameFilter);

            EncounteredRadioButton = new UICheckbox(RBText("Encountered"), RBText("ShowOnlyNPCKilledAlready"));
            EncounteredRadioButton.Top.Set(-40, 1f);
            EncounteredRadioButton.Left.Set(6, .5f);
            EncounteredRadioButton.OnSelectedChanged += (a, b) => updateNeeded = true;
            mainPanel.Append(EncounteredRadioButton);

            HasLootRadioButton = new UICheckbox(RBText("HasLoot"), RBText("ShowOnlyNPCWithLoot"));
            HasLootRadioButton.Top.Set(-20, 1f);
            HasLootRadioButton.Left.Set(6, .5f);
            HasLootRadioButton.OnSelectedChanged += (a, b) => updateNeeded = true;
            mainPanel.Append(HasLootRadioButton);

            NewLootOnlyRadioButton = new UICheckbox(RBText("NewLoot"), "???");
            NewLootOnlyRadioButton.Top.Set(-20, 1f);
            NewLootOnlyRadioButton.Left.Set(110, .5f);
            NewLootOnlyRadioButton.OnSelectedChanged += (a, b) => { updateNeeded = true; /*HasLootRadioButton.Selected = true;*/ };
            mainPanel.Append(NewLootOnlyRadioButton);

            if (RecipeBrowser.itemChecklistInstance != null)
            {
                NewLootOnlyRadioButton.OnSelectedChanged += ItemChecklistNewLootOnlyFilter_SelectedChanged;
                NewLootOnlyRadioButton.SetHoverText(RBText("ShowOnlyNPCWithNeverBeforeSeenLoot"));
            }
            else
            {
                NewLootOnlyRadioButton.SetDisabled();
                NewLootOnlyRadioButton.SetHoverText(RBText("InstallItemChecklistToUse", "Common"));
            }

            updateNeeded = true;

            return(mainPanel);
        }
Beispiel #3
0
        internal UIElement CreateItemCataloguePanel()
        {
            mainPanel = new UIPanel();
            mainPanel.SetPadding(6);
            mainPanel.BackgroundColor = color;

            mainPanel.Top.Set(20, 0f);
            mainPanel.Height.Set(-20, 1f);
            mainPanel.Width.Set(0, 1f);

            /*var inlaidPanel = new UIPanel();
             * inlaidPanel.SetPadding(6);
             * inlaidPanel.Width.Set(0, .8f);
             * inlaidPanel.Height.Set(65, 0f);
             * inlaidPanel.HAlign = 0.5f;
             * inlaidPanel.VAlign = 0.5f;
             * inlaidPanel.BackgroundColor = Color.DarkBlue;
             * mainPanel.Append(inlaidPanel);
             *
             * var text = new UIText("Coming Soon", 1.8f);
             * text.HAlign = 0.5f;
             * text.VAlign = 0.5f;
             * inlaidPanel.Append(text);*/

            itemNameFilter = new NewUITextBox("Filter by Name");
            itemNameFilter.OnTextChanged += () => { ValidateItemFilter(); updateNeeded = true; };
            itemNameFilter.OnTabPressed  += () => { itemDescriptionFilter.Focus(); };
            itemNameFilter.Top.Pixels     = 0f;
            itemNameFilter.Left.Set(-152, 1f);
            itemNameFilter.Width.Set(150, 0f);
            itemNameFilter.Height.Set(25, 0f);
            mainPanel.Append(itemNameFilter);

            itemDescriptionFilter = new NewUITextBox("Filter by tooltip");
            itemDescriptionFilter.OnTextChanged += () => { ValidateItemDescription(); updateNeeded = true; };
            itemDescriptionFilter.OnTabPressed  += () => { itemNameFilter.Focus(); };
            itemDescriptionFilter.Top.Pixels     = 30f;
            itemDescriptionFilter.Left.Set(-152, 1f);
            itemDescriptionFilter.Width.Set(150, 0f);
            itemDescriptionFilter.Height.Set(25, 0f);
            mainPanel.Append(itemDescriptionFilter);

            // Sorts
            // Filters: Categories?
            // Craft and Loot Badges as well!
            // Hide with alt click?
            // show hidden toggle
            // Favorite: Only affects sort order?

            CraftedRadioButton = new UICheckbox("Crafted", "Only show crafted items");
            CraftedRadioButton.Top.Set(0, 0f);
            CraftedRadioButton.Left.Set(-270, 1f);
            CraftedRadioButton.OnSelectedChanged += (a, b) => updateNeeded = true;
            mainPanel.Append(CraftedRadioButton);

            LootRadioButton = new UICheckbox("Loot", "Show only loot items");
            LootRadioButton.Top.Set(20, 0f);
            LootRadioButton.Left.Set(-270, 1f);
            LootRadioButton.OnSelectedChanged += (a, b) => updateNeeded = true;
            mainPanel.Append(LootRadioButton);

            UnobtainedRadioButton = new UICheckbox("Unobtained", "???");
            UnobtainedRadioButton.Top.Set(40, 0f);
            UnobtainedRadioButton.Left.Set(-270, 1f);
            UnobtainedRadioButton.OnSelectedChanged += (a, b) => { updateNeeded = true; /*HasLootRadioButton.Selected = true;*/ };
            mainPanel.Append(UnobtainedRadioButton);

            if (RecipeBrowser.itemChecklistInstance != null)
            {
                UnobtainedRadioButton.OnSelectedChanged += UnobtainedRadioButton_OnSelectedChanged;
                UnobtainedRadioButton.SetHoverText("Only unobtained items");
            }
            else
            {
                UnobtainedRadioButton.SetDisabled();
                UnobtainedRadioButton.SetHoverText("Install Item Checklist to use");
            }

            //updateNeeded = true;

            UIPanel itemGridPanel = new UIPanel();

            itemGridPanel.SetPadding(6);
            itemGridPanel.Top.Pixels = 60;
            itemGridPanel.Width.Set(0, 1f);
            itemGridPanel.Left.Set(0, 0f);
            itemGridPanel.Height.Set(-76, 1f);
            itemGridPanel.BackgroundColor = Color.CornflowerBlue;
            mainPanel.Append(itemGridPanel);

            itemGrid = new UIGrid();
            itemGrid.Width.Set(-20, 1f);
            itemGrid.Height.Set(0, 1f);
            itemGrid.ListPadding = 2f;
            itemGridPanel.Append(itemGrid);

            var itemGridScrollbar = new FixedUIScrollbar(RecipeBrowserUI.instance.userInterface);

            itemGridScrollbar.SetView(100f, 1000f);
            itemGridScrollbar.Height.Set(0, 1f);
            itemGridScrollbar.Left.Set(-20, 1f);
            itemGridPanel.Append(itemGridScrollbar);
            itemGrid.SetScrollbar(itemGridScrollbar);

            UIText text = new UIText("2x LMB: View Recipes  ---  2x RMB: See dropping NPCs", 0.85f);

            text.Top.Set(-14, 1f);
            text.HAlign = 0.5f;
            mainPanel.Append(text);
            additionalDragTargets.Add(text);

            return(mainPanel);
        }