Example #1
0
		public override void OnInitialize()
		{
			UIElement uIElement = new UIElement();
			uIElement.Width.Set(0f, 0.8f);
			uIElement.MaxWidth.Set(600f, 0f);
			uIElement.Top.Set(220f, 0f);
			uIElement.Height.Set(-220f, 1f);
			uIElement.HAlign = 0.5f;

			UIPanel scrollPanel = new UIPanel();
			scrollPanel.Width.Set(0f, 1f);
			scrollPanel.Height.Set(-65f, 1f);
			scrollPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
			uIElement.Append(scrollPanel);

			settingsItemList = new UIList();
			settingsItemList.Width.Set(-25f, 1f);
			settingsItemList.Height.Set(0f, 1f);
			settingsItemList.ListPadding = 5f;
			scrollPanel.Append(settingsItemList);

			UIScrollbar uIScrollbar = new UIScrollbar();
			uIScrollbar.SetView(100f, 1000f);
			uIScrollbar.Height.Set(0f, 1f);
			uIScrollbar.HAlign = 1f;
			scrollPanel.Append(uIScrollbar);
			settingsItemList.SetScrollbar(uIScrollbar);

			UITextPanel titleTextPanel = new UITextPanel("Saved Settings", 0.8f, true);
			titleTextPanel.HAlign = 0.5f;
			titleTextPanel.Top.Set(-35f, 0f);
			titleTextPanel.SetPadding(15f);
			titleTextPanel.BackgroundColor = new Color(73, 94, 171);
			uIElement.Append(titleTextPanel);

			UITextPanel backButton = new UITextPanel("Back", 1f, false);
			backButton.Width.Set(-10f, 1f / 2f);
			backButton.Height.Set(25f, 0f);
			backButton.VAlign = 1f;
			backButton.Top.Set(-20f, 0f);
			backButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			backButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			backButton.OnClick += new UIElement.MouseEvent(BackClick);
			uIElement.Append(backButton);

			UIColorTextPanel saveNewButton = new UIColorTextPanel("Save Current Settings as New", Color.Green, 1f, false);
			saveNewButton.CopyStyle(backButton);
			saveNewButton.HAlign = 1f;
			saveNewButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			saveNewButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			saveNewButton.OnClick += new UIElement.MouseEvent(SaveNewSettings);
			uIElement.Append(saveNewButton);

			base.Append(uIElement);
		}
Example #2
0
		public override void OnInitialize()
		{
			uIElement = new UIElement();
			uIElement.Width.Set(0f, 0.8f);
			uIElement.MaxWidth.Set(600f, 0f);
			uIElement.Top.Set(220f, 0f);
			uIElement.Height.Set(-220f, 1f);
			uIElement.HAlign = 0.5f;
			UIPanel uIPanel = new UIPanel();
			uIPanel.Width.Set(0f, 1f);
			uIPanel.Height.Set(-110f, 1f);
			uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
			uIElement.Append(uIPanel);
			modInfo = new UIMessageBox("This is a test of mod info here.");
			modInfo.Width.Set(-25f, 1f);
			modInfo.Height.Set(0f, 1f);
			uIPanel.Append(modInfo);
			UIScrollbar uIScrollbar = new UIScrollbar();
			uIScrollbar.SetView(100f, 1000f);
			uIScrollbar.Height.Set(0f, 1f);
			uIScrollbar.HAlign = 1f;
			uIPanel.Append(uIScrollbar);
			modInfo.SetScrollbar(uIScrollbar);
			uITextPanel = new UITextPanel("Mod Info", 0.8f, true);
			uITextPanel.HAlign = 0.5f;
			uITextPanel.Top.Set(-35f, 0f);
			uITextPanel.SetPadding(15f);
			uITextPanel.BackgroundColor = new Color(73, 94, 171);
			uIElement.Append(uITextPanel);
			modHomepageButton = new UITextPanel("Visit the Mod's Homepage for even more info", 1f, false);
			modHomepageButton.Width.Set(-10f, 1f);
			modHomepageButton.Height.Set(25f, 0f);
			modHomepageButton.VAlign = 1f;
			modHomepageButton.Top.Set(-65f, 0f);
			modHomepageButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			modHomepageButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			modHomepageButton.OnClick += new UIElement.MouseEvent(VisitModHomePage);
			uIElement.Append(modHomepageButton);
			UITextPanel backButton = new UITextPanel("Back", 1f, false);
			backButton.Width.Set(-10f, 0.5f);
			backButton.Height.Set(25f, 0f);
			backButton.VAlign = 1f;
			backButton.Top.Set(-20f, 0f);
			backButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			backButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			backButton.OnClick += new UIElement.MouseEvent(BackClick);
			uIElement.Append(backButton);
			base.Append(uIElement);
		}
