Exemple #1
0
 static void Init()
 {
     MKL.Lic("NJCR - NJCR.cs", "GNU General Public License 3");
     MKL.Version("NJCR - NJCR.cs", "21.03.09");
     JCR6_lzma.Init();
     JCR6_zlib.Init();
     JCR6_jxsrcca.Init();
     JCR_JCR5.Init();
     JCR6_JXSDA.Init();
     new JCR6_WAD();
     new JCR_QuakePack();
     new JCR_a();
     new JCR_QuickLink();
     new JCR_WestwoodPAK();
     Dirry.InitAltDrives();
     Register("ADD", new F_Add());
     Register("DELETE", new F_Delete());
     Register("EXTRACT", new F_Extract());
     Register("TYPE", new F_Type());
     Register("HEX", new F_HEX());
     {
         var V = new F_Verbose();
         Register("VIEW", V);
         Register("LIST", V);
         Register("VERBOSE", V);
     }
     Register("SHOW", new F_Show());
     Register("SCRIPT", new F_Script());
     Register("SUPPORT", new F_Support());
     //Register("QUHELP", new F_QU_Help());
     QCol.DoingTab = 20;
 }
Exemple #2
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);
            }
        }
Exemple #3
0
        static void Main(string[] args)
        {
            Source.Hello();
            Compile.Hello();
            Dirry.InitAltDrives();
            Instruction.Init();
            MKL.Version("Wendicka Project - WASM_Main.cs", "20.03.01");
            MKL.Lic("Wendicka Project - WASM_Main.cs", "GNU General Public License 3");
            Console.WriteLine($"Wendicka Assembler {MKL.Newest} - (c) {MKL.CYear(2020)} Jeroen P. Broks\n");
            if (args.Length == 0)
            {
                Console.WriteLine("Usage: WASM [options] <File>");
                TrickyDebug.AttachWait();
                return;
            }
            var parse = new FlagParse(args);

            parse.CrBool("s", false);
            parse.Parse();
            Silence = parse.GetBool("s");
            foreach (string f in parse.Args)
            {
                Compile.Go(Dirry.AD(f).Replace("\\", "/"));
            }
            Console.WriteLine($"\tErrors: {Errors}; Warnings: {Warnings}");
            TrickyDebug.AttachWait();
        }
Exemple #4
0
 static QuickNeil()
 {
     QCol.Hello();
     Dirry.InitAltDrives();
     FileList.Hello();
     qstr.Hello();
     QuickStream.Hello();
     //Launch.Hello();
 }
Exemple #5
0
        public MainWindow()
        {
            InitializeComponent();
            if (!File.Exists(GINIFILE))
            {
                QuickStream.SaveString(GINIFILE, "[rem]\nTeddybear knows nothing yet! Boring, huh?\n");
            }
            config = GINI.ReadFromFile(GINIFILE);
            if (config.C("Platform") == "")
            {
                var p = new string[] { "Windows", "Linux", "***" };
                foreach (string pl in p)
                {
                    if (pl == "***")
                    {
                        MessageBox.Show("Then I'm afraid you are on a non-supported system, sorry!");
                        Environment.Exit(1);
                    }
                    var r = MessageBox.Show($"Are you on {pl}?", "The current version of .NET has no PROPER platform detection, so I have to ask you:", MessageBoxButton.YesNo, MessageBoxImage.Warning);
                    if (r == MessageBoxResult.Yes)
                    {
                        config.D("Platform", pl);
                        config.SaveSource(GINIFILE);
                        break;
                    }
                }
            }
            switch (config.C("Platform"))
            {
            case "Windows":
                System.Diagnostics.Debug.WriteLine("Init Alt Drive: Windows");
                Dirry.InitAltDrives(AltDrivePlaforms.Windows);
                break;

            case "Linux":
                if (config.C("LINUX_MEDIA") == "")
                {
                    MessageBox.Show($"I cannot find out myself where to find the folder in which Linux automatically mounts drives to. You can help me by editing {GINIFILE} and add the line LINUX_MEDIA=<your folder here> under the [vars] section.");
                    Environment.Exit(2);
                }
                Dirry.InitAltDrives(AltDrivePlaforms.Linux, config.C("LINUX_MEDIA"));
                break;

            default:
                MessageBox.Show("Unknown or unsupported platform!");
                Environment.Exit(3);
                break;     // Not needed, but the C# compiler is not smart enough to notice, so it won't compile if not present.... DUH! :P
            }
            WorkSpace.Text = config.C("WORKSPACE");
            wpchanged      = false;
            ScanProjects();
            AutoEnable();
        }
