コード例 #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);
		}
コード例 #2
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;

            uiLoader = new UILoaderAnimatedImage(0.5f, 0.5f, 1f);

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

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

            UIScrollbar uIScrollbar = new UIScrollbar();

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

            UITextPanel <string> titleTextPanel = new UITextPanel <string>("Mod Packs", 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 <string> backButton = new UITextPanel <string>("Back", 1f, false);

            backButton.Width.Set(-10f, 1f / 2f);
            backButton.Height.Set(25f, 0f);
            backButton.VAlign = 1f;
            backButton.Top.Set(-20f, 0f);
            backButton.OnMouseOver += UICommon.FadedMouseOver;
            backButton.OnMouseOut  += UICommon.FadedMouseOut;
            backButton.OnClick     += BackClick;
            uIElement.Append(backButton);

            UIColorTextPanel saveNewButton = new UIColorTextPanel("Save Enabled as New Mod Pack", Color.Green, 1f, false);

            saveNewButton.CopyStyle(backButton);
            saveNewButton.HAlign       = 1f;
            saveNewButton.OnMouseOver += UICommon.FadedMouseOver;
            saveNewButton.OnMouseOut  += UICommon.FadedMouseOut;
            saveNewButton.OnClick     += SaveNewModList;
            uIElement.Append(saveNewButton);

            base.Append(uIElement);
        }
コード例 #3
0
ファイル: UIMods.cs プロジェクト: guyde2011/tModLoader
 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);
 }
コード例 #4
0
ファイル: UIMods.cs プロジェクト: JavidPack/TerraCustom
		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);
		}
