예제 #1
0
        public static void PrintOut(string log)
        {
            global::Console instance = global::Console.instance;

            if (instance == null)
            {
                return;
            }
            instance.Print(log);
        }
예제 #2
0
        // Token: 0x06000003 RID: 3 RVA: 0x00002084 File Offset: 0x00000284
        public static bool Prefix(global::Console __instance)
        {
            string   text = global::Console.instance.m_input.text;
            Assembly val  = typeof(Player).Assembly;

            string[] array = text.Split(new char[]
            {
                ' '
            });
            if (text.Equals("qol.debug"))
            {
                InputText_Patch.PrintOut("Usage: qol.debug <class>");
            }
            else if (text.Contains("qol.debug"))
            {
                try
                {
                    string _class = text.Split(' ')[1];
                    ModUtils.Log(_class);
                    Type type = val.GetType(_class);
                    if (type != null)
                    {
                        BindingFlags bindingFlags = BindingFlags.Public |
                                                    BindingFlags.NonPublic |
                                                    BindingFlags.Instance |
                                                    BindingFlags.Static;
                        InputText_Patch.PrintOut($"\n======== {type} =========");

                        foreach (FieldInfo field in type.GetFields(bindingFlags))
                        {
                            InputText_Patch.PrintOut($"{field.Name}");
                        }
                    }
                    else
                    {
                        InputText_Patch.PrintOut($"{text.Split(' ')[1]} class not found");
                    }
                }
                catch (Exception e) { ModUtils.Log(e); }
            }

            return(true);
        }