Exemplo n.º 1
0
        public static void LoadStaticContent(string contentManagerName)
        {
            if (string.IsNullOrEmpty(contentManagerName))
            {
                throw new System.ArgumentException("contentManagerName cannot be empty or null");
            }
            // Set the content manager for Gum
            var contentManagerWrapper = new FlatRedBall.Gum.ContentManagerWrapper();

            contentManagerWrapper.ContentManagerName = contentManagerName;
            RenderingLibrary.Content.LoaderManager.Self.ContentLoader = contentManagerWrapper;
            // Access the GumProject just in case it's async loaded
            var throwaway = GlobalContent.GumProject;

            #if DEBUG
            if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager)
            {
                HasBeenLoadedWithGlobalContentManager = true;
            }
            else if (HasBeenLoadedWithGlobalContentManager)
            {
                throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global.  This can lead to a lot of bugs");
            }
            #endif
            empty_building = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/screens/mainmenu/empty_building.png", contentManagerName);
            AbbatoirIntergradeAnimation = FlatRedBall.FlatRedBallServices.Load <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/screens/mainmenu/abbatoirintergradeanimation.achx", contentManagerName);
            AbbatoirIntergradeText      = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/screens/mainmenu/abbatoirintergradetext.png", contentManagerName);
            blue_eye = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/screens/mainmenu/blue_eye.png", contentManagerName);
            Gum.Wireframe.GraphicalUiElement.IsAllLayoutSuspended = true;  MainMenuGum = new FlatRedBall.Gum.GumIdb();  MainMenuGum.LoadFromFile("content/gumproject/screens/mainmenugum.gusx");  MainMenuGum.AssignReferences(); Gum.Wireframe.GraphicalUiElement.IsAllLayoutSuspended = false; MainMenuGum.Element.UpdateLayout(); MainMenuGum.Element.UpdateLayout();
            CustomLoadStaticContent(contentManagerName);
        }
Exemplo n.º 2
0
 public static void UnloadStaticContent()
 {
     if (LoadedContentManagers.Count != 0)
     {
         LoadedContentManagers.RemoveAt(0);
         mRegisteredUnloads.RemoveAt(0);
     }
     if (LoadedContentManagers.Count == 0)
     {
         if (FRB_icon != null)
         {
             FRB_icon = null;
         }
         if (Veilstone_Corner_Moon_Stone != null)
         {
             Veilstone_Corner_Moon_Stone = null;
         }
         if (something != null)
         {
             something = null;
         }
         if (Bariguess != null)
         {
             Bariguess = null;
         }
         if (adiamond != null)
         {
             adiamond = null;
         }
         if (RollingSlotsforall != null)
         {
             RollingSlotsforall = null;
         }
     }
 }
        public TextureGrid <FlatRedBall.Graphics.Animation.AnimationChain> ToAnimationChainGrid(string contentManagerName,
                                                                                                float gridSpacing)
        {
            TextureGrid <FlatRedBall.Graphics.Animation.AnimationChain> toReturn = new TextureGrid <FlatRedBall.Graphics.Animation.AnimationChain>();

            toReturn.FirstPaintedX = FirstPaintedX;
            toReturn.LastPaintedX  = new List <float>();

            toReturn.FirstPaintedY = FirstPaintedY;
            toReturn.LastPaintedY  = toReturn.FirstPaintedY + (ReferenceGrid.Length - 1) * gridSpacing;

            toReturn.GridSpacingX = gridSpacing;
            toReturn.GridSpacingY = gridSpacing;

            int yOn = 0;

            toReturn.BaseTexture = null;

            Dictionary <string, FlatRedBall.Graphics.Animation.AnimationChainList> animationChainListCache =
                new Dictionary <string, FlatRedBall.Graphics.Animation.AnimationChainList>();


            foreach (ReferencedAnimationChain[] racArray in ReferenceGrid)
            {
                List <FlatRedBall.Graphics.Animation.AnimationChain> newAnimationChainList =
                    new List <FlatRedBall.Graphics.Animation.AnimationChain>();
                toReturn.Textures.Add(newAnimationChainList);

                toReturn.LastPaintedX.Add(toReturn.FirstPaintedX[yOn] + gridSpacing * (racArray.Length - 1));

                foreach (ReferencedAnimationChain rac in racArray)
                {
                    FlatRedBall.Graphics.Animation.AnimationChainList acl = null;
                    if (!string.IsNullOrEmpty(rac.AnimationChainListFileName) && animationChainListCache.ContainsKey(rac.AnimationChainListFileName) == false)
                    {
                        AnimationChainListSave acls = AnimationChainListSave.FromFile(rac.AnimationChainListFileName);
                        animationChainListCache.Add(rac.AnimationChainListFileName,
                                                    acls.ToAnimationChainList(contentManagerName));
                    }

                    if (string.IsNullOrEmpty(rac.AnimationChainListFileName))
                    {
                        acl = null;
                        newAnimationChainList.Add(null);
                    }
                    else
                    {
                        acl = animationChainListCache[rac.AnimationChainListFileName];
                        newAnimationChainList.Add(acl[rac.AnimationChainName]);
                    }
                }

                yOn++;
            }


            return(toReturn);
        }
