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(RBText("Filter by Name", "Common"));
            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(RBText("Filter by tooltip", "Common"));
            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(RBText("Crafted"), RBText("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(RBText("Loot"), RBText("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(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("Only unobtained items"));
            }
            else
            {
                UnobtainedRadioButton.SetDisabled();
                UnobtainedRadioButton.SetHoverText(RBText("Install Item Checklist to use", "Common"));
            }

            //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);

            //"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);

            return(mainPanel);
        }
        internal UIElement CreateRecipeCataloguePanel()
        {
            mainPanel = new UIPanel();
            mainPanel.SetPadding(6);
            //			mainPanel.Left.Set(400f, 0f);
            //			mainPanel.Top.Set(400f, 0f);
            //			mainPanel.Width.Set(475f, 0f); // + 30
            //			mainPanel.MinWidth.Set(415f, 0f);
            //			mainPanel.MaxWidth.Set(784f, 0f);
            //			mainPanel.Height.Set(350, 0f);
            //			mainPanel.MinHeight.Set(243, 0f);
            //			mainPanel.MaxHeight.Set(1000, 0f);
            mainPanel.BackgroundColor = color;
            //Append(mainPanel);

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

            queryItem = new UIRecipeCatalogueQueryItemSlot(new Item());
            queryItem.Top.Set(2, 0f);
            queryItem.Left.Set(2, 0f);
            //queryItem.OnItemChanged += () => { Main.NewText("Item changed?"); TileLookupRadioButton.SetDisabled(queryItem.item.createTile <= -1); };
            mainPanel.Append(queryItem);

            TileLookupRadioButton = new UICheckbox(RBText("Tile"), "");
            TileLookupRadioButton.Top.Set(42, 0f);
            TileLookupRadioButton.Left.Set(0, 0f);
            TileLookupRadioButton.SetText("  " + RBText("Tile"));
            TileLookupRadioButton.OnSelectedChanged += (s, e) => { ToggleTileChooser(!mainPanel.HasChild(tileChooserPanel)); updateNeeded = true; };
            mainPanel.Append(TileLookupRadioButton);

            RadioButtonGroup             = new UIRadioButtonGroup();
            RadioButtonGroup.Left.Pixels = 45;
            RadioButtonGroup.Width.Set(180, 0f);
            UIRadioButton AllRecipesRadioButton = new UIRadioButton(RBText("AllRecipes"), "");

            NearbyIngredientsRadioBitton = new UIRadioButton(RBText("NearbyChests"), RBText("ClickToRefresh"));
            ItemChecklistRadioButton     = new UIRadioButton(RBText("ItemChecklistOnly"), "???");
            RadioButtonGroup.Add(AllRecipesRadioButton);
            RadioButtonGroup.Add(NearbyIngredientsRadioBitton);
            RadioButtonGroup.Add(ItemChecklistRadioButton);
            mainPanel.Append(RadioButtonGroup);
            AllRecipesRadioButton.Selected = true;

            NearbyIngredientsRadioBitton.OnSelectedChanged += NearbyIngredientsRadioBitton_OnSelectedChanged;

            if (RecipeBrowser.itemChecklistInstance != null)
            {
                ItemChecklistRadioButton.OnSelectedChanged += ItemChecklistFilter_SelectedChanged;
                ItemChecklistRadioButton.SetHoverText(RBText("OnlyNewItemsMadeFromSeenItems"));
                //ItemChecklistRadioButton.OnRightClick += ItemChecklistRadioButton_OnRightClick;
            }
            else
            {
                ItemChecklistRadioButton.SetDisabled();
                ItemChecklistRadioButton.SetHoverText(RBText("InstallItemChecklistToUse", "Common"));
            }

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

            recipeGridPanel = new UIPanel();
            recipeGridPanel.SetPadding(6);
            recipeGridPanel.Top.Pixels = 60;
            recipeGridPanel.Width.Set(-60, 1f);
            recipeGridPanel.Height.Set(-60 - 121, 1f);
            recipeGridPanel.BackgroundColor = Color.DarkBlue;
            mainPanel.Append(recipeGridPanel);

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

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

            lootItemsScrollbar.SetView(100f, 1000f);
            lootItemsScrollbar.Height.Set(0, 1f);
            lootItemsScrollbar.Left.Set(-20, 1f);
            recipeGridPanel.Append(lootItemsScrollbar);
            recipeGrid.SetScrollbar(lootItemsScrollbar);

            recipeInfo = new UIRecipeInfo();
            recipeInfo.Top.Set(-118, 1f);
            recipeInfo.Width.Set(-50, 1f);
            recipeInfo.Height.Set(120, 0f);
            mainPanel.Append(recipeInfo);

            UIPanel lootSourcePanel = new UIPanel();

            lootSourcePanel.SetPadding(6);
            lootSourcePanel.Top.Pixels = 0;
            lootSourcePanel.Width.Set(50, 0f);
            lootSourcePanel.Left.Set(-50, 1f);
            lootSourcePanel.Height.Set(-16, 1f);
            lootSourcePanel.BackgroundColor = Color.CornflowerBlue;
            mainPanel.Append(lootSourcePanel);

            lootSourceGrid = new UIGrid();
            lootSourceGrid.Width.Set(0, 1f);
            lootSourceGrid.Height.Set(0, 1f);
            lootSourceGrid.ListPadding    = 2f;
            lootSourceGrid.OnScrollWheel += RecipeBrowserUI.OnScrollWheel_FixHotbarScroll;
            lootSourcePanel.Append(lootSourceGrid);

            var lootSourceScrollbar = new InvisibleFixedUIScrollbar(RecipeBrowserUI.instance.userInterface);

            lootSourceScrollbar.SetView(100f, 1000f);
            lootSourceScrollbar.Height.Set(0, 1f);
            lootSourceScrollbar.Left.Set(-20, 1f);
            lootSourcePanel.Append(lootSourceScrollbar);
            lootSourceGrid.SetScrollbar(lootSourceScrollbar);

            // Tile Chooser
            tileChooserPanel = new UIPanel();
            tileChooserPanel.SetPadding(6);
            tileChooserPanel.Top.Pixels = 60;
            tileChooserPanel.Width.Set(50, 0f);
            tileChooserPanel.Height.Set(-60 - 121, 1f);
            tileChooserPanel.BackgroundColor = Color.CornflowerBlue;

            uniqueCheckbox = new UICycleImage(RecipeBrowser.instance.GetTexture("Images/uniqueTile") /* Thanks MiningdiamondsVIII */, 2, new string[] { "Show inherited recipes", "Show unique recipes" }, 36, 20);
            uniqueCheckbox.Top.Set(0, 0f);
            uniqueCheckbox.Left.Set(1, 0f);
            uniqueCheckbox.CurrentState    = 1;
            uniqueCheckbox.OnStateChanged += (s, e) => { updateNeeded = true; };
            tileChooserPanel.Append(uniqueCheckbox);

            tileChooserGrid = new UIGrid();
            tileChooserGrid.Width.Set(0, 1f);
            tileChooserGrid.Height.Set(-24, 1f);
            tileChooserGrid.Top.Set(24, 0f);
            tileChooserGrid.ListPadding    = 2f;
            tileChooserGrid.OnScrollWheel += RecipeBrowserUI.OnScrollWheel_FixHotbarScroll;
            tileChooserPanel.Append(tileChooserGrid);

            var tileChooserScrollbar = new InvisibleFixedUIScrollbar(RecipeBrowserUI.instance.userInterface);

            tileChooserScrollbar.SetView(100f, 1000f);
            tileChooserScrollbar.Height.Set(0, 1f);
            tileChooserScrollbar.Left.Set(-20, 1f);
            tileChooserPanel.Append(tileChooserScrollbar);
            tileChooserGrid.SetScrollbar(tileChooserScrollbar);

            recipeSlots = new List <UIRecipeSlot>();
            tileSlots   = new List <UITileSlot>();

            updateNeeded = true;

            return(mainPanel);
        }
