Esempio n. 1
0
        public override void OnInitialize()
        {
            xButtonTexture = TUA.instance.GetTexture("Texture/X_ui");

            xButton = new UIElement();
            xButton.Width.Set(20f, 0f);
            xButton.Height.Set(22f, 0f);
            xButton.Left.Set(Main.screenWidth / 2f + 170f, 0f);
            xButton.Top.Set(Main.screenHeight / 2f - 90f, 0f);
            xButton.OnClick += CloseButtonClicked;

            furnaceUI = new CustomizableUIPanel(TUA.instance.GetTexture("Texture/UI/panel"));
            furnaceUI.SetPadding(0);
            furnaceUI.Width.Set(400, 0f);
            furnaceUI.Height.Set(200, 0f);
            furnaceUI.Top.Set(Main.screenHeight / 2 - 100, 0f);
            furnaceUI.Left.Set(Main.screenWidth / 2 - 200, 0f);

            upgradeUI = new CustomizableUIPanel(TUA.instance.GetTexture("Texture/UI/panel"));
            upgradeUI.SetPadding(0);
            upgradeUI.Width.Set(200, 0f);
            upgradeUI.Height.Set(150, 0f);
            upgradeUI.Top.Set(Main.screenHeight / 2 - 100, 0f);
            upgradeUI.Left.Set(Main.screenWidth / 2 + 215, 0f);

            //furnaceUI.BackgroundColor = new Color(73, 94, 171);
            _output.Top.Set(60, 0f);
            _output.Left.Set(300, 0f);

            if (_fuel != null)
            {
                _input.Top.Set(30, 0f);
                _input.Left.Set(50, 0f);

                _fuel.Top.Set(90, 0f);
                _fuel.Left.Set(50, 0f);
                furnaceUI.Append(_fuel);
            }
            else
            {
                _input.Top.Set(60, 0f);
                _input.Left.Set(50, 0f);
            }


            furnaceUI.Append(_input);
            furnaceUI.Append(_output);


            _energyBar.Top.Set(180f, 0);
            _energyBar.Left.Set(10f, 0);
            _energyBar.Height.Set(14f, 0);
            _energyBar.Width.Set(386f, 0);
            furnaceUI.Append(_energyBar);

            Append(furnaceUI);
            Append(upgradeUI);
            Append(xButton);
        }
Esempio n. 2
0
        public override void OnInitialize()
        {
            xButtonTexture = TUA.instance.GetTexture("Texture/X_ui");

            xButton.Width.Set(20f, 0f);
            xButton.Height.Set(22f, 0f);
            xButton.Left.Set(220f, 0f);
            xButton.Top.Set(-280f, 0f);
            xButton.HAlign   = 0.5f;
            xButton.VAlign   = 0.5f;
            xButton.OnClick += (evt, listElem) => UIManager.CloseLoreUI();

            mainPanel = new CustomizableUIPanel(TUA.instance.GetTexture("Texture/UI/panel"));
            mainPanel.Width.Set(400, 0);
            mainPanel.Height.Set(500, 0);
            mainPanel.HAlign = 0.5f;
            mainPanel.VAlign = 0.5f;
            mainPanel.SetPadding(0);

            selectionPanel = new CustomizableUIPanel(TUA.instance.GetTexture("Texture/UI/panel"));
            selectionPanel.Width.Set(400, 0);
            selectionPanel.Height.Set(500, 0);
            selectionPanel.Left.Set(0, 0);
            selectionPanel.Top.Set(0, 0);
            selectionPanel.SetPadding(0);

            entryList = new UIList();
            entryList.Left.Set(5f, 0);
            entryList.Top.Set(30f, 0);
            entryList.Width.Set(350f, 0);
            entryList.Height.Set(550f, 0);

            scrollbar = new UIScrollbar();
            scrollbar.Top.Set(-50f, 0);
            scrollbar.Left.Set(50f, 0f);
            scrollbar.HAlign = 1f;

            entryList.SetScrollbar(scrollbar);

            AddEntry("Dummy", "I'm the guide, I'm dummy", TUA.instance.GetTexture("Texture/LoreUI/Guide"), false);
            AddEntry("The heart of the wasteland", "1000 year ago, scientist tried to explore the wasteland after the accident, most of them never came back. As the time went, they saw an amalgamate forming in the middle in the highly radioactive environment. That amalgamate was formed with the body of the dead scientist that once explored the wasteland. \n \n \n//FIX ME - Any developer", TUA.instance.GetTexture("Texture/LoreUI/WastelandCore"), false);

            selectionPanel.Append(entryList);
            mainPanel.Append(selectionPanel);
            Append(xButton);
            Append(mainPanel);
        }