Exemple #1
0
        public Form LoadGroupForm(G_ID windowID)
        {
            int num = Guid.NewGuid().GetHashCode();

            if (10501 >= num && 0 <= num)
            {
                num += 10501;
            }
            Form form = MsgHandler.HandleReturn <Form>("CreateForm", new object[]
            {
                windowID
            });

            if (form == null)
            {
                return(null);
            }
            this.formList.Add(num, form);
            form.InitializeForm();
            if (form.InteractivePanel == null)
            {
                return(null);
            }
            form.WindowID   = num;
            form.Orignal_ID = windowID;
            form.OnLoad();
            if (MsgHandler.Handle("IsNPCTalkState", new object[0]))
            {
                this.AddReserveShowForm(num);
                form.Visible = false;
            }
            this.formDepth.Add(num);
            return(form);
        }
Exemple #2
0
        public Form LoadForm(G_ID windowID)
        {
            if (this.formList.ContainsKey((int)windowID) && windowID != G_ID.TOOLTIP_DLG)
            {
                if (this.formList[(int)windowID].ShowHide)
                {
                    this.formList[(int)windowID].Show();
                }
                return(this.formList[(int)windowID]);
            }
            if (this.formList.ContainsKey((int)windowID) && windowID == G_ID.TOOLTIP_DLG)
            {
                this.CloseForm(windowID);
            }
            Form form = MsgHandler.HandleReturn <Form>("CreateForm", new object[]
            {
                windowID
            });

            if (form == null)
            {
                return(null);
            }
            this.formList.Add((int)windowID, form);
            this.formDepth.Add((int)windowID);
            form.WindowID   = (int)windowID;
            form.Orignal_ID = windowID;
            form.InitializeForm();
            if (form.InteractivePanel == null)
            {
                if (this.formList.ContainsKey((int)windowID))
                {
                    this.formList.Remove((int)windowID);
                }
                if (this.formDepth.Contains((int)windowID))
                {
                    this.formDepth.Remove((int)windowID);
                }
                return(null);
            }
            form.OnLoad();
            form.OnOpenCallback();
            return(form);
        }
Exemple #3
0
        public static Form LoadForm(GameObject gameObject, Type formType, GUISkin defaultSkin)
        {
            if (gameObject == null)
            {
                throw new ApplicationException("GameObject cannot be null");
            }

            Form form = (Form)gameObject.AddComponent(formType);

            formList.Add(form.ID, form);

            form.Skin = defaultSkin;

            form.InitializeForm();

            form.OnLoad();

            return(form);
        }