Exemple #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);
        }
Exemple #2
0
 internal void SetMainPanel(CustomizableUIPanel panel = null)
 {
     mainPanel.RemoveAllChildren();
     mainPanel.Append(panel ?? selectionPanel);
     if (panel == null)
     {
         InLoreEntry = false;
     }
 }
Exemple #3
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);
        }
Exemple #4
0
        public Texture2D arrow; //28x21

        public LoreEntry(string title, string content, Texture2D texture = null, bool TextureOnAllPage = false, Func <bool> condition = null)
        {
            pages = new Dictionary <int, LorePage>();

            arrow = TUA.instance.GetTexture("Texture/UI/Arrow");

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

            back = new UIElement();
            back.Width.Set(28, 0);
            back.Height.Set(21, 0);
            back.VAlign = 1;
            back.Top.Set(-5, 0);
            back.Left.Set(0, 0);
            back.OnClick += PreviousPage;

            next = new UIElement();
            next.Width.Set(28, 0);
            next.Height.Set(21, 0);
            next.HAlign = 1;
            next.VAlign = 1;
            next.Top.Set(-5, 0);
            next.Left.Set(5, 0);
            next.OnClick += NextPage;

            Panel.Append(back);
            Panel.Append(next);

            this.Title = title;

            Initialize(content, texture, TextureOnAllPage);
        }
Exemple #5
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 + 300f, 0f);
            xButton.Top.Set(Main.screenHeight / 2f - 125f, 0f);
            xButton.OnClick += (evt, listElem) => UIManager.CloseRaidsUI();

            selectTextPanel = new UITextPanel <TranslationWrapper>
                                  (LocalizationManager.instance.GetRawTranslation("TUA.UI.Select"), 0.5f, true)
            {
                DrawPanel = true,
                TextScale = 0.5f
            };
            selectTextPanel.Width.Set(100f, 0f);
            selectTextPanel.Left.Set(Main.screenWidth / 2f - selectTextPanel.Width.Pixels / 2, 0f);
            selectTextPanel.Top.Set(Main.screenHeight / 2f + 260f, 0f);
            selectTextPanel.OnClick += SetCurrentRaids;

            mainPanel = new CustomizableUIPanel(TUA.instance.GetTexture("Texture/UI/panel"));

            mainPanel.Width.Set(300f, 0);
            mainPanel.Height.Set(350f, 0);
            mainPanel.Left.Set(Main.screenWidth / 2f - 305f, 0f);
            mainPanel.Top.Set(Main.screenHeight / 2f - 100f, 0f);

            descriptionPanel = new CustomizableUIPanel(TUA.instance.GetTexture("Texture/UI/panel"));
            descriptionPanel.Width.Set(300f, 0);
            descriptionPanel.Height.Set(350f, 0);
            descriptionPanel.Left.Set(Main.screenWidth / 2f + 5f, 0f);
            descriptionPanel.Top.Set(Main.screenHeight / 2f - 100f, 0f);

            raidsDescription = new UIScrollingText();
            raidsDescription.Top.Set(2f, 0f);
            raidsDescription.Left.Set(5, 0f);
            raidsDescription.Height.Set(330f, 0f);
            raidsDescription.Width.Set(250f, 0f);
            raidsDescription.SetText("No raids are currently selected");
            descriptionPanel.Append(raidsDescription);

            scrollbar = new UIScrollbar();
            scrollbar.Height.Set(-5f, 1f);
            scrollbar.Top.Set(5, 0);
            scrollbar.SetView(100f, 100f);
            scrollbar.HAlign = 1f;

            raidsList = new UIList();
            raidsList.Top.Set(10f, 0f);
            raidsList.Left.Set(-5f, 0f);
            raidsList.Height.Set(300f, 0);
            raidsList.Width.Set(250f, 0f);
            raidsList.SetScrollbar(scrollbar);

            mainPanel.Append(raidsList);
            mainPanel.Append(scrollbar);

            Append(mainPanel);
            Append(descriptionPanel);
            Append(selectTextPanel);
            Append(xButton);

            #region Get Description In Shitcode Way
            StringBuilder builder = new StringBuilder();
            switch (currentlySelectedRaids.RaidsType)
            {
            case RaidsID.TheGreatHellRide:
                builder.AppendLine("The Great Hell Ride");
                builder.AppendLine("Have you heard the legend of the great hell ride?");
                builder.AppendLine("From what I've heard, it's a lot of fun and at the end you have to fight a giant wall!");
                builder.AppendLine("Sadly, I've not ever seen the infamous wall and I'll probably never get to, but you can do something about that.");
                builder.AppendLine("- The Guide");
                break;

            case RaidsID.TheWrathOfTheWasteland:
                builder.AppendLine("The Wrath of the Wasteland");
                builder.AppendLine("An earthquale just came from the core of the Wasteland, the heart might be angry again.");
                builder.AppendLine("Your goal is calm down the Heart of the Wasteland and make sure it doesn't wake up again.");
                builder.AppendLine("But first, you'll need to run some errands as you need specific stuff to calm it down");
                builder.AppendLine("- The Guide and the Infinity Traveler");
                break;

            case RaidsID.TheEyeOfDestruction:
                builder.AppendLine("The Hunt Beyond the Void");
                builder.AppendLine("A long time ago, I fought this god. He was one of the most powerful one I ever fought mainly because it could control the element of the void.");
                builder.AppendLine("This eye, also known as the eye of apocalypse, got out of his sleep after you killed the Ultra eye of Cthulhu.");
                builder.AppendLine("If he does what he did 1000 years ago, the world might be destroyed... Check the moon, because that's your biggest concern for now");
                builder.AppendLine("- The Infinity Traveler");
                break;

            case RaidsID.None:
                builder.AppendLine("There are no active raids currently!");
                break;
            }
            raidsDescription.SetText(builder.ToString());
            #endregion

            // Type no longer matters, the order of which panels are added here does
            ReflManager <RaidsPanel> .AddItem(PTI("None"),
                                              new RaidsPanel(RaidsID.None, () => RaidsWorld.currentRaid == RaidsID.None));

            ReflManager <RaidsPanel> .AddItem(PTI("WoF"),
                                              new RaidsPanel(RaidsID.TheGreatHellRide, () => !Main.hardMode && TUAWorld.Wasteland));

            ReflManager <RaidsPanel> .AddItem(PTI("HotW"),
                                              // since ^^ will be checked first, there is no need to check !TUAWorld.Wasteland
                                              new RaidsPanel(RaidsID.TheWrathOfTheWasteland, () => !Main.hardMode));

            ReflManager <RaidsPanel> .AddItem(PTI("EoA"),
                                              new RaidsPanel(RaidsID.TheEyeOfDestruction, () => TUAWorld.ApoMoonDowned && !TUAWorld.EoADowned));

            string PTI(string name) => "RaidsPanel_" + name;
        }