コード例 #1
0
ファイル: MultiForm.cs プロジェクト: kjmikkel/NWN2_Multibrush
        public static MultiForm makeMultiForm()
        {
            if (form == null)
                form = new MultiForm();

            return form;
        }
コード例 #2
0
ファイル: Multibrush.cs プロジェクト: SeanWH/NWN2_Multibrush
        public void Unload(INWN2PluginHost cHost)
        {
            UI.MultiForm form = UI.MultiForm.makeMultiForm();
            form.Dispose();

            m_cMenuItem.Dispose();
            m_cMenuItem = null;
        }
コード例 #3
0
        public static MultiForm makeMultiForm()
        {
            if (form == null)
            {
                form = new MultiForm();
            }

            return(form);
        }
コード例 #4
0
ファイル: Multibrush.cs プロジェクト: SeanWH/NWN2_Multibrush
        /// <summary>
        /// A utility method to handle the launch of the multiform.
        /// If the data is different than null, then it becomes the default data for the multiform
        /// </summary>
        /// <param name="data"></param>
        public static void makeMultiForm(brushData data)
        {
            UI.MultiForm form = UI.MultiForm.makeMultiForm();

            if (data != null)
            {
                form.setData(data);
            }

            if (DialogResult.OK == form.ShowDialog() && form.data != null)
            {
                drawPolygon.Enabled = false;
                if (form.data.mode == paintmode.paint)
                {
                    debugOut("brush!");
                    tool = "Brush";
                }
                else if (form.data.mode == paintmode.eyedrop)
                {
                    debugOut("eyedrop");
                    tool = "Eyedrop tool";
                }
                else if (form.data.mode == paintmode.polygon)
                {
                    debugOut("Polygon");
                    tool = "Polygon paint";
                    drawPolygon.Enabled = true;
                }
                else
                {
                    throw new Exception("Error wrong paint mode");
                }
                //	setStartStopTitle(true);

                if (!form.stopSystem)
                {
                    if (m_timer != null)
                    {
                        m_timer.setNewData(form.data);
                        m_timer.resumeTexture();
                    }
                    else
                    {
                        m_timer = new IntervalTimer(form.data);
                        m_timer.startTexture();
                    }
                    setStartStopTitle(true);
                }
                else
                {
                    if (m_timer != null)
                    {
                        m_timer.stopTexture();
                        setStartStopTitle(false);
                    }
                }
            }

            if (form.data == null)
            {
                setStartStopTitle(false);
            }
        }