Exemplo n.º 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()
        {
            // 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
        }
Exemplo n.º 2
0
 void Neg()
 {
     Negative = TQMG.NewImage(Original.Width, Original.Height);
     for (int y = 0; y < Original.Height; y++)
     {
         for (int x = 0; x < Original.Width; x++)
         {
             var Pix = Original.GetPixel(x, y);
             Negative.PutPixel(x, y, (byte)(255 - Pix.R), (byte)(255 - Pix.G), (byte)(255 - Pix.B), Pix.A);
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Allows the game to run logic such as updating the world,
 /// checking for collisions, gathering input, and playing audio.
 /// </summary>
 /// <param name="gameTime">Provides a snapshot of timing values.</param>
 protected override void Update(GameTime gameTime)
 {
     //if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
     if (FilesIDX >= FilesCNT)
     {
         JCRC.Close();
         Exit();
     }
     else
     {
         Original = TQMG.GetImage(Files[FilesIDX].Entry);
         Neg();
         Negative.Save(JCRC, $"{qstr.StripExt(Files[FilesIDX].Entry)}.Negative.png", "lzma", Files[FilesIDX].Author, Files[FilesIDX].Notes);
         FilesIDX++;
     }
     base.Update(gameTime);
 }
Exemplo n.º 4
0
        static public void GoError(string ct, string message, string trace)
        {
            blocked = true;
            BubConsole.WriteLine($"ERROR>{message}", 255, 0, 0);
            Debug.WriteLine($"{ct}: {message}\nTraceback:\n{trace}\n\n");
            if (crashed)
            {
                return;
            }
            crashed = true;
            var s = QuickStream.OpenEmbedded("Death.png");

            if (s == null)
            {
                Debug.WriteLine("ERROR! Trying to read Death resulted into null!");
            }
            s.Position = 0;
            Death      = TQMG.GetImage(s);
            sct        = ct;
            smsg       = message;
            strace     = trace;
            FlowManager.GoHardFlow(new Error(), true);
        }
Exemplo n.º 5
0
        static BubConsole()
        {
            if (AllowWriteLog)
            {
                try {
                    WriteLine($"Output will be written to {WriteLogFile}", 255, 180, 0);
                    System.IO.Directory.CreateDirectory(qstr.ExtractDir(WriteLogFile));
                    WrLog = QuickStream.WriteFile(WriteLogFile);
                    WrLog.WriteString("<html>\n<head><title>Log from Bubble!</title></head><style>body{ color: white; background-color: black; font-family: courier; font-size:20pt; }</style>\n\n", true);
                } catch (Exception EX) {
                    WriteLine("ERROR!", 255, 0, 0);
                    WriteLine($"{EX.Message}", 255, 0, 0);
                    WriteLine("Due to this error I cannot guarantee the log will work!");
                    Console.Beep();
                }
            }
            WriteLine($"Bubble {MKL.Newest} - (c) Jeroen P. Broks", 255, 255, 0);
            var s = new NLua.Lua();
            var v = (string)s.DoString("return _VERSION")[0];

            WriteLine($"Uses {v} by PUC-Rio", 180, 0, 255);
            WriteLine($"Data folder: {Bubble_Save.SWorkDir}", 180, 255, 0);
            if (SBubble.JCR.Exists("Bubble/Background.png"))
            {
                WriteLine("Loading: Bubble/Background.png", 255, 180, 0);
                BackGround = TQMG.GetImage("Bubble/Console.png");
            }
            else if (SBubble.JCR.Exists("Bubble/Console.jpg"))
            {
                WriteLine("Loading: Bubble/Console.jpg", 255, 180, 0);
                BackGround = TQMG.GetImage("Bubble/Console.jpg");
            }
            else
            {
                WriteLine("No background found", 255, 0, 0);
            }
        }
 public static void SetUnknown(TQMGImage ui) => Unknown = ui;