コード例 #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");