public static void Info(string msg, bool showOnScreen = false, AssemblyName callingAssembly = null)
        {
            Console.WriteLine($"[{(callingAssembly ?? ModName).Name}:INFO] {msg}");

            if (showOnScreen)
            {
                ErrorMessage.AddMessage(msg);
            }
        }
Example #2
0
        public static void Info(string msg, bool showOnScreen = false, Assembly callingAssembly = null)
        {
            string name = (callingAssembly ?? Assembly.GetCallingAssembly()).GetName().Name;

            Console.WriteLine($"[{name}:INFO] {msg}");

            if (showOnScreen)
                ErrorMessage.AddMessage(msg);
        }
Example #3
0
        public static void Message(string msg, bool showOnScreen = false)
        {
            string name = Assembly.GetCallingAssembly().GetName().Name;

            Console.WriteLine($"[{name}] : {msg}");

            if (showOnScreen)
            {
                ErrorMessage.AddMessage(msg);
            }
        }
Example #4
0
        public static void ExecuteCommand(object message, object command)
        {
            if (message != null)
            {
                ErrorMessage.AddMessage(message.ToString());
            }

            if (command != null)
            {
                SNLogger.Log((string)command);
                DevConsole.SendConsoleCommand(command.ToString());
            }
        }
Example #5
0
        public static Vector3 Teleport(string targetName, Vector3 targetPos)
        {
            Vector3 currentWorldPos = Player.main.transform.position;

            if (IsPlayerInVehicle())
            {
                Player.main.GetVehicle().TeleportVehicle(targetPos, Quaternion.identity);
                Player.main.CompleteTeleportation();
                ErrorMessage.AddMessage($"Vehicle and Player Warped to: {targetName}\n({targetPos.ToString()})");
            }
            else
            {
                Player.main.SetPosition(targetPos);
                Player.main.OnPlayerPositionCheat();
                ErrorMessage.AddMessage($"Player Warped to: {targetName}\n({targetPos.ToString()})");
            }

            return(currentWorldPos);
        }
Example #6
0
        public static string Teleport(string targetName, string vector3string)
        {
            Vector3 currentWorldPos = Player.main.transform.position;

            string prevCwPos = string.Format("{0:D} {1:D} {2:D}", (int)currentWorldPos.x, (int)currentWorldPos.y, (int)currentWorldPos.z);

            if (IsPlayerInVehicle())
            {
                Player.main.GetVehicle().TeleportVehicle(ConvertStringPosToVector3(vector3string), Quaternion.identity);
                Player.main.CompleteTeleportation();
                ErrorMessage.AddMessage($"Vehicle and Player Warped to: {targetName}\n({vector3string})");
            }
            else
            {
                Player.main.SetPosition(ConvertStringPosToVector3(vector3string));
                Player.main.OnPlayerPositionCheat();
                ErrorMessage.AddMessage($"Player Warped to: {targetName}\n({vector3string})");
            }

            return(prevCwPos);
        }