Exemple #1
0
            static public GameObject SpawnBlackButton(GameObject parent, Vector2 givenSize, string givenLabel, List <TMPro.TextMeshProUGUI> texts, bool isFallback = false)
            {
                ColorBlock colourBlockA = new ColorBlock();

                colourBlockA.disabledColor    = new Color(1, 1, 1, 1);
                colourBlockA.highlightedColor = new Color(1, 1, 1, 1);
                colourBlockA.normalColor      = new Color(1, 1, 1, 1);
                colourBlockA.pressedColor     = new Color(1, 1, 1, 1);
                colourBlockA.colorMultiplier  = 1;

                ColorBlock colourBlockB = new ColorBlock();

                colourBlockB.disabledColor    = new Color(0.094f, 0.094f, 0.094f, 0.286f);
                colourBlockB.highlightedColor = new Color(0.300f, 0.300f, 0.300f, 1.00f);
                colourBlockB.normalColor      = new Color(0.300f, 0.300f, 0.300f, 1.00f);
                colourBlockB.pressedColor     = new Color(0.500f, 0.500f, 0.500f, 1.000f);
                colourBlockB.colorMultiplier  = 1;

                GameObject buttonA = ElementCreator.SpawnButtonSize(parent, Resources.panelTextures[4], colourBlockA, new Vector2(0, 1), givenSize);
                GameObject buttonB = ElementCreator.SpawnButtonOffset(buttonA, Resources.panelTextures[3], colourBlockB, isFallback);

                buttonA.GetComponent <RoR2.UI.HGButton>().interactable = false;
                Image highlightImageA = ElementCreator.SpawnImageOffset(new List <Image>(), buttonA, Resources.panelTextures[2], new Color(1, 1, 1, 1), new Vector2(0.5f, 0.5f), new Vector2(-4, -12), new Vector2(12, 4));

                buttonA.GetComponent <RoR2.UI.HGButton>().imageOnHover = buttonB.GetComponent <Image>();
                buttonB.GetComponent <RoR2.UI.HGButton>().imageOnHover = highlightImageA;
                ElementCreator.SpawnTextOffset(texts, buttonA, new Color(1, 1, 1, 1), 24, 0, new Vector2(12, 4), new Vector2(-12, -4));
                texts[0].text = givenLabel;
                return(buttonB);
            }
Exemple #2
0
            static public GameObject SpawnBlueButton(GameObject parent, Vector2 givenPivot, Vector2 givenSize, string givenLabel, TMPro.TextAlignmentOptions alignment, List <Image> images, bool isFallback = false)
            {
                ColorBlock colourBlock = new ColorBlock();

                colourBlock.disabledColor    = new Color(0.255f, 0.201f, 0.201f, 0.714f);
                colourBlock.highlightedColor = new Color(0.988f, 1.000f, 0.693f, 0.733f);
                colourBlock.normalColor      = new Color(0.327f, 0.403f, 0.472f, 1.000f);
                colourBlock.pressedColor     = new Color(0.740f, 0.755f, 0.445f, 0.984f);
                colourBlock.colorMultiplier  = 1;

                GameObject button = ElementCreator.SpawnButtonSize(parent, Resources.panelTextures[0], colourBlock, givenPivot, givenSize, isFallback);

                ElementCreator.SpawnImageOffset(images, button, Resources.panelTextures[7], new Color(1, 1, 1, 1), new Vector2(0.5f, 0.5f), new Vector2(-6, -6), new Vector2(6, 6));
                images[images.Count - 1].gameObject.SetActive(false);
                ElementCreator.SpawnImageOffset(new List <Image>(), button, Resources.panelTextures[1], new Color(1, 1, 1, 0.286f), new Vector2(0.5f, 0.5f), new Vector2(0, 0), new Vector2(0, 0));
                Image highlightImage = ElementCreator.SpawnImageOffset(new List <Image>(), button, Resources.panelTextures[2], new Color(1, 1, 1, 1), new Vector2(0.5f, 0.5f), new Vector2(-4, -12), new Vector2(12, 4));

                button.GetComponent <RoR2.UI.HGButton>().imageOnHover = highlightImage;
                List <TMPro.TextMeshProUGUI> buttonText = new List <TMPro.TextMeshProUGUI>();

                ElementCreator.SpawnTextOffset(buttonText, button, new Color(1, 1, 1, 1), 24, 0, new Vector2(12, 4), new Vector2(-12, -4));
                buttonText[0].alignment   = alignment;
                buttonText[0].text        = givenLabel;
                buttonText[0].lineSpacing = -25;
                return(button);
            }