Exemplo n.º 4
0
        public static void LoadStaticContent(string contentManagerName)
        {
            if (string.IsNullOrEmpty(contentManagerName))
            {
                throw new System.ArgumentException("contentManagerName cannot be empty or null");
            }
            ContentManagerName = contentManagerName;
            // Set the content manager for Gum
            var contentManagerWrapper = new FlatRedBall.Gum.ContentManagerWrapper();

            contentManagerWrapper.ContentManagerName = contentManagerName;
            RenderingLibrary.Content.LoaderManager.Self.ContentLoader = contentManagerWrapper;
            // Access the GumProject just in case it's async loaded
            var throwaway = GlobalContent.GumProject;

            #if DEBUG
            if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager)
            {
                HasBeenLoadedWithGlobalContentManager = true;
            }
            else if (HasBeenLoadedWithGlobalContentManager)
            {
                throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global.  This can lead to a lot of bugs");
            }
            #endif
            bool registerUnload = false;
            if (LoadedContentManagers.Contains(contentManagerName) == false)
            {
                LoadedContentManagers.Add(contentManagerName);
                lock (mLockObject)
                {
                    if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
                    {
                        FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("TankStaticUnload", UnloadStaticContent);
                        mRegisteredUnloads.Add(ContentManagerName);
                    }
                }
                if (!FlatRedBall.FlatRedBallServices.IsLoaded <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/tank/animationchainlistfile.achx", ContentManagerName))
                {
                    registerUnload = true;
                }
                AnimationChainListFile = FlatRedBall.FlatRedBallServices.Load <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/tank/animationchainlistfile.achx", ContentManagerName);
            }
            GreasyPlatypusSlapper.Entities.Turret.LoadStaticContent(contentManagerName);
            GreasyPlatypusSlapper.Entities.Effects.Smoke.LoadStaticContent(contentManagerName);
            if (registerUnload && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
            {
                lock (mLockObject)
                {
                    if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
                    {
                        FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("TankStaticUnload", UnloadStaticContent);
                        mRegisteredUnloads.Add(ContentManagerName);
                    }
                }
            }
            CustomLoadStaticContent(contentManagerName);
        }
Exemplo n.º 5
0
 public static void LoadStaticContent(string contentManagerName)
 {
     if (string.IsNullOrEmpty(contentManagerName))
     {
         throw new System.ArgumentException("contentManagerName cannot be empty or null");
     }
     ContentManagerName = contentManagerName;
     #if DEBUG
     if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager)
     {
         HasBeenLoadedWithGlobalContentManager = true;
     }
     else if (HasBeenLoadedWithGlobalContentManager)
     {
         throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global.  This can lead to a lot of bugs");
     }
     #endif
     bool registerUnload = false;
     if (LoadedContentManagers.Contains(contentManagerName) == false)
     {
         LoadedContentManagers.Add(contentManagerName);
         lock (mLockObject)
         {
             if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
             {
                 FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("PlayerStaticUnload", UnloadStaticContent);
                 mRegisteredUnloads.Add(ContentManagerName);
             }
         }
         if (!FlatRedBall.FlatRedBallServices.IsLoaded <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/player/tiny_ship.png", ContentManagerName))
         {
             registerUnload = true;
         }
         tiny_ship = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/player/tiny_ship.png", ContentManagerName);
         if (!FlatRedBall.FlatRedBallServices.IsLoaded <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/player/playeranimation.achx", ContentManagerName))
         {
             registerUnload = true;
         }
         PlayerAnimation = FlatRedBall.FlatRedBallServices.Load <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/player/playeranimation.achx", ContentManagerName);
         if (!FlatRedBall.FlatRedBallServices.IsLoaded <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/player/flame.png", ContentManagerName))
         {
             registerUnload = true;
         }
         Flame = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/player/flame.png", ContentManagerName);
     }
     if (registerUnload && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
     {
         lock (mLockObject)
         {
             if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
             {
                 FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("PlayerStaticUnload", UnloadStaticContent);
                 mRegisteredUnloads.Add(ContentManagerName);
             }
         }
     }
     CustomLoadStaticContent(contentManagerName);
 }
Exemplo n.º 6
0
        public AnimationChainList ToAnimationChainList(string contentManagerName, bool throwError)
        {
            mToRuntimeErrors.Clear();

            AnimationChainList list = new AnimationChainList();

            list.FileRelativeTextures = FileRelativeTextures;
            list.TimeMeasurementUnit  = TimeMeasurementUnit;
            list.Name = mFileName;

            string oldRelativeDirectory = FileManager.RelativeDirectory;

            try
            {
                if (this.FileRelativeTextures)
                {
                    FileManager.RelativeDirectory = FileManager.GetDirectory(mFileName);
                }

                foreach (AnimationChainSave animationChain in this.AnimationChains)
                {
                    try
                    {
                        FlatRedBall.Graphics.Animation.AnimationChain newChain = null;

                        newChain = animationChain.ToAnimationChain(contentManagerName, this.TimeMeasurementUnit, this.CoordinateType);

                        newChain.mIndexInLoadedAchx = list.Count;

                        newChain.ParentAchxFileName = mFileName;

                        list.Add(newChain);
                    }
                    catch (Exception e)
                    {
                        mToRuntimeErrors.Add(e.ToString());
                        if (throwError)
                        {
                            throw new Exception("Error loading AnimationChain", e);
                        }
                    }
                }
            }
            finally
            {
                FileManager.RelativeDirectory = oldRelativeDirectory;
            }

            return(list);
        }
Exemplo n.º 7
0
 public static void UnloadStaticContent()
 {
     if (LoadedContentManagers.Count != 0)
     {
         LoadedContentManagers.RemoveAt(0);
         mRegisteredUnloads.RemoveAt(0);
     }
     if (LoadedContentManagers.Count == 0)
     {
         if (ExplosionAnimationChain != null)
         {
             ExplosionAnimationChain = null;
         }
     }
 }
Exemplo n.º 8
0
 public static void UnloadStaticContent()
 {
     if (LoadedContentManagers.Count != 0)
     {
         LoadedContentManagers.RemoveAt(0);
         mRegisteredUnloads.RemoveAt(0);
     }
     if (LoadedContentManagers.Count == 0)
     {
         if (AnimationChainListFile != null)
         {
             AnimationChainListFile = null;
         }
     }
 }
Exemplo n.º 9
0
 public static void UnloadStaticContent()
 {
     if (LoadedContentManagers.Count != 0)
     {
         LoadedContentManagers.RemoveAt(0);
         mRegisteredUnloads.RemoveAt(0);
     }
     if (LoadedContentManagers.Count == 0)
     {
         if (Particles != null)
         {
             Particles = null;
         }
     }
 }
        public static new void LoadStaticContent(string contentManagerName)
        {
            if (string.IsNullOrEmpty(contentManagerName))
            {
                throw new System.ArgumentException("contentManagerName cannot be empty or null");
            }
            // Set to use global content
            contentManagerName = FlatRedBall.FlatRedBallServices.GlobalContentManager;
            ContentManagerName = FlatRedBall.FlatRedBallServices.GlobalContentManager;
            AbbatoirIntergrade.Entities.BaseEntities.BaseEnemy.LoadStaticContent(contentManagerName);
            // Set the content manager for Gum
            var contentManagerWrapper = new FlatRedBall.Gum.ContentManagerWrapper();

            contentManagerWrapper.ContentManagerName = FlatRedBall.FlatRedBallServices.GlobalContentManager;
            RenderingLibrary.Content.LoaderManager.Self.ContentLoader = contentManagerWrapper;
            // Access the GumProject just in case it's async loaded
            var throwaway = GlobalContent.GumProject;

            #if DEBUG
            if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager)
            {
                HasBeenLoadedWithGlobalContentManager = true;
            }
            else if (HasBeenLoadedWithGlobalContentManager)
            {
                throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global.  This can lead to a lot of bugs");
            }
            #endif
            if (LoadedContentManagers.Contains(contentManagerName) == false)
            {
                LoadedContentManagers.Add(contentManagerName);
                lock (mLockObject)
                {
                    if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
                    {
                        FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("Rabbit1EnemyStaticUnload", UnloadStaticContent);
                        mRegisteredUnloads.Add(ContentManagerName);
                    }
                }
                Rabbit1Animations = FlatRedBall.FlatRedBallServices.Load <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/screens/gamescreen/monsters/rabbit1animations.achx", ContentManagerName);
                Stage1            = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/screens/gamescreen/monsters/stage1.png", ContentManagerName);
                Rabbit1Death1     = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Audio.SoundEffect>(@"content/entities/enemies/rabbit1enemy/rabbit1death1", ContentManagerName);
                Rabbit1Death2     = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Audio.SoundEffect>(@"content/entities/enemies/rabbit1enemy/rabbit1death2", ContentManagerName);
                Rabbit1Death3     = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Audio.SoundEffect>(@"content/entities/enemies/rabbit1enemy/rabbit1death3", ContentManagerName);
            }
            CustomLoadStaticContent(contentManagerName);
        }
 public static void UnloadStaticContent()
 {
     if (LoadedContentManagers.Count != 0)
     {
         LoadedContentManagers.RemoveAt(0);
         mRegisteredUnloads.RemoveAt(0);
     }
     if (LoadedContentManagers.Count == 0)
     {
         if (The_BRICK != null)
         {
             The_BRICK = null;
         }
         if (Brick_getting_killed != null)
         {
             Brick_getting_killed = null;
         }
     }
 }
Exemplo n.º 12
0
        /// <summary>
        /// Create a "save" object from a regular animation chain list
        /// </summary>
        public static AnimationChainListSave FromAnimationChainList(AnimationChainList chainList)
        {
            AnimationChainListSave achlist = new AnimationChainListSave();

            achlist.FileRelativeTextures = chainList.FileRelativeTextures;
            achlist.TimeMeasurementUnit  = chainList.TimeMeasurementUnit;
            achlist.mFileName            = chainList.Name;

            List <AnimationChainSave> newChains = new List <AnimationChainSave>(chainList.Count);

            for (int i = 0; i < chainList.Count; i++)
            {
                AnimationChainSave ach = AnimationChainSave.FromAnimationChain(chainList[i], achlist.TimeMeasurementUnit);
                newChains.Add(ach);
            }
            achlist.AnimationChains = newChains;

            return(achlist);
        }
Exemplo n.º 13
0
 public static void UnloadStaticContent()
 {
     if (LoadedContentManagers.Count != 0)
     {
         LoadedContentManagers.RemoveAt(0);
         mRegisteredUnloads.RemoveAt(0);
     }
     if (LoadedContentManagers.Count == 0)
     {
         if (TopDownValues != null)
         {
             TopDownValues = null;
         }
         if (PlayerAnimationChain != null)
         {
             PlayerAnimationChain = null;
         }
     }
 }
Exemplo n.º 14
0
 public static void UnloadStaticContent()
 {
     if (LoadedContentManagers.Count != 0)
     {
         LoadedContentManagers.RemoveAt(0);
         mRegisteredUnloads.RemoveAt(0);
     }
     if (LoadedContentManagers.Count == 0)
     {
         if (rat != null)
         {
             rat = null;
         }
         if (MouseAnimation != null)
         {
             MouseAnimation = null;
         }
     }
 }
Exemplo n.º 15
0
        public static void LoadStaticContent(string contentManagerName)
        {
            if (string.IsNullOrEmpty(contentManagerName))
            {
                throw new System.ArgumentException("contentManagerName cannot be empty or null");
            }
            // Set to use global content
            contentManagerName = FlatRedBall.FlatRedBallServices.GlobalContentManager;
            ContentManagerName = FlatRedBall.FlatRedBallServices.GlobalContentManager;
            // Set the content manager for Gum
            var contentManagerWrapper = new FlatRedBall.Gum.ContentManagerWrapper();

            contentManagerWrapper.ContentManagerName = FlatRedBall.FlatRedBallServices.GlobalContentManager;
            RenderingLibrary.Content.LoaderManager.Self.ContentLoader = contentManagerWrapper;
            // Access the GumProject just in case it's async loaded
            var throwaway = GlobalContent.GumProject;

            #if DEBUG
            if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager)
            {
                HasBeenLoadedWithGlobalContentManager = true;
            }
            else if (HasBeenLoadedWithGlobalContentManager)
            {
                throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global.  This can lead to a lot of bugs");
            }
            #endif
            if (LoadedContentManagers.Contains(contentManagerName) == false)
            {
                LoadedContentManagers.Add(contentManagerName);
                lock (mLockObject)
                {
                    if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
                    {
                        FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("SkeletonStaticUnload", UnloadStaticContent);
                        mRegisteredUnloads.Add(ContentManagerName);
                    }
                }
                SkeletonAnimation = GlobalContent.SkeletonAnimation;
            }
            CustomLoadStaticContent(contentManagerName);
        }
Exemplo n.º 16
0
        public override void Destroy()
        {
            base.Destroy();
            empty_building = null;
            AbbatoirIntergradeAnimation = null;
            AbbatoirIntergradeText      = null;
            blue_eye = null;
            FlatRedBall.SpriteManager.RemoveDrawableBatch(MainMenuGum); FlatRedBall.FlatRedBallServices.GraphicsOptions.SizeOrOrientationChanged -= MainMenuGum.HandleResolutionChanged;
            MainMenuGum = null;

            if (TheSpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSprite(TheSpriteInstance);
            }
            if (ASpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSprite(ASpriteInstance);
            }
            if (BbatoirSpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSprite(BbatoirSpriteInstance);
            }
            if (ISpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSprite(ISpriteInstance);
            }
            if (NtergradeSpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSprite(NtergradeSpriteInstance);
            }
            if (MainMenuGumRuntime != null)
            {
                MainMenuGumRuntime.RemoveFromManagers();
            }
            if (LeftEye != null)
            {
                LeftEye.RemoveFromManagers();
            }
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }
Exemplo n.º 17
0
 public static void UnloadStaticContent()
 {
     if (LoadedContentManagers.Count != 0)
     {
         LoadedContentManagers.RemoveAt(0);
         mRegisteredUnloads.RemoveAt(0);
     }
     if (LoadedContentManagers.Count == 0)
     {
         if (tiny_ship != null)
         {
             tiny_ship = null;
         }
         if (PlayerAnimation != null)
         {
             PlayerAnimation = null;
         }
         if (Flame != null)
         {
             Flame = null;
         }
     }
 }
Exemplo n.º 18
0
		public static void UnloadStaticContent ()
		{
			if (LoadedContentManagers.Count != 0)
			{
				LoadedContentManagers.RemoveAt(0);
				mRegisteredUnloads.RemoveAt(0);
			}
			if (LoadedContentManagers.Count == 0)
			{
				if (AnimacionOrden != null)
				{
					AnimacionOrden= null;
				}
				if (SceneFile != null)
				{
					SceneFile.RemoveFromManagers(ContentManagerName != "Global");
					SceneFile= null;
				}
			}
		}
Exemplo n.º 19
0
		public static void LoadStaticContent (string contentManagerName)
		{
			if (string.IsNullOrEmpty(contentManagerName))
			{
				throw new System.ArgumentException("contentManagerName cannot be empty or null");
			}
			ContentManagerName = contentManagerName;
			#if DEBUG
			if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager)
			{
				HasBeenLoadedWithGlobalContentManager = true;
			}
			else if (HasBeenLoadedWithGlobalContentManager)
			{
				throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global.  This can lead to a lot of bugs");
			}
			#endif
			bool registerUnload = false;
			if (LoadedContentManagers.Contains(contentManagerName) == false)
			{
				LoadedContentManagers.Add(contentManagerName);
				lock (mLockObject)
				{
					if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
					{
						FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("BarraSensorialStaticUnload", UnloadStaticContent);
						mRegisteredUnloads.Add(ContentManagerName);
					}
				}
				if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/barrasensorial/animacionorden.achx", ContentManagerName))
				{
					registerUnload = true;
				}
				AnimacionOrden = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/barrasensorial/animacionorden.achx", ContentManagerName);
				if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Scene>(@"content/entities/barrasensorial/scenefile.scnx", ContentManagerName))
				{
					registerUnload = true;
				}
				SceneFile = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Scene>(@"content/entities/barrasensorial/scenefile.scnx", ContentManagerName);
			}
			if (registerUnload && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
			{
				lock (mLockObject)
				{
					if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
					{
						FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("BarraSensorialStaticUnload", UnloadStaticContent);
						mRegisteredUnloads.Add(ContentManagerName);
					}
				}
			}
			CustomLoadStaticContent(contentManagerName);
		}
Exemplo n.º 20
0
        public static void LoadStaticContent(string contentManagerName)
        {
            if (string.IsNullOrEmpty(contentManagerName))
            {
                throw new System.ArgumentException("contentManagerName cannot be empty or null");
            }
            ContentManagerName = contentManagerName;
            // Set the content manager for Gum
            var contentManagerWrapper = new FlatRedBall.Gum.ContentManagerWrapper();

            contentManagerWrapper.ContentManagerName = contentManagerName;
            RenderingLibrary.Content.LoaderManager.Self.ContentLoader = contentManagerWrapper;
            // Access the GumProject just in case it's async loaded
            var throwaway = GlobalContent.GumProject;

            #if DEBUG
            if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager)
            {
                HasBeenLoadedWithGlobalContentManager = true;
            }
            else if (HasBeenLoadedWithGlobalContentManager)
            {
                throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global.  This can lead to a lot of bugs");
            }
            #endif
            bool registerUnload = false;
            if (LoadedContentManagers.Contains(contentManagerName) == false)
            {
                LoadedContentManagers.Add(contentManagerName);
                lock (mLockObject)
                {
                    if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
                    {
                        FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("PlayerStaticUnload", UnloadStaticContent);
                        mRegisteredUnloads.Add(ContentManagerName);
                    }
                }
                if (TopDownValues == null)
                {
                    {
                        // We put the { and } to limit the scope of oldDelimiter
                        char oldDelimiter = FlatRedBall.IO.Csv.CsvFileManager.Delimiter;
                        FlatRedBall.IO.Csv.CsvFileManager.Delimiter = ',';
                        System.Collections.Generic.Dictionary <string, MyNewGame.DataTypes.TopDownValues> temporaryCsvObject = new System.Collections.Generic.Dictionary <string, MyNewGame.DataTypes.TopDownValues>();
                        FlatRedBall.IO.Csv.CsvFileManager.CsvDeserializeDictionary <string, MyNewGame.DataTypes.TopDownValues>("content/entities/player/topdownvalues.csv", temporaryCsvObject);
                        FlatRedBall.IO.Csv.CsvFileManager.Delimiter = oldDelimiter;
                        TopDownValues = temporaryCsvObject;
                    }
                }
                if (!FlatRedBall.FlatRedBallServices.IsLoaded <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/player/playeranimationchain.achx", ContentManagerName))
                {
                    registerUnload = true;
                }
                PlayerAnimationChain = FlatRedBall.FlatRedBallServices.Load <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/player/playeranimationchain.achx", ContentManagerName);
            }
            if (registerUnload && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
            {
                lock (mLockObject)
                {
                    if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
                    {
                        FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("PlayerStaticUnload", UnloadStaticContent);
                        mRegisteredUnloads.Add(ContentManagerName);
                    }
                }
            }
            CustomLoadStaticContent(contentManagerName);
        }
        public static void LoadStaticContent(string contentManagerName)
        {
            if (string.IsNullOrEmpty(contentManagerName))
            {
                throw new System.ArgumentException("contentManagerName cannot be empty or null");
            }
            ContentManagerName = contentManagerName;
            // Set the content manager for Gum
            var contentManagerWrapper = new FlatRedBall.Gum.ContentManagerWrapper();

            contentManagerWrapper.ContentManagerName = contentManagerName;
            RenderingLibrary.Content.LoaderManager.Self.ContentLoader = contentManagerWrapper;
            // Access the GumProject just in case it's async loaded
            var throwaway = GlobalContent.GumProject;

            #if DEBUG
            if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager)
            {
                HasBeenLoadedWithGlobalContentManager = true;
            }
            else if (HasBeenLoadedWithGlobalContentManager)
            {
                throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global.  This can lead to a lot of bugs");
            }
            #endif
            bool registerUnload = false;
            if (LoadedContentManagers.Contains(contentManagerName) == false)
            {
                LoadedContentManagers.Add(contentManagerName);
                lock (mLockObject)
                {
                    if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
                    {
                        FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("A_Brick_being_destroyedStaticUnload", UnloadStaticContent);
                        mRegisteredUnloads.Add(ContentManagerName);
                    }
                }
                if (!FlatRedBall.FlatRedBallServices.IsLoaded <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/a_brick/the_brick.png", ContentManagerName))
                {
                    registerUnload = true;
                }
                The_BRICK = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/a_brick/the_brick.png", ContentManagerName);
                if (!FlatRedBall.FlatRedBallServices.IsLoaded <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/a_brick_being_destroyed/brick_getting_killed.achx", ContentManagerName))
                {
                    registerUnload = true;
                }
                Brick_getting_killed = FlatRedBall.FlatRedBallServices.Load <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/a_brick_being_destroyed/brick_getting_killed.achx", ContentManagerName);
            }
            if (registerUnload && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
            {
                lock (mLockObject)
                {
                    if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
                    {
                        FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("A_Brick_being_destroyedStaticUnload", UnloadStaticContent);
                        mRegisteredUnloads.Add(ContentManagerName);
                    }
                }
            }
            CustomLoadStaticContent(contentManagerName);
        }
Exemplo n.º 22
0
        public static void LoadStaticContent(string contentManagerName)
        {
            if (string.IsNullOrEmpty(contentManagerName))
            {
                throw new System.ArgumentException("contentManagerName cannot be empty or null");
            }
            ContentManagerName = contentManagerName;
            // Set the content manager for Gum
            var contentManagerWrapper = new FlatRedBall.Gum.ContentManagerWrapper();

            contentManagerWrapper.ContentManagerName = contentManagerName;
            RenderingLibrary.Content.LoaderManager.Self.ContentLoader = contentManagerWrapper;
            // Access the GumProject just in case it's async loaded
            var throwaway = GlobalContent.GumProject;

            #if DEBUG
            if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager)
            {
                HasBeenLoadedWithGlobalContentManager = true;
            }
            else if (HasBeenLoadedWithGlobalContentManager)
            {
                throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global.  This can lead to a lot of bugs");
            }
            #endif
            bool registerUnload = false;
            if (LoadedContentManagers.Contains(contentManagerName) == false)
            {
                LoadedContentManagers.Add(contentManagerName);
                lock (mLockObject)
                {
                    if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
                    {
                        FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("Slot3StaticUnload", UnloadStaticContent);
                        mRegisteredUnloads.Add(ContentManagerName);
                    }
                }
                if (!FlatRedBall.FlatRedBallServices.IsLoaded <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/slot3/frb_icon.png", ContentManagerName))
                {
                    registerUnload = true;
                }
                FRB_icon = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/slot3/frb_icon.png", ContentManagerName);
                if (!FlatRedBall.FlatRedBallServices.IsLoaded <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/slot3/veilstone_corner_moon_stone.png", ContentManagerName))
                {
                    registerUnload = true;
                }
                Veilstone_Corner_Moon_Stone = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/slot3/veilstone_corner_moon_stone.png", ContentManagerName);
                if (!FlatRedBall.FlatRedBallServices.IsLoaded <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/slot3/something.png", ContentManagerName))
                {
                    registerUnload = true;
                }
                something = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/slot3/something.png", ContentManagerName);
                if (!FlatRedBall.FlatRedBallServices.IsLoaded <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/slot3/bariguess.png", ContentManagerName))
                {
                    registerUnload = true;
                }
                Bariguess = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/slot3/bariguess.png", ContentManagerName);
                if (!FlatRedBall.FlatRedBallServices.IsLoaded <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/slot3/adiamond.png", ContentManagerName))
                {
                    registerUnload = true;
                }
                adiamond = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/slot3/adiamond.png", ContentManagerName);
                if (!FlatRedBall.FlatRedBallServices.IsLoaded <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/slot3/rollingslotsforall.achx", ContentManagerName))
                {
                    registerUnload = true;
                }
                RollingSlotsforall = FlatRedBall.FlatRedBallServices.Load <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/slot3/rollingslotsforall.achx", ContentManagerName);
            }
            if (registerUnload && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
            {
                lock (mLockObject)
                {
                    if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
                    {
                        FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("Slot3StaticUnload", UnloadStaticContent);
                        mRegisteredUnloads.Add(ContentManagerName);
                    }
                }
            }
            CustomLoadStaticContent(contentManagerName);
        }
Exemplo n.º 23
0
 public static void LoadStaticContent(string contentManagerName)
 {
     if (string.IsNullOrEmpty(contentManagerName))
     {
         throw new System.ArgumentException("contentManagerName cannot be empty or null");
     }
     ContentManagerName = contentManagerName;
     #if DEBUG
     if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager)
     {
         HasBeenLoadedWithGlobalContentManager = true;
     }
     else if (HasBeenLoadedWithGlobalContentManager)
     {
         throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global.  This can lead to a lot of bugs");
     }
     #endif
     bool registerUnload = false;
     if (LoadedContentManagers.Contains(contentManagerName) == false)
     {
         LoadedContentManagers.Add(contentManagerName);
         lock (mLockObject)
         {
             if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
             {
                 FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("PlayerStaticUnload", UnloadStaticContent);
                 mRegisteredUnloads.Add(ContentManagerName);
             }
         }
         if (PlatformerValues == null)
         {
             {
                 // We put the { and } to limit the scope of oldDelimiter
                 char oldDelimiter = FlatRedBall.IO.Csv.CsvFileManager.Delimiter;
                 FlatRedBall.IO.Csv.CsvFileManager.Delimiter = ',';
                 System.Collections.Generic.Dictionary <System.String, Soccer.DataTypes.PlatformerValues> temporaryCsvObject = new System.Collections.Generic.Dictionary <System.String, Soccer.DataTypes.PlatformerValues>();
                 FlatRedBall.IO.Csv.CsvFileManager.CsvDeserializeDictionary <System.String, Soccer.DataTypes.PlatformerValues>("content/entities/player/platformervalues.csv", temporaryCsvObject);
                 FlatRedBall.IO.Csv.CsvFileManager.Delimiter = oldDelimiter;
                 PlatformerValues = temporaryCsvObject;
             }
         }
         if (!FlatRedBall.FlatRedBallServices.IsLoaded <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/player/hombre.png", ContentManagerName))
         {
             registerUnload = true;
         }
         hombre = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/player/hombre.png", ContentManagerName);
         if (!FlatRedBall.FlatRedBallServices.IsLoaded <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/player/animationchainlistfile.achx", ContentManagerName))
         {
             registerUnload = true;
         }
         AnimationChainListFile = FlatRedBall.FlatRedBallServices.Load <FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/entities/player/animationchainlistfile.achx", ContentManagerName);
     }
     if (registerUnload && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
     {
         lock (mLockObject)
         {
             if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBall.FlatRedBallServices.GlobalContentManager)
             {
                 FlatRedBall.FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("PlayerStaticUnload", UnloadStaticContent);
                 mRegisteredUnloads.Add(ContentManagerName);
             }
         }
     }
     CustomLoadStaticContent(contentManagerName);
 }