Example #1
0
        private void AddSortAndFilterButtons(
            UIElement innerTopContainer,
            UIBestiaryEntryInfoPage infoSpace)
        {
            int           num            = 17;
            UIImageButton uiImageButton1 = new UIImageButton((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Filtering", (AssetRequestMode)1));

            uiImageButton1.Left   = new StyleDimension(-infoSpace.Width.Pixels - (float)num, 0.0f);
            uiImageButton1.HAlign = 1f;
            UIImageButton uiImageButton2 = uiImageButton1;

            uiImageButton2.SetHoverImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Wide_Border", (AssetRequestMode)1));
            uiImageButton2.SetVisibility(1f, 1f);
            uiImageButton2.SetSnapPoint("FilterButton", 0, new Vector2?(), new Vector2?());
            uiImageButton2.OnClick += new UIElement.MouseEvent(this.OpenOrCloseFilteringGrid);
            innerTopContainer.Append((UIElement)uiImageButton2);
            UIText uiText1 = new UIText("", 0.8f, false);

            uiText1.Left        = new StyleDimension(34f, 0.0f);
            uiText1.Top         = new StyleDimension(2f, 0.0f);
            uiText1.VAlign      = 0.5f;
            uiText1.TextOriginX = 0.0f;
            UIText uiText2 = uiText1;

            uiImageButton2.Append((UIElement)uiText2);
            this._filteringText = uiText2;
            UIImageButton uiImageButton3 = new UIImageButton((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Sorting", (AssetRequestMode)1));

            uiImageButton3.Left   = new StyleDimension((float)(-(double)infoSpace.Width.Pixels - (double)uiImageButton2.Width.Pixels - 3.0) - (float)num, 0.0f);
            uiImageButton3.HAlign = 1f;
            UIImageButton uiImageButton4 = uiImageButton3;

            uiImageButton4.SetHoverImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Wide_Border", (AssetRequestMode)1));
            uiImageButton4.SetVisibility(1f, 1f);
            uiImageButton4.SetSnapPoint("SortButton", 0, new Vector2?(), new Vector2?());
            uiImageButton4.OnClick += new UIElement.MouseEvent(this.OpenOrCloseSortingOptions);
            innerTopContainer.Append((UIElement)uiImageButton4);
            UIText uiText3 = new UIText("", 0.8f, false);

            uiText3.Left        = new StyleDimension(34f, 0.0f);
            uiText3.Top         = new StyleDimension(2f, 0.0f);
            uiText3.VAlign      = 0.5f;
            uiText3.TextOriginX = 0.0f;
            UIText uiText4 = uiText3;

            uiImageButton4.Append((UIElement)uiText4);
            this._sortingText = uiText4;
        }
Example #2
0
        private void AddSortAndFilterButtons(UIElement innerTopContainer, UIBestiaryEntryInfoPage infoSpace)
        {
            int           num           = 17;
            UIImageButton uIImageButton = new UIImageButton(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Filtering", Main.content, (AssetRequestMode)1))
            {
                Left   = new StyleDimension(0f - infoSpace.Width.Pixels - (float)num, 0f),
                HAlign = 1f
            };

            uIImageButton.SetHoverImage(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Wide_Border", Main.content, (AssetRequestMode)1));
            uIImageButton.SetVisibility(1f, 1f);
            uIImageButton.SetSnapPoint("FilterButton", 0);
            uIImageButton.OnClick += OpenOrCloseFilteringGrid;
            innerTopContainer.Append(uIImageButton);
            UIText uIText = new UIText("", 0.8f)
            {
                Left        = new StyleDimension(34f, 0f),
                Top         = new StyleDimension(2f, 0f),
                VAlign      = 0.5f,
                TextOriginX = 0f
            };

            uIImageButton.Append(uIText);
            _filteringText = uIText;
            UIImageButton uIImageButton2 = new UIImageButton(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Sorting", Main.content, (AssetRequestMode)1))
            {
                Left   = new StyleDimension(0f - infoSpace.Width.Pixels - uIImageButton.Width.Pixels - 3f - (float)num, 0f),
                HAlign = 1f
            };

            uIImageButton2.SetHoverImage(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Wide_Border", Main.content, (AssetRequestMode)1));
            uIImageButton2.SetVisibility(1f, 1f);
            uIImageButton2.SetSnapPoint("SortButton", 0);
            uIImageButton2.OnClick += OpenOrCloseSortingOptions;
            innerTopContainer.Append(uIImageButton2);
            UIText uIText2 = new UIText("", 0.8f)
            {
                Left        = new StyleDimension(34f, 0f),
                Top         = new StyleDimension(2f, 0f),
                VAlign      = 0.5f,
                TextOriginX = 0f
            };

            uIImageButton2.Append(uIText2);
            _sortingText = uIText2;
        }
Example #3
0
        private void AddSearchBar(UIElement innerTopContainer, UIBestiaryEntryInfoPage infoSpace)
        {
            UIImageButton uiImageButton1 = new UIImageButton((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Search", (AssetRequestMode)1));

            uiImageButton1.Left   = new StyleDimension(-infoSpace.Width.Pixels, 1f);
            uiImageButton1.VAlign = 0.5f;
            UIImageButton uiImageButton2 = uiImageButton1;

            uiImageButton2.OnClick += new UIElement.MouseEvent(this.Click_SearchArea);
            uiImageButton2.SetHoverImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Search_Border", (AssetRequestMode)1));
            uiImageButton2.SetVisibility(1f, 1f);
            uiImageButton2.SetSnapPoint("SearchButton", 0, new Vector2?(), new Vector2?());
            innerTopContainer.Append((UIElement)uiImageButton2);
            UIPanel uiPanel1 = new UIPanel();

            uiPanel1.Left   = new StyleDimension((float)(-(double)infoSpace.Width.Pixels + (double)uiImageButton2.Width.Pixels + 3.0), 1f);
            uiPanel1.Width  = new StyleDimension((float)((double)infoSpace.Width.Pixels - (double)uiImageButton2.Width.Pixels - 3.0), 0.0f);
            uiPanel1.Height = new StyleDimension(0.0f, 1f);
            uiPanel1.VAlign = 0.5f;
            UIPanel uiPanel2 = uiPanel1;

            this._searchBoxPanel     = uiPanel2;
            uiPanel2.BackgroundColor = new Color(35, 40, 83);
            uiPanel2.BorderColor     = new Color(35, 40, 83);
            uiPanel2.SetPadding(0.0f);
            innerTopContainer.Append((UIElement)uiPanel2);
            UISearchBar uiSearchBar1 = new UISearchBar(Language.GetText("UI.PlayerNameSlot"), 0.8f);

            uiSearchBar1.Width  = new StyleDimension(0.0f, 1f);
            uiSearchBar1.Height = new StyleDimension(0.0f, 1f);
            uiSearchBar1.HAlign = 0.0f;
            uiSearchBar1.VAlign = 0.5f;
            uiSearchBar1.Left   = new StyleDimension(0.0f, 0.0f);
            uiSearchBar1.IgnoresMouseInteraction = true;
            UISearchBar uiSearchBar2 = uiSearchBar1;

            this._searchBar   = uiSearchBar2;
            uiPanel2.OnClick += new UIElement.MouseEvent(this.Click_SearchArea);
            uiSearchBar2.OnContentsChanged += new Action <string>(this.OnSearchContentsChanged);
            uiPanel2.Append((UIElement)uiSearchBar2);
            uiSearchBar2.OnStartTakingInput       += new Action(this.OnStartTakingInput);
            uiSearchBar2.OnEndTakingInput         += new Action(this.OnEndTakingInput);
            uiSearchBar2.OnNeedingVirtualKeyboard += new Action(this.OpenVirtualKeyboardWhenNeeded);
        }
Example #4
0
        private void AddSearchBar(UIElement innerTopContainer, UIBestiaryEntryInfoPage infoSpace)
        {
            UIImageButton uIImageButton = new UIImageButton(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Search", Main.content, (AssetRequestMode)1))
            {
                Left   = new StyleDimension(0f - infoSpace.Width.Pixels, 1f),
                VAlign = 0.5f
            };

            uIImageButton.OnClick += Click_SearchArea;
            uIImageButton.SetHoverImage(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Search_Border", Main.content, (AssetRequestMode)1));
            uIImageButton.SetVisibility(1f, 1f);
            uIImageButton.SetSnapPoint("SearchButton", 0);
            innerTopContainer.Append(uIImageButton);
            UIPanel uIPanel = (_searchBoxPanel = new UIPanel
            {
                Left = new StyleDimension(0f - infoSpace.Width.Pixels + uIImageButton.Width.Pixels + 3f, 1f),
                Width = new StyleDimension(infoSpace.Width.Pixels - uIImageButton.Width.Pixels - 3f, 0f),
                Height = new StyleDimension(0f, 1f),
                VAlign = 0.5f
            });

            uIPanel.BackgroundColor = new Color(35, 40, 83);
            uIPanel.BorderColor     = new Color(35, 40, 83);
            uIPanel.SetPadding(0f);
            innerTopContainer.Append(uIPanel);
            UISearchBar uISearchBar = (_searchBar = new UISearchBar(Language.GetText("UI.PlayerNameSlot"), 0.8f)
            {
                Width = new StyleDimension(0f, 1f),
                Height = new StyleDimension(0f, 1f),
                HAlign = 0f,
                VAlign = 0.5f,
                Left = new StyleDimension(0f, 0f),
                IgnoresMouseInteraction = true
            });

            uIPanel.OnClick += Click_SearchArea;
            uISearchBar.OnContentsChanged += OnSearchContentsChanged;
            uIPanel.Append(uISearchBar);
            uISearchBar.OnStartTakingInput       += OnStartTakingInput;
            uISearchBar.OnEndTakingInput         += OnEndTakingInput;
            uISearchBar.OnNeedingVirtualKeyboard += OpenVirtualKeyboardWhenNeeded;
        }
Example #5
0
        private void BuildPage()
        {
            this.RemoveAllChildren();
            int       num1       = true.ToInt() * 100;
            UIElement uiElement1 = new UIElement();

            uiElement1.Width.Set(0.0f, 0.875f);
            uiElement1.MaxWidth.Set(800f + (float)num1, 0.0f);
            uiElement1.MinWidth.Set(600f + (float)num1, 0.0f);
            uiElement1.Top.Set(220f, 0.0f);
            uiElement1.Height.Set(-220f, 1f);
            uiElement1.HAlign = 0.5f;
            this.Append(uiElement1);
            this.MakeExitButton(uiElement1);
            UIPanel uiPanel = new UIPanel();

            uiPanel.Width.Set(0.0f, 1f);
            uiPanel.Height.Set(-90f, 1f);
            uiPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
            uiElement1.Append((UIElement)uiPanel);
            uiPanel.PaddingTop    -= 4f;
            uiPanel.PaddingBottom -= 4f;
            int       num2       = 24;
            UIElement uiElement2 = new UIElement()
            {
                Width  = new StyleDimension(0.0f, 1f),
                Height = new StyleDimension((float)num2, 0.0f),
                VAlign = 0.0f
            };

            uiElement2.SetPadding(0.0f);
            uiPanel.Append(uiElement2);
            UIBestiaryEntryInfoPage bestiaryEntryInfoPage = new UIBestiaryEntryInfoPage();

            bestiaryEntryInfoPage.Height = new StyleDimension(12f, 1f);
            bestiaryEntryInfoPage.HAlign = 1f;
            UIBestiaryEntryInfoPage infoSpace = bestiaryEntryInfoPage;

            this.AddSortAndFilterButtons(uiElement2, infoSpace);
            this.AddSearchBar(uiElement2, infoSpace);
            int       num3     = 20;
            UIElement element1 = new UIElement()
            {
                Width  = new StyleDimension(0.0f, 1f),
                Height = new StyleDimension((float)(-num2 - 6 - num3), 1f),
                VAlign = 1f,
                Top    = new StyleDimension((float)-num3, 0.0f)
            };

            element1.SetPadding(0.0f);
            uiPanel.Append(element1);
            UIElement uiElement3 = new UIElement()
            {
                Width  = new StyleDimension(0.0f, 1f),
                Height = new StyleDimension(20f, 0.0f),
                VAlign = 1f
            };

            uiPanel.Append(uiElement3);
            uiElement3.SetPadding(0.0f);
            this.FillProgressBottomBar(uiElement3);
            UIElement element2 = new UIElement()
            {
                Width  = new StyleDimension(-12f - infoSpace.Width.Pixels, 1f),
                Height = new StyleDimension(-4f, 1f),
                VAlign = 1f
            };

            element1.Append(element2);
            element2.SetPadding(0.0f);
            this._bestiarySpace = element2;
            UIBestiaryEntryGrid bestiaryEntryGrid = new UIBestiaryEntryGrid(this._workingSetEntries, new UIElement.MouseEvent(this.Click_SelectEntryButton));

            element2.Append((UIElement)bestiaryEntryGrid);
            this._entryGrid = bestiaryEntryGrid;
            this._entryGrid.OnGridContentsChanged += new Action(this.UpdateBestiaryGridRange);
            element1.Append((UIElement)infoSpace);
            this._infoSpace = infoSpace;
            this.AddBackAndForwardButtons(uiElement2);
            this._sortingGrid                     = new UIBestiarySortingOptionsGrid(this._sorter);
            this._sortingGrid.OnClick            += new UIElement.MouseEvent(this.Click_CloseSortingGrid);
            this._sortingGrid.OnClickingOption   += new Action(this.UpdateBestiaryContents);
            this._filteringGrid                   = new UIBestiaryFilteringOptionsGrid(this._filterer);
            this._filteringGrid.OnClick          += new UIElement.MouseEvent(this.Click_CloseFilteringGrid);
            this._filteringGrid.OnClickingOption += new Action(this.UpdateBestiaryContents);
            this._filteringGrid.SetupAvailabilityTest(this._originalEntriesList);
            this._searchBar.SetContents((string)null, true);
            this.UpdateBestiaryContents();
        }
Example #6
0
        private void BuildPage()
        {
            RemoveAllChildren();
            int       num       = Utils.ToInt(value: true) * 100;
            UIElement uIElement = new UIElement();

            uIElement.Width.Set(0f, 0.875f);
            uIElement.MaxWidth.Set(800f + (float)num, 0f);
            uIElement.MinWidth.Set(600f + (float)num, 0f);
            uIElement.Top.Set(220f, 0f);
            uIElement.Height.Set(-220f, 1f);
            uIElement.HAlign = 0.5f;
            Append(uIElement);
            MakeExitButton(uIElement);
            UIPanel uIPanel = new UIPanel();

            uIPanel.Width.Set(0f, 1f);
            uIPanel.Height.Set(-90f, 1f);
            uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
            uIElement.Append(uIPanel);
            uIPanel.PaddingTop    -= 4f;
            uIPanel.PaddingBottom -= 4f;
            int       num2       = 24;
            UIElement uIElement2 = new UIElement
            {
                Width  = new StyleDimension(0f, 1f),
                Height = new StyleDimension(num2, 0f),
                VAlign = 0f
            };

            uIElement2.SetPadding(0f);
            uIPanel.Append(uIElement2);
            UIBestiaryEntryInfoPage uIBestiaryEntryInfoPage = new UIBestiaryEntryInfoPage
            {
                Height = new StyleDimension(12f, 1f),
                HAlign = 1f
            };

            AddSortAndFilterButtons(uIElement2, uIBestiaryEntryInfoPage);
            AddSearchBar(uIElement2, uIBestiaryEntryInfoPage);
            int       num3       = 20;
            UIElement uIElement3 = new UIElement
            {
                Width  = new StyleDimension(0f, 1f),
                Height = new StyleDimension(-num2 - 6 - num3, 1f),
                VAlign = 1f,
                Top    = new StyleDimension(-num3, 0f)
            };

            uIElement3.SetPadding(0f);
            uIPanel.Append(uIElement3);
            UIElement uIElement4 = new UIElement
            {
                Width  = new StyleDimension(0f, 1f),
                Height = new StyleDimension(20f, 0f),
                VAlign = 1f
            };

            uIPanel.Append(uIElement4);
            uIElement4.SetPadding(0f);
            FillProgressBottomBar(uIElement4);
            UIElement uIElement5 = new UIElement
            {
                Width  = new StyleDimension(-12f - uIBestiaryEntryInfoPage.Width.Pixels, 1f),
                Height = new StyleDimension(-4f, 1f),
                VAlign = 1f
            };

            uIElement3.Append(uIElement5);
            uIElement5.SetPadding(0f);
            _bestiarySpace = uIElement5;
            UIBestiaryEntryGrid uIBestiaryEntryGrid = new UIBestiaryEntryGrid(_workingSetEntries, Click_SelectEntryButton);

            uIElement5.Append(uIBestiaryEntryGrid);
            _entryGrid = uIBestiaryEntryGrid;
            _entryGrid.OnGridContentsChanged += UpdateBestiaryGridRange;
            uIElement3.Append(uIBestiaryEntryInfoPage);
            _infoSpace = uIBestiaryEntryInfoPage;
            AddBackAndForwardButtons(uIElement2);
            _sortingGrid                     = new UIBestiarySortingOptionsGrid(_sorter);
            _sortingGrid.OnClick            += Click_CloseSortingGrid;
            _sortingGrid.OnClickingOption   += UpdateBestiaryContents;
            _filteringGrid                   = new UIBestiaryFilteringOptionsGrid(_filterer);
            _filteringGrid.OnClick          += Click_CloseFilteringGrid;
            _filteringGrid.OnClickingOption += UpdateBestiaryContents;
            _filteringGrid.SetupAvailabilityTest(_originalEntriesList);
            _searchBar.SetContents(null, forced: true);
            UpdateBestiaryContents();
        }