Example #1
0
 public WindowControl(GameWindow WND)
 {
     this.WND = WND;
 }
Example #2
0
        public void LoadAllWindows()
        {
            GO = Memory.RD(CHR.HNDL, "BA+GA_OFS+Gui_O1+Gui_O2");
            if (GO == 0)
            {
                return;
            }
            WL.Clear();
            int P = Memory.RD(CHR.HNDL, GO + OFS.GetInt("Gui_LowW_Struct"));

            while (true)
            {
                if (P == 0)
                {
                    break;
                }
                try
                {
                    GameWindow w = new GameWindow(CHR.HNDL);
                    w.ptr        = Memory.RD(CHR.HNDL, P + OFS.GetInt("Gui_Win_Ptr"));
                    w.GF         = Memory.RD(CHR.HNDL, Memory.RD(CHR.HNDL, w.ptr) + 0x30);
                    w.name_ptr   = Memory.RD(CHR.HNDL, w.ptr + OFS.GetInt("Gui_Win_Name"));
                    w.name       = Memory.RS(CHR.HNDL, w.name_ptr, 64, false);
                    w.visibility = (Memory.RD(CHR.HNDL, w.ptr + OFS.GetInt("Gui_Win_Visibility")) & 1) > 1 ? 1 : 0;
                    w.CL         = new List <WindowControl>();
                    WL.Add(w);
                    P = Memory.RD(CHR.HNDL, P);
                }
                catch (Exception e)
                {
                    Logging.Log(e.ToString());
                    break;
                }
            }
            P = Memory.RD(CHR.HNDL, GO + OFS.GetInt("Gui_TopW_Struct"));
            while (true)
            {
                if (P == 0)
                {
                    break;
                }
                try
                {
                    GameWindow w = new GameWindow(CHR.HNDL);
                    w.ptr        = Memory.RD(CHR.HNDL, P + OFS.GetInt("Gui_Win_Ptr"));
                    w.name_ptr   = Memory.RD(CHR.HNDL, w.ptr + OFS.GetInt("Gui_Win_Name"));
                    w.name       = Memory.RS(CHR.HNDL, w.name_ptr, 64, false);
                    w.visibility = Memory.RD(CHR.HNDL, w.ptr + OFS.GetInt("Gui_Win_Visibility"));
                    w.CL         = new List <WindowControl>();
                    WL.Add(w);
                    P = Memory.RD(CHR.HNDL, P);
                }
                catch (Exception e)
                {
                    Logging.Log(e.ToString());
                    break;
                }
            }
            foreach (GameWindow w in WL)
            {
                P = Memory.RD(CHR.HNDL, w.ptr + OFS.GetInt("Gui_Win_Ctrl_Array"));
                while (true)
                {
                    if (P == 0)
                    {
                        break;
                    }
                    try
                    {
                        WindowControl c = new WindowControl(w);
                        c.ptr      = Memory.RD(CHR.HNDL, P + OFS.GetInt("Gui_Win_Ctrl_Ptr"));
                        c.name_ptr = Memory.RD(CHR.HNDL, c.ptr + OFS.GetInt("Gui_Win_Ctrl_Name"));
                        c.name     = Memory.RS(CHR.HNDL, c.name_ptr, 64, false);
                        c.CP       = Memory.RD(CHR.HNDL, c.ptr + OFS.GetInt("Gui_Win_Ctrl_Function"));
                        c.CN       = Memory.RS(CHR.HNDL, c.CP, 64, false);
                        w.CL.Add(c);
                        P = Memory.RD(CHR.HNDL, P + OFS.GetInt("Gui_Win_Ctrl_Next"));
                    }
                    catch (Exception e)
                    {
                        Logging.Log(e.ToString());
                        break;
                    }
                }
            }
        }