Exemple #6
0
 static void Main(string[] args)
 {
     Dirry.InitAltDrives();
     if (args.Length == 0)
     {
         NoStuff();
     }
     else
     {
         Run(args);
     }
     TrickyDebug.AttachWait();
 }
Exemple #7
0
 void Init(string[] args)
 {
     Kthura.automap = false;
     if (args.Length == 0)
     {
         Uitleg();
         OriCol();
         Environment.Exit(0);
     }
     InitJCR6.Go();
     ExportBasis.Init();
     Dirry.InitAltDrives(AltDrivePlaforms.Windows); // TODO: I may need to expand this later for Linux and Mac.
     cli_Settings = new FlagParse(args);
     cli_Settings.CrString("target");
     cli_Settings.CrString("project");
     cli_Settings.CrString("map");
     cli_Settings.CrString("xpto");
     if (!cli_Settings.Parse())
     {
         Uitleg();
         Error("Parsing command line input failed!");
     }
     Project = cli_Settings.GetString("project");
     Map     = cli_Settings.GetString("map");
     XPTo    = cli_Settings.GetString("xpto");
     Target  = cli_Settings.GetString("target");
     Assert(File.Exists(GlobalConfigFile), $"I cannot find {GlobalConfigFile}");
     GlobalConfig = GINI.ReadFromFile(GlobalConfigFile);
     Assert(GlobalConfig != null, "Global config could nt be properly loaded");
     Assert(Project, "Hey! I don't have a project!");
     Assert(WorkSpace, "I can't find out what the workspace is. Is Kthura properly configured?");
     Assert(File.Exists(ProjectConfigFile), $"I could not access {ProjectConfigFile}. It appears it doesn't exist!");
     Doing("Reading project", ProjectConfigFile);
     ProjectConfig = GINI.ReadFromFile(ProjectConfigFile);
     Assert(ProjectConfig, "Project could not be properly read.");
     Target = cli_Settings.GetString("target");
     if (Target == "")
     {
         Target = ProjectConfig.C("EXPORT.TARGET");
     }
     Assert(Target, "No target");
     Doing("Exporting to", Target);
     Assert(ExportBasis.HaveDriver(Target), $"Driver to export to {Target} has not been found!");
     XPTo = cli_Settings.GetString("xpto");
     if (XPTo == "")
     {
         XPTo = ProjectConfig.C("EXPORT.XPTO");
     }
     Assert(XPTo, "No export-to folder.");
     Map = cli_Settings.GetString("map");
 }
Exemple #8
0
 private Program(string[] args)
 {
     fp = new FlagParse(args);
     Dirry.InitAltDrives();
     MKL.Lic("Alternate Dir - Program.cs", "GNU General Public License 3");
     MKL.Version("Alternate Dir - Program.cs", "19.10.27");
     fp.CrBool("p", false);
     fp.CrBool("all", false);
     fp.CrBool("ansi", OnWindows);
     fp.CrBool("s", false);
     fp.CrBool("w", false);
     fp.CrBool("b", false);
     fp.CrBool("h", false);
     fp.Parse();
 }
Exemple #9
0
 static void Main(string[] args)
 {
     Dirry.InitAltDrives();
     JCR6_lzma.Init();
     JCR6_zlib.Init();
     if (args.Length != 1)
     {
         Console.WriteLine("Usage: KthuraConvert <Project>");
     }
     else
     {
         var M = new Program(args[0]);
         M.Run();
     }
     TrickyDebug.AttachWait();
 }
