Beispiel #1
0
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            BlepOut Currblep = new BlepOut();

            Application.Run(Currblep);
        }
Beispiel #2
0
 public Options(BlepOut mainForm)
 {
     InitializeComponent();
     mf = mainForm;
     Wood.WriteLine("Options window opened " + DateTime.Now);
     labelREGIONNAME.Text      = string.Empty;
     labelREGIONDESC.Text      = string.Empty;
     labelSTRUCTURESTATUS.Text = string.Empty;
     regpacklist = new List <RegModData>();
     FetchStuff();
 }
Beispiel #3
0
        private static void Main(string[] args)
        {
#warning forced culture
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            var argl = args?.ToList() ?? new List <string>();
            Wood.SetNewPathAndErase(Path.Combine(Directory.GetCurrentDirectory(), "BOILOG.txt"));
            Wood.WriteLine($"BOI {BlepOut.VersionNumber} starting {DateTime.UtcNow}");
            Wood.WriteLine("Console output is disabled for the time being, sorry.");
#if !DEBUG
            goto noconsolesqm;
#endif
            //broken
            if (File.Exists("showConsole.txt") || argl.Contains("-nc") || argl.Contains("--new-console"))
            {
                Wood.WriteLine("");
                AllocConsole();
                Console.WriteLine("Launching BOI with output to a new console window.");
                Console.WriteLine("Reminder: you can always select text in console and then copy it by pressing enter. It also pauses the app.\n");
            }
            else if (argl.Contains("-ac") || argl.Contains("--attach-console"))
            {
                AttachConsole(-1);
                Console.WriteLine("\nLaunching BOI and attempting to attach parent process console.");
            }
noconsolesqm:
            //write the help file
            StreamWriter o = default;
            try
            {
                var casm = System.Reflection.Assembly.GetExecutingAssembly();
                foreach (var resname in casm.GetManifestResourceNames())
                {
                    Wood.WriteLine(resname);
                }
                var str = casm.GetManifestResourceStream("Blep.Resources.BOI_INFO.txt");
                var bf  = new byte[str.Length];
                str.Read(bf, 0, (int)str.Length);
                o = File.CreateText(Path.Combine(Directory.GetCurrentDirectory(), "BOI_INFO.txt"));
                o.WriteLine(System.Text.Encoding.UTF8.GetString(bf));
            }
            catch (Exception ee) { Wood.WriteLine(ee); }
            finally { o?.Close(); }
            //enter the form
            try
            {
                BlepOut Currblep = new BlepOut();
#if !DEBUG
                Application.ThreadException += (sender, e) => {
                    var oind = Wood.IndentLevel;
                    Wood.IndentLevel = 0;
                    Wood.WriteLine("\n<--------------------->\nUNHANDLED EXCEPTION IN APPLICATION LOOP");
                    Wood.WriteLine(e.Exception);
                    Wood.WriteLine("<--------------------->\n");
                    Wood.IndentLevel = oind;
                    if (e.Exception is TypeLoadException)
                    {
                        Currblep.Close();
                    }
                };
#endif
                Application.Run(Currblep);
            }
            catch (Exception e)
            {
                Wood.IndentLevel = 0;
                Wood.WriteLine("Unhandled exception in the application loop:");
                Wood.WriteLine(e);
            }
            //form is dead
            //if (File.Exists("changelog.txt")) File.Delete("changelog.txt");
            if (argl.Contains("-nu") || argl.Contains("--no-update") || File.Exists("neverUpdate.txt"))
            {
                Wood.WriteLine("Skipping self update.");
            }
            else
            {
                TrySelfUpdate();
            }
            Wood.Lifetime = 5;
        }
Beispiel #4
0
 public PartYeet(BlepOut mainform)
 {
     mf         = mainform;
     mf.Enabled = false;
     InitializeComponent();
 }