Example #3
0
 public override void OnInitialize()
 {
     UIElement element = new UIElement();
     element.Width.Set(0.0f, 0.8f);
     element.MaxWidth.Set(600f, 0.0f);
     element.Top.Set(220f, 0.0f);
     element.Height.Set(-220f, 1f);
     element.HAlign = 0.5f;
     UIPanel uiPanel = new UIPanel();
     uiPanel.Width.Set(0.0f, 1f);
     uiPanel.Height.Set(-110f, 1f);
     uiPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
     element.Append(uiPanel);
     _worldList = new UIList();
     _worldList.Width.Set(-25f, 1f);
     _worldList.Height.Set(0.0f, 1f);
     _worldList.ListPadding = 5f;
     uiPanel.Append(_worldList);
     UIScrollbar scrollbar = new UIScrollbar();
     scrollbar.SetView(100f, 1000f);
     scrollbar.Height.Set(0.0f, 1f);
     scrollbar.HAlign = 1f;
     uiPanel.Append(scrollbar);
     _worldList.SetScrollbar(scrollbar);
     UITextPanel uiTextPanel1 = new UITextPanel("Select World", 0.8f, true);
     uiTextPanel1.HAlign = 0.5f;
     uiTextPanel1.Top.Set(-35f, 0.0f);
     uiTextPanel1.SetPadding(15f);
     uiTextPanel1.BackgroundColor = new Color(73, 94, 171);
     element.Append(uiTextPanel1);
     UITextPanel uiTextPanel2 = new UITextPanel("Back", 0.7f, true);
     uiTextPanel2.Width.Set(-10f, 0.5f);
     uiTextPanel2.Height.Set(50f, 0.0f);
     uiTextPanel2.VAlign = 1f;
     uiTextPanel2.Top.Set(-45f, 0.0f);
     uiTextPanel2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
     uiTextPanel2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
     uiTextPanel2.OnClick += new UIElement.MouseEvent(GoBackClick);
     element.Append(uiTextPanel2);
     UITextPanel uiTextPanel3 = new UITextPanel("New", 0.7f, true);
     uiTextPanel3.CopyStyle(uiTextPanel2);
     uiTextPanel3.HAlign = 1f;
     uiTextPanel3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
     uiTextPanel3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
     uiTextPanel3.OnClick += new UIElement.MouseEvent(NewWorldClick);
     element.Append(uiTextPanel3);
     Append(element);
 }
		public override void OnInitialize()
		{
			UIElement uIElement = new UIElement();
			uIElement.Width.Set(0f, 0.8f);
			uIElement.MaxWidth.Set(600f, 0f);
			uIElement.Top.Set(220f, 0f);
			uIElement.Height.Set(-220f, 1f);
			uIElement.HAlign = 0.5f;
			UIPanel uIPanel = new UIPanel();
			uIPanel.Width.Set(0f, 1f);
			uIPanel.Height.Set(-110f, 1f);
			uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
			uIElement.Append(uIPanel);
			this._playerList = new UIList();
			this._playerList.Width.Set(-25f, 1f);
			this._playerList.Height.Set(0f, 1f);
			this._playerList.ListPadding = 5f;
			uIPanel.Append(this._playerList);
			UIScrollbar uIScrollbar = new UIScrollbar();
			uIScrollbar.SetView(100f, 1000f);
			uIScrollbar.Height.Set(0f, 1f);
			uIScrollbar.HAlign = 1f;
			uIPanel.Append(uIScrollbar);
			this._playerList.SetScrollbar(uIScrollbar);
			UITextPanel uITextPanel = new UITextPanel("Select Player", 0.8f, true);
			uITextPanel.HAlign = 0.5f;
			uITextPanel.Top.Set(-35f, 0f);
			uITextPanel.SetPadding(15f);
			uITextPanel.BackgroundColor = new Color(73, 94, 171);
			uIElement.Append(uITextPanel);
			UITextPanel uITextPanel2 = new UITextPanel("Back", 0.7f, true);
			uITextPanel2.Width.Set(-10f, 0.5f);
			uITextPanel2.Height.Set(50f, 0f);
			uITextPanel2.VAlign = 1f;
			uITextPanel2.Top.Set(-45f, 0f);
			uITextPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver);
			uITextPanel2.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut);
			uITextPanel2.OnClick += new UIElement.MouseEvent(this.GoBackClick);
			uIElement.Append(uITextPanel2);
			UITextPanel uITextPanel3 = new UITextPanel("New", 0.7f, true);
			uITextPanel3.CopyStyle(uITextPanel2);
			uITextPanel3.HAlign = 1f;
			uITextPanel3.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver);
			uITextPanel3.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut);
			uITextPanel3.OnClick += new UIElement.MouseEvent(this.NewCharacterClick);
			uIElement.Append(uITextPanel3);
			base.Append(uIElement);
		}
