Beispiel #1
0
 public void esp()
 {
     foreach (PurchaseInteraction Pinteraction in Pinterobj)
     {
         if (Pinteraction.available)
         {
             Vector3 vector = Camera.main.WorldToScreenPoint(Pinteraction.transform.position);
             if ((double)vector.z > 0.01)
             {
                 GUI.color = Color.cyan;
                 string displayName = Pinteraction.GetDisplayName();
                 GUI.Label(new Rect(vector.x, (float)Screen.height - vector.y, 100f, 50f), displayName);
             }
         }
     }
     foreach (TeleporterInteraction teleporterInteraction in Tinterobj)
     {
         Vector3 vector2 = Camera.main.WorldToScreenPoint(teleporterInteraction.transform.position);
         if ((double)vector2.z > 0.01)
         {
             GUI.color = Color.green;
             GUI.Label(new Rect(vector2.x, (float)Screen.height - vector2.y, 100f, 50f), "Teleporter");
         }
     }
 }
Beispiel #2
0
        public static string PurchasableMessage(PurchaseInteraction PI)
        {
            string displayName = $"{PI.GetDisplayName()}";
            string cost        = PI.GetTextFromPurchasableType();
            string costColor   = PI.GetColorFromPurchasableType();

            if (PI.InteractableIsUsedUp())
            {
                if (PI.IsContainer())
                {
                    cost = "Opened";
                }
                else if (PI.IsShrine())
                {
                    cost = "Used";
                }
                else
                {
                    cost = "Unavailable";
                }
                costColor = RoR2Colors.Tier1ItemDark;
            }
            string message = $"<color={RoR2Colors.Tier1ItemDark}>{displayName}:</color> <color={costColor}>{cost}</color>";

            return(message);
        }
Beispiel #3
0
        public static void Interactables()
        {
            if (TeleporterInteraction.instance)
            {
                var     teleporterInteraction = TeleporterInteraction.instance;
                float   distanceToObject      = Vector3.Distance(Camera.main.transform.position, teleporterInteraction.transform.position);
                Vector3 Position       = Camera.main.WorldToScreenPoint(teleporterInteraction.transform.position);
                var     BoundingVector = new Vector3(Position.x, Position.y, Position.z);
                if (BoundingVector.z > 0.01)
                {
                    Styles.RenderTeleporterStyle.normal.textColor =
                        teleporterInteraction.isIdle ? Color.magenta :
                        teleporterInteraction.isIdleToCharging || teleporterInteraction.isCharging ? Color.yellow :
                        teleporterInteraction.isCharged ? Color.green : Color.yellow;
                    int    distance     = (int)distanceToObject;
                    String friendlyName = "Teleporter";
                    string status       = "" + (
                        teleporterInteraction.isIdle ? "Idle" :
                        teleporterInteraction.isCharging ? "Charging" :
                        teleporterInteraction.isCharged ? "Charged" :
                        teleporterInteraction.isActiveAndEnabled ? "Idle" :
                        teleporterInteraction.isIdleToCharging ? "Idle-Charging" :
                        teleporterInteraction.isInFinalSequence ? "Final-Sequence" :
                        "???");
                    string boxText = $"{friendlyName}\n{status}\n{distance}m";
                    GUI.Label(new Rect(BoundingVector.x - 50f, (float)Screen.height - BoundingVector.y, 100f, 50f), boxText, Styles.RenderTeleporterStyle);
                }
            }

            for (int i = 0; i < barrelInteractions.Count; i++)
            {
                BarrelInteraction barrel = barrelInteractions[i];

                if (!barrel.Networkopened)
                {
                    string  friendlyName   = "Barrel";
                    Vector3 Position       = Camera.main.WorldToScreenPoint(barrel.transform.position);
                    var     BoundingVector = new Vector3(Position.x, Position.y, Position.z);
                    if (BoundingVector.z > 0.01)
                    {
                        float  distance = (int)Vector3.Distance(Camera.main.transform.position, barrel.transform.position);
                        string boxText  = $"{friendlyName}\n{distance}m";
                        GUI.Label(new Rect(BoundingVector.x - 50f, (float)Screen.height - BoundingVector.y, 100f, 50f), boxText, Styles.RenderInteractablesStyle);
                    }
                }
            }

            for (int i = 0; i < secretButtons.Count; i++)
            {
                PressurePlateController secretButton = secretButtons[i];
                if (secretButton)
                {
                    string  friendlyName   = "Secret Button";
                    Vector3 Position       = Camera.main.WorldToScreenPoint(secretButton.transform.position);
                    var     BoundingVector = new Vector3(Position.x, Position.y, Position.z);
                    if (BoundingVector.z > 0.01)
                    {
                        float  distance = (int)Vector3.Distance(Camera.main.transform.position, secretButton.transform.position);
                        string boxText  = $"{friendlyName}\n{distance}m";
                        GUI.Label(new Rect(BoundingVector.x - 50f, (float)Screen.height - BoundingVector.y, 100f, 50f), boxText, Styles.RenderSecretsStyle);
                    }
                }
            }

            for (int i = 0; i < scrappers.Count; i++)
            {
                ScrapperController scrapper = scrappers[i];
                if (scrapper)
                {
                    string  friendlyName   = "Scrapper";
                    Vector3 Position       = Camera.main.WorldToScreenPoint(scrapper.transform.position);
                    var     BoundingVector = new Vector3(Position.x, Position.y, Position.z);
                    if (BoundingVector.z > 0.01)
                    {
                        float  distance = (int)Vector3.Distance(Camera.main.transform.position, scrapper.transform.position);
                        string boxText  = $"{friendlyName}\n{distance}m";
                        GUI.Label(new Rect(BoundingVector.x - 50f, (float)Screen.height - BoundingVector.y, 100f, 50f), boxText, Styles.RenderInteractablesStyle);
                    }
                }
            }

            for (int i = 0; i < purchaseInteractions.Count; i++)
            {
                PurchaseInteraction purchaseInteraction = purchaseInteractions[i];

                if (purchaseInteraction.available)
                {
                    string dropName = null;
                    var    chest    = purchaseInteraction?.gameObject.GetComponent <ChestBehavior>();
                    if (chest)
                    {
                        dropName = Util.GenerateColoredString(Language.GetString(chest.GetField <PickupIndex>("dropPickup").GetPickupNameToken()), chest.GetField <PickupIndex>("dropPickup").GetPickupColor());
                    }
                    float   distanceToObject = Vector3.Distance(Camera.main.transform.position, purchaseInteraction.transform.position);
                    Vector3 Position         = Camera.main.WorldToScreenPoint(purchaseInteraction.transform.position);
                    var     BoundingVector   = new Vector3(Position.x, Position.y, Position.z);
                    if (BoundingVector.z > 0.01)
                    {
                        int    distance     = (int)distanceToObject;
                        String friendlyName = purchaseInteraction.GetDisplayName();
                        int    cost         = purchaseInteraction.cost;
                        string boxText      = dropName != null ? $"{friendlyName}\n${cost}\n{distance}m\n{dropName}" : $"{friendlyName}\n${cost}\n{distance}m";
                        GUI.Label(new Rect(BoundingVector.x - 50f, (float)Screen.height - BoundingVector.y, 100f, 50f), boxText, Styles.RenderInteractablesStyle);
                    }
                }
            }
        }