Exemple #3
0
        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);
        }
        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);
        }
Exemple #5
0
        internal UIElement CreateCraftPanel()
        {
            mainPanel = new UIPanel();
            mainPanel.SetPadding(6);
            mainPanel.BackgroundColor = color;

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

            recipeResultItemSlot = new UICraftQueryItemSlot(new Item());
            recipeResultItemSlot.emptyHintText = RBText("EmptyQuerySlotHint");
            // Not used, UICraftQueryItemSlot calls SetItem on click.
            // SetItem -> ReplaceWithFake -> OnItemChanged -> SetItem loop issue.
            //recipeResultItemSlot.OnItemChanged += RecipeResultItemSlot_OnItemChanged;
            mainPanel.Append(recipeResultItemSlot);

            UICheckbox extendedCraft = new UICheckbox(RBText("Calc"), RBText("CalcTooltip"));

            extendedCraft.Top.Set(42, 0f);
            extendedCraft.Left.Set(0, 0f);
            extendedCraft.SetText("  " + RBText("Calc"));
            extendedCraft.Selected           = RecipePath.extendedCraft;
            extendedCraft.OnSelectedChanged += (s, e) =>
            {
                RecipeCatalogueUI.instance.InvalidateExtendedCraft();
                RecipePath.extendedCraft = extendedCraft.Selected;
            };
            mainPanel.Append(extendedCraft);

            int top  = 2;
            int left = 50;

            // Problem: Most bosses don't have banner....
            UICheckbox lootables = new UICheckbox(RBText("Loot"), RBText("LootTooltip"));

            lootables.Top.Set(top, 0f);
            lootables.Left.Set(left, 0f);
            lootables.Selected           = RecipePath.allowLoots;
            lootables.OnSelectedChanged += (s, e) =>
            {
                RecipeCatalogueUI.instance.InvalidateExtendedCraft();
                RecipePath.allowLoots = lootables.Selected;
            };
            mainPanel.Append(lootables);
            left += (int)lootables.MinWidth.Pixels + 6;

            UICheckbox npcShopsCheckbox = new UICheckbox(RBText("Shop"), RBText("ShopTooltip"));

            npcShopsCheckbox.SetDisabled();             // TODO: implement correctly
            npcShopsCheckbox.Top.Set(top, 0f);
            npcShopsCheckbox.Left.Set(left, 0f);
            npcShopsCheckbox.Selected           = RecipePath.allowPurchasable;
            npcShopsCheckbox.OnSelectedChanged += (s, e) =>
            {
                RecipeCatalogueUI.instance.InvalidateExtendedCraft();
                RecipePath.allowPurchasable = npcShopsCheckbox.Selected;
            };
            mainPanel.Append(npcShopsCheckbox);
            left += (int)npcShopsCheckbox.MinWidth.Pixels + 6;

            // Adjacent, Seen, Unseen. This allows Unseen.
            UICheckbox missingStationsCheckbox = new UICheckbox(RBText("MissingStations"), RBText("MissingStationsTooltip"));

            missingStationsCheckbox.Top.Set(top, 0f);
            missingStationsCheckbox.Left.Set(left, 0f);
            missingStationsCheckbox.Selected           = RecipePath.allowMissingStations;
            missingStationsCheckbox.OnSelectedChanged += (s, e) =>
            {
                RecipeCatalogueUI.instance.InvalidateExtendedCraft();
                RecipePath.allowMissingStations = missingStationsCheckbox.Selected;
            };
            mainPanel.Append(missingStationsCheckbox);
            left += (int)missingStationsCheckbox.MinWidth.Pixels + 6;

            // Checkbox for RecipeAvailable?
            // TODO: Handle other invalidations. Button here for forced refresh?

            top += 25;
            left = 50;

            // Option to skip some items? Hotbar? Starred?
            UICheckbox sourceInventoryCheckbox = new UICheckbox(RBText("Inventory"), "");

            sourceInventoryCheckbox.SetDisabled();
            sourceInventoryCheckbox.Top.Set(top, 0f);
            sourceInventoryCheckbox.Left.Set(left, 0f);
            sourceInventoryCheckbox.Selected           = RecipePath.sourceInventory;
            sourceInventoryCheckbox.OnSelectedChanged += (s, e) =>
            {
                RecipeCatalogueUI.instance.InvalidateExtendedCraft();
                RecipePath.sourceInventory = sourceInventoryCheckbox.Selected;
            };
            mainPanel.Append(sourceInventoryCheckbox);
            left += (int)sourceInventoryCheckbox.MinWidth.Pixels + 6;

            UICheckbox sourceBanksCheckbox = new UICheckbox(RBText("Banks"), RBText("BanksTooltip"));

            sourceBanksCheckbox.SetDisabled();
            sourceBanksCheckbox.Top.Set(top, 0f);
            sourceBanksCheckbox.Left.Set(left, 0f);
            sourceBanksCheckbox.Selected           = RecipePath.sourceBanks;
            sourceBanksCheckbox.OnSelectedChanged += (s, e) =>
            {
                RecipeCatalogueUI.instance.InvalidateExtendedCraft();
                RecipePath.sourceBanks = sourceBanksCheckbox.Selected;
            };
            mainPanel.Append(sourceBanksCheckbox);
            left += (int)sourceBanksCheckbox.MinWidth.Pixels + 6;

            UICheckbox sourceChestsCheckbox = new UICheckbox(RBText("Chests"), RBText("ChestsTooltip"));

            sourceChestsCheckbox.SetDisabled();
            sourceChestsCheckbox.Top.Set(top, 0f);
            sourceChestsCheckbox.Left.Set(left, 0f);
            sourceChestsCheckbox.Selected           = RecipePath.sourceChests;
            sourceChestsCheckbox.OnSelectedChanged += (s, e) =>
            {
                RecipeCatalogueUI.instance.InvalidateExtendedCraft();
                RecipePath.sourceChests = sourceChestsCheckbox.Selected;
            };
            mainPanel.Append(sourceChestsCheckbox);
            left += (int)sourceChestsCheckbox.MinWidth.Pixels + 6;

            UICheckbox sourceMagicStorageCheckbox = new UICheckbox(RBText("MagicStorage"), RBText("MagicStorageTooltip"));

            sourceMagicStorageCheckbox.SetDisabled();
            sourceMagicStorageCheckbox.Top.Set(top, 0f);
            sourceMagicStorageCheckbox.Left.Set(left, 0f);
            sourceMagicStorageCheckbox.Selected           = RecipePath.sourceMagicStorage;
            sourceMagicStorageCheckbox.OnSelectedChanged += (s, e) =>
            {
                RecipeCatalogueUI.instance.InvalidateExtendedCraft();
                RecipePath.sourceMagicStorage = sourceMagicStorageCheckbox.Selected;
            };
            mainPanel.Append(sourceMagicStorageCheckbox);
            left += (int)sourceMagicStorageCheckbox.MinWidth.Pixels + 6;

            top += 37;

            craftPanel = new UIPanel();
            craftPanel.SetPadding(6);
            craftPanel.Top.Pixels = top;
            craftPanel.Left.Set(0, 0f);
            craftPanel.Width.Set(0, 1f);
            craftPanel.Height.Set(-top - 16, 1f);
            craftPanel.BackgroundColor = Color.DarkCyan;

            craftPathList = new UIList();
            craftPathList.Width.Set(-24f, 1f);
            craftPathList.Height.Set(0, 1f);
            craftPathList.ListPadding    = 6f;
            craftPathList.OnScrollWheel += RecipeBrowserUI.OnScrollWheel_FixHotbarScroll;
            craftPanel.Append(craftPathList);

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

            craftPathListScrollbar.SetView(100f, 1000f);
            craftPathListScrollbar.Height.Set(0, 1f);
            craftPathListScrollbar.Left.Set(-20, 1f);
            craftPanel.Append(craftPathListScrollbar);
            craftPathList.SetScrollbar(craftPathListScrollbar);
            mainPanel.Append(craftPanel);

            UIText text = new UIText(RBText("BottomInstructions"), 0.85f);

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

            return(mainPanel);
        }
        internal UIElement CreateRecipeCataloguePanel()
        {
            UIPanel mainPanel = new UIPanel();

            mainPanel.SetPadding(6);
            //			mainPanel.Left.Set(400f, 0f);
            //			mainPanel.Top.Set(400f, 0f);
            //			mainPanel.Width.Set(475f, 0f); // + 30
            //			mainPanel.MinWidth.Set(415f, 0f);
            //			mainPanel.MaxWidth.Set(784f, 0f);
            //			mainPanel.Height.Set(350, 0f);
            //			mainPanel.MinHeight.Set(243, 0f);
            //			mainPanel.MaxHeight.Set(1000, 0f);
            mainPanel.BackgroundColor = color;
            //Append(mainPanel);

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

            queryItem = new UIRecipeCatalogueQueryItemSlot(new Item());
            queryItem.Top.Set(2, 0f);
            queryItem.Left.Set(2, 0f);
            queryItem.OnItemChanged += () => { TileLookupRadioButton.SetDisabled(queryItem.item.createTile <= -1); };
            mainPanel.Append(queryItem);

            TileLookupRadioButton = new UICheckbox("Tile", "");
            TileLookupRadioButton.Top.Set(42, 0f);
            TileLookupRadioButton.Left.Set(0, 0f);
            TileLookupRadioButton.SetText("  Tile");
            TileLookupRadioButton.OnSelectedChanged += (s, e) => { updateNeeded = true; };
            TileLookupRadioButton.SetDisabled(true);
            mainPanel.Append(TileLookupRadioButton);

            RadioButtonGroup             = new UIRadioButtonGroup();
            RadioButtonGroup.Left.Pixels = 45;
            RadioButtonGroup.Width.Set(180, 0f);
            UIRadioButton AllRecipesRadioButton = new UIRadioButton("All Recipes", "");

            NearbyIngredientsRadioBitton = new UIRadioButton("Nearby Chests", "Click to Refresh");
            ItemChecklistRadioButton     = new UIRadioButton("Item Checklist Only", "???");
            RadioButtonGroup.Add(AllRecipesRadioButton);
            RadioButtonGroup.Add(NearbyIngredientsRadioBitton);
            RadioButtonGroup.Add(ItemChecklistRadioButton);
            mainPanel.Append(RadioButtonGroup);
            AllRecipesRadioButton.Selected = true;

            NearbyIngredientsRadioBitton.OnSelectedChanged += NearbyIngredientsRadioBitton_OnSelectedChanged;

            if (RecipeBrowser.itemChecklistInstance != null)
            {
                ItemChecklistRadioButton.OnSelectedChanged += ItemChecklistFilter_SelectedChanged;
                ItemChecklistRadioButton.SetHoverText("Only new Items made from Seen Items");
                //ItemChecklistRadioButton.OnRightClick += ItemChecklistRadioButton_OnRightClick;
            }
            else
            {
                ItemChecklistRadioButton.SetDisabled();
                ItemChecklistRadioButton.SetHoverText("Install Item Checklist to use");
            }

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

            recipeGridPanel = new UIPanel();
            recipeGridPanel.SetPadding(6);
            recipeGridPanel.Top.Pixels = 60;
            recipeGridPanel.Width.Set(-60, 1f);
            recipeGridPanel.Height.Set(-60 - 121, 1f);
            recipeGridPanel.BackgroundColor = Color.DarkBlue;
            mainPanel.Append(recipeGridPanel);

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

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

            lootItemsScrollbar.SetView(100f, 1000f);
            lootItemsScrollbar.Height.Set(0, 1f);
            lootItemsScrollbar.Left.Set(-20, 1f);
            recipeGridPanel.Append(lootItemsScrollbar);
            recipeGrid.SetScrollbar(lootItemsScrollbar);

            recipeInfo = new UIRecipeInfo();
            recipeInfo.Top.Set(-118, 1f);
            recipeInfo.Width.Set(-50, 1f);
            recipeInfo.Height.Set(120, 0f);
            mainPanel.Append(recipeInfo);

            UIPanel lootSourcePanel = new UIPanel();

            lootSourcePanel.SetPadding(6);
            lootSourcePanel.Top.Pixels = 0;
            lootSourcePanel.Width.Set(50, 0f);
            lootSourcePanel.Left.Set(-50, 1f);
            lootSourcePanel.Height.Set(-16, 1f);
            lootSourcePanel.BackgroundColor = Color.CornflowerBlue;
            mainPanel.Append(lootSourcePanel);

            lootSourceGrid = new UIGrid();
            lootSourceGrid.Width.Set(0, 1f);
            lootSourceGrid.Height.Set(0, 1f);
            lootSourceGrid.ListPadding = 2f;
            lootSourcePanel.Append(lootSourceGrid);

            var lootSourceScrollbar = new InvisibleFixedUIScrollbar(RecipeBrowserUI.instance.userInterface);

            lootSourceScrollbar.SetView(100f, 1000f);
            lootSourceScrollbar.Height.Set(0, 1f);
            lootSourceScrollbar.Left.Set(-20, 1f);
            lootSourcePanel.Append(lootSourceScrollbar);
            lootSourceGrid.SetScrollbar(lootSourceScrollbar);

            recipeSlots = new List <UIRecipeSlot>();

            updateNeeded = true;

            return(mainPanel);
        }