Example #5
0
 public override void OnInitialize()
 {
     UIElement uIElement = new UIElement();
     uIElement.Width.Set(0f, 0.8f);
     uIElement.MaxWidth.Set(600f, 0f);
     uIElement.Top.Set(220f, 0f);
     uIElement.Height.Set(-220f, 1f);
     uIElement.HAlign = 0.5f;
     UIPanel uIPanel = new UIPanel();
     uIPanel.Width.Set(0f, 1f);
     uIPanel.Height.Set(-110f, 1f);
     uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
     uIElement.Append(uIPanel);
     modInfo = new UITextPanel("This is a test of mod info here.");
     modInfo.Width.Set(-25f, 1f);
     modInfo.Height.Set(0f, 1f);
     uIPanel.Append(modInfo);
     uITextPanel = new UITextPanel("Mod Info", 0.8f, true);
     uITextPanel.HAlign = 0.5f;
     uITextPanel.Top.Set(-35f, 0f);
     uITextPanel.SetPadding(15f);
     uITextPanel.BackgroundColor = new Color(73, 94, 171);
     uIElement.Append(uITextPanel);
     UITextPanel button3 = new UITextPanel("Back", 1f, false);
     button3.Width.Set(-10f, 0.5f);
     button3.Height.Set(25f, 0f);
     button3.VAlign = 1f;
     button3.Top.Set(-20f, 0f);
     button3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
     button3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
     button3.OnClick += new UIElement.MouseEvent(BackClick);
     uIElement.Append(button3);
     base.Append(uIElement);
 }
		public override void OnInitialize()
		{
			UIElement uIElement = new UIElement();
			uIElement.Width.Set(0f, 0.8f);
			uIElement.MaxWidth.Set(600f, 0f);
			uIElement.Top.Set(220f, 0f);
			uIElement.Height.Set(-220f, 1f);
			uIElement.HAlign = 0.5f;

			UIPanel uIPanel = new UIPanel();
			uIPanel.Width.Set(0f, 1f);
			uIPanel.Height.Set(-110f, 1f);
			uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
			uIPanel.PaddingTop = 0f;
			uIElement.Append(uIPanel);

			uITextPanel = new UITextPanel("Please Enter Your Passcode", 0.8f, true);
			uITextPanel.HAlign = 0.5f;
			uITextPanel.Top.Set(-35f, 0f);
			uITextPanel.SetPadding(15f);
			uITextPanel.BackgroundColor = new Color(73, 94, 171);
			uIElement.Append(uITextPanel);

			UITextPanel button = new UITextPanel("Back", 1f, false);
			button.Width.Set(-10f, 0.5f);
			button.Height.Set(25f, 0f);
			button.VAlign = 1f;
			button.Top.Set(-65f, 0f);
			button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button.OnClick += new UIElement.MouseEvent(BackClick);
			uIElement.Append(button);

			UITextPanel button2 = new UITextPanel("Submit", 1f, false);
			button2.CopyStyle(button);
			button2.HAlign = 1f;
			button2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button2.OnClick += new UIElement.MouseEvent(OKClick);
			uIElement.Append(button2);

			UITextPanel button3 = new UITextPanel("Visit Website to Generate Passphrase", 1f, false);
			button3.CopyStyle(button);
			button3.Width.Set(0f, 1f);
			button3.Top.Set(-20f, 0f);
			button3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button3.OnClick += new UIElement.MouseEvent(VisitRegisterWebpage);
			uIElement.Append(button3);

			passcodeTextField = new UIInputTextField("Paste Passphrase (ctrl-v)");
			passcodeTextField.HAlign = 0.5f;
			passcodeTextField.VAlign = 0.5f;
			passcodeTextField.Left.Set(-100, 0);
			passcodeTextField.OnTextChange += new UIInputTextField.EventHandler(OnTextChange);
			uIPanel.Append(passcodeTextField);

			base.Append(uIElement);
		}
		public override void OnInitialize()
		{
			UIElement uIElement = new UIElement();
			uIElement.Width.Set(0f, 0.8f);
			uIElement.MaxWidth.Set(600f, 0f);
			uIElement.Top.Set(220f, 0f);
			uIElement.Height.Set(-220f, 1f);
			uIElement.HAlign = 0.5f;
			UIPanel uIPanel = new UIPanel();
			uIPanel.Width.Set(0f, 1f);
			uIPanel.Height.Set(-110f, 1f);
			uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
			uIElement.Append(uIPanel);
			myPublishedMods = new UIList();
			myPublishedMods.Width.Set(-25f, 1f);
			myPublishedMods.Height.Set(0f, 1f);
			myPublishedMods.ListPadding = 5f;
			uIPanel.Append(myPublishedMods);
			UIScrollbar uIScrollbar = new UIScrollbar();
			uIScrollbar.SetView(100f, 1000f);
			uIScrollbar.Height.Set(0f, 1f);
			uIScrollbar.HAlign = 1f;
			uIPanel.Append(uIScrollbar);
			myPublishedMods.SetScrollbar(uIScrollbar);
			uITextPanel = new UITextPanel("My Published Mods", 0.8f, true);
			uITextPanel.HAlign = 0.5f;
			uITextPanel.Top.Set(-35f, 0f);
			uITextPanel.SetPadding(15f);
			uITextPanel.BackgroundColor = new Color(73, 94, 171);
			uIElement.Append(uITextPanel);
			UITextPanel button3 = new UITextPanel("Back", 1f, false);
			button3.VAlign = 1f;
			button3.Height.Set(25f, 0f);
			button3.Width.Set(-10f, 1f / 2f);
			button3.Top.Set(-20f, 0f);
			button3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button3.OnClick += new UIElement.MouseEvent(BackClick);
			uIElement.Append(button3);
			base.Append(uIElement);
		}
        private void AddSearchBar(UIElement searchArea)
        {
            UIImageButton uiImageButton1 = new UIImageButton((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Search", (AssetRequestMode)1));

            uiImageButton1.VAlign = 0.5f;
            uiImageButton1.HAlign = 0.0f;
            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("CreativeInfinitesSearch", 0, new Vector2?(), new Vector2?());
            searchArea.Append((UIElement)uiImageButton2);
            UIPanel uiPanel1 = new UIPanel();

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

            this._searchBoxPanel     = uiPanel2;
            uiPanel2.BackgroundColor = new Color(35, 40, 83);
            uiPanel2.BorderColor     = new Color(35, 40, 83);
            uiPanel2.SetPadding(0.0f);
            searchArea.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);
            uiSearchBar2.OnCancledTakingInput     += new Action(this.OnCancledInput);
        }
        private void AddSearchBar(UIElement searchArea)
        {
            UIImageButton uIImageButton = new UIImageButton(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Button_Search", (AssetRequestMode)1))
            {
                VAlign = 0.5f,
                HAlign = 0f
            };

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

            uIPanel.BackgroundColor = new Color(35, 40, 83);
            uIPanel.BorderColor     = new Color(35, 40, 83);
            uIPanel.SetPadding(0f);
            searchArea.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;
            uISearchBar.OnCancledTakingInput     += OnCancledInput;
        }
Example #10
0
        public override void OnInitialize()
        {
            UIElement element1 = new UIElement();
            element1.Width.Set(0.0f, 0.8f);
            element1.MaxWidth.Set(800f, 0.0f);
            element1.MinWidth.Set(600f, 0.0f);
            element1.Top.Set(220f, 0.0f);
            element1.Height.Set(-220f, 1f);
            element1.HAlign = 0.5f;
            _outerContainer = element1;
            Append(element1);
            UIPanel uiPanel = new UIPanel();
            uiPanel.Width.Set(0.0f, 1f);
            uiPanel.Height.Set(-110f, 1f);
            uiPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
            uiPanel.PaddingTop = 0.0f;
            element1.Append(uiPanel);
            _achievementsList = new UIList();
            _achievementsList.Width.Set(-25f, 1f);
            _achievementsList.Height.Set(-50f, 1f);
            _achievementsList.Top.Set(50f, 0.0f);
            _achievementsList.ListPadding = 5f;
            uiPanel.Append(_achievementsList);
            UITextPanel uiTextPanel1 = new UITextPanel("Achievements", 1f, true);
            uiTextPanel1.HAlign = 0.5f;
            uiTextPanel1.Top.Set(-33f, 0.0f);
            uiTextPanel1.SetPadding(13f);
            uiTextPanel1.BackgroundColor = new Color(73, 94, 171);
            element1.Append(uiTextPanel1);
            UITextPanel uiTextPanel2 = new UITextPanel("Back", 0.7f, true);
            uiTextPanel2.Width.Set(-10f, 0.5f);
            uiTextPanel2.Height.Set(50f, 0.0f);
            uiTextPanel2.VAlign = 1f;
            uiTextPanel2.HAlign = 0.5f;
            uiTextPanel2.Top.Set(-45f, 0.0f);
            uiTextPanel2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
            uiTextPanel2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
            uiTextPanel2.OnClick += new UIElement.MouseEvent(GoBackClick);
            element1.Append(uiTextPanel2);
            List<Achievement> achievementsList = Main.Achievements.CreateAchievementsList();
            for (int index = 0; index < achievementsList.Count; ++index)
            {
                UIAchievementListItem achievementListItem = new UIAchievementListItem(achievementsList[index]);
                _achievementsList.Add((UIElement)achievementListItem);
                _achievementElements.Add(achievementListItem);
            }

            UIScrollbar scrollbar = new UIScrollbar();
            scrollbar.SetView(100f, 1000f);
            scrollbar.Height.Set(-50f, 1f);
            scrollbar.Top.Set(50f, 0.0f);
            scrollbar.HAlign = 1f;
            uiPanel.Append((UIElement)scrollbar);
            _achievementsList.SetScrollbar(scrollbar);
            UIElement element2 = new UIElement();
            element2.Width.Set(0.0f, 1f);
            element2.Height.Set(32f, 0.0f);
            element2.Top.Set(10f, 0.0f);
            Texture2D texture = TextureManager.Load("Images/UI/Achievement_Categories");
            for (int index = 0; index < 4; ++index)
            {
                UIToggleImage uiToggleImage = new UIToggleImage(texture, 32, 32, new Point(34 * index, 0), new Point(34 * index, 34));
                uiToggleImage.Left.Set((float)(index * 36 + 8), 0.0f);
                uiToggleImage.SetState(true);
                uiToggleImage.OnClick += new UIElement.MouseEvent(FilterList);
                _categoryButtons.Add(uiToggleImage);
                element2.Append((UIElement)uiToggleImage);
            }
            uiPanel.Append(element2);
        }
Example #11
0
 public override void OnInitialize()
 {
     UIElement uIElement = new UIElement();
     uIElement.Width.Set(0f, 0.8f);
     uIElement.MaxWidth.Set(600f, 0f);
     uIElement.Top.Set(220f, 0f);
     uIElement.Height.Set(-220f, 1f);
     uIElement.HAlign = 0.5f;
     UIPanel uIPanel = new UIPanel();
     uIPanel.Width.Set(0f, 1f);
     uIPanel.Height.Set(-110f, 1f);
     uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
     uIElement.Append(uIPanel);
     modList = new UIList();
     modList.Width.Set(-25f, 1f);
     modList.Height.Set(0f, 1f);
     modList.ListPadding = 5f;
     uIPanel.Append(modList);
     UIScrollbar uIScrollbar = new UIScrollbar();
     uIScrollbar.SetView(100f, 1000f);
     uIScrollbar.Height.Set(0f, 1f);
     uIScrollbar.HAlign = 1f;
     uIPanel.Append(uIScrollbar);
     modList.SetScrollbar(uIScrollbar);
     UITextPanel uITextPanel = new UITextPanel("Mods List", 0.8f, true);
     uITextPanel.HAlign = 0.5f;
     uITextPanel.Top.Set(-35f, 0f);
     uITextPanel.SetPadding(15f);
     uITextPanel.BackgroundColor = new Color(73, 94, 171);
     uIElement.Append(uITextPanel);
     UIColorTextPanel button = new UIColorTextPanel("Enable All", Color.Green, 1f, false);
     button.Width.Set(-10f, 0.5f);
     button.Height.Set(25f, 0f);
     button.VAlign = 1f;
     button.Top.Set(-65f, 0f);
     button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
     button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
     button.OnClick += new UIElement.MouseEvent(this.EnableAll);
     uIElement.Append(button);
     UIColorTextPanel button2 = new UIColorTextPanel("Disable All", Color.Red, 1f, false);
     button2.CopyStyle(button);
     button2.HAlign = 1f;
     button2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
     button2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
     button2.OnClick += new UIElement.MouseEvent(this.DisableAll);
     uIElement.Append(button2);
     UITextPanel uITextPanel2 = new UITextPanel("Back", 1f, false);
     uITextPanel2.CopyStyle(button);
     uITextPanel2.Top.Set(-20f, 0f);
     uITextPanel2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
     uITextPanel2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
     uITextPanel2.OnClick += new UIElement.MouseEvent(BackClick);
     uIElement.Append(uITextPanel2);
     UITextPanel uITextPanel3 = new UITextPanel("Reload Mods", 1f, false);
     uITextPanel3.CopyStyle(uITextPanel2);
     uITextPanel3.HAlign = 1f;
     uITextPanel3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
     uITextPanel3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
     uITextPanel3.OnClick += new UIElement.MouseEvent(ReloadMods);
     uIElement.Append(uITextPanel3);
     base.Append(uIElement);
 }
		public override void OnInitialize()
		{
			UIElement uIElement = new UIElement();
			uIElement.Width.Set(0f, 0.8f);
			uIElement.MaxWidth.Set(800f, 0f);
			uIElement.MinWidth.Set(600f, 0f);
			uIElement.Top.Set(220f, 0f);
			uIElement.Height.Set(-220f, 1f);
			uIElement.HAlign = 0.5f;
			this._outerContainer = uIElement;
			base.Append(uIElement);
			UIPanel uIPanel = new UIPanel();
			uIPanel.Width.Set(0f, 1f);
			uIPanel.Height.Set(-110f, 1f);
			uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
			uIPanel.PaddingTop = 0f;
			uIElement.Append(uIPanel);
			this._achievementsList = new UIList();
			this._achievementsList.Width.Set(-25f, 1f);
			this._achievementsList.Height.Set(-50f, 1f);
			this._achievementsList.Top.Set(50f, 0f);
			this._achievementsList.ListPadding = 5f;
			uIPanel.Append(this._achievementsList);
			UITextPanel uITextPanel = new UITextPanel("Achievements", 1f, true);
			uITextPanel.HAlign = 0.5f;
			uITextPanel.Top.Set(-33f, 0f);
			uITextPanel.SetPadding(13f);
			uITextPanel.BackgroundColor = new Color(73, 94, 171);
			uIElement.Append(uITextPanel);
			UITextPanel uITextPanel2 = new UITextPanel("Back", 0.7f, true);
			uITextPanel2.Width.Set(-10f, 0.5f);
			uITextPanel2.Height.Set(50f, 0f);
			uITextPanel2.VAlign = 1f;
			uITextPanel2.HAlign = 0.5f;
			uITextPanel2.Top.Set(-45f, 0f);
			uITextPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver);
			uITextPanel2.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut);
			uITextPanel2.OnClick += new UIElement.MouseEvent(this.GoBackClick);
			uIElement.Append(uITextPanel2);
			List<Achievement> list = Main.Achievements.CreateAchievementsList();
			for (int i = 0; i < list.Count; i++)
			{
				UIAchievementListItem item = new UIAchievementListItem(list[i]);
				this._achievementsList.Add(item);
				this._achievementElements.Add(item);
			}
			UIScrollbar uIScrollbar = new UIScrollbar();
			uIScrollbar.SetView(100f, 1000f);
			uIScrollbar.Height.Set(-50f, 1f);
			uIScrollbar.Top.Set(50f, 0f);
			uIScrollbar.HAlign = 1f;
			uIPanel.Append(uIScrollbar);
			this._achievementsList.SetScrollbar(uIScrollbar);
			UIElement uIElement2 = new UIElement();
			uIElement2.Width.Set(0f, 1f);
			uIElement2.Height.Set(32f, 0f);
			uIElement2.Top.Set(10f, 0f);
			Texture2D texture = TextureManager.Load("Images/UI/Achievement_Categories");
			for (int j = 0; j < 4; j++)
			{
				UIToggleImage uIToggleImage = new UIToggleImage(texture, 32, 32, new Point(34 * j, 0), new Point(34 * j, 34));
				uIToggleImage.Left.Set((float)(j * 36 + 8), 0f);
				uIToggleImage.SetState(true);
				uIToggleImage.OnClick += new UIElement.MouseEvent(this.FilterList);
				this._categoryButtons.Add(uIToggleImage);
				uIElement2.Append(uIToggleImage);
			}
			uIPanel.Append(uIElement2);
		}