Exemple #3
0
            static public RectTransform SpawnItemButton(GameObject root, int textCount, int givenID, Dictionary <int, List <Image> > images, Dictionary <int, List <TMPro.TextMeshProUGUI> > texts, bool isFallback = false)
            {
                images.Add(givenID, new List <Image>());
                texts.Add(givenID, new List <TMPro.TextMeshProUGUI>());

                ColorBlock colourBlockA = new ColorBlock();

                colourBlockA.colorMultiplier  = 1;
                colourBlockA.disabledColor    = new Color(0, 0, 0, 0);
                colourBlockA.highlightedColor = new Color(0, 0, 0, 0);
                colourBlockA.normalColor      = new Color(0, 0, 0, 0);
                colourBlockA.pressedColor     = new Color(0, 0, 0, 0);

                Vector2 size = new Vector2();

                size.x = UIConfig.itemButtonWidth + UIConfig.itemPaddingOuter * 2;
                size.y = UIConfig.itemButtonWidth + textCount * UIConfig.itemTextHeight + UIConfig.itemPaddingOuter * 2;
                GameObject item   = ElementCreator.SpawnButtonSize(root, null, colourBlockA, new Vector2(0, 1), size, isFallback);
                GameObject scaler = ElementCreator.SpawnImageOffset(new List <Image>(), item, null, new Color(0, 0, 0, 0), new Vector2(0, 1), new Vector2(UIConfig.itemPaddingOuter, UIConfig.itemPaddingOuter), new Vector2(-UIConfig.itemPaddingOuter, -UIConfig.itemPaddingOuter)).gameObject;

                ElementCreator.SpawnImageOffset(new List <Image>(), scaler, Resources.panelTextures[1], new Color(0.286f, 0.286f, 0.286f, 1), new Vector2(0, 1), new Vector2(-2, textCount * UIConfig.itemTextHeight - 2), new Vector2(2, 2));
                for (int textIndex = 0; textIndex < textCount; textIndex++)
                {
                    ElementCreator.SpawnImageOffset(new List <Image>(), scaler, Resources.panelTextures[1], new Color(0.286f, 0.286f, 0.286f, 1), new Vector2(0, 1), new Vector2(-2, textIndex * UIConfig.itemTextHeight - 2), new Vector2(2, -UIConfig.itemButtonWidth - (textCount - 1 - textIndex) * UIConfig.itemTextHeight + UIConfig.itemPaddingInner + 2));
                    ElementCreator.SpawnImageOffset(new List <Image>(), scaler, Resources.panelTextures[0], new Color(0.120f, 0.120f, 0.120f, 1), new Vector2(0, 1), new Vector2(-2, textIndex * UIConfig.itemTextHeight - 2), new Vector2(2, -UIConfig.itemButtonWidth - (textCount - 1 - textIndex) * UIConfig.itemTextHeight + UIConfig.itemPaddingInner + 2));
                }

                ElementCreator.SpawnImageOffset(images[givenID], scaler, Resources.tierTextures[Data.GetItemTier(givenID)], new Color(1, 1, 1), new Vector2(0, 1), new Vector2(UIConfig.itemPaddingInner, textCount * UIConfig.itemTextHeight + UIConfig.itemPaddingInner), new Vector2(-UIConfig.itemPaddingInner, -UIConfig.itemPaddingInner));
                Sprite itemImage = null;

                if (Data.allItemIDs.ContainsKey(givenID))
                {
                    itemImage = RoR2.ItemCatalog.GetItemDef(Data.allItemIDs[givenID]).pickupIconSprite;
                }
                else if (Data.allEquipmentIDs.ContainsKey(givenID))
                {
                    itemImage = RoR2.EquipmentCatalog.GetEquipmentDef(Data.allEquipmentIDs[givenID]).pickupIconSprite;
                }
                ElementCreator.SpawnImageOffset(images[givenID], scaler, itemImage, new Color(1, 1, 1), new Vector2(0, 1), new Vector2(UIConfig.itemPaddingInner, textCount * UIConfig.itemTextHeight + UIConfig.itemPaddingInner), new Vector2(-UIConfig.itemPaddingInner, -UIConfig.itemPaddingInner));

                ElementCreator.SpawnImageOffset(images[givenID], scaler, Resources.panelTextures[1], new Color(0.988f, 1.000f, 0.693f, 0.733f), new Vector2(0.5f, 0), new Vector2(1, textCount * UIConfig.itemTextHeight + 1), new Vector2(-1, -1));
                ElementCreator.SpawnImageSize(images[givenID], images[givenID][images[givenID].Count - 1].gameObject, Resources.panelTextures[6], new Color(0.988f, 1.000f, 0.693f, 0.733f), new Vector2(0.5f, 0.5f), new Vector2(20, 20), new Vector3(0, 3, 0));

                for (int textIndex = 0; textIndex < textCount; textIndex++)
                {
                    ElementCreator.SpawnTextOffset(texts[givenID], scaler, new Color(1, 1, 1), 24, 1, new Vector2(UIConfig.itemPaddingInner, textIndex * UIConfig.itemTextHeight + UIConfig.itemPaddingInner), new Vector2(-UIConfig.itemPaddingInner, -UIConfig.itemButtonWidth - (textCount - 1 - textIndex) * UIConfig.itemTextHeight - UIConfig.itemPaddingInner));
                    texts[givenID][texts[givenID].Count - 1].text = "";
                }

                ColorBlock colourBlockB = new ColorBlock();

                colourBlockB.colorMultiplier  = 1;
                colourBlockB.disabledColor    = new Color(1, 1, 1, 1);
                colourBlockB.highlightedColor = new Color(1, 1, 1, 1);
                colourBlockB.normalColor      = new Color(1, 1, 1, 1);
                colourBlockB.pressedColor     = new Color(0.8f, 0.8f, 0.8f, 1);

                /*
                 * GameObject highlight = ElementCreator.SpawnButtonOffset(item, Resources.resources.panelTextures[5], colourBlockB);
                 * highlight.GetComponent<RoR2.UI.HGButton>().showImageOnHover = false;
                 * RectTransform highlightTransform = highlight.GetComponent<RectTransform>();
                 * highlightTransform.offsetMin = new Vector2(-5, -5);
                 * highlightTransform.offsetMax = new Vector2(5, 5);
                 * item.GetComponent<RoR2.UI.HGButton>().imageOnHover = highlight.GetComponent<Image>();
                 */

                Image highlight = ElementCreator.SpawnImageOffset(new List <Image>(), scaler, Resources.panelTextures[5], new Color(1, 1, 1, 1), new Vector2(0.5f, 0.5f), new Vector2(-5, -5), new Vector2(5, 5));

                item.GetComponent <RoR2.UI.HGButton>().imageOnHover = highlight.GetComponent <Image>();

                RoR2.UI.TooltipProvider tooltipProvider = item.AddComponent <RoR2.UI.TooltipProvider>();
                tooltipProvider.titleColor = Resources.colours[Data.GetItemTier(givenID)];
                tooltipProvider.bodyColor  = Resources.colours[6];
                if (Data.allItemIDs.ContainsKey(givenID))
                {
                    tooltipProvider.titleToken = RoR2.ItemCatalog.GetItemDef(Data.allItemIDs[givenID]).nameToken;
                    tooltipProvider.bodyToken  = RoR2.ItemCatalog.GetItemDef(Data.allItemIDs[givenID]).descriptionToken;
                }
                else if (Data.allEquipmentIDs.ContainsKey(givenID))
                {
                    tooltipProvider.titleToken = RoR2.EquipmentCatalog.GetEquipmentDef(Data.allEquipmentIDs[givenID]).nameToken;
                    tooltipProvider.bodyToken  = RoR2.EquipmentCatalog.GetEquipmentDef(Data.allEquipmentIDs[givenID]).descriptionToken;
                }

                PointerClick pointerClick = item.AddComponent <PointerClick>();

                pointerClick.eventSystem = item.GetComponent <RoR2.UI.MPEventSystemLocator>().eventSystem;
                pointerClick.onLeftClick.AddListener(() => {
                    Data.LeftClick(givenID);
                });
                pointerClick.onRightClick.AddListener(() => {
                    Data.RightClick(givenID);
                });
                return(item.GetComponent <RectTransform>());
            }
