Example #1
0
 public Project(string citprojPath)
 {
     CitprojPath = citprojPath;
     AddDefaultRulers();
     UserprefsPath   = Path.ChangeExtension(citprojPath, ".userprefs");
     AssetsDirectory = Path.Combine(Path.GetDirectoryName(CitprojPath), "Data");
     if (!Directory.Exists(AssetsDirectory))
     {
         throw new InvalidOperationException($"Assets directory {AssetsDirectory} doesn't exist.");
     }
     Orange.The.Workspace.Open(citprojPath);
     foreach (var ruler in Orange.The.Workspace.ProjectJson.GetArray("Rulers", new RulerData[0]))
     {
         Rulers.Add(ruler);
     }
     UpdateTextureParams();
 }
 public void SaveActiveRuler()
 {
     Rulers.Add(ActiveRuler);
     ActiveRuler = new Ruler();
     UserPreferences.Instance.Save();
 }
Example #3
0
 public void AddRuler(RulerData ruler)
 {
     Orange.The.Workspace.ProjectJson.AddToArray("Rulers", ruler);
     Rulers.Add(ruler);
     Orange.The.Workspace.SaveCurrentProject();
 }