public override bool Commit() { var profileType = SettingsProfileType.SingleMonitor; if (IsSimPitSetup.Value) { profileType = SettingsProfileType.SimPit; } if (IsVirtualRealitySetup.Value) { profileType = SettingsProfileType.VirtualReality; } if (IsHeliosSetup.Value) { profileType = SettingsProfileType.Helios; } var profile = new SettingsProfile { Name = ProfileName.Value, ProfileType = profileType, Path = Path.Combine(ApplicationPaths.ProfilesPath, $"{ProfileName.Value}.json") }; _profileSettingsService.AddProfile(profile); _profileSettingsService.SelectedProfileName = profile.Name; _profileSettingsService.SetValue(ProfileSettingsCategories.GameOptions, "options.VR.enabled", IsVirtualRealitySetup.Value); var primaryScreen = Screen.PrimaryScreen; switch (profileType) { case SettingsProfileType.SingleMonitor: Tracker.Instance.SendEvent(AnalyticsCategories.Configuration, AnalyticsEvents.ViewportSetup, "single"); _profileSettingsService.SetValue(ProfileSettingsCategories.Viewports, SettingsKeys.DeviceViewportsDisplays, new [] { primaryScreen.DeviceName }); break; case SettingsProfileType.Helios: case SettingsProfileType.SimPit: Tracker.Instance.SendEvent(AnalyticsCategories.Configuration, AnalyticsEvents.ViewportSetup, profileType == SettingsProfileType.SimPit ? "simpit" : "helios"); Controller.Steps.Add(new SelectGameViewportScreensStepViewModel(Container)); Controller.Steps.Add(new SelectUIViewportScreensStepViewModel(Container)); Controller.Steps.Add(new SelectDeviceViewportScreensStepViewModel(Container)); break; case SettingsProfileType.VirtualReality: Tracker.Instance.SendEvent(AnalyticsCategories.Configuration, AnalyticsEvents.ViewportSetup, "vr"); _profileSettingsService.SetValue(ProfileSettingsCategories.Viewports, SettingsKeys.DeviceViewportsDisplays, new[] { primaryScreen.DeviceName }); break; default: throw new ArgumentOutOfRangeException(); } return(base.Commit()); }
public override bool Commit() { var screens = Screens.Where(s => s.IsSelected.Value).Select(s => s.Id).ToArray(); Tracker.Instance.SendEvent(AnalyticsCategories.Configuration, AnalyticsEvents.TotalViewportDisplayCount, screens.Length.ToString()); _profileSettingsService.SetValue(ProfileSettingsCategories.Viewports, SettingsKeys.DeviceViewportsDisplays, screens); var profiles = SettingsProfileStorageAdapter.GetAll(); var selectedProfile = profiles.FirstOrDefault(p => p.Name == _profileSettingsService.SelectedProfileName); Guard.RequireIsNotNull(selectedProfile, nameof(selectedProfile)); switch (selectedProfile.ProfileType) { case SettingsProfileType.SingleMonitor: break; case SettingsProfileType.SimPit: case SettingsProfileType.Helios: if (screens.Length == 1) { Controller.Steps.Add(new SelectInitialViewportsWizardStepViewModel(Container)); } break; case SettingsProfileType.VirtualReality: break; default: throw new ArgumentOutOfRangeException(); } return(base.Commit()); }
public override bool Commit() { var selectedScreens = Screens.Where(s => s.IsSelected.Value).ToArray(); Tracker.Instance.SendEvent(AnalyticsCategories.Configuration, AnalyticsEvents.TotalUiDisplayCount, selectedScreens.Length.ToString()); _profileSettingsService.SetValue(ProfileSettingsCategories.Viewports, SettingsKeys.UIViewportsDisplays, selectedScreens.Select(s => s.Id).ToArray()); return(base.Commit()); }
public void UpsertAdvancedOption(string id, object value) { _profileSettingsService.SetValue(ProfileSettingsCategories.AdvancedOptions, id, value); }