Exemple #10
0
        void LoadMainConfig()
        {
            if (!File.Exists(GINIFILE))
            {
                Crash($"I need configuration first!\nLoading the launcher will do that for you!");
            }
            dwriteln($"Reading: {GINIFILE}");
            MainConfig = GINI.ReadFromFile(GINIFILE);
            switch (MainConfig.C("Platform").ToUpper())
            {
            case "WINDOWS": Dirry.InitAltDrives(AltDrivePlaforms.Windows); break;

            case "LINUX": Dirry.InitAltDrives(AltDrivePlaforms.Linux); break;

            default:
                Crash($"Unknown platform setting in project file: {MainConfig.C("Platform")}");
                break;
            }
        }
Exemple #11
0
 static Core()
 {
     MKL.Lic("Stach - Core.cs", "GNU General Public License 3");
     MKL.Version("Stach - Core.cs", "21.03.09");
     FFS.Hello();
     Debug.WriteLine($"Running on {Platform}");
     Dirry.InitAltDrives();
     Config = GINIE.FromFile($"{Dirry.C("$AppSupport$/Stach.ini")}");
     Config.AutoSaveSource = $"{Dirry.C("$AppSupport$/Stach.ini")}";
     JCR6_lzma.Init();
     JCR6_jxsrcca.Init();
     JCR6_zlib.Init();
     new JCR_QuakePack();
     new JCR_a();
     new JCR_QuickLink();
     JCR_JCR5.Init();
     new JCR6_WAD();
     new JCR_WestwoodPAK();
 }
