Ejemplo n.º 1
0
        static public void ViewImg(byte[] Buffer, string File)
        {
            var ext = qstr.ExtractExt(File).ToLower();

            QuickStream.SaveBytes($"{Core.ViewSwap}/Image.{ext}", Buffer);
            QuickStream.SaveString($"{Core.ViewSwap}/ViewFile.html", HTMLTemplate.Replace("<HEADER>", $"Viewing: {File}").Replace("<URI>", $"{Core.ViewSwap}/Image.{ext}"));
        }
Ejemplo n.º 2
0
 bool GetGINI()
 {
     if (File.Exists(qstr.RemSuffix(GINIFile, ".gini") + ".ini"))
     {
         Console.Beep();
         Console.WriteLine("Renaming old ini file to GINI!");
         File.Move(qstr.RemSuffix(GINIFile, ".gini") + ".ini", GINIFile);
     }
     if (!File.Exists(GINIFile))
     {
         for (int i = 0; i < 10; i++)
         {
             Console.Beep(2000, 1000);
             Console.Beep(1000, 1000);
         }
         Console.WriteLine("This directory has not been initized as a MKL based project!");
         Console.Write("Do you want it to be a MKL based project ? <Y/N> ");
         if (Console.ReadLine().ToUpper() != "Y")
         {
             return(false);
         }
         QuickStream.SaveString(GINIFile, "[rem]\nVoid Dark(){ cprintf(\"Void the darkness\"); }\n");
     }
     Data = GINI.ReadFromFile(GINIFile);
     Data.CL("KNOWN");
     Data.CL("SKIPFILE");
     Data.CL("SKIPDIR");
     Ask("Project", dir, "Please name the project: ");
     return(true);
 }
Ejemplo n.º 3
0
        public override void Run(FlagParse fp)
        {
            if (fp.Args.Length < 2)
            {
                QCol.Green("This feature allows you to show the content of a certain file.\n");
                QCol.Green("In order to do this, some additional configuration will be needed, as well as knowledge of the file system you are using.\n");
                QCol.Green("Don't worry about having to set up this file, manually. You will be prompted whenever NJCR requires more information.\n");
                QCol.Green($"The configuration can lateron be edited with your favority text editor (as long as it supports Unix LF line ends), as it will be saved as {ShowConfig}");
                return;
            }
            QCol.Doing("Reading JCR", fp.Args[1].Replace("\\", "/"));
            var jcr = JCR6.Dir(fp.Args[1]);

            if (jcr == null)
            {
                QCol.QuickError(JCR6.JERROR); return;
            }
            if (!File.Exists(ShowConfig))
            {
                QuickStream.SaveString(ShowConfig, "[rem]\nNothint to see here yet\n");
            }
            Config = GINI.ReadFromFile(ShowConfig);
            Ask("Temp.Dir", "I am in need of a temp-directory.\nYou can pick any directory you want for this, and the system will try to create the desired directory if it doesn't yet exist.\nThe files to show will be temporarily stored here, and IT'S VERY IMPORTANT THAT THIS DIRECTORY IS ONLY USED FOR THIS PURPOSE!!!", "Temp Folder");
            QCol.Doing("Temp dir", TempFolder);
            Directory.CreateDirectory(TempFolder);
            for (int i = 2; i < fp.Args.Length; i++)
            {
                Show(jcr, fp.Args[i]);
            }
        }
