예제 #1
0
            public ViewModel([NotNull] DarkKn5ObjectRenderer renderer, [NotNull] CarObject carObject, string skinId)
            {
                if (renderer == null)
                {
                    throw new ArgumentNullException(nameof(renderer));
                }

                Renderer = renderer;
                Settings = new CmPreviewsSettings(renderer);

                renderer.PropertyChanged += Renderer_PropertyChanged;
                Renderer_CarNodeUpdated();
                renderer.Tick += Renderer_Tick;

                Car  = carObject;
                Skin = skinId == null ? Car.SelectedSkin : Car.GetSkinById(skinId);
                Car.SkinsManager.EnsureLoadedAsync().Forget();

                Saveable = new SaveHelper <SaveableData>("__CmPreviewsTools", () => new SaveableData(), o => {
                }, () => {
                    Reset(false);
                });
            }
예제 #2
0
 /// <summary>
 /// Get checksum of specified preset.
 /// </summary>
 public static string GetChecksum(string presetFilename = null)
 {
     return(CmPreviewsSettings.GetSavedOptions(presetFilename).GetChecksum());
 }
예제 #3
0
 public static Task <IReadOnlyList <UpdatePreviewError> > UpdatePreview(IReadOnlyList <ToUpdatePreview> entries, string presetFilename = null)
 {
     return(UpdatePreview(entries, CmPreviewsSettings.GetSavedOptions(presetFilename), GetPresetName()));
 }