Exemple #12
0
        static void Main(string[] args)
        {
            // Header
            QCol.Red("Kitty "); QCol.Magenta("Coded by: Tricky\n");
            QCol.Yellow($"(c) {MKL.CYear(2019)} Jeroen P. Broks\n\n");
            // Init
            Dirry.InitAltDrives();
            KittyHigh.Init();
            new KittyHighCS();
            new KittyHighNIL();
            new KittyHighLua();
            new KittyHighGINI();
            new KittyHighScyndi();
            new KittyBlitzMax();
            new KittyHighC();
            new KittyHighPascal();
            new KittyHighBrainFuck();
            new KittyHighGo();
            new KittyHighBlitzBasic();
            new KittyHighSASKIA();
            new KittyHighPython();
            new KittyHighJavaScript();
            new KittyHighWhiteSpace();
            new KittyHighBASIC();
            new KittyHighJava();
            new KittyHighINI();
            new KittyHighVB();
            new KittyHighCobra();
            new KittyHighHtml();
            new KittyHighXml();
            new KittyHighNeil();
            var slin = true;

            if (args.Length == 0)
            {
                QCol.Green("Kitty is a simple program which will help you view source files in syntax highlight\n");
                QCol.Magenta("Usage:\t");
                QCol.Yellow("Kitty ");
                QCol.Cyan("<switches> ");
                QCol.White("<files>");
                QCol.Green("[");
                QCol.Cyan("<switches> ");
                QCol.White("<files>");
                QCol.Green("..]");
                Console.WriteLine("\n\n");
                QCol.Yellow("Please note that switches affect all files defined after it not those that come before it. This allows you to configure each file shown\n\n");
                QCol.Cyan("-ln              "); QCol.Yellow("Toggle line numbers on/off (default is on)\n");
                QCol.Cyan("-nolinenumbers   "); QCol.Yellow("Turn line numbers off\n");
                QCol.Cyan("-Showlinenumbers "); QCol.Yellow("Turn line numbers on\n");
                QCol.Cyan("-re              "); QCol.Yellow("Toggle searching by RegEx (this allows limited support for Wild Cards and more nice things)\n");
                QCol.Cyan("-p, -more        "); QCol.Yellow("Turn \"more\" mode on/off. (Read note below)\n");
                QCol.Cyan("-support         "); QCol.Yellow("Show a list of all supported file formats\n");
                QCol.Red("\n\nThe \"more\" mode!\n");
                QCol.Yellow("Does not entirely work the same as the 'more' utility, but has the same primary function!\n");
                QCol.Yellow("When the \"more\" bar appears you can hit space to show the next line, Enter/Return to show the entire next page and escape to turn the more mode off\n");
                QCol.White("\n\nKitty can be used as as CLI tool, but the integry has been made to be included in your own projects, and has been released under the terms of the zlib license\n\n");
                return;
            }
            // Go for it
            QCol.Doing("Called from:", System.IO.Directory.GetCurrentDirectory());
            void ViewFile(string a)
            {
                try {
                    var arg = Dirry.AD(a).Replace("\\", "/");
                    QCol.Doing("Reading", arg); KittyHigh.PageBreak();
                    var src  = QuickStream.LoadString(arg);
                    var eoln = qstr.EOLNType(arg);
                    // QCol.Doing("EOLN", eoln); // didn't work anyway
                    //QCol.OriCol();
                    var       ext    = qstr.ExtractExt(arg).ToLower();
                    KittyHigh Viewer = KittyHigh.Langs["OTHER"];
                    if (KittyHigh.Langs.ContainsKey(ext))
                    {
                        Viewer = KittyHigh.Langs[ext];
                    }
                    QCol.Doing("Type", Viewer.Language); KittyHigh.PageBreak();
                    KittyHigh.WriteLine();
                    Viewer.Show(src, slin);
                } catch (Exception ex) {
                    QCol.QuickError($"{ex.Message}\n");
#if DEBUG
                    QCol.Magenta($"{ex.StackTrace}\n\n");
#endif
                }
            }

            var aregex = false;
            foreach (string a in args)
            {
                if (qstr.Prefixed(a, "-"))
                {
                    switch (a.ToLower())
                    {
                    case "-ln": slin = !slin; break;

                    case "-nolinenumbers": slin = false; break;

                    case "-showlinenumbers": slin = true; break;

                    case "-p":
                    case "-more": KittyHigh.BrkLines = !KittyHigh.BrkLines; break;

                    case "-re": aregex = !aregex; break;

                    case "-support":
                        foreach (string ext in KittyHigh.Langs.Keys)
                        {
                            QCol.Cyan(qstr.Left($"{ext}                    ", 20));
                            QCol.Yellow($"{KittyHigh.Langs[ext].Language}\n");
                        }
                        break;

                    default: QCol.QuickError($"Unknown switch: {a}"); break;
                    }
                }
                else if (aregex)
                {
                    QCol.Doing("Searching for RegEx", a);
                    var rgxl = RegExTree.Tree(a);
                    foreach (string af in rgxl)
                    {
                        ViewFile(af);
                    }
                }
                else
                {
                    ViewFile(a);
                }
            }
            TrickyDebug.AttachWait();
        }
