Beispiel #1
0
 static public void Start(string Exe, string Arg = "")
 {
     if (Running)
     {
         Confirm.Annoy("There is already a process running!");
         return;
     }
     try {
         Pr = new Process();
         Pr.StartInfo.FileName               = Exe;
         Pr.StartInfo.Arguments              = Arg;
         Pr.StartInfo.CreateNoWindow         = true;
         Pr.StartInfo.WindowStyle            = System.Diagnostics.ProcessWindowStyle.Hidden;
         Pr.StartInfo.RedirectStandardOutput = true;
         Pr.StartInfo.UseShellExecute        = false;
         Comm.Text = $"\"{Exe}\" {Arg}";
         Pr.Start();
         Running   = true;
         Stat.Text = "Process running";
         Outp.Text = "";
     } catch (Exception Foutje) {
         Console.Beep();
         Stat.Text = $"ERROR: {Foutje.Message}";
     }
 }
Beispiel #2
0
        private void Listbox_Favs_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (Listbox_Favs.SelectedItem == null)
            {
                return;
            }
            var rf = (string)Listbox_Favs.SelectedItem;
            var rc = JCR6.Recognize(rf);

            Debug.WriteLine($"Analysing {rf} => {rc}");
            if (rc == "NONE")
            {
                Confirm.Annoy($"{rf} was not recognized");
                return;
            }
            Core.IN_Resource = true;
            Core.Resource    = rf;
            Core.CDirectory  = "";
            //Core.Config.ListAddNew(Platform, "Used", rf);
            //RenewUsed();
            UpdateDirBox();
            ResTableSTG.Content = Core.JCR.FATstorage;
            ResType.Content     = rc;
            return;
        }
Beispiel #3
0
        public MainWindow()
        {
            try {
                InitializeComponent();
                MKL.Version("Stach - MainWindow.xaml.cs", "22.05.21");
                MKL.Lic("Stach - MainWindow.xaml.cs", "GNU General Public License 3");
                Title            = $"Stach - (c) {MKL.CYear(2020)} Jeroen P. Broks";
                ExampleSwap.Text = Core.Config[Platform, "ExampleSwap"];
                foreach (string ad in Dirry.AltDriveList)
                {
                    List_System.Items.Add(ad);
                }
                var startd = Directory.GetCurrentDirectory().Replace('\\', '/');
                RegisterEntryFields();
                Core.IN_Resource = false;
                Core.CDirectory  = startd;
                UpdateDirBox();
                RenewUsed();
                RenewFavs();
                ViewNothing();
            } catch (Exception e) {
#if DEBUG
                Confirm.Annoy($"{e}\n\n{e.StackTrace}\n\nI will try to continue, but expect things NOT to go so well!", "Start up error!", System.Windows.Forms.MessageBoxIcon.Error);
#else
                Confirm.Annoy($"{e.Message}\n\nI will try to continue, but expect things NOT to go so well!", "Start up error!", System.Windows.Forms.MessageBoxIcon.Error);
#endif
            } finally {
                AutoConfigUpdate = true;
            }
        }
Beispiel #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()
        {
            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);
            }
        }
Beispiel #5
0
        public NALACore()
        {
            try {
                graphics = new GraphicsDeviceManager(this);
                Content.RootDirectory = "Content";
                Core = this;

                Dirry.InitAltDrives();
                UseJCR6.BubbleInit.Init();
#if !DEBUG
                graphics.HardwareModeSwitch = false;
                graphics.IsFullScreen       = true;
                graphics.ApplyChanges();
#else
                graphics.PreferredBackBufferWidth  = 1200;
                graphics.PreferredBackBufferHeight = 1000;
#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 (CO)", 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 (C))", System.Windows.Forms.MessageBoxIcon.Error);
#endif
                System.Environment.Exit(10);
            }
        }
Beispiel #6
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
        }