Ejemplo n.º 4
0
        static public void View(string file, string showme)
        {
            if (HexViewer.IsBinary(showme))
            {
                HexViewer.View(showme, file);
                return;
            }
            if (!InitDone)
            {
                Init();
            }
            Debug.WriteLine("Setting up view");
            var KV   = new KittyViewer();
            var ext  = qstr.ExtractExt(file).ToLower();
            var odir = Core.Config[Core.Platform, "VIEWSWAP"];

            Debug.WriteLine("Linking to Kitty");
            KittyHigh.Console = (KittyOutput)KV;
            if (KittyHigh.Langs.ContainsKey(ext))
            {
                KittyHigh.Langs[ext].Show(showme, LineNumbers);
            }
            else
            {
                KittyHigh.Langs["OTHER"].Show(showme, LineNumbers);
            }
            Directory.CreateDirectory(odir);
            QuickStream.SaveString($"{odir}/ViewFile.html", KV.ToString());
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 6
0
        void SaveFile(string f, string[] code)
        {
            //var bt = QuickStream.WriteFile(f);
            //foreach (string ln in code) bt.WriteString($"{ln}\n",true);
            //bt.Close();
            var s = new StringBuilder();

            foreach (string ln in code)
            {
                s.Append($"{ln}\n");
            }
            QuickStream.SaveString(f, s.ToString().Trim());
        }
Ejemplo n.º 7
0
        void Show(TJCRDIR jcr, string entry)
        {
            try {
                var Ext = qstr.ExtractExt(entry).ToUpper(); if (Ext == "")
                {
                    throw new Exception($"Files without extension cannot be processed: {entry}");
                }
                Ask($"APP.{Ext}", $"Which application should be used to show .{Ext} files?\nI need to know in order to view {entry}.\nJust a tag for the application, not yet a full line to execute", "Application");
                Ask($"EXE.{Config.C($"APP.{Ext}")}", $"Now I need the full line to execute the application {Config.C($"App.{Ext}")}.\nPlease note I will visit the folder where the temp file is located, and you must add {'{'}file{'}'} in the line so NJCR can subsitute that with the file needed", "Command line");
                QCol.Doing("Extracting", entry);
                var b    = jcr.JCR_B(entry);
                var tent = qstr.StripDir(entry);
                var old  = Directory.GetCurrentDirectory();
                Directory.SetCurrentDirectory(TempFolder);
                if (b == null)
                {
                    throw new Exception($"JCR ERROR: {JCR6.JERROR}");
                }
                QuickStream.SaveBytes(tent, b);
                QuickStream.SaveString("NJCRSHOW.BAT", $"{Config.C($"EXE.{Config.C($"APP.{Ext}")}").Replace("{file}", tent)}");
                // Start the child process.
                QCol.Doing("Executing", $"{Config.C($"EXE.{Config.C($"APP.{Ext}")}").Replace("{file}", tent)}");
                Process p = new Process();
                // Redirect the output stream of the child process.
                p.StartInfo.UseShellExecute        = false;
                p.StartInfo.RedirectStandardOutput = true;
                p.StartInfo.FileName = "NJCRSHOW.BAT";
                p.Start();
                // Do not wait for the child process to exit before
                // reading to the end of its redirected stream.
                // p.WaitForExit();
                // Read the output stream first and then wait.
                string output = p.StandardOutput.ReadToEnd();
                QCol.Magenta(output);
                p.WaitForExit();
                QCol.Doing("Deleting temp", tent);
                File.Delete(tent);
                Directory.SetCurrentDirectory(old);
            } catch (Exception Mislukt) {
                QCol.QuickError(Mislukt.Message);
#if DEBUG
                QCol.Magenta($"{Mislukt.StackTrace}\n");
#endif
            }
        }
Ejemplo n.º 8
0
        public void SaveMap()
        {
            #region Save the map in TeddyBear's native format
            UI.ErrorNotice = "";
            ProjectData.Log($"Compresion = {ProjectData.MapCompression}");
            var r = TeddySave.Save(ProjectData.Map, ProjectData.MapFile, "", ProjectData.MapCompression, ProjectData.MapCompression);
            if (r != "" && r != "Ok")
            {
                UI.ErrorNotice = r; return;
            }
            #endregion

            #region Export the map if applicable
            if (ProjectData.ProjectConfig.C("XPORT.EDITAUTO").ToUpper() != "YES")
            {
                return;
            }
            var XTo     = ProjectData.ProjectConfig.C("XPORT.TO");
            var XTarget = ProjectData.ProjectConfig.C("XPORT.TARGET").ToLower();
            if (XTo == "")
            {
                UI.ErrorNotice = "EXPORT: Folder to export to not configured!"; return;
            }
            XTo = Dirry.AD(XTo);
            if (XTarget == "")
            {
                UI.ErrorNotice = "EXPORT: Target language to export to not set!"; return;
            }
            if (!XPort_Base.Drivers.ContainsKey(XTarget))
            {
                UI.ErrorNotice = $"EXPORT: Target language '{XTarget}' unknown!"; return;
            }
            try {
                ProjectData.Log($"Translating into {XTarget} to folder {XTo}");
                var translation = XPort_Base.Drivers[XTarget].Translate(ProjectData.Map);
                Directory.CreateDirectory(XTo);
                var outfile = XPort_Base.Drivers[XTarget].TransFile($"{XTo}/{qstr.StripDir(ProjectData.MapFile)}");
                ProjectData.Log($"Saving translation into {outfile}");
                QuickStream.SaveString(outfile, translation);
            } catch (Exception e) {
                UI.ErrorNotice = $"EXPORT.SAVE: {e.Message}";
            }
            #endregion
        }
Ejemplo n.º 9
0
        void TranslateMaps()
        {
            Doing("Analysing Maps for Project", XProject);
            var tdrv   = XPort_Base.Drivers[XTarget];
            var mapdir = Dirry.AD(ProjectConfig.C("LevelDir"));
            var fl     = FileList.GetDir(mapdir);

            foreach (string mapname in fl)
            {
                Doing("Translating", mapname);
                var map = TeddyBear.TeddyMap.Load($"{mapdir}/{mapname}");
                if (map == null)
                {
                    Crash($"Map Load Error\n{JCR6.JERROR}");
                }
                var translation = tdrv.Translate(map);
                QuickStream.SaveString(tdrv.TransFile($"{XTo}/{mapname}"), translation);
            }
        }
Ejemplo n.º 10
0
        static public void View(char[] dat, string file)
        {
            //var s = new StringBuilder($"<h2>File: {file}</h2><pre>");
            var t = new StringBuilder("");
            var p = 0;

            Console = new KittyViewer();
            Console.WriteLine($"<h2>File: {file}</h2><pre>");
            for (int i = 0; i < dat.Length; ++i)
            {
                p = i % 16;
                var b = (byte)dat[i];
                if (p == 0)
                {
                    Console.ForegroundColor = ConsoleColor.Yellow;
                    Console.Write($"  {t}\n");
                    Console.ForegroundColor = ConsoleColor.DarkGray;
                    Console.Write(Fmt.sprintf("%09X | ", i));
                    t.Clear();
                }
                Console.ForegroundColor = ConsoleColor.Cyan;
                //Console.Write(Fmt.sprintf("%02X ", (byte)dat[i]));
                Console.Write(("0" + b.ToString("X")).Substring(0, 2) + " ");
                if (b >= 32 && b < 127)
                {
                    t.Append(dat[i]);
                }
                else
                {
                    t.Append(".");
                }
            }
            for (int i = p; i < 15; ++i)
            {
                Console.ForegroundColor = ConsoleColor.Black;
                Console.Write("   ");
            }
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.Write($"  {t}");
            Directory.CreateDirectory(Core.ViewSwap);
            QuickStream.SaveString($"{Core.ViewSwap}/ViewFile.html", Console.ToString());
            Console = null;
        }
Ejemplo n.º 11
0
        void Export(string amap)
        {
            if (amap == "")
            {
                foreach (string m in FileList.GetDir(Dirry.AD($"{MapDir}")))
                {
                    Export(m);
                }
                return;
            }
            var    exporter   = ExportBasis.Get(Target);
            var    outputfile = $"{XPTo}/{exporter.ExportedFile(amap)}";
            Kthura kmap       = null; // (=null is required or the compiler THINKS we got an unassigned thing.... TRY it! :P

            Doing("Exporting Map", amap);
            Doing("Output", outputfile);
            Magenta(" Reading\r");
            try {
                kmap = Kthura.Load($"{MapDir}/{amap}");
            } catch (Exception e) {
                if (JCR6.JERROR != "" && JCR6.JERROR != "OK")
                {
                    Error(JCR6.JERROR);
                }
                Error(e);
            }
            Assert(kmap != null, $"Failed to load the map!    {JCR6.JERROR}");
            Magenta(" Translating\r");
            var translation = exporter.DoExport(kmap);

            Magenta(" Writing      \r");
            try {
                Directory.CreateDirectory(qstr.ExtractDir(outputfile));
                QuickStream.SaveString(outputfile, translation);
            } catch (Exception e) {
                Error(e);
            }
            Magenta("                  \n");
        }
Ejemplo n.º 12
0
 static void Main(string[] args)
 {
     if (args.Length == 0)
     {
         Console.WriteLine("txt2unix - Coded by Jeroen P. Broks");
         Console.WriteLine("\n\tUsage: txt2unix <text-files>");
         Console.WriteLine("\n\nWarning this tool is very very simplistic and although it does try to distiguish text files from binary files, there is no 100% protection, and using it on binary files can have very funny outcomes!");
     }
     else
     {
         foreach (string fl in args)
         {
             Console.ForegroundColor = ConsoleColor.Yellow;
             Console.Write("Processing: ");
             Console.ForegroundColor = ConsoleColor.Cyan;
             Console.Write($"{fl} ");
             Console.ForegroundColor = ConsoleColor.Magenta;
             Console.Write("r\b");
             string s = QuickStream.LoadString(fl);
             Console.Write("p\b");
             if (s.IndexOf((char)26) >= 0)
             {
                 E("Binary file! Can't process!");
             }
             else
             {
                 s = s.Replace("\r\n", "\n");
                 Console.Write("w\b");
                 QuickStream.SaveString(fl, s);
                 Console.ForegroundColor = ConsoleColor.Green;
                 Console.WriteLine("Ok");
             }
         }
     }
     Console.ForegroundColor = ConsoleColor.Gray;
 }
Ejemplo n.º 13
0
        private void DirBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Entry_Alias.Items.Clear();
            Entry_Ratio.Content = "N/A";
            Entry_Main.Content  = "--";
            if (DirBox.SelectedItem == null)
            {
                foreach (string EL in EntryLink.Keys)
                {
                    EntryLink[EL].Content = "--";
                }
                UpdateBlockView(false);
                return;
            }
            var item = (string)DirBox.SelectedItem;

            if (Core.IN_Resource)
            {
                var ename = $"{Core.CDirectory}/{item}";
                while (ename != "" && ename[0] == '/')
                {
                    ename = ename.Substring(1);
                }
                if (qstr.Suffixed(ename, "/"))
                {
                    foreach (string EL in EntryLink.Keys)
                    {
                        EntryLink[EL].Content = "N/A";
                    }
                    Entry_Entry.Content = ename;
                    Entry_Type.Content  = "Directory";
                    UpdateBlockView(false);
                }
                else
                {
                    var E = Core.JCR.Entries[ename.ToUpper()];
                    UpdateBlockView(E.Block != 0);
                    foreach (TJCREntry ECHK in Core.JCR.Entries.Values)
                    {
                        if (ECHK != E && ECHK.MainFile == E.MainFile && ECHK.Offset == E.Offset && ECHK.Block == E.Block)
                        {
                            Entry_Alias.Items.Add(ECHK.Entry);
                        }
                    }
                    foreach (string k in E.databool.Keys)
                    {
                        if (EntryLink.ContainsKey(k))
                        {
                            if (E.databool[k])
                            {
                                EntryLink[k].Content = "Yes";
                            }
                            else
                            {
                                EntryLink[k].Content = "No";
                            }
                        }
                    }
                    foreach (string k in E.dataint.Keys)
                    {
                        if (EntryLink.ContainsKey(k))
                        {
                            EntryLink[k].Content = $"{E.dataint[k]}";
                        }
                    }
                    foreach (string k in E.datastring.Keys)
                    {
                        if (EntryLink.ContainsKey(k))
                        {
                            EntryLink[k].Content = $"{E.datastring[k]}";
                        }
                    }
                    Entry_Main.Content  = E.MainFile;
                    Entry_Ratio.Content = E.Ratio;
                    if (E.Block != 0)
                    {
                        Entry_Ratio.Content  = "Unavailable (block)";
                        Entry_Offset.Content = "Unavailable (block)";
                        var B = Core.JCR.Blocks[$"{E.Block}:{E.MainFile}"];
                        Entry_Entry_Block.Content = E.Entry;
                        Entry_Block.Content       = $"{E.Block}";
                        Block_Entries.Items.Clear();
                        foreach (var BE in Core.JCR.Entries.Values)
                        {
                            if (BE.Block == E.Block)
                            {
                                Block_Entries.Items.Add(BE.Entry);
                            }
                        }
                        Block_EntryOffset.Content = $"{E.Offset}";
                        Block_Offset.Content      = $"{B.Offset}";
                        Block_Size.Content        = $"{B.Size}";
                        Block_CSize.Content       = $"{B.CompressedSize}";
                        Block_Ratio.Content       = $"{B.Ratio}%";
                    }
                    if (Core.Config[Core.Platform, "ViewSwap"] == "")
                    {
                        Viewer.Navigate($"file://{Core.MyExeDir}/NoViewSwap.html");
                    }
                    else
                    {
                        switch (qstr.ExtractExt(E.Entry).ToLower())
                        {
                        case "jpg":
                        case "jpeg":
                        case "gif":
                        case "bmp":
                        case "png":
                            ImgViewer.ViewImg(Core.JCR.JCR_B(E.Entry), $"{E.MainFile}/{E.Entry}");
                            Viewer.Refresh();
                            break;

                        default:
                            KittyViewer.View($"{E.MainFile}/{E.Entry}", Core.JCR.LoadString(E.Entry));
                            break;
                        }
                        Viewer.Navigate($"file://{Core.Config[Core.Platform, "VIEWSWAP"]}/ViewFile.html");
                    }
                }
            }
            else
            {
                var ename = $"{Core.CDirectory}/{item}";
                if (!qstr.Suffixed(ename, "/"))
                {
                    if (Core.Config[Core.Platform, "ViewSwap"] == "")
                    {
                        Viewer.Navigate($"file://{Core.MyExeDir}/NoViewSwap.html");
                    }
                    else if (JCR6.Recognize(ename).ToUpper() != "NONE")
                    {
                        var odir = Core.Config[Core.Platform, "VIEWSWAP"];
                        var KV   = new KittyViewer();
                        KV.ForegroundColor = ConsoleColor.Yellow;
                        KV.WriteLine("JCR6 resource");
                        KV.ForegroundColor = ConsoleColor.White;
                        KV.WriteLine($"File {qstr.StripDir(ename)} has been recognized as: {JCR6.Recognize(ename)}");
                        KV.WriteLine($"JCR6 understands this format, so why don't you open it to see its contents?");
                        Directory.CreateDirectory(odir);
                        QuickStream.SaveString($"{odir}/ViewJCRFile.html", KV.ToString());
                        Viewer.Navigate($"{odir}/ViewJCRFile.html");
                    }
                    else
                    {
                        switch (qstr.ExtractExt(ename).ToLower())
                        {
                        case "jpg":
                        case "jpeg":
                        case "gif":
                        case "bmp":
                        case "png":
                            ImgViewer.ViewImg(QuickStream.GetFile(ename), ename);
                            break;

                        default:
                            KittyViewer.View($"{ename}", QuickStream.LoadString(ename));
                            break;
                        }
                        Viewer.Navigate($"file://{Core.Config[Core.Platform, "VIEWSWAP"]}/ViewFile.html");
                    }
                }
            }
        }