Example #13
0
		public override void OnInitialize()
		{
			UIElement uIElement = new UIElement();
			uIElement.Width.Set(0f, 0.8f);
			uIElement.MaxWidth.Set(600f, 0f);
			uIElement.Top.Set(220f, 0f);
			uIElement.Height.Set(-220f, 1f);
			uIElement.HAlign = 0.5f;
			UIPanel uIPanel = new UIPanel();
			uIPanel.Width.Set(0f, 1f);
			uIPanel.Height.Set(-110f, 1f);
			uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
			uIElement.Append(uIPanel);
			modListAll = new UIList();
			modList = new UIList();
			modList.Width.Set(-25f, 1f);
			modList.Height.Set(0f, 1f);
			modList.ListPadding = 5f;
			uIPanel.Append(modList);
			UIScrollbar uIScrollbar = new UIScrollbar();
			uIScrollbar.SetView(100f, 1000f);
			uIScrollbar.Height.Set(0f, 1f);
			uIScrollbar.HAlign = 1f;
			uIPanel.Append(uIScrollbar);
			modList.SetScrollbar(uIScrollbar);
			UITextPanel uITextPanel = new UITextPanel("Mods List", 0.8f, true);
			uITextPanel.HAlign = 0.5f;
			uITextPanel.Top.Set(-35f, 0f);
			uITextPanel.SetPadding(15f);
			uITextPanel.BackgroundColor = new Color(73, 94, 171);
			uIElement.Append(uITextPanel);
			UIColorTextPanel button = new UIColorTextPanel("Enable All", Color.Green, 1f, false);
			button.Width.Set(-10f, 1f / 3f);
			button.Height.Set(25f, 0f);
			button.VAlign = 1f;
			button.Top.Set(-65f, 0f);
			button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button.OnClick += new UIElement.MouseEvent(this.EnableAll);
			uIElement.Append(button);
			UIColorTextPanel button2 = new UIColorTextPanel("Disable All", Color.Red, 1f, false);
			button2.CopyStyle(button);
			button2.HAlign = 0.5f;
			button2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button2.OnClick += new UIElement.MouseEvent(this.DisableAll);
			uIElement.Append(button2);
			UITextPanel button3 = new UITextPanel("Reload Mods", 1f, false);
			button3.CopyStyle(button);
			button3.HAlign = 1f;
			button3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button3.OnClick += new UIElement.MouseEvent(ReloadMods);
			uIElement.Append(button3);
			UITextPanel button4 = new UITextPanel("Back", 1f, false);
			button4.CopyStyle(button);
			button4.Top.Set(-20f, 0f);
			button4.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button4.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button4.OnClick += new UIElement.MouseEvent(BackClick);
			uIElement.Append(button4);
			UITextPanel button5 = new UITextPanel("Open Mods Folder", 1f, false);
			button5.CopyStyle(button4);
			button5.HAlign = 0.5f;
			button5.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button5.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button5.OnClick += new UIElement.MouseEvent(OpenModsFolder);
			uIElement.Append(button5);
			UIPanel panel = new UIPanel();
			panel.Top.Set(-40f, 0f);
			panel.Left.Set(-200f, 1f);
			panel.Width.Set(200f, 0f);
			panel.Height.Set(40f, 0f);
			uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
			uIElement.Append(panel);
			filterTextBox = new UIInputTextField("Type to search");
			filterTextBox.Top.Set(-30f, 0f);
			filterTextBox.Left.Set(-180f, 1f);
			filterTextBox.OnTextChange += new UIInputTextField.EventHandler(FilterList);
			uIElement.Append(filterTextBox);
			UITextPanel modListButton = new UITextPanel("Mod Packs", 1f, false);
			modListButton.CopyStyle(button5);
			modListButton.HAlign = 1f;
			modListButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			modListButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			modListButton.OnClick += new UIElement.MouseEvent(GotoModPacksMenu);
			uIElement.Append(modListButton);
			base.Append(uIElement);
		}
