Ejemplo n.º 1
0
 static void Take(string n)
 {
     if (CurrentProject == null)
     {
         Annoy("No project!"); return;
     }
     if (n.Trim() == "")
     {
         Takes++;
     }
     else if (n.Trim() == "RESET")
     {
         Takes = 1;
     }
     else
     {
         Takes = Math.Max(1, qstr.ToInt(n.Trim()));
     }
     if (!CurrentProject.GotTag("TEST"))
     {
         NewTag("TEST");
     }
     AddEntry($"TEST Take {Roman.ToRoman(Takes)}");
 }
Ejemplo n.º 2
0
 static public void Init()
 {
     MKL.Lic("Development Log - Command.cs", "GNU General Public License 3");
     MKL.Version("Development Log - Command.cs", "20.07.24");
     Commands["ANNOY"]        = Annoy;
     Commands["BYE"]          = Bye;
     Commands["SAY"]          = delegate(string yeah) { GUI.WriteLn(yeah, true); };
     Commands["F**K"]         = delegate { Annoy("Did your mother never teach you not to say such words?"); };
     Commands["YULERIA"]      = delegate { Annoy("Yuleria's rule of revenge:\nAn amateur kills people! A professional makes them suffer!"); };
     Commands["GLOBALCONFIG"] = GlobalConfig;
     Commands["USE"]          = delegate(string useme) { GUI.Use(useme); };
     Commands["SYSVARS"]      = delegate { if (CurrentProject == null)
                                           {
                                               GUI.WriteLn("No project!"); return;
                                           }
                                           foreach (string v in CurrentProject.Data.Vars())
                                           {
                                               GUI.WriteLn(v);
                                           }
     };
     Commands["VARS"] = delegate { if (CurrentProject == null)
                                   {
                                       GUI.WriteLn("No project!"); return;
                                   }
                                   foreach (string v in CurrentProject.Data.Vars())
                                   {
                                       if (qstr.Prefixed(v, "VAR."))
                                       {
                                           GUI.WriteLn(v);
                                       }
                                   }
     };
     Commands["LET"]    = LetVar;
     Commands["NEWTAG"] = NewTag;
     Commands["ADDTAG"] = NewTag;
     Commands["ADD"]    = AddEntry;
     Commands["GEN"]    = delegate { Export.Gen(); };
     Commands["ABOUT"]  = delegate {
         GUI.WriteLn($"This tool has been created and copyrighted by Jeroen P. Broks\nIs has been released under the terms of the GPL version 3\n\nCompiled on the next source files:\n\n{MKL.All()}");
     };
     Commands["CLH"]    = delegate { GUI.ClearHistory(); };
     Commands["CLS"]    = delegate { GUI.ClearConsole(); };
     Commands["PUSH"]   = delegate { GUI.WriteLn("Thanks to Ziggo I cannot push yet, but that comes later!"); };
     Commands["GO"]     = Go;
     Commands["UNLINK"] = Delete;
     Commands["DELETE"] = Delete;
     Commands["KILL"]   = Delete;
     Commands["RM"]     = Delete;
     Commands["REMOVE"] = Delete;
     Commands["DEL"]    = Delete;
     Commands["CREATE"] = Create;
     Commands["SAVE"]   = delegate { if (CurrentProject != null)
                                     {
                                         CurrentProject.SaveMe(); GUI.WriteLn("Saved!");
                                     }
                                     else
                                     {
                                         Annoy("No Project!");
                                     } };
     Commands["TAKE"] = Take;
     Commands["EDIT"] = delegate(string num) {
         if (CurrentProject == null)
         {
             Annoy("No Project!"); return;
         }
         var e = new dvEntry(CurrentProject, qstr.ToInt(num), true);
         if (e == null)
         {
             Annoy("Entry couldn't be accessed!"); return;
         }
         GUI.SetPrompt($"MODIFY {num} {e.Tag} {e.Pure}");
     };
     Commands["MODIFY"] = delegate(string str) {
         var args = str.Split(' ');
         if (CurrentProject == null)
         {
             Annoy("No Project!"); return;
         }
         if (args.Length < 3)
         {
             Annoy("Modify syntax error!"); return;
         }
         var num = qstr.ToInt(args[0]);
         var e   = new dvEntry(CurrentProject, num, true);
         if (e == null)
         {
             Annoy("Entry couldn't be accessed!"); return;
         }
         var tag = args[1].ToUpper();
         if (!CurrentProject.GotTag(tag))
         {
             Annoy($"There's no tag: {tag}"); return;
         }
         var sb = new System.Text.StringBuilder();
         e.Tag = tag;
         for (int i = 2; i < args.Length; ++i)
         {
             sb.Append($"{args[i]} ");
         }
         e.Pure = sb.ToString().Trim();
         GUI.UpdateEntries(CurrentProject.HighestRecordNumber - 200, CurrentProject.HighestRecordNumber);
     };
 }