public ViewModel(TrackObjectBase track, TrackMapPreparationRenderer renderer) { Track = track; Renderer = renderer; Renderer.SetFilter(this); Surfaces = SurfaceDescription.LoadAll(Path.Combine(track.DataDirectory, "surfaces.ini")).ToList(); _save = new SaveHelper <SaveableData>(".TrackMapRendererTools:" + track.Id, () => new SaveableData { Filter = Filter, IgnoreCase = FilterIgnoreCase, UseFxaa = UseFxaa, Scale = Scale, Margin = Margin, AiLaneWidth = AiLaneWidth, AiLaneActualWidth = AiLaneActualWidth, }, o => { if (o.Filter == null) { UpdateFilter(Surfaces.Where(x => x.ShouldBeVisibleOnMap())); } else { Filter = o.Filter; } FilterIgnoreCase = o.IgnoreCase; UseFxaa = o.UseFxaa; Scale = o.Scale; Margin = o.Margin; AiLaneWidth = o.AiLaneWidth; AiLaneActualWidth = o.AiLaneActualWidth; }, storage: CacheStorage.Storage); _save.Initialize(); }
public ViewModel(TrackObjectBase track, TrackMapPreparationRenderer renderer) { Track = track; Renderer = renderer; Renderer.SetFilter(this); Surfaces = SurfaceDescription.LoadAll(Path.Combine(track.DataDirectory, "surfaces.ini")).ToList(); UpdateFilter(Surfaces.Where(x => x.ShouldBeVisibleOnMap())); _useFxaa = Renderer.UseFxaa; _margin = Renderer.Margin; _scale = Renderer.Scale; }