Example #14
0
		public override void OnInitialize()
		{
			UIElement uIElement = new UIElement();
			uIElement.Width.Set(0f, 0.8f);
			uIElement.MaxWidth.Set(600f, 0f);
			uIElement.Top.Set(220f, 0f);
			uIElement.Height.Set(-220f, 1f);
			uIElement.HAlign = 0.5f;
			UIPanel uIPanel = new UIPanel();
			uIPanel.Width.Set(0f, 1f);
			uIPanel.Height.Set(-110f, 1f);
			uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
			uIPanel.PaddingTop = 0f;
			uIElement.Append(uIPanel);
			modListAll = new UIList();
			modList = new UIList();
			modList.Width.Set(-25f, 1f);
			modList.Height.Set(-50f, 1f);
			modList.Top.Set(50f, 0f);
			modList.ListPadding = 5f;
			uIPanel.Append(modList);
			UIScrollbar uIScrollbar = new UIScrollbar();
			uIScrollbar.SetView(100f, 1000f);
			uIScrollbar.Height.Set(-50f, 1f);
			uIScrollbar.Top.Set(50f, 0f);
			uIScrollbar.HAlign = 1f;
			uIPanel.Append(uIScrollbar);
			modList.SetScrollbar(uIScrollbar);
			uITextPanel = new UITextPanel("Mod Browser", 0.8f, true);
			uITextPanel.HAlign = 0.5f;
			uITextPanel.Top.Set(-35f, 0f);
			uITextPanel.SetPadding(15f);
			uITextPanel.BackgroundColor = new Color(73, 94, 171);
			uIElement.Append(uITextPanel);
			UITextPanel button = new UITextPanel("Reload List", 1f, false);
			button.Width.Set(-10f, 0.5f);
			button.Height.Set(25f, 0f);
			button.VAlign = 1f;
			button.Top.Set(-65f, 0f);
			button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button.OnClick += new UIElement.MouseEvent(ReloadList);
			uIElement.Append(button);
			UITextPanel button3 = new UITextPanel("Back", 1f, false);
			button3.Width.Set(-10f, 0.5f);
			button3.Height.Set(25f, 0f);
			button3.VAlign = 1f;
			button3.Top.Set(-20f, 0f);
			button3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button3.OnClick += new UIElement.MouseEvent(BackClick);
			uIElement.Append(button3);
			base.Append(uIElement);
			UIElement uIElement2 = new UIElement();
			uIElement2.Width.Set(0f, 1f);
			uIElement2.Height.Set(32f, 0f);
			uIElement2.Top.Set(10f, 0f);
			Texture2D texture = Texture2D.FromStream(Main.instance.GraphicsDevice, Assembly.GetExecutingAssembly().GetManifestResourceStream("Terraria.ModLoader.UI.UIModBrowserIcons.png"));
			UICycleImage uIToggleImage;
			for (int j = 0; j < 2; j++)
			{
				if (j == 0)
				{
					uIToggleImage = new UICycleImage(texture, 5, 32, 32, 0, 0);
					uIToggleImage.setCurrentState((int)sortMode);
					uIToggleImage.OnClick += (a, b) => Interface.modBrowser.sortMode = sortMode.Next();
					uIToggleImage.OnClick += new UIElement.MouseEvent(this.SortList);
				}
				else
				{
					uIToggleImage = new UICycleImage(texture, 3, 32, 32, 34, 0);
					uIToggleImage.setCurrentState((int)updateFilterMode);
					uIToggleImage.OnClick += (a, b) => Interface.modBrowser.updateFilterMode = updateFilterMode.Next();
					uIToggleImage.OnClick += new UIElement.MouseEvent(this.SortList);
				}
				uIToggleImage.Left.Set((float)(j * 36 + 8), 0f);
				_categoryButtons.Add(uIToggleImage);
				uIElement2.Append(uIToggleImage);
			}
			filterTextBox = new UIInputTextField("Type to search");
			filterTextBox.Top.Set(5, 0f);
			filterTextBox.Left.Set(-150, 1f);
			filterTextBox.OnTextChange += new UIInputTextField.EventHandler(SortList);
			uIElement2.Append(filterTextBox);
			UICycleImage SearchFilterToggle = new UICycleImage(texture, 2, 32, 32, 68, 0);
			SearchFilterToggle.setCurrentState((int)searchFilterMode);
			SearchFilterToggle.OnClick += (a, b) => Interface.modBrowser.searchFilterMode = searchFilterMode.Next();
			SearchFilterToggle.OnClick += new UIElement.MouseEvent(this.SortList);
			SearchFilterToggle.Left.Set(545f, 0f);
			_categoryButtons.Add(SearchFilterToggle);
			uIElement2.Append(SearchFilterToggle);
			uIPanel.Append(uIElement2);
		}
        private void BuildSacrificeMenuContents(UIElement totalContainer)
        {
            UIPanel uIPanel = CreateBasicPanel();

            uIPanel.VAlign = 0.5f;
            uIPanel.Height = new StyleDimension(170f, 0f);
            uIPanel.Width  = new StyleDimension(170f, 0f);
            uIPanel.Top    = default(StyleDimension);
            totalContainer.Append(uIPanel);
            uIPanel.OnUpdate    += Hover_OnUpdate;
            uIPanel.OnMouseOver += Hover_OnMouseOver;
            uIPanel.OnMouseOut  += Hover_OnMouseOut;
            AddCogsForSacrificeMenu(uIPanel);
            _pistonParticleAsset = Main.Assets.Request <Texture2D>("Images/UI/Creative/Research_Spark", (AssetRequestMode)1);
            float   pixels  = 0f;
            UIImage uIImage = new UIImage(Main.Assets.Request <Texture2D>("Images/UI/Creative/Research_Slots", (AssetRequestMode)1))
            {
                HAlign = 0.5f,
                VAlign = 0.5f,
                Top    = new StyleDimension(-20f, 0f),
                Left   = new StyleDimension(pixels, 0f)
            };

            uIPanel.Append(uIImage);
            Asset <Texture2D> obj           = Main.Assets.Request <Texture2D>("Images/UI/Creative/Research_FramedPistons", (AssetRequestMode)1);
            UIImageFramed     uIImageFramed = new UIImageFramed(obj, obj.Frame(1, 9))
            {
                HAlign = 0.5f,
                VAlign = 0.5f,
                Top    = new StyleDimension(-20f, 0f),
                Left   = new StyleDimension(pixels, 0f),
                IgnoresMouseInteraction = true
            };

            uIPanel.Append(uIImageFramed);
            _sacrificePistons = uIImageFramed;
            UIParticleLayer uIParticleLayer = _pistonParticleSystem = new UIParticleLayer
            {
                Width  = new StyleDimension(0f, 1f),
                Height = new StyleDimension(0f, 1f),
                AnchorPositionOffsetByPercents = Vector2.One / 2f,
                AnchorPositionOffsetByPixels   = Vector2.Zero
            };

            uIImageFramed.Append(_pistonParticleSystem);
            UIElement uIElement = Main.CreativeMenu.ProvideItemSlotElement(0);

            uIElement.HAlign = 0.5f;
            uIElement.VAlign = 0.5f;
            uIElement.Top    = new StyleDimension(-15f, 0f);
            uIElement.Left   = new StyleDimension(pixels, 0f);
            uIElement.SetSnapPoint("CreativeSacrificeSlot", 0);
            uIImage.Append(uIElement);
            UIText uIText = new UIText("(0/50)", 0.8f)
            {
                Top    = new StyleDimension(10f, 0f),
                Left   = new StyleDimension(pixels, 0f),
                HAlign = 0.5f,
                VAlign = 0.5f,
                IgnoresMouseInteraction = true
            };

            uIText.OnUpdate += descriptionText_OnUpdate;
            uIPanel.Append(uIText);
            UIPanel uIPanel2 = new UIPanel
            {
                Top    = new StyleDimension(0f, 0f),
                Left   = new StyleDimension(pixels, 0f),
                HAlign = 0.5f,
                VAlign = 1f,
                Width  = new StyleDimension(124f, 0f),
                Height = new StyleDimension(30f, 0f)
            };
            UIText element = new UIText(Language.GetText("CreativePowers.ConfirmInfiniteItemSacrifice"), 0.8f)
            {
                IgnoresMouseInteraction = true,
                HAlign = 0.5f,
                VAlign = 0.5f
            };

            uIPanel2.Append(element);
            uIPanel2.SetSnapPoint("CreativeSacrificeConfirm", 0);
            uIPanel2.OnClick     += sacrificeButton_OnClick;
            uIPanel2.OnMouseOver += FadedMouseOver;
            uIPanel2.OnMouseOut  += FadedMouseOut;
            uIPanel2.OnUpdate    += research_OnUpdate;
            uIPanel.Append(uIPanel2);
            uIPanel.OnUpdate += sacrificeWindow_OnUpdate;
        }
        private void BuildSacrificeMenuContents(UIElement totalContainer)
        {
            UIPanel basicPanel = UICreativeInfiniteItemsDisplay.CreateBasicPanel();

            basicPanel.VAlign = 0.5f;
            basicPanel.Height = new StyleDimension(170f, 0.0f);
            basicPanel.Width  = new StyleDimension(170f, 0.0f);
            basicPanel.Top    = new StyleDimension();
            totalContainer.Append((UIElement)basicPanel);
            basicPanel.OnUpdate    += new UIElement.ElementEvent(this.Hover_OnUpdate);
            basicPanel.OnMouseOver += new UIElement.MouseEvent(this.Hover_OnMouseOver);
            basicPanel.OnMouseOut  += new UIElement.MouseEvent(this.Hover_OnMouseOut);
            this.AddCogsForSacrificeMenu((UIElement)basicPanel);
            this._pistonParticleAsset = (Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Creative/Research_Spark", (AssetRequestMode)1);
            float   pixels   = 0.0f;
            UIImage uiImage1 = new UIImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Creative/Research_Slots", (AssetRequestMode)1));

            uiImage1.HAlign = 0.5f;
            uiImage1.VAlign = 0.5f;
            uiImage1.Top    = new StyleDimension(-20f, 0.0f);
            uiImage1.Left   = new StyleDimension(pixels, 0.0f);
            UIImage uiImage2 = uiImage1;

            basicPanel.Append((UIElement)uiImage2);
            Asset <M0>    asset          = Main.Assets.Request <Texture2D>("Images/UI/Creative/Research_FramedPistons", (AssetRequestMode)1);
            UIImageFramed uiImageFramed1 = new UIImageFramed((Asset <Texture2D>)asset, ((Asset <Texture2D>)asset).Frame(1, 9, 0, 0, 0, 0));

            uiImageFramed1.HAlign = 0.5f;
            uiImageFramed1.VAlign = 0.5f;
            uiImageFramed1.Top    = new StyleDimension(-20f, 0.0f);
            uiImageFramed1.Left   = new StyleDimension(pixels, 0.0f);
            uiImageFramed1.IgnoresMouseInteraction = true;
            UIImageFramed uiImageFramed2 = uiImageFramed1;

            basicPanel.Append((UIElement)uiImageFramed2);
            this._sacrificePistons = uiImageFramed2;
            UIParticleLayer uiParticleLayer = new UIParticleLayer();

            uiParticleLayer.Width  = new StyleDimension(0.0f, 1f);
            uiParticleLayer.Height = new StyleDimension(0.0f, 1f);
            uiParticleLayer.AnchorPositionOffsetByPercents = Vector2.One / 2f;
            uiParticleLayer.AnchorPositionOffsetByPixels   = Vector2.Zero;
            this._pistonParticleSystem = uiParticleLayer;
            uiImageFramed2.Append((UIElement)this._pistonParticleSystem);
            UIElement element = Main.CreativeMenu.ProvideItemSlotElement(0);

            element.HAlign = 0.5f;
            element.VAlign = 0.5f;
            element.Top    = new StyleDimension(-15f, 0.0f);
            element.Left   = new StyleDimension(pixels, 0.0f);
            element.SetSnapPoint("CreativeSacrificeSlot", 0, new Vector2?(), new Vector2?());
            uiImage2.Append(element);
            UIText uiText1 = new UIText("(0/50)", 0.8f, false);

            uiText1.Top    = new StyleDimension(10f, 0.0f);
            uiText1.Left   = new StyleDimension(pixels, 0.0f);
            uiText1.HAlign = 0.5f;
            uiText1.VAlign = 0.5f;
            uiText1.IgnoresMouseInteraction = true;
            UIText uiText2 = uiText1;

            uiText2.OnUpdate += new UIElement.ElementEvent(this.descriptionText_OnUpdate);
            basicPanel.Append((UIElement)uiText2);
            UIPanel uiPanel1 = new UIPanel();

            uiPanel1.Top    = new StyleDimension(0.0f, 0.0f);
            uiPanel1.Left   = new StyleDimension(pixels, 0.0f);
            uiPanel1.HAlign = 0.5f;
            uiPanel1.VAlign = 1f;
            uiPanel1.Width  = new StyleDimension(124f, 0.0f);
            uiPanel1.Height = new StyleDimension(30f, 0.0f);
            UIPanel uiPanel2 = uiPanel1;
            UIText  uiText3  = new UIText(Language.GetText("CreativePowers.ConfirmInfiniteItemSacrifice"), 0.8f, false);

            uiText3.IgnoresMouseInteraction = true;
            uiText3.HAlign = 0.5f;
            uiText3.VAlign = 0.5f;
            UIText uiText4 = uiText3;

            uiPanel2.Append((UIElement)uiText4);
            uiPanel2.SetSnapPoint("CreativeSacrificeConfirm", 0, new Vector2?(), new Vector2?());
            uiPanel2.OnClick     += new UIElement.MouseEvent(this.sacrificeButton_OnClick);
            uiPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver);
            uiPanel2.OnMouseOut  += new UIElement.MouseEvent(this.FadedMouseOut);
            uiPanel2.OnUpdate    += new UIElement.ElementEvent(this.research_OnUpdate);
            basicPanel.Append((UIElement)uiPanel2);
            basicPanel.OnUpdate += new UIElement.ElementEvent(this.sacrificeWindow_OnUpdate);
        }
