MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Save

Method Save

Source/Editor/Options/OptionsModule.cs:160–184  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

158 }
159
160 private void Save()
161 {
162 // Update file
163 if (Editor.SaveJsonAsset(_optionsFilePath, Options))
164 {
165 MessageBox.Show(string.Format("Failed to save editor option to '{0}'. Ensure that directory exists and program has access to it.", _optionsFilePath), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
166 }
167
168 // Special case for editor analytics
169 var editorAnalyticsTrackingFile = Path.Combine(Editor.LocalCachePath, "noTracking");
170 if (Options.General.EnableEditorAnalytics)
171 {
172 if (File.Exists(editorAnalyticsTrackingFile))
173 {
174 File.Delete(editorAnalyticsTrackingFile);
175 }
176 }
177 else
178 {
179 if (!File.Exists(editorAnalyticsTrackingFile))
180 {
181 File.WriteAllText(editorAnalyticsTrackingFile, "Don't track me, please.");
182 }
183 }
184 }
185
186 private void OnOptionsChanged()
187 {

Callers

nothing calls this directly

Calls 6

SaveJsonAssetMethod · 0.80
FormatMethod · 0.80
WriteAllTextMethod · 0.80
ShowMethod · 0.45
ExistsMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected