Example #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            try {
                // Create a new SpriteBatch, which can be used to draw textures.
                spriteBatch = new SpriteBatch(GraphicsDevice);


                #region Tricky's Quick Monogame Graphics
                if (SBubble.JCR == null)
                {
                    System.Diagnostics.Debug.WriteLine("EEP! JCR resource is null! But how?");
                }
                TQMG.Init(graphics, GraphicsDevice, spriteBatch, SBubble.JCR);
                #endregion

                BubbleInit.LetsGo();

                TrickyGameJolt.GJAPI.ERRORFUNCTION = delegate(string msg) {
#if FATAL_GAMEJOLT
                    SBubble.MyError("Game Jolt API Error", msg, "");
#else
                    BubConsole.WriteLine("GAME JOLT ERROR", 255, 0, 0); System.Console.Beep();
                    BubConsole.WriteLine(msg);
#endif
                };
            } catch (System.Exception Allemaal_naar_de_klote) {
#if DEBUG
                Confirm.Annoy($"ERROR!\n{Allemaal_naar_de_klote.Message}\n\n{Allemaal_naar_de_klote.StackTrace}\n", "NALA Init error (LC)", System.Windows.Forms.MessageBoxIcon.Error);
#else
                Confirm.Annoy($"ERROR!\n{Allemaal_naar_de_klote.Message}\n\nDid you install everything propely, or is the engine broken?\n", "NALA Init error (LC)", System.Windows.Forms.MessageBoxIcon.Error);
#endif
                System.Environment.Exit(10);
            }
        }
Example #2
0
        void GetJCR()
        {
            var f = new List <TJCREntry>();

            JCR = JCR6.Dir(Dirry.AD(args[1]));
            Assert(JCR, JCR6.JERROR);

            foreach (TJCREntry e in JCR.Entries.Values)
            {
                var ok = qstr.Suffixed(e.Entry.ToLower(), ".png");
                var p  = false;
                for (int i = 2; i < args.Length; i++)
                {
                    p = p || qstr.Prefixed(e.Entry.ToLower(), args[i].ToLower());
                }
                ok = (args.Length == 2 || p);
                if (ok)
                {
                    f.Add(e);
                }
            }
            Files = f.ToArray();
            TQMG.Init(graphics, GraphicsDevice, spriteBatch, JCR);
            JCRC = new TJCRCreate($"{qstr.StripExt(args[1])}.Negative.JCR");
        }
Example #3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            try {
                spriteBatch = new SpriteBatch(GraphicsDevice);
                TQMG.Init(graphics, GraphicsDevice, spriteBatch, JCR);
                MousePointer = TQMG.GetImage("Mouse.png"); Assert(MousePointer, JCR6.JERROR);
                Font         = TQMG.GetFont("DosFont.JFBF"); Assert(Font, JCR6.JERROR);
                Back         = TQMG.GetImage("Back.png");
                VoidBack     = TQMG.GetImage("Void.png");
                Stage.GoTo(new Editor());
                foreach (string prj in Config.GetL("Projects"))
                {
                    if (System.IO.Directory.Exists(prj))
                    {
                        Project.ProjMap[prj] = new Project(prj);
                    }
                    else
                    {
                        Confirm.Annoy($"Project directory \"{prj}\" has not been found!");
                    }
                }
                new LexNIL();
            } catch (Exception QuelleCatastrophe) {
#if DEBUG
                FatalError($"Exception Thrown:\n{QuelleCatastrophe.Message}\n\n{QuelleCatastrophe.StackTrace}");
#else
                FatalError($"Exception Thrown:\n{QuelleCatastrophe.Message}");
#endif
            }

            // TODO: use this.Content to load your game content here
        }
Example #4
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            // TQMG
            TQMG.Init(graphics, GraphicsDevice, spriteBatch, SBubble.JCR);

            // Make sure all states consider at least these!
            SBubble.AddInit(delegate(string v) { SBubble.State(v).DoString($"function {FlowManager.NOTHING}() end", "Alright move along, nothing to see here!"); });
            SBubble.AddInit(BubbleConsole.StateInit);
            SBubble.AddInit(BubbleGraphics.InitGraphics);
            SBubble.AddInit(Bubble_Audio.Init);
            SBubble.AddInit(APIFlow.Init);
            SBubble.AddInit(BubbleSuperGlobal.Init);
            SBubble.AddInit(Bubble_Input.Init);
            SBubble.AddInit(Bubble_Save.Init);

            // Start init script
            FlowManager.StartInitFlow();


            // Error Test
            //Error.GoError("Test", "TestError", "Traceme");
        }
Example #5
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()
        {
            ProjectData.InitJCRDrivers();
            ProjectData.SetGame(this);

            #region Screen Size
            //graphics.PreferredBackBufferWidth = GraphicsDevice.DisplayMode.Width;
            //graphics.PreferredBackBufferHeight = GraphicsDevice.DisplayMode.Height;
            graphics.HardwareModeSwitch = false;
            graphics.IsFullScreen       = true;
            graphics.ApplyChanges();
            #endregion

            #region TeddyBear Draw MonoGame Driver
            TeddyBear.TeddyDraw_MonoGame.Init();
            #endregion

            // Sprite Batch
            SB = new SpriteBatch(GraphicsDevice);

            // Mouse Pointer
            MousePointer = ProjectData.GetTex(GraphicsDevice, "MousePointer.png");

            // TQMG
            TQMG.Init(graphics, GraphicsDevice, SB, ProjectData.JCR);
            TQMG.RegLog(ProjectData.Log);

            // Exporter
            TeddyXport.XPort.init();

            // Unknown
            TeddyBear.TeddyDraw_MonoGame.SetUnknown(TQMG.GetImage("Unknown.png"));
            TeddyBear.TeddyDraw_MonoGame.Log = ProjectData.Log;


            // Do we have a project and a map?
#if DEBUG
            if (false)
            {
            }              // just some crap as things are different while debugging.
#else
            if (ProjectData.args.Length < 3)
            {
                Crash.Error(this, "No arguments given!\nUsage: TeddyEdit <project> <map>\n \n If you are not sure how to use this tool, use the launcher in stead!");
            }
#endif
            else
            {
#if DEBUG
                ProjectData.Project = "Test";
#else
                ProjectData.Project = ProjectData.args[1];
#endif
                if (!ProjectData.AllWell)
                {
                    Crash.Error(this, $"Project loading failed! {ProjectData.Project}");
                }
                else
                {
#if DEBUG
                    ProjectData.MapFile = $"{Dirry.AD(ProjectData.ProjectConfig.C("LevelDir"))}/Test Map";
#else
                    ProjectData.MapFile = $"{Dirry.AD(ProjectData.ProjectConfig.C("LevelDir"))}/{ProjectData.args[2]}";
#endif
                }
            }


            // Teddy Save Log
            TeddyBear.TeddySave.SetLog(ProjectData.Log);

            // Final
            base.Initialize();

            if (ProjectData.AllWell)
            {
                SetStage(Main.Me);
            }
        }