Example #17
0
		public override void OnInitialize()
		{
			UIElement uIElement = new UIElement();
			uIElement.Width.Set(0f, 0.8f);
			uIElement.MaxWidth.Set(600f, 0f);
			uIElement.Top.Set(220f, 0f);
			uIElement.Height.Set(-220f, 1f);
			uIElement.HAlign = 0.5f;
			UIPanel uIPanel = new UIPanel();
			uIPanel.Width.Set(0f, 1f);
			uIPanel.Height.Set(-110f, 1f);
			uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
			uIElement.Append(uIPanel);
			modList = new UIList();
			modList.Width.Set(-25f, 1f);
			modList.Height.Set(0f, 1f);
			modList.ListPadding = 5f;
			uIPanel.Append(modList);
			UIScrollbar uIScrollbar = new UIScrollbar();
			uIScrollbar.SetView(100f, 1000f);
			uIScrollbar.Height.Set(0f, 1f);
			uIScrollbar.HAlign = 1f;
			uIPanel.Append(uIScrollbar);
			modList.SetScrollbar(uIScrollbar);
			UITextPanel uITextPanel = new UITextPanel("Mod Sources", 0.8f, true);
			uITextPanel.HAlign = 0.5f;
			uITextPanel.Top.Set(-35f, 0f);
			uITextPanel.SetPadding(15f);
			uITextPanel.BackgroundColor = new Color(73, 94, 171);
			uIElement.Append(uITextPanel);
			UITextPanel button = new UITextPanel("Build All", 1f, false);
			button.Width.Set(-10f, 0.5f);
			button.Height.Set(25f, 0f);
			button.VAlign = 1f;
			button.Top.Set(-65f, 0f);
			button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button.OnClick += new UIElement.MouseEvent(BuildMods);
			uIElement.Append(button);
			UITextPanel button2 = new UITextPanel("Build + Reload All", 1f, false);
			button2.CopyStyle(button);
			button2.HAlign = 1f;
			button2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button2.OnClick += new UIElement.MouseEvent(BuildAndReload);
			uIElement.Append(button2);
			UITextPanel button3 = new UITextPanel("Back", 1f, false);
			button3.CopyStyle(button);
			button3.Width.Set(-10f, 1f / 3f);
			button3.Top.Set(-20f, 0f);
			button3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button3.OnClick += new UIElement.MouseEvent(BackClick);
			uIElement.Append(button3);
			UITextPanel button4 = new UITextPanel("Open Sources", 1f, false);
			button4.CopyStyle(button3);
			button4.HAlign = .5f;
			button4.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button4.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button4.OnClick += new UIElement.MouseEvent(OpenSources);
			uIElement.Append(button4);
			UITextPanel button5 = new UITextPanel("Manage Published", 1f, false);
			button5.CopyStyle(button3);
			button5.HAlign = 1f;
			button5.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
			button5.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
			button5.OnClick += new UIElement.MouseEvent(ManagePublished);
			uIElement.Append(button5);
			base.Append(uIElement);
		}