예제 #1
0
        private static void NativeError(string namesection, string txt)
        {
            namesection ??= MelonUtils.GetMelonFromStackTrace()?.Info?.Name?.Replace(" ", "_");

            Internal_Error(namesection, txt ?? "null");
            RunErrorCallbacks(namesection, txt ?? "null");
        }
예제 #2
0
        private static void SendWarning(string txt)
        {
            string    namesection = null;
            MelonBase melon       = MelonUtils.GetMelonFromStackTrace();

            if (melon != null)
            {
                namesection = melon.Info.Name;
            }
            ManualWarning(namesection, txt);
        }
예제 #3
0
        private static void SendMsg(ConsoleColor msgcolor, string msg)
        {
            ConsoleColor meloncolor  = MelonLogger.DefaultMelonColor;
            string       namesection = null;
            MelonBase    melon       = MelonUtils.GetMelonFromStackTrace();

            if (melon != null)
            {
                namesection = melon.Info.Name.Replace(" ", "_");
                msgcolor    = melon.ConsoleColor;
            }
            Internal_Msg(meloncolor, msgcolor, namesection, msg);
            MsgCallbackHandler?.Invoke(meloncolor, msgcolor, namesection, msg);
        }
예제 #4
0
        private static void SendMsg(ConsoleColor txtcolor, string txt)
        {
            ConsoleColor meloncolor  = DefaultMelonColor;
            string       namesection = null;
            MelonBase    melon       = MelonUtils.GetMelonFromStackTrace();

            if (melon != null)
            {
                namesection = melon.Info.Name.Replace(" ", "_");
                meloncolor  = melon.ConsoleColor;
            }
            Internal_Msg(meloncolor, txtcolor, namesection, txt);
            RunMsgCallbacks(meloncolor, txtcolor, namesection, txt);
        }
예제 #5
0
        private static void SendMsg(ConsoleColor txtcolor, string txt)
        {
            ConsoleColor meloncolor  = DefaultMelonColor;
            string       namesection = null;
            MelonBase    melon       = MelonUtils.GetMelonFromStackTrace();

            if (melon != null)
            {
                namesection = melon.Info.Name.Replace(" ", "_");
                meloncolor  = melon.ConsoleColor;
            }

            PushMessageToBepInEx(namesection, txt, LogLevel.Message);
            RunMsgCallbacks(meloncolor, txtcolor, namesection, txt ?? "null");
        }
예제 #6
0
        private static void NativeMsg(ConsoleColor namesection_color, ConsoleColor txt_color, string namesection, string txt)
        {
            if (string.IsNullOrEmpty(namesection))
            {
                MelonBase melon = MelonUtils.GetMelonFromStackTrace();
                if (melon != null)
                {
                    namesection       = melon.Info?.Name?.Replace(" ", "_");
                    namesection_color = melon.ConsoleColor;
                }
            }

            Internal_Msg(namesection_color, txt_color, namesection, txt ?? "null");
            RunMsgCallbacks(namesection_color, txt_color, namesection, txt ?? "null");
        }
예제 #7
0
 private static void SendError(string txt) => ManualMelonError(MelonUtils.GetMelonFromStackTrace(), txt ?? "null");