Exemple #4
0
            static void DrawInfoPanel()
            {
                Transform background = ElementCreator.SpawnImageOffset(new List <Image>(), UIDrawer.rootTransform.transform.parent.gameObject, null, new Color(0, 0, 0, 0.95f), new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero).transform;

                background.GetComponent <Image>().raycastTarget = true;

                GameObject    panelOutline   = PanelCreator.CreatePanelSize(background);
                RectTransform panelTransform = panelOutline.GetComponent <RectTransform>();
                float         panelWidth     = 700 + UIConfig.panelPadding * 2 + 10;
                float         panelHeight    = 600 + UIConfig.panelPadding * 2 + 10;

                if (Data.mode == DataNoShop.mode)
                {
                    panelHeight = 500 + UIConfig.panelPadding * 2 + 10;
                }
                panelTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, panelWidth);
                panelTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, panelHeight);
                panelTransform.localPosition = new Vector3(-panelWidth / 2f, panelHeight / 2f, 0);
                RectTransform panelChildTransform = panelTransform.GetChild(0).GetComponent <RectTransform>();

                List <TMPro.TextMeshProUGUI> text = new List <TMPro.TextMeshProUGUI>();

                ElementCreator.SpawnTextOffset(text, panelChildTransform.gameObject, new Color(1, 1, 1), 24, 0, new Vector2(UIConfig.spacingHorizontal, UIConfig.spacingVertical + UIConfig.blackButtonHeight + UIConfig.spacingVertical), new Vector2(-UIConfig.spacingHorizontal, -UIConfig.spacingVertical));
                if (Data.mode == DataShop.mode)
                {
                    text[0].text  = "UES EMPLOYMENT CONTRACT";
                    text[0].text += "\nSUBSECTION 17b: SALVAGE";
                    text[0].text += "\n";
                    text[0].text += "\nShould the employee be deployed to the site of any crashed UES vessels they are to prioritize the recovery of any intact cargo. As part of our vertical integration policies (38d), the employee will be reimbursed for any cargo salvaged with increased UES Aptitude Scores (11a). The category of aptitude increased is dependant on the value of the cargo salvaged, as this demonstrates ability of the employee work to UES’s interests. Employees with sufficiently high scores may redeem them to enrol in approved UES corporate training courses, to be upskilled in the use of various UES products. Should the employee perish during deployment (41a), a drone will be dispatched to recover any cargo that was in their possession. Any Aptitude Score owing will be accredited to the employee’s next of kin, should they also be an employee of UES, as well as the right to enrol in any corporate training courses the employee had previously redeemed.";
                }
                else if (Data.mode == DataNoShop.mode)
                {
                    text[0].text  = "UES EMPLOYMENT CONTRACT";
                    text[0].text += "\nSUBSECTION 45a: TRAINING";
                    text[0].text += "\n";
                    text[0].text += "\nUES endeavours to ensure that all its employees are as equipped as necessary to complete their assigned duties. To this end numerous corporate training courses have been made available, to upskill employees in the use of various UES products. A thorough analysis of employee aptitude concluded that employees with a close familial relation on the Board of Directors (3b) are more capable than any others. To this end, any such employee is afforded the right to enrol in any course that they deem, in their own judgement, to be of a benefit in fulfilling their duties. UES will take aggressive legal action against any employee alleging bias or nepotism in regards to this matter. The employee agrees to waive their right to a lawyer (42a) should they be sued in regards to this matter.";
                }

                GameObject    backButton          = ButtonCreator.SpawnBlackButton(panelChildTransform.gameObject, new Vector2(UIConfig.blackButtonWidth, UIConfig.blackButtonHeight), "Back", new List <TMPro.TextMeshProUGUI>());
                RectTransform backButtonTransform = backButton.transform.parent.GetComponent <RectTransform>();

                backButtonTransform.localPosition = new Vector3(panelWidth / 2f - UIConfig.blackButtonWidth / 2f, -panelHeight + UIConfig.spacingVertical + UIConfig.blackButtonHeight, backButtonTransform.localPosition.z);

                RoR2.UI.HGButton previousSelectable = backButton.GetComponent <RoR2.UI.MPEventSystemLocator>().eventSystem.currentSelectedGameObject.GetComponent <RoR2.UI.HGButton>();
                Button           backButtonButton   = backButton.GetComponent <RoR2.UI.HGButton>();

                backButtonButton.onClick.AddListener(() => {
                    UIDrawer.rootTransform.GetComponent <CanvasGroup>().interactable = true;
                    if (backButtonButton.GetComponent <RoR2.UI.MPEventSystemLocator>().eventSystem.currentInputSource == RoR2.UI.MPEventSystem.InputSource.Gamepad)
                    {
                        previousSelectable.Select();
                    }
                    else
                    {
                        previousSelectable.enabled = false;
                        previousSelectable.enabled = true;
                    }
                    Destroy(background.gameObject);
                });
                backButtonButton.Select();

                UIDrawer.rootTransform.GetComponent <CanvasGroup>().interactable = false;
            }
            static void DrawRecentPanel()
            {
                if (DataShop.RecentScrap())
                {
                    Transform background = ElementCreator.SpawnImageOffset(new List <Image>(), UIDrawer.rootTransform.transform.parent.gameObject, null, new Color(0, 0, 0, 0.95f), new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero).transform;
                    background.GetComponent <Image>().raycastTarget = true;

                    GameObject    panelOutline   = PanelCreator.CreatePanelSize(background);
                    RectTransform panelTransform = panelOutline.GetComponent <RectTransform>();
                    float         panelWidth     = 600 + UIConfig.panelPadding * 2 + 10;
                    float         panelHeight    = 400 + UIConfig.panelPadding * 2 + 10;
                    panelTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, panelWidth);
                    panelTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, panelHeight);
                    panelTransform.localPosition = new Vector3(-panelWidth / 2f, panelHeight / 2f, 0);
                    RectTransform panelChildTransform = panelTransform.GetChild(0).GetComponent <RectTransform>();

                    List <TMPro.TextMeshProUGUI> text = new List <TMPro.TextMeshProUGUI>();
                    ElementCreator.SpawnTextOffset(text, panelTransform.GetChild(0).gameObject, new Color(1, 1, 1), 24, 0, new Vector2(UIConfig.spacingHorizontal, UIConfig.spacingVertical + UIConfig.blackButtonHeight + UIConfig.spacingVertical * 2 + UIConfig.blueButtonHeight + UIConfig.spacingVertical), new Vector2(-UIConfig.spacingHorizontal, -UIConfig.spacingVertical));
                    text[0].text  = "THANK YOU";
                    text[0].text += "\nFor your (or your kinsman's) continued service. Working to the benefit of UES is working to the benefit of us all.";
                    text[0].text += "\n";
                    text[0].text += "\nYour UES Aptitude Scores have been increased by the following amounts:";

                    float scrapSpacing = 75;
                    List <TMPro.TextMeshProUGUI> scrapTexts = new List <TMPro.TextMeshProUGUI>();
                    for (int tierIndex = 0; tierIndex < DataShop.scrap.Count; tierIndex++)
                    {
                        ElementCreator.SpawnTextSize(scrapTexts, panelChildTransform.gameObject, new Color(1, 1, 1, 1), 30, 0, new Vector2(0.5f, 1), new Vector2(300, UIConfig.blueButtonHeight - UIConfig.panelPadding * 2), new Vector3(panelChildTransform.rect.width / 2f + (-DataShop.scrap.Count / 2f + tierIndex + 0.5f) * scrapSpacing, -panelChildTransform.rect.height + UIConfig.spacingVertical + UIConfig.blackButtonHeight + UIConfig.spacingVertical * 2 + UIConfig.blueButtonHeight, 0));
                        scrapTexts[tierIndex].text = DataShop.scrapRecent[tierIndex].ToString();
                        if (DataShop.scrapRecent[tierIndex] > 0)
                        {
                            scrapTexts[tierIndex].color = UIConfig.tierColours[tierIndex];
                        }
                        else
                        {
                            scrapTexts[tierIndex].color = UIConfig.tierColours[tierIndex] * 0.5f;
                        }
                    }

                    GameObject    backButton          = ButtonCreator.SpawnBlackButton(panelChildTransform.gameObject, new Vector2(UIConfig.blackButtonWidth, UIConfig.blackButtonHeight), "Back", new List <TMPro.TextMeshProUGUI>());
                    RectTransform backButtonTransform = backButton.transform.parent.GetComponent <RectTransform>();
                    backButtonTransform.localPosition = new Vector3(panelChildTransform.rect.width / 2f - UIConfig.blackButtonWidth / 2f, -panelHeight + UIConfig.spacingVertical + UIConfig.blackButtonHeight, backButtonTransform.localPosition.z);

                    RoR2.UI.HGButton previousSelectable = backButton.GetComponent <RoR2.UI.MPEventSystemLocator>().eventSystem.currentSelectedGameObject.GetComponent <RoR2.UI.HGButton>();
                    Button           backButtonButton   = backButton.GetComponent <RoR2.UI.HGButton>();
                    backButtonButton.onClick.AddListener(() => {
                        UIDrawer.rootTransform.GetComponent <CanvasGroup>().interactable = true;
                        if (backButtonButton.GetComponent <RoR2.UI.MPEventSystemLocator>().eventSystem.currentInputSource == RoR2.UI.MPEventSystem.InputSource.Gamepad)
                        {
                            previousSelectable.Select();
                        }
                        else
                        {
                            previousSelectable.enabled = false;
                            previousSelectable.enabled = true;
                        }
                        DataShop.ClearRecentScrap();
                        Data.SaveConfigProfile();
                        Destroy(background.gameObject);
                    });
                    backButtonButton.Select();

                    UIDrawer.rootTransform.GetComponent <CanvasGroup>().interactable = false;
                }
            }
            static void DrawInfoPanel()
            {
                rootTransform.GetComponent <CanvasGroup>().interactable = false;

                Transform background = ElementCreator.SpawnImageOffset(new List <Image>(), UIDrawer.rootTransform.transform.parent.gameObject, null, new Color(0, 0, 0, 0.95f), new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero).transform;

                background.GetComponent <Image>().raycastTarget = true;

                GameObject    panelOutline   = PanelCreator.CreatePanelSize(background);
                RectTransform panelTransform = panelOutline.GetComponent <RectTransform>();
                float         panelWidth     = 700 + UIConfig.panelPadding * 2 + 10;
                float         panelHeight    = 650 + UIConfig.panelPadding * 2 + 10;

                if (Data.earningMethod == 2 || Data.mode == DataFree.mode)
                {
                    panelHeight = 525 + UIConfig.panelPadding * 2 + 10;
                }
                panelTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, panelWidth);
                panelTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, panelHeight);
                panelTransform.localPosition = new Vector3(-panelWidth / 2f, panelHeight / 2f, 0);
                RectTransform panelChildTransform = panelTransform.GetChild(0).GetComponent <RectTransform>();

                List <TMPro.TextMeshProUGUI> text = new List <TMPro.TextMeshProUGUI>();

                ElementCreator.SpawnTextOffset(text, panelChildTransform.gameObject, new Color(1, 1, 1), 24, 0, new Vector2(UIConfig.spacingHorizontal, UIConfig.spacingVertical + UIConfig.blackButtonHeight + UIConfig.spacingVertical), new Vector2(-UIConfig.spacingHorizontal, -UIConfig.spacingVertical));
                if (Data.mode == DataFree.mode)
                {
                    text[0].text  = "UES EMPLOYMENT CONTRACT";
                    text[0].text += "\nSUBSECTION 45b: REQUSITION";
                    text[0].text += "\n";
                    text[0].text += "\nUES always strives to ensure that all its employees are as equipped as necessary to complete their assigned duties. However, UES has finite resources and must determine in who’s hands those resources can be put to the best use. A thorough analysis of employee aptitude concluded that employees with a close familial relation on the Board of Directors (3b) are most able to use the resources of UES to their fullest capacity. To this end, any such employee is afforded the right to requisition any items or equipment they deem, in their own judgement, to be of a benefit in fulfilling their duties. UES will take aggressive legal action against any employee alleging bias or nepotism in regards to this matter. The employee agrees to waive their right to a lawyer (42a) should they be sued in regards to this matter.";
                }
                else if (Data.mode == DataRandom.mode)
                {
                    text[0].text  = "UES EMPLOYMENT CONTRACT";
                    text[0].text += "\nSUBSECTION 50a: EQUIPPING";
                    text[0].text += "\n";
                    text[0].text += "\nUES always strives to ensure that all its employees are as equipped as necessary to complete their assigned duties. However, UES has finite resources and must determine in who’s hands those resources can be put to the best use. To this end, a thorough analysis is conducted prior to any deployment to determine which, if any, equipment will give the employee the greatest chance of success. The employee agrees that this analysis its conclusions are infallible and that the manner in which the employee is equipped cannot be the basis for any suit against UES. UES will take aggressive legal action against any employee alleging that equipment is, instead, assigned arbitrarily. The employee agrees to waive their right to a lawyer (42a) should they be sued in regards to this matter.";
                }
                else if (Data.earningMethod == 1)
                {
                    text[0].text  = "UES EMPLOYMENT CONTRACT";
                    text[0].text += "\nSUBSECTION 18a: BOUNTIES";
                    text[0].text += "\n";
                    if (Data.mode == DataEarntPersistent.mode)
                    {
                        text[0].text += "\nWhile deployed, UES employees should at all times endeavour to improve the relative safety of any environment they find themselves in. To this end, all employees are equipped a UES Threat Level Detection system which will quantify the threat of hostile organisms in the employee’s vicinity. If the organism is deemed to pose an imminent threat to UES operations, as part of our vertical integration policies (38b), the employee will be rewarded with supplemental UES Credits (10a) for eliminating the threat. Credits awarded is dependent upon the threat level of the organism. Credits can be exchanged for any items currently available in the UES Catalogue. Should the employee perish during deployment (41a), a drone will be dispatched to recover any items that were in their possession. Any Credits owing will be accredited to the employee’s next of kin, should they also be an employee of UES, as well as any items they owned.";
                    }
                    else if (Data.mode == DataEarntConsumable.mode)
                    {
                        text[0].text += "\nWhile deployed, UES employees should at all times endeavour to improve the relative safety of any environment they find themselves in. To this end, all employees are equipped a UES Threat Level Detection system which will quantify the threat of hostile organisms in the employee’s vicinity. If the organism is deemed to pose an imminent threat to UES operations, as part of our vertical integration policies (38b), the employee will be rewarded with supplemental UES Credits (10a) for eliminating the threat. Credits awarded is dependent upon the threat level of the organism. Credits can be exchanged for the loan of any items currently available in the UES Catalogue. Any items in the possession of an employee returning from a deployment will be reclaimed for refurbishment, the employee will not be reimbursed. Should the employee perish during deployment (41a), any Credits owing will be accredited to the employee’s next of kin, should they also be an employee of UES.";
                    }
                }
                else if (Data.earningMethod == 0)
                {
                    text[0].text  = "UES EMPLOYMENT CONTRACT";
                    text[0].text += "\nSUBSECTION 23a: TELEPORTATION";
                    text[0].text += "\n";
                    if (Data.mode == DataEarntPersistent.mode)
                    {
                        text[0].text += "\nThe employee agrees that primitive teleportation technology has no adverse, health related side effects and that any claims otherwise are unfounded. Should the employee be required to utilize primitive teleporters in the fulfilment of their duties while deployed, the employee agrees that UES is released from all responsibility and liability, and as part of our vertical integration policies (38b), will receive supplemental UES Credits (10a). Credits awarded is dependent upon the number of teleporter journeys the employee made during deployment and the effectiveness of the employee in carrying out the duties outlined in this contract. Credits can be exchanged for any items currently available in the UES Catalogue. Should the employee perish during deployment (41a), a drone will be dispatched to recover any items that were in their possession. Any Credits owing will be accredited to the employee’s next of kin, should they also be an employee of UES, as well as any items they owned.";
                    }
                    else if (Data.mode == DataEarntConsumable.mode)
                    {
                        text[0].text += "\nThe employee agrees that primitive teleportation technology has no adverse, health related side effects and that any claims otherwise are unfounded. Should the employee be required to utilize primitive teleporters in the fulfilment of their duties while deployed, the employee agrees that UES is released from all responsibility and liability, and as part of our vertical integration policies (38b), will receive supplemental UES Credits (10a). Credits awarded is dependent upon the number of teleporter journeys the employee made during deployment and the effectiveness of the employee in carrying out the duties outlined in this contract. Credits can be exchanged for the loan of any items currently available in the UES Catalogue. Any items in the possession of an employee returning from a deployment will be reclaimed for refurbishment, the employee will not be reimbursed. Should the employee perish during deployment (41a), any Credits owing will be accredited to the employee’s next of kin, should they also be an employee of UES.";
                    }
                }
                else if (Data.earningMethod == 2)
                {
                    text[0].text  = "UES EMPLOYMENT CONTRACT";
                    text[0].text += "\nSUBSECTION 14a: PERFORMANCE BONUSES";
                    text[0].text += "\n";
                    if (Data.mode == DataEarntPersistent.mode)
                    {
                        text[0].text += "\nIt is UES policy that the ends always justify the means (40d). To this end, as part of our vertical integration policies (38b), employees may earn an allotment of supplemental UES Credits (10a) when returning from deployment. Credits awarded is dependent upon the outcome of the deployment and is in no way impacted by the manner in which that outcome was achieved. Credits can be exchanged for any items currently available in the UES Catalogue. Should the employee perish during deployment (41a), a drone will be dispatched to recover any items that were in their possession. Any Credits owing will be accredited to the employee’s next of kin, should they also be an employee of UES, as well as any items they owned.";
                    }
                    else if (Data.mode == DataEarntConsumable.mode)
                    {
                        text[0].text += "\nIt is UES policy that the ends always justify the means (40d). To this end, as part of our vertical integration policies (38b), employees may earn an allotment of supplemental UES Credits (10a) when returning from deployment. Credits awarded is dependent upon the outcome of the deployment and is in no way impacted by the manner in which that outcome was achieved. Credits can be exchanged for the loan of any items currently available in the UES Catalogue. Any items in the possession of an employee returning from a deployment will be reclaimed for refurbishment, the employee will not be reimbursed. Should the employee perish during deployment (41a), any Credits owing will be accredited to the employee’s next of kin, should they also be an employee of UES.";
                    }
                }

                GameObject    backButton          = ButtonCreator.SpawnBlackButton(panelChildTransform.gameObject, new Vector2(UIConfig.blackButtonWidth, UIConfig.blackButtonHeight), "Back", new List <TMPro.TextMeshProUGUI>());
                RectTransform backButtonTransform = backButton.transform.parent.GetComponent <RectTransform>();

                backButtonTransform.localPosition = new Vector3(panelWidth / 2f - UIConfig.blackButtonWidth / 2f, -panelHeight + UIConfig.spacingVertical + UIConfig.blackButtonHeight, backButtonTransform.localPosition.z);

                RoR2.UI.HGButton previousSelectable = backButton.GetComponent <RoR2.UI.MPEventSystemLocator>().eventSystem.currentSelectedGameObject.GetComponent <RoR2.UI.HGButton>();
                Button           backButtonButton   = backButton.GetComponent <RoR2.UI.HGButton>();

                backButtonButton.onClick.AddListener(() => {
                    rootTransform.GetComponent <CanvasGroup>().interactable = true;
                    if (backButtonButton.GetComponent <RoR2.UI.MPEventSystemLocator>().eventSystem.currentInputSource == RoR2.UI.MPEventSystem.InputSource.Gamepad)
                    {
                        previousSelectable.Select();
                    }
                    else
                    {
                        previousSelectable.enabled = false;
                        previousSelectable.enabled = true;
                    }
                    Destroy(background.gameObject);
                });
                backButtonButton.Select();
            }
            static void DrawRecentPanel()
            {
                if ((Data.mode == DataEarntConsumable.mode && DataEarntConsumable.userPointsRecent > 0) || (Data.mode == DataEarntPersistent.mode && DataEarntPersistent.userPointsRecent > 0))
                {
                    Transform background = ElementCreator.SpawnImageOffset(new List <Image>(), UIDrawer.rootTransform.transform.parent.gameObject, null, new Color(0, 0, 0, 0.95f), new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero).transform;
                    background.GetComponent <Image>().raycastTarget = true;

                    GameObject    panelOutline   = PanelCreator.CreatePanelSize(background);
                    RectTransform panelTransform = panelOutline.GetComponent <RectTransform>();
                    float         panelWidth     = 600 + UIConfig.panelPadding * 2 + 10;
                    float         panelHeight    = 350 + UIConfig.panelPadding * 2 + 10;
                    panelTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, panelWidth);
                    panelTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, panelHeight);
                    panelTransform.localPosition = new Vector3(-panelWidth / 2f, panelHeight / 2f, 0);
                    RectTransform panelChildTransform = panelTransform.GetChild(0).GetComponent <RectTransform>();

                    List <TMPro.TextMeshProUGUI> text = new List <TMPro.TextMeshProUGUI>();
                    ElementCreator.SpawnTextOffset(text, panelTransform.GetChild(0).gameObject, new Color(1, 1, 1), 24, 0, new Vector2(UIConfig.spacingHorizontal, UIConfig.spacingVertical + UIConfig.blackButtonHeight + UIConfig.spacingVertical + UIConfig.blueButtonHeight + UIConfig.spacingVertical), new Vector2(-UIConfig.spacingHorizontal, -UIConfig.spacingVertical));
                    text[0].text  = "THANK YOU";
                    text[0].text += "\nFor your (or your kinsman's) continued service. Working to the benefit of UES is working to the benefit of us all.";
                    text[0].text += "\n";
                    text[0].text += "\nYour UES Credit balance has been increased by the following amount:";

                    List <TMPro.TextMeshProUGUI> creditsText = new List <TMPro.TextMeshProUGUI>();
                    ElementCreator.SpawnTextSize(creditsText, panelChildTransform.gameObject, new Color(1, 1, 1, 1), 40, 0, new Vector2(0.5f, 1), new Vector2(300, UIConfig.blueButtonHeight - UIConfig.panelPadding * 2), new Vector3(panelChildTransform.rect.width / 2f, -panelChildTransform.rect.height + UIConfig.spacingVertical + UIConfig.blackButtonHeight + UIConfig.spacingVertical + UIConfig.blueButtonHeight, 0));
                    creditsText[0].text = "";
                    if (Data.mode == DataEarntConsumable.mode)
                    {
                        creditsText[0].text = DataEarntConsumable.userPointsRecent.ToString();
                    }
                    else if (Data.mode == DataEarntPersistent.mode)
                    {
                        creditsText[0].text = DataEarntPersistent.userPointsRecent.ToString();
                    }

                    GameObject    backButton          = ButtonCreator.SpawnBlackButton(panelChildTransform.gameObject, new Vector2(UIConfig.blackButtonWidth, UIConfig.blackButtonHeight), "Back", new List <TMPro.TextMeshProUGUI>());
                    RectTransform backButtonTransform = backButton.transform.parent.GetComponent <RectTransform>();
                    backButtonTransform.localPosition = new Vector3(panelChildTransform.rect.width / 2f - UIConfig.blackButtonWidth / 2f, -panelHeight + UIConfig.spacingVertical + UIConfig.blackButtonHeight, backButtonTransform.localPosition.z);

                    RoR2.UI.HGButton previousSelectable = backButton.GetComponent <RoR2.UI.MPEventSystemLocator>().eventSystem.currentSelectedGameObject.GetComponent <RoR2.UI.HGButton>();
                    Button           backButtonButton   = backButton.GetComponent <RoR2.UI.HGButton>();
                    backButtonButton.onClick.AddListener(() => {
                        UIDrawer.rootTransform.GetComponent <CanvasGroup>().interactable = true;
                        if (backButtonButton.GetComponent <RoR2.UI.MPEventSystemLocator>().eventSystem.currentInputSource == RoR2.UI.MPEventSystem.InputSource.Gamepad)
                        {
                            previousSelectable.Select();
                        }
                        else
                        {
                            previousSelectable.enabled = false;
                            previousSelectable.enabled = true;
                        }
                        if (Data.mode == DataEarntConsumable.mode)
                        {
                            DataEarntConsumable.ClearRecentPoints();
                        }
                        else if (Data.mode == DataEarntPersistent.mode)
                        {
                            DataEarntPersistent.ClearRecentPoints();
                        }
                        Data.SaveConfigProfile();
                        Destroy(background.gameObject);
                    });
                    backButtonButton.Select();

                    UIDrawer.rootTransform.GetComponent <CanvasGroup>().interactable = false;
                }
            }