Exemple #13
0
 /* Crappy Callback Stuff */
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     Dirry.InitAltDrives();
 }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            TGINI config;

            try {
                config = GINI.ReadFromFile(Dirry.C("$AppSupport$/TeddyBaseConfig.GINI"));
            } catch (Exception err) {
                Afgekeurd($"Failed to load the configuration file\n{err.Message}");
                return;
            }
            switch (config.C("PLATFORM"))
            {
            case "Windows":
                Dirry.InitAltDrives(AltDrivePlaforms.Windows);
                break;

            case "Linux":
                Dirry.InitAltDrives(AltDrivePlaforms.Linux, config.C("LINUX_MEDIA"));
                break;

            default:
                Afgekeurd($"Platform {config.C("PLATFORM")} unknown");
                return;
            }
            var workspace = config.C("WORKSPACE");

            if (workspace == "")
            {
                Afgekeurd("Workspace not configured. Please run the launcher first!"); return;
            }

            TGINI project       = new TGINI();
            var   prjallowregex = new Regex(@"^[a-zA-Z0-9_ ]+$");

            ProjectName.Text = ProjectName.Text.Trim();
            var projectdir = $"{workspace}/{ProjectName.Text}";

            if (ProjectName.Text == "")
            {
                Afgekeurd("No project name given!"); return;
            }
            if (!prjallowregex.IsMatch(ProjectName.Text))
            {
                Afgekeurd("Only numbers letters underscores and spaces allowed in project name"); return;
            }
            if (Directory.Exists(projectdir))
            {
                Afgekeurd("That project already exists!"); return;
            }
            var mapw = qstr.ToInt(MapW.Text);
            var maph = qstr.ToInt(MapH.Text);

            if (mapw <= 0 || maph <= 0)
            {
                Afgekeurd("The map format has incorrect values"); return;
            }
            if (mapw * maph > 50000)
            {
                var r = MessageBox.Show($"These settings will be very very costly on your RAM. {mapw * maph} bytes per layer at least, and then the object layer not counted. Are you SURE, you wanna do this?", "Are you crazy?", MessageBoxButton.YesNo, MessageBoxImage.Warning);
                if (r == MessageBoxResult.No)
                {
                    return;
                }
            }
            var layers = Layers.Text.Split(';');

            if (layers.Length < 1)
            {
                Afgekeurd("A TeddyBear project MUST have at least 1 layer");
            }

            // Not really needed as the editor will never use it, but I guess it's just good practise
            project.D("PROJECTNAME", ProjectName.Text);

            // Create Project
            try {
                Directory.CreateDirectory(Dirry.AD(projectdir));
            } catch (Exception err) { Afgekeurd($"Project creation folder failed!\n\nDir: {Dirry.AD(projectdir)}\n\n{err.Message}"); return; }

            // Grid should when you are not an advanced user always be 32x32, and if you are an advanced user, why are you using this wizard?
            project.D("GRIDX", "32");
            project.D("GRIDY", "32");

            // Sizes
            project.D("SIZEX", $"{mapw}");
            project.D("SIZEY", $"{maph}");
            project.D("ResizeTextures", "FALSE");

            // Layers
            foreach (string layer in Layers.Text.Split(';'))
            {
                if (layer != "")
                {
                    project.Add("LAYERS", layer);
                    if (!qstr.Prefixed(layer, "Zone_"))
                    {
                        project.D($"HOT.{layer}", "BC");
                    }
                }
            }

            // Map dir
            var mapdir = MapFileFolder.Text;

            if (mapdir == "*InProject*")
            {
                mapdir = $"{projectdir}/Maps";
            }
            project.D("LevelDir", mapdir);
            try {
                Directory.CreateDirectory(Dirry.AD(mapdir));
            } catch (Exception err) {
                Afgekeurd($"Creation/access of map folder failed! -- Please note that a (project dir is now already created, you may need to destroy it for another go)\n\n{err.Message}");
                return;
            }

            // Texture dirs
            var texdir = TextureFolder.Text;

            if (texdir == "*InProject*")
            {
                texdir = $"{projectdir}/Textures";
            }
            var texdirs = texdir.Split(';');

            foreach (string td in texdirs)
            {
                project.Add("textures", td);
                try {
                    Directory.CreateDirectory(Dirry.AD(td));
                } catch (Exception err) {
                    Afgekeurd($"Creation/access of texture folder {td} failed! -- Please note that a (project dir is now already created, you may need to destroy it for another go)\n\n{err.Message}");
                    return;
                }
            }

            // Meta data
            var metas = MetaData.Text.Split(';');

            foreach (string meta in metas)
            {
                project.Add("Data", meta.Trim());
            }

            // Create project file
            try {
                project.SaveSource(Dirry.AD($"{projectdir}/{ProjectName.Text}.Project.GINI"));
            } catch (Exception err) {
                Afgekeurd($"I could not create project file '{projectdir}/{ProjectName.Text}.Project.GINI'\n\n{err.Message}");
                return;
            }
            MessageBox.Show("Project succesfully created", ProjectName.Text);
        }