コード例 #5
0
ファイル: UIMods.cs プロジェクト: BoopLamb/tModLoader
        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 = 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);

            uiLoader = new UILoaderAnimatedImage(0.5f, 0.5f, 1f);

            modListAll = new List <UIModItem>();
            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 <string> uIHeaderTexTPanel = new UITextPanel <string>("Mods List", 0.8f, true);

            uIHeaderTexTPanel.HAlign = 0.5f;
            uIHeaderTexTPanel.Top.Set(-35f, 0f);
            uIHeaderTexTPanel.SetPadding(15f);
            uIHeaderTexTPanel.BackgroundColor = new Color(73, 94, 171);
            uIElement.Append(uIHeaderTexTPanel);
            buttonEA = new UIColorTextPanel("Enable All", Color.Green, 1f, false);
            buttonEA.Width.Set(-10f, 1f / 3f);
            buttonEA.Height.Set(25f, 0f);
            buttonEA.VAlign = 1f;
            buttonEA.Top.Set(-65f, 0f);
            buttonEA.OnMouseOver += UICommon.FadedMouseOver;
            buttonEA.OnMouseOut  += UICommon.FadedMouseOut;
            buttonEA.OnClick     += this.EnableAll;
            uIElement.Append(buttonEA);
            buttonDA = new UIColorTextPanel("Disable All", Color.Red, 1f, false);
            buttonDA.CopyStyle(buttonEA);
            buttonDA.HAlign       = 0.5f;
            buttonDA.OnMouseOver += UICommon.FadedMouseOver;
            buttonDA.OnMouseOut  += UICommon.FadedMouseOut;
            buttonDA.OnClick     += this.DisableAll;
            uIElement.Append(buttonDA);
            buttonRM = new UITextPanel <string>("Reload Mods", 1f, false);
            buttonRM.CopyStyle(buttonEA);
            buttonRM.HAlign       = 1f;
            buttonRM.OnMouseOver += UICommon.FadedMouseOver;
            buttonRM.OnMouseOut  += UICommon.FadedMouseOut;
            buttonRM.OnClick     += ReloadMods;
            uIElement.Append(buttonRM);
            buttonB = new UITextPanel <string>("Back", 1f, false);
            buttonB.CopyStyle(buttonEA);
            buttonB.Top.Set(-20f, 0f);
            buttonB.OnMouseOver += UICommon.FadedMouseOver;
            buttonB.OnMouseOut  += UICommon.FadedMouseOut;
            buttonB.OnClick     += BackClick;
            uIElement.Append(buttonB);
            buttonOMF = new UITextPanel <string>("Open Mods Folder", 1f, false);
            buttonOMF.CopyStyle(buttonB);
            buttonOMF.HAlign       = 0.5f;
            buttonOMF.OnMouseOver += UICommon.FadedMouseOver;
            buttonOMF.OnMouseOut  += UICommon.FadedMouseOut;
            buttonOMF.OnClick     += OpenModsFolder;
            uIElement.Append(buttonOMF);

            Texture2D texture            = Texture2D.FromStream(Main.instance.GraphicsDevice, Assembly.GetExecutingAssembly().GetManifestResourceStream("Terraria.ModLoader.UI.UIModBrowserIcons.png"));
            UIElement upperMenuContainer = new UIElement();

            upperMenuContainer.Width.Set(0f, 1f);
            upperMenuContainer.Height.Set(32f, 0f);
            upperMenuContainer.Top.Set(10f, 0f);

            UICycleImage toggleImage;

            for (int j = 0; j < 2; j++)
            {
                if (j == 0)
                {
                    toggleImage = new UICycleImage(texture, 3, 32, 32, 34 * 3, 0);
                    toggleImage.setCurrentState((int)sortMode);
                    toggleImage.OnClick += (a, b) =>
                    {
                        sortMode     = sortMode.NextEnum();
                        updateNeeded = true;
                    };
                    toggleImage.OnRightClick += (a, b) =>
                    {
                        sortMode     = sortMode.PreviousEnum();
                        updateNeeded = true;
                    };
                }
                else
                {
                    toggleImage = new UICycleImage(texture, 3, 32, 32, 34 * 4, 0);
                    toggleImage.setCurrentState((int)enabledFilterMode);
                    toggleImage.OnClick += (a, b) =>
                    {
                        enabledFilterMode = enabledFilterMode.NextEnum();
                        updateNeeded      = true;
                    };
                    toggleImage.OnRightClick += (a, b) =>
                    {
                        enabledFilterMode = enabledFilterMode.PreviousEnum();
                        updateNeeded      = true;
                    };
                }
                toggleImage.Left.Set((float)(j * 36 + 8), 0f);
                _categoryButtons.Add(toggleImage);
                upperMenuContainer.Append(toggleImage);
            }

            UIPanel filterTextBoxBackground = new UIPanel();

            filterTextBoxBackground.Top.Set(0f, 0f);
            filterTextBoxBackground.Left.Set(-170f, 1f);
            filterTextBoxBackground.Width.Set(135f, 0f);
            filterTextBoxBackground.Height.Set(40f, 0f);
            upperMenuContainer.Append(filterTextBoxBackground);

            filterTextBox = new UIInputTextField("Type to search");
            filterTextBox.Top.Set(5f, 0f);
            filterTextBox.Left.Set(-160f, 1f);
            filterTextBox.OnTextChange += (a, b) => { updateNeeded = true; };
            upperMenuContainer.Append(filterTextBox);

            SearchFilterToggle = new UICycleImage(texture, 2, 32, 32, 34 * 2, 0);
            SearchFilterToggle.setCurrentState((int)searchFilterMode);
            SearchFilterToggle.OnClick += (a, b) =>
            {
                searchFilterMode = searchFilterMode.NextEnum();
                updateNeeded     = true;
            };
            SearchFilterToggle.OnRightClick += (a, b) =>
            {
                searchFilterMode = searchFilterMode.PreviousEnum();
                updateNeeded     = true;
            };
            SearchFilterToggle.Left.Set(545f, 0f);
            _categoryButtons.Add(SearchFilterToggle);
            upperMenuContainer.Append(SearchFilterToggle);

            buttonMP = new UITextPanel <string>("Mod Packs", 1f, false);
            buttonMP.CopyStyle(buttonOMF);
            buttonMP.HAlign       = 1f;
            buttonMP.OnMouseOver += UICommon.FadedMouseOver;
            buttonMP.OnMouseOut  += UICommon.FadedMouseOut;
            buttonMP.OnClick     += GotoModPacksMenu;
            uIElement.Append(buttonMP);

            uIPanel.Append(upperMenuContainer);
            Append(uIElement);
        }
コード例 #6
0
ファイル: UIMods.cs プロジェクト: guyde2011/tModLoader
        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);
        }
