static void init()
    {
        ImGuiUn.Layout += DoImgui;
        style           = new GUIStyle();
        style.padding   = new RectOffset(4, 0, 0, 0);

        ComReg.AddCom("debug.stats", () => debugStats = !debugStats, "toggles debug stats");
    }
Example #2
0
    static void InitRosace()
    {
        RosaceUpdateContext.Init();

        ComReg.AddCom("rosace.updatescale", (float val) => Rosace.updateScale = val);
        ComReg.AddCom("rosace.timescale", (float val) => Rosace.timeScale     = val);
        ComReg.AddCom("rosace.delta", (float val) => Rosace.delta             = val);

        Debug.Log("ROSACE INJECTED");
    }
    static void OnLoad()
    {
        GameObject obj = new GameObject("CURSOR_DEFAULT");

        DontDestroyOnLoad(obj);
        inst = obj.AddComponent <CursorDefault>();

        ComReg.AddCom(inst, "tglcursor", ToggleCursor, "Toggles cursor active");

        CursorToggled += (on) => Debug.Log("Cursor toggled: " + on);
    }
Example #4
0
 static void ProcessLines(string[] lines)
 {
     foreach (string str in lines)
     {
         Debug.Log($"autoexec - {str}");
     }
     foreach (string str in lines)
     {
         ComReg.RunCom(str);
     }
 }
    static void init()
    {
        if (vizs != null)
        {
            return;
        }
        vizs = new List <DearImguiDebugViz>();

        ImGuiUn.Layout += ImGuiUn_Layout;

        ComReg.AddCom("debug.viz", () => doDebugViz = !doDebugViz, "toggles debug viz window");
    }