Exemple #7
0
        internal UIElement CreateHelpPanel()
        {
            mainPanel = new HelpUIPanel();
            mainPanel.SetPadding(6);
            mainPanel.BackgroundColor = color;

            mainPanel.Top.Set(20, 0f);
            mainPanel.Height.Set(-20, 1f);
            mainPanel.Width.Set(0, 1f);
            //mainPanel.OverflowHidden = true;

            //UIText text = new UIText("Help will be here.", 0.85f);
            //text.Top.Set(4, 0f);
            //text.HAlign = 0.5f;
            //mainPanel.Append(text);

            // UIList of expandable subheadings? possible with TextSnippet?
            //[image:Terraria/UI/ButtonCloudActive]

            StringBuilder sb = new StringBuilder();

            string headingColor = Color.CornflowerBlue.Hex3();

            // Overhaul warning
            if (Terraria.ModLoader.ModLoader.GetMod("TerrariaOverhaul") != null)
            {
                sb.Append($"[c/{headingColor}:Jumbled Text?]\n    If the text below looks wrong, you'll need to disable Terraria Overhaul to fix it.\n\n");
            }
            // Recipes
            sb.Append($"[c/{headingColor}:Recipes]\n    Place items in the query slot to find recipes using or resulting in that item. You can also search and filter with the various options in the window. The Nearby Chests option filters the recipes to show only recipes that you have at least 1 of each ingredient. The [c/{Color.Goldenrod.Hex3()}:Item Checklist Only] option limits the recipes to only show recipes that result in an item you have never seen using items you have seen. The Tile checkbox brings up a list of crafting stations sorted by most often required. Clicking on a tile limits recipes to recipes using that crafting station. The [image:RecipeBrowser/Images/Help/uniqueTile] Show Unique Recipes option toggles showing inherited recipes. For example, Hellforge inherits all of the Forge recipes, but has the unique Hellstone Bar recipes. Crafting stations for a selected recipe are listed at the bottom. The color will be red or green showing if the player is near one or not. The right side will show any NPC that drops the selected item. Double Click on an NPC to visit the Bestiary. Double Clicking on a Recipe or Ingredient will populate the query slot with the item, great for traversing crafting trees for items with multiple levels of crafting. Alt-click on a recipe to favorite a recipe, see Favorite section below.\n");
            // Craft
            sb.Append($"[c/{headingColor}:Craft]\n    This tool can be used to craft recipes. In the Recipes tool, right click on any recipe to bring up this tool. Recipes with the [image/s0.5:RecipeBrowser/Images/CanCraftExtendedBackground] background can be crafted via multiple steps. You can also left click on items in the Items tool and then visit this tool. This tool shows extended crafting options. For example, if you have gold and iron ore and click on the Gold Watch recipe, this tool will show you the multiple steps needed to craft gold and iron ore, followed by crafting chains, and finally the gold watch itself. You can also enable the Loot option to allow farming as part of the multi-step process. Simply find and kill the specified enemies to farm the needed ingredient. By default, all crafting stations that you have seen will be available for the extended crafting paths. If you enable the Missing Stations option, unseen crafting stations will also be shown. [c/{Utilities.yesColor.Hex3()}:✓], [c/{Utilities.maybeColor.Hex3()}:X], and [c/{Utilities.noColor.Hex3()}:?] icons over the tiles indicate if you are near the crafting station, not near it, or have never seen the station. Use the [image/s0.7:RecipeBrowser/Images/Help/CraftIcon] button to craft individual steps. By default the Recipes tool won't automatically calculate multiple step crafting unless the Calc checkbox is checked. You can also use the Extended Craftable filter to quickly view all extended crafting options. Note that you may experience some lag with this feature.\n");
            // Items
            sb.Append($"[c/{headingColor}:Items]\n    Here you can explore all items in the game. Use the filters and sorts to find what you want. Double click an item to query it in the Recipe panel. Double right click an item to query the item in the Bestiary. The Unobtained option shows only items not collected yet with [c/{Color.Goldenrod.Hex3()}:Item Checklist].\n");
            // Bestiary
            sb.Append($"[c/{headingColor}:Bestiary]\n    Here you can explore all NPC in the game. Use the filters and sorts to find what you want. Clicking on an NPC shows the loot from that NPC. Placing an item in the query slot filters the grid to show only NPC that drop that item. Double click an item to query it in the Recipe panel. Right click an item to populate the query slot, great for seeing who else drops the same item. The New Loot ([c/{Color.Goldenrod.Hex3()}:Item Checklist only]) option shows only NPC with items not collected yet, great for knowing which NPC are still hiding valuable loot.\n");
            // Borders
            sb.Append($"[c/{headingColor}:Borders]\n    Sometimes items will display with different borders, here is what they mean:\n[image/s0.5:RecipeBrowser/Images/FavoritedOverlay] This Recipe is Favorited, read Favorite section below.\n[image/s0.5:RecipeBrowser/Images/SelectedOverlay] This Recipe/Item/NPC is Selected. Information shown relates to this thing.\n[image/s0.5:RecipeBrowser/Images/CanCraftBackground] This Recipe can currently be crafted. Click on it to open the crafting menu directly.\n[image/s0.5:RecipeBrowser/Images/CanCraftExtendedBackground] This Recipe can currently be crafted via multiple steps. Right Click on it to open the Craft tool to view crafting options.\n[image/s0.5:RecipeBrowser/Images/Help/Inventory_Back8] [c/{Color.Goldenrod.Hex3()}:Item Checklist integration:] These items use the most recent new item you have collected.\n");
            // TODO ItemCatelog Badges
            // TODO Delete RecipeBrowser/Images/Help/Inventory_Back8 and 2 after 0.10.1.6 fix
            // Favorite
            sb.Append($"[c/{headingColor}:Favorite]\n    In the Recipe panel, you can favorite recipes by alt-clicking on the recipe. If you have favorited recipes, the favorites panel will appear on screen. This panel will help you track progress towards collecting all ingredients. In multiplayer, recipes favorited by other players will also appear in the favorites panel. You can track the progress of other players and cooperate efficiently. Item counts shown correspond to the player who favorited the recipe.\n[image:RecipeBrowser/Images/Help/mpFavorited]\n");
            // Query Hovered Item
            sb.Append($"[c/{headingColor}:Query Hovered Item]\n By assigning a hotkey in the keybindings menu, you can use this feature to quickly bring the item into one of the tools. You can use anytime you are hovering over any item anywhere in the game. Depending on the last panel you were on, the behavior changes. The Recipe tool will populate the query slot, the Craft tool will display options to craft the item, the Item tool will scroll and select the item, and the Bestiary tool will populate the loot query slot.\n");
            // Categories, Sub Categories, Sorts, and Filters
            sb.Append($"[c/{headingColor}:Categories, Sub Categories, Sorts, and Filters]\n    The Recipe and Item panels both have many ways to filter and sort items and recipes. You can type to search tooltips and item names and use the [image:RecipeBrowser/Images/filterMod] button to filter by source mod. You can also click on Categories such as [image:RecipeBrowser/Images/Help/Item_2430] and [image:RecipeBrowser/Images/Help/Item_54] to filter by category. Some Categories have Sub-Categories. You'll also notice on the 2nd row various Sorts such as [image:RecipeBrowser/Images/sortValue] and [image:RecipeBrowser/Images/sortAZ]. There are also Filters like [image:RecipeBrowser/Images/Help/Item_531]. Many Sorts and Filters are visible only within specific Categories. Some Filters, like the Ammo Filter, will cycle through many options. For these Filters, use left and right click to go forward and back, and middle click to clear the Filter.\n[image:RecipeBrowser/Images/Help/sortsExplanation]\n");
            // Item Checklist Integration
            sb.Append($"[c/{headingColor}:Item Checklist Integration]\n    By using the Item Checklist mod at the same time, you can narrow down your browsing to new items you've never obtained before from items you've collected so far. This helps you focus on items at the current stage of your game. Item Checklist also affects the Items and Bestiary tools. [l/www.gfycat.com/insidiousblandgoitered:Item Checklist video].");

            message = new UIMessageBox(sb.ToString());

            //message = new UIMessageBox($"[i:{ItemID.Safe}][i:{ItemID.Safe}][i:{ItemID.Safe}][i:{ItemID.Safe}] [i:{ItemID.Safe}][i:{ItemID.Safe}] [i:{ItemID.Safe}][i:{ItemID.Safe}] [i:{ItemID.Safe}][i:{ItemID.Safe}][i:{ItemID.Safe}] [i:{ItemID.Safe}]. [i:{ItemID.Safe}][i:{ItemID.Safe}][i:{ItemID.Safe}][i:{ItemID.Safe}] [i:{ItemID.Safe}][i:{ItemID.Safe}] [i:{ItemID.Safe}][i:{ItemID.Safe}] [i:{ItemID.Safe}][i:{ItemID.Safe}][i:{ItemID.Safe}] [i:{ItemID.Safe}] [i:{ItemID.Safe}][i:{ItemID.Safe}][i:{ItemID.Safe}][i:{ItemID.Safe}] [i:{ItemID.Safe}][i:{ItemID.Safe}] [i:{ItemID.Safe}][i:{ItemID.Safe}] [i:{ItemID.Safe}][i:{ItemID.Safe}][i:{ItemID.Safe}] [i:{ItemID.Safe}] Wow.");
            //message = new UIMessageBox($"Just Text word word rap wrap rappdfhdhdfgfdhhghgddafadsfsdfdsfararpfghffhfgh par parr Just Text word word rap wrap rapp ararp par parrJust Text word word rap wrap rapp ararp par parr Just Text word word rap wrap rapp ararp par parr");
            //message = new UIMessageBox($"s a s d f f f f f f f f f f f f f f f f f f f f f f f f f f f a f a d s f s df  d s f a rarp a parr Just Text word word rap wrap rapp ararp par parrJust Text word word rap wrap rapp ararp par parr Just Text word word rap wrap rapp ararp par parr");

            // text: 28. newlines too. mult newlines ignored? ==> mess up "no carrige return.
            message.Width.Set(-25f, 1f);
            message.Height.Set(0f, 1f);
            //message.Top.Set(20f, 0f);
            mainPanel.Append(message);

            FixedUIScrollbar uIScrollbar = new FixedUIScrollbar(RecipeBrowserUI.instance.userInterface);

            uIScrollbar.SetView(100f, 1000f);
            //uIScrollbar.Top.Set(25f, 0f);
            uIScrollbar.Top.Set(5f, 0f);
            uIScrollbar.Height.Set(-30, 1f);
            //uIScrollbar.VAlign = 0.5f;
            uIScrollbar.HAlign = 1f;
            mainPanel.Append(uIScrollbar);

            message.SetScrollbar(uIScrollbar);

            return(mainPanel);
        }