Inheritance: System.Windows.Forms.Form
示例#1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            InitializeIoc();

            this.TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);

            mToolForm       = new ToolForm();
            mToolForm.Owner = (Form)(Form.FromHandle(FlatRedBallServices.WindowHandle));
            mToolForm.ItemCollapsedOrExpanded += HandleToolFormItemCollapsedOrExpanded;
            Plugin.PluginManager.Initialize();

            IsMouseVisible = true;

            IsFixedTimeStep = false;

            GuiData.Initialize();

            RegisterAdditionalAssemblies();

            AvailableAssetTypes.Self.Initialize(FileManager.RelativeDirectory);

            #region Set up resizing

            mFormMethods = new FormMethods(0, 0, 0, 0);

            #endregion

            SpriteManager.Camera.BackgroundColor = Color.Gray;
            FlatRedBall.Math.Geometry.Polygon.TolerateEmptyPolygons = true;
            ExposedVariableManager.Initialize();

            try
            {
                RemotingServer.SetupPort(8686);
                RemotingServer.SetupInterface <FlatRedBall.Glue.SelectionInterface>();
                RemotingServer.SetupInterface <RegisterInterface>();
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show("GlueView could not start, please make sure GlueView is not already running on your computer \n \n Exception: \n" + e.ToString());
                FlatRedBall.FlatRedBallServices.Game.Exit();
            }

            mToolForm.Show();

            GluxManager.ContentManagerName = "GlueView";


            EditorLogic.Initialize();

            CommandLineManager.Self.ProcessCommandLineArgs(this.mToolForm);

            mainForm         = Form.FromHandle(FlatRedBallServices.WindowHandle) as Form;
            mainForm.Resize += HandleResize;
            base.Initialize();
        }
示例#2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            FlatRedBallServices.InitializeFlatRedBall(this, graphics);

            this.TargetElapsedTime = TimeSpan.FromSeconds( 1 / 30.0 );

            mToolForm = new ToolForm();
            mToolForm.Owner = (Form)(Form.FromHandle(FlatRedBallServices.WindowHandle));
            Plugin.PluginManager.Initialize();

            IsMouseVisible = true;

            IsFixedTimeStep = false;

            GuiData.Initialize();

            RegisterAdditionalAssemblies();

            AvailableAssetTypes.Self.Initialize(FileManager.RelativeDirectory);

            #region Set up resizing

            mFormMethods = new FormMethods(0, 0, 0, 0);

            #endregion

            SpriteManager.Camera.BackgroundColor = Color.Gray;
            FlatRedBall.Math.Geometry.Polygon.TolerateEmptyPolygons = true;
            ExposedVariableManager.Initialize();

            try
            {
                RemotingServer.SetupPort(8686);
                RemotingServer.SetupInterface<SelectionInterface>();
                RemotingServer.SetupInterface<RegisterInterface>();
            }
            catch(Exception e)
            {
                System.Windows.Forms.MessageBox.Show("GlueView could not start, please make sure GlueView is not already running on your computer \n \n Exception: \n"+e.ToString());
                FlatRedBall.FlatRedBallServices.Game.Exit(); 
            }

            mToolForm.Show();
            
            GluxManager.ContentManagerName = "GlueView";


            EditorLogic.Initialize();

            CommandLineManager.Self.ProcessCommandLineArgs(this.mToolForm);

            Form form = Form.FromHandle(FlatRedBallServices.WindowHandle) as Form;
            form.Resize += HandleResize;
            
            base.Initialize();
        }
 public void ProcessCommandLineArgs(ToolForm toolForm)
 {
     foreach (var argument in Program.CommandLineArgs)
     {
         if (argument == "ScriptMode")
         {
             SwitchToScriptMode(toolForm);
         }
     }
 }
        private void SwitchToScriptMode(ToolForm toolForm)
        {
            var foundForm = CollapsibleFormHelper.Self.GetControlByLabel("Script Parsing") as ScriptingControl;

            if (foundForm != null)
            {
                foundForm.ShowNewFullScriptingForm();
                // need to hide the window
                toolForm.Minimize();
            }
        }