public void Load() { var config = WorkspaceConfig.Load(); Open(config.CitrusProject); The.UI.LoadFromWorkspaceConfig(config); }
public static void Save(WorkspaceConfig config) { using (FileStream stream = new FileStream(GetConfigPath(), FileMode.Create, FileAccess.Write, FileShare.None)) { var js = new Yuzu.Json.JsonSerializer(); js.ToStream(config, stream); } }
public void RemoveRecentProject(string projectPath) { var config = WorkspaceConfig.Load(); config.RemoveRecentProject(projectPath); WorkspaceConfig.Save(config); }
public override void LoadFromWorkspaceConfig(WorkspaceConfig config) { var newIndex = config.ActiveTargetIndex; if (newIndex < 0 || newIndex >= platformPicker.Items.Count) { newIndex = 0; } platformPicker.Index = newIndex; updateVcs.CheckBox.Checked = config.UpdateBeforeBuild; projectPicker.ChosenFile = config.CitrusProject; if (config.ClientPosition.X < 0) { config.ClientPosition.X = 0; } if (config.ClientPosition.Y < 0) { config.ClientPosition.Y = 0; } if (config.ClientPosition != Vector2.Zero) { window.ClientPosition = config.ClientPosition; } if (config.ClientSize != Vector2.Zero) { window.ClientSize = config.ClientSize; } }
public override void LoadFromWorkspaceConfig(WorkspaceConfig config) { var newIndex = config.ActiveTargetIndex; if (newIndex < 0 || newIndex >= platformPicker.Items.Count) { newIndex = 0; } platformPicker.Index = newIndex; projectPicker.ChosenFile = config.CitrusProject; if (config.ClientPosition.X < 0) { config.ClientPosition.X = 0; } if (config.ClientPosition.Y < 0) { config.ClientPosition.Y = 0; } if (config.ClientPosition != Vector2.Zero) { window.ClientPosition = config.ClientPosition; } if (config.ClientSize != Vector2.Zero) { window.ClientSize = config.ClientSize; } UpdateCacheModeCheckboxes(config.AssetCacheMode); UpdateBundlePicker(config.BundlePickerVisible); }
public void Load(string projectFilePath = null) { // heuristic behavior: always try to go up and search for a citproj file // if found, ignore the one saved in app data, since we're opening citrus directory // related to found game project as a submodule var config = WorkspaceConfig.Load(); if (projectFilePath != null) { Open(projectFilePath); } else if (Toolbox.TryFindCitrusProjectForExecutingAssembly(out projectFilePath)) { Open(projectFilePath); } var projectConfig = config.GetProjectConfig(projectFilePath); The.UI.LoadFromWorkspaceConfig(config, projectConfig); var citrusVersion = CitrusVersion.Load(); if (citrusVersion.IsStandalone) { Console.WriteLine($"Welcome to Citrus. Version {citrusVersion.Version}, build number: {citrusVersion.BuildNumber}"); } BenchmarkEnabled = config.BenchmarkEnabled; if (projectConfig != null) { BundlePickerVisible = projectConfig.BundlePickerVisible; } #pragma warning disable CS4014 Orange.Updater.CheckForUpdates(); #pragma warning restore CS4014 LoadCacheSettings(); }
public void Save() { var config = WorkspaceConfig.Load(); config.CitrusProject = ProjectFile; The.UI.SaveToWorkspaceConfig(ref config); WorkspaceConfig.Save(config); }
public string GetTangerineCacheBundlePath() { var name = string .Join("_", ProjectFilePath.Split(new[] { "\\", "/", ":" }, StringSplitOptions.RemoveEmptyEntries)) .ToLower(System.Globalization.CultureInfo.InvariantCulture); name = Path.ChangeExtension(name, "tancache"); return(Path.Combine(WorkspaceConfig.GetDataPath(), name)); }
public override void SaveToWorkspaceConfig(ref WorkspaceConfig config) { config.ActiveTargetIndex = platformPicker.Index; config.BundlePickerVisible = bundlePickerWidget.Visible; if (window.State != WindowState.Minimized) { config.ClientPosition = window.ClientPosition; config.ClientSize = window.ClientSize; } }
public override void SaveToWorkspaceConfig(ref WorkspaceConfig config) { config.UpdateBeforeBuild = DoesNeedSvnUpdate(); config.ActiveTargetIndex = platformPicker.Index; if (window.State != WindowState.Minimized) { config.ClientPosition = window.ClientPosition; config.ClientSize = window.ClientSize; } }
public override void LoadFromWorkspaceConfig(WorkspaceConfig config) { var newIndex = config.ActiveTargetIndex; if (newIndex < 0 || newIndex >= platformPicker.Items.Count) { newIndex = 0; } platformPicker.Index = newIndex; updateVcs.CheckBox.Checked = config.UpdateBeforeBuild; projectPicker.ChosenFile = config.CitrusProject; }
public void Save() { var config = WorkspaceConfig.Load(); config.RegisterRecentProject(ProjectFilePath); var projectConfig = config.GetProjectConfig(ProjectFilePath); if (projectConfig != null) { projectConfig.AssetCacheMode = AssetCacheMode; } The.UI.SaveToWorkspaceConfig(ref config, projectConfig); WorkspaceConfig.Save(config); }
public void LoadCacheSettings() { var config = WorkspaceConfig.Load(); if (ProjectFile != string.Empty) { AssetCacheMode = config.AssetCacheMode; LocalAssetCachePath = config.LocalAssetCachePath; if (ProjectDirectory != null && !Path.IsPathRooted(LocalAssetCachePath)) { LocalAssetCachePath = Path.Combine(ProjectDirectory, LocalAssetCachePath); } } }
public void LoadCacheSettings() { var config = WorkspaceConfig.Load(); var projectConfig = config.GetProjectConfig(ProjectFilePath); if (projectConfig != null) { AssetCacheMode = projectConfig.AssetCacheMode; LocalAssetCachePath = projectConfig.LocalAssetCachePath; if (ProjectDirectory != null && !Path.IsPathRooted(LocalAssetCachePath)) { LocalAssetCachePath = Path.Combine(ProjectDirectory, LocalAssetCachePath); } } }
public void Load() { var config = WorkspaceConfig.Load(); Open(config.CitrusProject); The.UI.LoadFromWorkspaceConfig(config); var citrusVersion = CitrusVersion.Load(); if (citrusVersion.IsStandalone) { Console.WriteLine($"Welcome to Citrus. Version {citrusVersion.Version}, build number: {citrusVersion.BuildNumber}"); } #pragma warning disable CS4014 Orange.Updater.CheckForUpdates(); #pragma warning restore CS4014 }
public override void LoadFromWorkspaceConfig(WorkspaceConfig config, ProjectConfig projectConfig) { if (config.ClientPosition.X < 0) { config.ClientPosition.X = 0; } if (config.ClientPosition.Y < 0) { config.ClientPosition.Y = 0; } if (config.ClientPosition != Vector2.Zero) { window.ClientPosition = config.ClientPosition; } if (config.ClientSize != Vector2.Zero) { window.ClientSize = config.ClientSize; } if (config.WindowState != WindowState.Minimized) { window.State = config.WindowState; } if (projectConfig != null) { var newIndex = projectConfig.ActiveTargetIndex; if (newIndex < 0 || newIndex >= platformPicker.Items.Count) { newIndex = 0; } platformPicker.Index = newIndex; UpdateCacheModeCheckboxes(projectConfig.AssetCacheMode); UpdateBundlePicker(projectConfig.BundlePickerVisible); } else { UpdateBundlePicker(false); startPageWidget = ProduceStartPage(config.RecentProjects); windowWidget.Nodes.Clear(); windowWidget.AddNode(startPageWidget); } }
public void Load() { var config = WorkspaceConfig.Load(); var citrusDirectory = Toolbox.CalcCitrusDirectory(); { // heuristic behavior: always try to go up and search for a citproj file // if found, ignore the one saved in app data, since we're opening citrus directory // related to found game project as a submodule var directoryInfo = (new DirectoryInfo(citrusDirectory)).Parent; while (directoryInfo != null) { var citprojFiles = directoryInfo.EnumerateFiles("*.citproj"); if (citprojFiles.Any()) { config.CitrusProject = citprojFiles.First().FullName; break; } directoryInfo = directoryInfo.Parent; } } Open(config.CitrusProject); The.UI.LoadFromWorkspaceConfig(config); var citrusVersion = CitrusVersion.Load(); if (citrusVersion.IsStandalone) { Console.WriteLine($"Welcome to Citrus. Version {citrusVersion.Version}, build number: {citrusVersion.BuildNumber}"); } BenchmarkEnabled = config.BenchmarkEnabled; BundlePickerVisible = config.BundlePickerVisible; #pragma warning disable CS4014 Orange.Updater.CheckForUpdates(); #pragma warning restore CS4014 LoadCacheSettings(); }
public static void Save(WorkspaceConfig config) => persistence.WriteObjectToFile(GetConfigPath(), config, Persistence.Format.Json);
public override void SaveToWorkspaceConfig(ref WorkspaceConfig config) { config.UpdateBeforeBuild = DoesNeedSvnUpdate(); config.ActiveTargetIndex = platformPicker.Index; }
public virtual void LoadFromWorkspaceConfig(WorkspaceConfig config) { }
public virtual void SaveToWorkspaceConfig(ref WorkspaceConfig config) { }
public virtual void SaveToWorkspaceConfig(ref WorkspaceConfig config, ProjectConfig projectConfig) { }
public virtual void LoadFromWorkspaceConfig(WorkspaceConfig config, ProjectConfig projectConfig) { }
public static string GetCodeCachePath() { var name = string.Join("_", The.Workspace.ProjectFilePath.Split(new string[] { "\\", "/", ":" }, StringSplitOptions.RemoveEmptyEntries)).ToLower(CultureInfo.InvariantCulture); return(Path.Combine(WorkspaceConfig.GetDataPath(), name, "code_cooker_cache.json")); }