コード例 #7
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 = new UIPanel();
            uIPanel.Width.Set(0f, 1f);
            uIPanel.Height.Set(-110f, 1f);
            uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
            uIElement.Append(uIPanel);

            uiLoader = new UILoaderAnimatedImage(0.5f, 0.5f, 1f);

            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 <string> uIHeaderTexTPanel = new UITextPanel <string>("Mods List", 0.8f, true);

            uIHeaderTexTPanel.HAlign = 0.5f;
            uIHeaderTexTPanel.Top.Set(-35f, 0f);
            uIHeaderTexTPanel.SetPadding(15f);
            uIHeaderTexTPanel.BackgroundColor = new Color(73, 94, 171);
            uIElement.Append(uIHeaderTexTPanel);
            buttonEA = new UIColorTextPanel("Enable All", Color.Green, 1f, false);
            buttonEA.Width.Set(-10f, 1f / 3f);
            buttonEA.Height.Set(25f, 0f);
            buttonEA.VAlign = 1f;
            buttonEA.Top.Set(-65f, 0f);
            buttonEA.OnMouseOver += UICommon.FadedMouseOver;
            buttonEA.OnMouseOut  += UICommon.FadedMouseOut;
            buttonEA.OnClick     += this.EnableAll;
            uIElement.Append(buttonEA);
            buttonDA = new UIColorTextPanel("Disable All", Color.Red, 1f, false);
            buttonDA.CopyStyle(buttonEA);
            buttonDA.HAlign       = 0.5f;
            buttonDA.OnMouseOver += UICommon.FadedMouseOver;
            buttonDA.OnMouseOut  += UICommon.FadedMouseOut;
            buttonDA.OnClick     += this.DisableAll;
            uIElement.Append(buttonDA);
            buttonRM = new UITextPanel <string>("Reload Mods", 1f, false);
            buttonRM.CopyStyle(buttonEA);
            buttonRM.HAlign       = 1f;
            buttonRM.OnMouseOver += UICommon.FadedMouseOver;
            buttonRM.OnMouseOut  += UICommon.FadedMouseOut;
            buttonRM.OnClick     += ReloadMods;
            uIElement.Append(buttonRM);
            buttonB = new UITextPanel <string>("Back", 1f, false);
            buttonB.CopyStyle(buttonEA);
            buttonB.Top.Set(-20f, 0f);
            buttonB.OnMouseOver += UICommon.FadedMouseOver;
            buttonB.OnMouseOut  += UICommon.FadedMouseOut;
            buttonB.OnClick     += BackClick;
            uIElement.Append(buttonB);
            buttonOMF = new UITextPanel <string>("Open Mods Folder", 1f, false);
            buttonOMF.CopyStyle(buttonB);
            buttonOMF.HAlign       = 0.5f;
            buttonOMF.OnMouseOver += UICommon.FadedMouseOver;
            buttonOMF.OnMouseOut  += UICommon.FadedMouseOut;
            buttonOMF.OnClick     += OpenModsFolder;
            uIElement.Append(buttonOMF);
            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);
            buttonMP = new UITextPanel <string>("Mod Packs", 1f, false);
            buttonMP.CopyStyle(buttonOMF);
            buttonMP.HAlign       = 1f;
            buttonMP.OnMouseOver += UICommon.FadedMouseOver;
            buttonMP.OnMouseOut  += UICommon.FadedMouseOut;
            buttonMP.OnClick     += GotoModPacksMenu;
            uIElement.Append(buttonMP);
            Append(uIElement);
        }
コード例 #8
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 <string> uITextPanel = new UITextPanel <string>("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 += UICommon.FadedMouseOver;
            button.OnMouseOut  += UICommon.FadedMouseOut;
            button.OnClick     += this.EnableAll;
            uIElement.Append(button);
            UIColorTextPanel button2 = new UIColorTextPanel("Disable All", Color.Red, 1f, false);

            button2.CopyStyle(button);
            button2.HAlign       = 0.5f;
            button2.OnMouseOver += UICommon.FadedMouseOver;
            button2.OnMouseOut  += UICommon.FadedMouseOut;
            button2.OnClick     += this.DisableAll;
            uIElement.Append(button2);
            UITextPanel <string> button3 = new UITextPanel <string>("Reload Mods", 1f, false);

            button3.CopyStyle(button);
            button3.HAlign       = 1f;
            button3.OnMouseOver += UICommon.FadedMouseOver;
            button3.OnMouseOut  += UICommon.FadedMouseOut;
            button3.OnClick     += ReloadMods;
            uIElement.Append(button3);
            UITextPanel <string> button4 = new UITextPanel <string>("Back", 1f, false);

            button4.CopyStyle(button);
            button4.Top.Set(-20f, 0f);
            button4.OnMouseOver += UICommon.FadedMouseOver;
            button4.OnMouseOut  += UICommon.FadedMouseOut;
            button4.OnClick     += BackClick;
            uIElement.Append(button4);
            UITextPanel <string> button5 = new UITextPanel <string>("Open Mods Folder", 1f, false);

            button5.CopyStyle(button4);
            button5.HAlign       = 0.5f;
            button5.OnMouseOver += UICommon.FadedMouseOver;
            button5.OnMouseOut  += UICommon.FadedMouseOut;
            button5.OnClick     += 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 <string> modListButton = new UITextPanel <string>("Mod Packs", 1f, false);

            modListButton.CopyStyle(button5);
            modListButton.HAlign       = 1f;
            modListButton.OnMouseOver += UICommon.FadedMouseOver;
            modListButton.OnMouseOut  += UICommon.FadedMouseOut;
            modListButton.OnClick     += GotoModPacksMenu;
            uIElement.Append(modListButton);
            base.Append(uIElement);
        }