Пример #1
0
        static void Create(string project)
        {
            GUI.WriteLn("Creating project");
            var prj = project.Replace(" ", "_").Replace("/", ".").Replace("\\", ".");
            var np  = new dvProject(prj); np.Data.CL("TAGS");

            GUI.WriteLn($"Codename: {np.PrjName}, using file {np.PrjName}");
            GUI.WriteLn("Setting up base tags");
            var tags = np.Data.List("TAGS");

            tags.Add("SITE");
            tags.Add("GENERAL");
            tags.Add("BUG");
            tags.Add("FIXED");
            GUI.WriteLn("Configuring Base tags");
            np.DefData($"HEAD.SITE", $"background-color:rgb(0,0,0); color:rgb(255,255,255);");
            np.DefData($"INHD.SITE", $"background-color:rgb(127,127,127); color:rgb(255,255,255);");
            np.DefData($"HEAD.GENERAL", $"background-color:rgb(0,0,0); color:rgb(0,255,255);");
            np.DefData($"INHD.GENERAL", $"background-color:rgb(0,127,127); color:rgb(0,255,255);");
            np.DefData($"HEAD.BUG", $"background-color:rgb(0,0,0); color:rgb(255,0,0);");
            np.DefData($"INHD.BUG", $"background-color:rgb(127,0,0); color:rgb(255,0,0);");
            np.DefData($"HEAD.FIXED", $"background-color:rgb(0,0,0); color:rgb(255,0,0);");
            np.DefData($"INHD.FIXED", $"background-color:rgb(0,127,0); color:rgb(0,255,0);");
            GUI.WriteLn("First entry!");
            new dvEntry(np, "SITE", $"Devlog created on {DateTime.Now.ToLongDateString()}; {DateTime.Now.ToLongTimeString()}.<p>Codenamed: {prj}");
            GUI.WriteLn("Saving for security's sake");
            np.SaveMe();
            GUI.WriteLn("Renew project list");
            GUI.RenewProjects();
            GUI.WriteLn($"Project {prj} has been created");
        }
Пример #2
0
        static void NewTag(string atag)
        {
            CurrentProject.Data.CL("TAGS");
            var tag = atag.Trim().ToUpper();

            if (tag == "")
            {
                GUI.WriteLn("No Tag!");
            }
            else if (CurrentProject == null)
            {
                GUI.WriteLn("No project!");
            }
            else if (tag.IndexOf(' ') >= 0)
            {
                GUI.WriteLn("Invalid tag!");
            }
            else if (CurrentProject.Data.List("TAGS").Contains(tag))
            {
                GUI.WriteLn($"Ttag {tag} already exists!");
            }
            else
            {
                var FR = Rand(CurrentProject.GetDataDefaultInt("FCOLMIN.R", 127), CurrentProject.GetDataDefaultInt("FCOLMAX.R", 255));
                var FG = Rand(CurrentProject.GetDataDefaultInt("FCOLMIN.G", 127), CurrentProject.GetDataDefaultInt("FCOLMAX.G", 255));
                var FB = Rand(CurrentProject.GetDataDefaultInt("FCOLMIN.B", 127), CurrentProject.GetDataDefaultInt("FCOLMAX.B", 255));
                var BR = (int)(FR / 20);
                var BG = (int)(FG / 20);
                var BB = (int)(FB / 20);
                if (CurrentProject.GetDataDefaultInt("BCOLMAX.R", 0) > 0)
                {
                    BR = Rand(CurrentProject.GetDataDefaultInt("BCOLMIN.R", 6), CurrentProject.GetDataDefaultInt("BCOLMAX.R", 12));
                }
                if (CurrentProject.GetDataDefaultInt("BCOLMAX.G", 0) > 0)
                {
                    BG = Rand(CurrentProject.GetDataDefaultInt("BCOLMIN.G", 6), CurrentProject.GetDataDefaultInt("BCOLMAX.G", 12));
                }
                if (CurrentProject.GetDataDefaultInt("BCOLMAX.B", 0) > 0)
                {
                    BB = Rand(CurrentProject.GetDataDefaultInt("BCOLMIN.B", 6), CurrentProject.GetDataDefaultInt("BCOLMAX.B", 12));
                }
                CurrentProject.Data.Add("TAGS", tag);
                CurrentProject.DefData($"HEAD.{tag}", $"background-color:rgb(0,0,0); color:rgb({FR},{FG},{FB});");
                CurrentProject.DefData($"INHD.{tag}", $"background-color:rgb({BR},{BG},{BB}); color:rgb({FR},{FG},{FB});");
                GUI.WriteLn($"Tag {tag} added");
                AddEntry($"SITE Added tag {tag}");
                GUI.UpdateTags();
            }
        }