Ejemplo n.º 14
0
        static public void Gen()
        {
            string template;
            var    cp = CurrentProject; if (cp == null)

            {
                GUI.WriteLn("GEN: No project!"); return;
            }

            try {
                System.IO.Directory.CreateDirectory(OutDir);
            } catch (Exception e) {
                GUI.WriteLn($"GEN: {e.Message}");
                return;
            }
            int    pages        = cp.CountRecords / 200;
            int    page         = 1;
            int    pcountdown   = 200;
            bool   justnewpaged = false;
            string olddate      = "____OLD____";

            string[] iconext = { "png", "gif", "svg", "jpg" };
            if (cp.CountRecords % 200 > 0)
            {
                pages++;
            }
            try{
                template = QuickStream.LoadString(cp.Template.Trim());
            } catch {
                QuickGTK.Error($"Template {cp.Template} could not be properly loaded!");
                GUI.WriteLn($"GEN:Template {cp.Template} could not be properly loaded!");
                return;
            }
            GUI.Write("Exporting...");
            var pageline = "";

            for (int p = 1; p <= pages; p++)
            {
                if (page == p)
                {
                    pageline += $"<big><big>{p}</big></big> ";
                }
                else
                {
                    pageline += $"<a href='{cp.PrjName}_DevLog_Page_{p}.html'>{p}</a> ";
                }
            }
            pageline = pageline.Trim();
            var content = new System.Text.StringBuilder($"<table style=\"width:{cp.GetDataDefaultInt("EXPORT.TABLEWIDTH", 1200)}\">\n");

            content.Append($"<tr><td colspan=3 align=center>{pageline}</td></tr>\n");
            for (int i = cp.HighestRecordNumber; i > 0; i--)
            {
                //if (i % 6 == 0) { GUI.Write("."); Console.Write($".{i}."); }
                justnewpaged = false;
                var rec = new dvEntry(cp, i, true);
                if (rec.Loaded)
                {
                    if (rec.Date != olddate)
                    {
                        content.Append($"<tr><td align=center colspan=3 style='font-size:30pt;'>- = {rec.Date} = -</td></tr>\n");
                    }
                    olddate = rec.Date;
                    string headstyle    = cp.Data.C($"HEAD.{rec.Tag.ToUpper()}");
                    string contentstyle = cp.Data.C($"INHD.{rec.Tag.ToUpper()}");
                    content.Append($"<tr valign=top><td align=left><a id='dvRec_{rec.RecID}'></a>{rec.Time}</td><td style=\"{headstyle}\">{rec.Tag}</td><td style='width: { cp.GetDataDefaultInt("EXPORT.CONTENTWIDTH", 800)}; {contentstyle}'><div style=\"width: { cp.GetDataDefaultInt("EXPORT.CONTENTWIDTH", 800)}; overflow-x:auto;\">");
                    var alticon = cp.Data.C($"ICON.{rec.Tag.ToUpper()}").Trim();
                    if (alticon == "")
                    {
                        var icon    = $"{OutDir}/Icons/{rec.Tag.ToLower()}";
                        var neticon = $"Icons/{rec.Tag.ToLower()}";
                        neticon = neticon.Replace("#", "%23");
                        icon    = icon.Replace("#", "hashtag");
                        foreach (string pfmt in iconext)
                        {
                            var iconfile = $"{icon}.{pfmt}";
                            iconfile = iconfile.Replace("#", "%23");
                            if (System.IO.File.Exists(iconfile))
                            {
                                content.Append($"<img style='float:{cp.GetDataDefault("EXPORT.ICONFLOATPOSITION", "Right")}; height:{cp.GetDataDefaultInt("EXPORT.ICONHEIGHT", 50)}' src='{neticon}.{pfmt}' alt='{rec.Tag}'>"); break;
                            }
                        }
                    }
                    else
                    {
                        //content.Append($"<img style='float:{cp.GetDataDefault("EXPORT.ICONFLOATPOSITION", "Right")}; height:{cp.GetDataDefaultInt("EXPORT.ICONHEIGHT", 50)};'  src='{alticon}' alt='{rec.Tag}'>");
                        content.Append($"<img style='float:{cp.GetDataDefault("EXPORT.ICONFLOATPOSITION", "Right")};' height='{cp.GetDataDefaultInt("EXPORT.ICONHEIGHT", 50)}' src='{alticon}' alt='{rec.Tag}'>");
                    }
                    content.Append($"{rec.Text}</div></td></tr>\n");
                    pcountdown--;
                    if (pcountdown <= 0)
                    {
                        pcountdown   = 200;
                        justnewpaged = true;
                        content.Append($"<tr><td colspan=3 align=center>{pageline}</td></tr>\n</table>\n\n");
                        QuickStream.SaveString($"{OutDir}/{cp.PrjName}_DevLog_Page_{page}.html", template.Replace("@CONTENT@", content.ToString()));
                        page++;
                        pageline = "";
                        for (int p = 1; p <= pages; p++)
                        {
                            if (page == p)
                            {
                                pageline += $"<big><big>{p}</big></big> ";
                            }
                            else
                            {
                                pageline += $"<a href='{cp.PrjName}_DevLog_Page_{p}.html'>{p}</a> ";
                            }
                        }
                        content = new System.Text.StringBuilder($"<table style=\"width:{cp.GetDataDefaultInt("EXPORT.TABLEWIDTH", 1200)}\">\n");
                        content.Append($"<tr><td colspan=3 align=center>{pageline}</td></tr>\n");
                    }
                }
            }
            if (!justnewpaged)
            {
                content.Append($"<tr><td colspan=3 align=center>{pageline}</td></tr>\n</table>");
                QuickStream.SaveString($"{OutDir}/{cp.PrjName}_DevLog_Page_{page}.html", template.Replace("@CONTENT@", content.ToString()));
            }
            GUI.WriteLn(" Done");
            Console.WriteLine(" GENERATED");
        }
Ejemplo n.º 15
0
 public void SaveString(string file, string Content)
 {
     QuickStream.SaveString(file, Content);
 }