Example #6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DBUtility.ComReg comreg = new ComReg();
            comreg.Delete();

            if (comreg.Add(this.TextBox1.Text, "") > 0)
            {
                Response.Redirect("super/default.aspx");
            }
            else
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "message", "<script language='javascript' defer>alert('注册码输入错误,请重新输入!注册不成功');</script>");
            }
        }
    void Start()
    {
        ImGuiUn.Layout += Layout;

        CursorDefault.ConsoleToggled += CursorDefault_ConsoleToggled;

        ComReg.AddCom(this, "history", (int val) =>
        {
            if (val < history.Count && val >= 0)
            {
                Debug.Log($"history[{val}] - {history[val]}");
            }
        });

        ComReg.AddCom("clear", () =>
        {
            inst.logs.Clear();
        });
    }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            v.InnerHtml = Version.Ver();
            DataTable dt = new DataTable();

            DBUtility.ComReg bll = new ComReg();
            dt = bll.Getlist();
            if (dt.Rows.Count > 0)
            {
                try
                {
                    string str = dt.Rows[0]["str"].ToString();
                    str = Maticsoft.DBUtility.DESEncrypt.Decrypt(str);
                    string[] strlist = str.Split('|');
                    if (strlist[0] == DESEncrypt.Encrypt(System.Net.Dns.GetHostName()))
                    {
                        if (DateTime.Parse(strlist[1]) <= System.DateTime.Now && DateTime.Parse(strlist[2]) >= System.DateTime.Now)
                        {
                            //Response.Redirect("admin/login.aspx");
                        }
                        else
                        {
                            MessageBox.ShowAndRedirect(this, "您的软件注册时间已经到期请重新注册谢谢!", "../reg.aspx");
                        }
                    }
                    else
                    {
                        MessageBox.ShowAndRedirect(this, "您的软件还没注册请注册谢谢!", "../reg.aspx");
                    }
                }
                catch
                {
                    MessageBox.ShowAndRedirect(this, "您的软件还没注册或者已经到期请重新注册谢谢!", "../reg.aspx");
                }
            }
            else
            {
                MessageBox.ShowAndRedirect(this, "您的软件还没注册或者已经到期请重新注册谢谢!", "../reg.aspx");
            }
        }
    unsafe void Layout()
    {
        if (!CursorDefault.consoleIsOpen)
        {
            //ImGui.ShowDemoWindow();
            return;
        }

        ImGui.SetNextWindowSize(new Vector2(Screen.width, 200));
        ImGui.SetNextWindowPos(new Vector2(0, 0));
        if (ImGui.Begin("window", ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.MenuBar | ImGuiWindowFlags.NoSavedSettings))
        {
            ImGui.Separator();

            if (ImGui.BeginMenuBar())
            {
                ImGui.Checkbox("Errors", ref showErrors);
                ImGui.Checkbox("Warnings", ref showWarnings);
                ImGui.Checkbox("Info", ref showInfo);

                ImGui.Spacing();

                ImGui.Checkbox("Timestamps", ref timestamps);

                ImGui.EndMenuBar();
            }

            ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(0, 0));
            ImGui.PushStyleVar(ImGuiStyleVar.FramePadding, Vector2.one);
            if (ImGui.BeginChildFrame(1, ImGui.GetWindowSize() - new Vector2(0, 60)))
            {
                uint idx = 0;
                foreach (var log in inst.logs)
                {
                    string str = timestamps ? log.logStr : log.logStrNoTimestamp;
                    ImGui.PushStyleVar(ImGuiStyleVar.ItemInnerSpacing, Vector2.zero);

                    TimeSpan diff  = DateTime.Now - log.time;
                    float    alpha = 1 - Mathf.Clamp01((float)diff.TotalSeconds - (float)CmdFadeTime.TotalSeconds);

                    Vector4 col = Vector4.one;
                    if (log.logType == LogType.Assert || log.logType == LogType.Exception)
                    {
                        col = new Vector4(.6f, 0, 0, 1);
                    }
                    if (log.logType == LogType.Error)
                    {
                        col = new Vector4(1, 0, 0, 1);
                    }
                    if (log.logType == LogType.Warning)
                    {
                        col = new Vector4(1, 1, .3f, 1);
                    }
                    if (log.logType == LogType.Log)
                    {
                        col = new Vector4(1, 1, 1, 1);
                    }
                    ImGui.PushStyleColor(ImGuiCol.Button, new Vector4(1, 1, 1, 0.1f * alpha));
                    ImGui.PushStyleColor(ImGuiCol.Text, col);
                    Vector2 size = new Vector2(ImGui.GetWindowWidth(), ImGui.CalcTextSize(str).y + 3);
                    ImGui.PushStyleVar(ImGuiStyleVar.ButtonTextAlign, new Vector2(0f, 0.5f));
                    bool show = ((log.logType == LogType.Assert || log.logType == LogType.Exception) && showErrors) ||
                                (log.logType == LogType.Error && showErrors) ||
                                (log.logType == LogType.Warning && showWarnings) ||
                                (log.logType == LogType.Log && showInfo);
                    if (show)
                    {
                        if (ImGui.Button(str, size))
                        {
                            log.isOpen = !log.isOpen;
                        }
                        if (ImGui.BeginPopupContextItem($"expand_log_{idx}"))
                        {
                            ImGui.Checkbox("Stack trace", ref log.isOpen);
                            if (ImGui.Selectable("Copy..."))
                            {
                                if (log.isOpen)
                                {
                                    ImGui.SetClipboardText($"{str}\n{log.stackTrace}");
                                }
                                else
                                {
                                    ImGui.SetClipboardText(str);
                                }
                                inst.PushStatus("Copied!");
                            }

                            ImGui.EndPopup();
                        }
                        if (log.isOpen)
                        {
                            ImGui.Text(log.stackTrace);
                        }
                    }
                    ImGui.PopStyleColor();
                    ImGui.PopStyleColor();
                    ImGui.PopStyleVar();
                    ImGui.PopStyleVar();

                    idx++;
                }

                inst.scrollToBottom = ImGui.GetScrollY() >= ImGui.GetScrollMaxY();

                if (inst.scrollToBottom)
                {
                    ImGui.SetScrollHereY(1.0f);
                }

                ImGui.EndChildFrame();
            }
            ImGui.PopStyleVar();
            ImGui.PopStyleVar();

            ImGui.Spacing();

            ImGuiInputTextCallback cb = (ImGuiInputTextCallbackData * data) =>
            {
                ImGuiInputTextCallbackDataPtr ptr = new ImGuiInputTextCallbackDataPtr(data);
                if (desiredConsoleInput != null)
                {
                    ptr.DeleteChars(0, ptr.BufTextLen);
                    ptr.InsertChars(0, desiredConsoleInput);
                    desiredConsoleInput = null;
                }
                return(ptr.BufTextLen);
            };
            if (ImGui.InputTextWithHint("", ">", ref consoleInput, 150, ImGuiInputTextFlags.EnterReturnsTrue | ImGuiInputTextFlags.CallbackAlways, cb))
            {
                bool didRun = ComReg.RunCom(consoleInput);
                //if (history.Count == 0 || history[history.Count - 1] != consoleInput)
                if (didRun)
                {
                    history.Add(consoleInput);
                }
                consoleInput    = "";
                historyLogIndex = -1;
                ImGui.SetKeyboardFocusHere();
            }

            if (FocusText)
            {
                ImGui.SetKeyboardFocusHere(-1);
                FocusText = false;
            }
            if (consoleInput.Contains("`")) //hack
            {
                consoleInput = consoleInput.Replace("`", "");
            }
            ImGui.SameLine();
            inst.DrawStatusImgui();

            ImGui.End();
        }
    }