Beispiel #7
0
        private void Butt_Extract_Click(object sender, RoutedEventArgs e)
        {
            if (DirBox.SelectedItem == null)
            {
                Debug.WriteLine("No item, so no extract"); return;
            }
            var item = (string)DirBox.SelectedItem; Debug.WriteLine($"Item: {item}"); if (item == "" || qstr.Suffixed(item, "/"))
            {
                Debug.WriteLine("Item is directory, so no extract"); return;
            }
            var xas = FFS.RequestFile(true); if (xas == "")
            {
                return;
            }
            var ix = qstr.ExtractExt(item).ToLower();
            var ex = qstr.ExtractExt(xas).ToLower();

            if (ix != ex)
            {
                switch (Confirm.YNC($"Original extention is \"{ix}\", and given extension is \"{ex}\". This does not match. Add this extension?"))
                {
                case -1:
                    return;

                case 0:
                    break;

                case 1:
                    xas += $".{ix}";
                    break;

                default:
                    throw new Exception("Invalid output from Confirm.YNC");
                }
            }
            if (Core.IN_Resource)
            {
                try {
                    var data = Core.JCR.JCR_B($"{Core.CDirectory}/{item}");
                    if (data == null)
                    {
                        throw new Exception($"Unable to get data!\nJCR6 reported: {JCR6.JERROR}");
                    }
                    QuickStream.SaveBytes(xas, data);
                } catch (Exception E) {
                    Confirm.Annoy(E.Message, "Error!", System.Windows.Forms.MessageBoxIcon.Error);
                }
            }
            else
            {
                try {
                    File.Copy($"{Core.CDirectory}/{item}", xas, true);
                } catch (Exception E) {
                    Confirm.Annoy(E.Message, "Error!", System.Windows.Forms.MessageBoxIcon.Error);
                }
            }
        }
        public void Annoy(string msg, string Caption = "", string Icon = "Information")
        {
            var useicon = MessageBoxIcon.Information;

            foreach (MessageBoxIcon iIcon in (MessageBoxIcon[])Enum.GetValues(typeof(MessageBoxIcon)))
            {
                if (Icon == $"{iIcon}")
                {
                    useicon = iIcon;
                }
            }
            Confirm.Annoy(msg, Caption, useicon);
        }
Beispiel #9
0
        void UpdateDirBox()
        {
            UpdateResourceHeader();
            DirBox.Items.Clear();
            if (Core.IN_Resource)
            {
                var files = new List <string>();
                var dirs  = new List <string>();
                foreach (TJCREntry e in Core.JCR.Entries.Values)
                {
                    var d = qstr.ExtractDir(e.Entry).ToUpper();
                    //Debug.WriteLine($"{d} => {e.Entry}");
                    if (d == Core.CDirectory)
                    {
                        files.Add(qstr.StripDir(e.Entry));
                    }

                    /*
                     * if (d != "") {
                     *      var dd = qstr.ExtractDir(d).ToUpper();
                     *      if (dd == Core.CDirectory && (!dirs.Contains(qstr.StripDir(d.ToUpper()))))
                     *              dirs.Add(qstr.StripDir(d.ToUpper()));
                     *      else if (d.Length>Core.CDirectory.Length && (Core.CDirectory=="" || qstr.Prefixed (d,Core.CDirectory))) {
                     *              var ded = qstr.Right(d.ToUpper(), d.Length-Core.CDirectory.Length);
                     *              var p = ded.IndexOf('/');
                     *              if (p>=0) {
                     *                      var dr = ded.Substring(0, p);
                     *                      if (dr!="" && (!dirs.Contains(dr)))
                     *                              dirs.Add(dr);
                     *              }
                     *      }
                     *
                     * }
                     */
                }
                var drl = Core.DirList;
                foreach (string dr in drl)
                {
                    if (dr != "" && qstr.ExtractDir(dr) == Core.CDirectory && (!dirs.Contains(qstr.StripDir(dr))))
                    {
                        dirs.Add(qstr.StripDir(dr));
                    }
                }
                dirs.Sort();
                files.Sort();
                DirBox.Items.Add("../");
                foreach (string d in dirs)
                {
                    DirBox.Items.Add($"{d}/");
                }
                foreach (string f in files)
                {
                    DirBox.Items.Add(f);
                }
            }
            else
            {
                try {
                    ResType.Content     = $"{Platform}:File Sytem";
                    ResTableSTG.Content = "N/A";
                    DirBox.Items.Add("../");
                    foreach (string f in FileList.GetDir(Core.CDirectory, 1))
                    {
                        var ff = $"{Core.CDirectory}/{f}";
                        if (Directory.Exists(ff))
                        {
                            DirBox.Items.Add($"{f}/");
                        }
                        else
                        {
                            DirBox.Items.Add($"{f}");
                        }
                    }
                } catch (Exception E) {
                    Confirm.Annoy(E.Message, "Error during scanning directory", System.Windows.Forms.MessageBoxIcon.Error);
                }
            }
        }
Beispiel #10
0
 static public void FatalError(string msg)
 {
     Confirm.Annoy(msg, "Void - FATAL ERROR", System.Windows.Forms.MessageBoxIcon.Error);
 }