Example #1
0
        private void UpdateCoreGumFilePresence(Assembly assemblyContainingResources, FileAdditionBehavior behavior)
        {
            var codeItemAdder = GetGumCoreCodeItemAdder(assemblyContainingResources);

            if (behavior == FileAdditionBehavior.EmbedCodeFiles)
            {
                // April 14, 2017
                // Used to only copy
                // if out of date, but
                // this plugin is updated
                // so frequently, and if we
                // don't force copy, then starter
                // projects will always be out of date
                // because their modified date is newer
                // than the plugin.
                //mCodeAdder.AddFileBehavior = AddFileBehavior.IfOutOfDate;
                codeItemAdder.AddFileBehavior = AddFileBehavior.AlwaysCopy;
                TaskManager.Self.AddSync(() =>
                {
                    // Just in case the project was unloaded:
                    if (GlueState.Self.CurrentGlueProject != null)
                    {
                        codeItemAdder.PerformAddAndSave(assemblyContainingResources);
                    }
                }, "Adding standard Gum files");
            }
            else // remove both:
            {
                TaskManager.Self.AddSync(() =>
                {
                    codeItemAdder.PerformRemoveAndSave(assemblyContainingResources);
                }, "Removing standard Gum files");
            }
        }
Example #2
0
        public void UpdateCodeInProjectPresence(FileAdditionBehavior behavior)
        {
            bool hasGumProject = AppState.Self.GumProjectSave != null;

            if (hasGumProject)
            {
                Assembly assembly = Assembly.GetExecutingAssembly();

                UpdateCoreGumFilePresence(assembly, behavior);

                UpdateAdvancedStateInterpolationFiles(assembly, behavior);
            }
        }
Example #3
0
        public void SetFrom(GumProjectSave gumProjectSave, ReferencedFileSave referencedFileSave)
        {
            backingGumProject = gumProjectSave;
            backingRfs        = referencedFileSave;

            UseAtlases           = backingRfs.Properties.GetValue <bool>(nameof(UseAtlases));
            AutoCreateGumScreens = backingRfs.Properties.GetValue <bool>(nameof(AutoCreateGumScreens));
            ShowDottedOutlines   = backingRfs.Properties.GetValue <bool>(nameof(ShowDottedOutlines));
            FileAdditionBehavior behavior = (FileAdditionBehavior)backingRfs.Properties.GetValue <int>(nameof(FileAdditionBehavior));

            EmbedCodeFiles                     = behavior == FileAdditionBehavior.EmbedCodeFiles;
            IncludeNoFiles                     = behavior == FileAdditionBehavior.IncludeNoFiles;
            IncludeFormsInComponents           = backingRfs.Properties.GetValue <bool>(nameof(IncludeFormsInComponents));
            IncludeComponentToFormsAssociation = backingRfs.Properties.GetValue <bool>(nameof(IncludeComponentToFormsAssociation));

            ShowMouse = backingRfs.Properties.GetValue <bool>(nameof(ShowMouse));
        }
Example #4
0
        private void UpdateAdvancedStateInterpolationFiles(Assembly assembly, FileAdditionBehavior behavior)
        {
            mStateInterpolationItemAdder = new CodeBuildItemAdder();
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/Back.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/Bounce.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/Circular.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/Cubic.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/Elastic.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/Exponential.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/Instant.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/Linear.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/Quadratic.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/Quartic.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/Quintic.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/ShakeTweener.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/Sinusoidal.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/Tweener.cs");
            mStateInterpolationItemAdder.Add("GumPlugin/Embedded/StateInterpolation/TweenerManager.cs");


            mStateInterpolationItemAdder.OutputFolderInProject = "StateInterpolation";
            if (behavior == FileAdditionBehavior.EmbedCodeFiles)
            {
                mStateInterpolationItemAdder.AddFileBehavior = AddFileBehavior.IfOutOfDate;

                TaskManager.Self.AddSync(() =>
                {
                    FlatRedBall.Glue.Plugins.PluginManager.ReceiveOutput("Adding interpolation files from Gum plugin");
                    mStateInterpolationItemAdder.IsVerbose = true;
                    mStateInterpolationItemAdder.PerformAddAndSave(assembly);
                }
                                         , "Adding interpolation files for Gum");
            }
            else if (behavior == FileAdditionBehavior.IncludeNoFiles)
            {
                TaskManager.Self.AddSync(() =>
                {
                    mStateInterpolationItemAdder.PerformRemoveAndSave(assembly);
                }, "Removing standard Gum files");
            }
        }