コード例 #1
0
        public static void Initialize()
        {
            if (ObjectFinder.Self.GlueProject == null)
            {
                ExposedVariableManager.Initialize();

                ObjectFinder.Self.GlueProject = new FlatRedBall.Glue.SaveClasses.GlueProjectSave();

                AvailableAssetTypes.Self.Initialize(FileManager.RelativeDirectory);


                // Perform a partial initialization of FRB:
                FlatRedBallServices.InitializeCommandLine();
                //SpriteManager.Initialize();

                SpriteManager.Camera.LeftDestination   = 0;
                SpriteManager.Camera.RightDestination  = 800;
                SpriteManager.Camera.TopDestination    = 0;
                SpriteManager.Camera.BottomDestination = 640;


                // Do this after inintializing FlatRedBall
                GluxManager.ContentDirectory   = FileManager.RelativeDirectory + "Content\\";
                GluxManager.ContentManagerName = "ContentManagerName";

                ScriptParsingPlugin.Self.StartUp();
            }
        }
コード例 #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);

            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();
        }
コード例 #3
0
        public void Initialize()
        {
            OverallInitializer.Initialize();

            ExposedVariableManager.Initialize();
            mEntitySave = CreateEntitySaveWithStates("ExposedVariableEntity");
            mEntitySave.ImplementsIVisible = true;
            ObjectFinder.Self.GlueProject.Entities.Add(mEntitySave);

            mDerivedEntitySave            = new EntitySave();
            mDerivedEntitySave.BaseEntity = mEntitySave.Name;
            mDerivedEntitySave.Name       = "DerivedExposedVariableEntity";
            ObjectFinder.Self.GlueProject.Entities.Add(mDerivedEntitySave);

            mEntityWithCategorizedThatShareVariables      = new EntitySave();
            mEntityWithCategorizedThatShareVariables.Name = "ExposedVariableTestEntityWithCategorizedThatShareVariables";
            ObjectFinder.Self.GlueProject.Entities.Add(mEntityWithCategorizedThatShareVariables);
            StateSaveCategory category = new StateSaveCategory();

            category.SharesVariablesWithOtherCategories = true; // this is important - it means that it won't make a new enum or property, so it is just the "CurrentState" variable
            category.Name = "Category1";
            mEntityWithCategorizedThatShareVariables.StateCategoryList.Add(category);
            StateSave stateSave = new StateSave();

            stateSave.Name = "CategorizedState1";
            category.States.Add(stateSave);

            mContainerBaseEntity      = new EntitySave();
            mContainerBaseEntity.Name = "ExposedVariableTestContainerBaseEntity";
            ObjectFinder.Self.GlueProject.Entities.Add(mContainerBaseEntity);
            NamedObjectSave namedObjectSave = new NamedObjectSave();

            namedObjectSave.InstanceName    = mEntitySave.Name + "Instance";
            namedObjectSave.SourceType      = SourceType.Entity;
            namedObjectSave.SourceClassType = mEntitySave.Name;
            mContainerBaseEntity.NamedObjects.Add(namedObjectSave);
            CustomVariable tunneledVariable = new CustomVariable();

            tunneledVariable.Name                 = "TunneledStateVariable";
            tunneledVariable.SourceObject         = namedObjectSave.InstanceName;
            tunneledVariable.SourceObjectProperty = "Current" + mEntitySave.StateCategoryList[0].Name + "State";
            tunneledVariable.Type                 = mEntitySave.StateCategoryList[0].Name;
            tunneledVariable.SetByDerived         = true;
            mContainerBaseEntity.CustomVariables.Add(tunneledVariable);

            mContainerDerivedEntity      = new EntitySave();
            mContainerDerivedEntity.Name = "ExposedVariableTestContainerDerivedEntity";
            ObjectFinder.Self.GlueProject.Entities.Add(mContainerDerivedEntity);
            mContainerDerivedEntity.BaseEntity = mContainerBaseEntity.Name;
            mContainerDerivedEntity.UpdateFromBaseType();
            mContainerDerivedEntity.GetCustomVariable(tunneledVariable.Name).DefaultValue = mEntitySave.StateCategoryList[0].States[0].Name;

            CreateCsvContainerEntitySave();
        }
コード例 #4
0
        public static void Initialize()
        {
            if (ObjectFinder.Self.GlueProject == null)
            {
                ObjectFinder.Self.GlueProject = new FlatRedBall.Glue.SaveClasses.GlueProjectSave();
                ProjectManager.Initialize();
#if TEST
                ProjectManager.ProjectBase = new TestProject();
#endif
                FlatRedBall.Instructions.InstructionManager.Initialize();

                AvailableAssetTypes.Self.Initialize("ContentTypes.csv", FlatRedBall.IO.FileManager.CurrentDirectory);
                ExposedVariableManager.Initialize();

                // Just to initialize:
                var throwaway = EditorData.FileAssociationSettings;
            }
        }
コード例 #5
0
        private void OnLoaded(Object sender, RoutedEventArgs routedEventArgs)
        {
            _mainGame            = new MainGame(flatRedBallControl);
            _mainGame.MainWindow = this;
            ArrowCommands.Self.Initialize(this.AllElementsTreeView, this.SingleElementTreeView, this.DeleteMenuItem, this.CopyMenuItem);
            ArrowState.Self.Initialize(this, this.AllElementsTreeView, this.SingleElementTreeView);
            PropertyGridManager.Self.Initialize(DataGridUi);

            ArrowState.Self.CurrentArrowProject = new FlatRedBall.Arrow.DataTypes.ArrowProjectSave();

            GluxManager.ObjectFinder = new GlueObjectFinder();


            AvailableAssetTypes.Self.AddAssetTypes("Content/ContentTypes.csv");
            ExposedVariableManager.Initialize();

            this.AllElementsTreeView.DataContext   = ArrowState.Self.CurrentArrowProjectVm;
            this.SingleElementTreeView.DataContext = ArrowState.Self;
            this.ContentsLabel.DataContext         = ArrowState.Self;
        }