public override bool Save(bool restartReq) { restartReq = base.Save(restartReq); if (this.InGameResolution != this.mOldInGameResolution) { restartReq = true; switch (this.InGameResolution) { case InGameResolution.HD_720p: RegistryManager.Instance.Guest[this.ParentWindow.mVmName].GamingResolutionCOD = "720"; GameSettingViewModel.SendGameSettingsStat("cod_res_720"); break; case InGameResolution.FHD_1080p: RegistryManager.Instance.Guest[this.ParentWindow.mVmName].GamingResolutionCOD = "1080"; GameSettingViewModel.SendGameSettingsStat("cod_res_1080"); break; case InGameResolution.QHD_1440p: RegistryManager.Instance.Guest[this.ParentWindow.mVmName].GamingResolutionCOD = "1440"; GameSettingViewModel.SendGameSettingsStat("cod_res_1440"); break; case InGameResolution.UHD_2160p: RegistryManager.Instance.Guest[this.ParentWindow.mVmName].GamingResolutionCOD = "2160"; GameSettingViewModel.SendGameSettingsStat("cod_res_2160"); break; } } if (this.GraphicsQuality != this.mOldGraphicsQuality) { restartReq = true; switch (this.GraphicsQuality) { case GraphicsQuality.Auto: RegistryManager.Instance.Guest[this.ParentWindow.mVmName].DisplayQualityCOD = "-1"; GameSettingViewModel.SendGameSettingsStat("pubg_gfx_auto"); break; case GraphicsQuality.Smooth: RegistryManager.Instance.Guest[this.ParentWindow.mVmName].DisplayQualityCOD = "0"; GameSettingViewModel.SendGameSettingsStat("pubg_gfx_smooth"); break; case GraphicsQuality.Balanced: RegistryManager.Instance.Guest[this.ParentWindow.mVmName].DisplayQualityCOD = "1"; GameSettingViewModel.SendGameSettingsStat("pubg_gfx_balanced"); break; case GraphicsQuality.HD: RegistryManager.Instance.Guest[this.ParentWindow.mVmName].DisplayQualityCOD = "2"; GameSettingViewModel.SendGameSettingsStat("pubg_gfx_hd"); break; } } return(restartReq); }
private void SaveGameSettings(object obj) { bool restartReq = false; bool flag = false; switch (this.CurrentGame) { case CurrentGame.PubG: restartReq = this.PubgGameSettingViewModel.Save(restartReq); this.PubgGameSettingViewModel.LockOriginal(); flag = true; break; case CurrentGame.CallOfDuty: restartReq = this.CallOfDutyGameSettingViewModel.Save(restartReq); this.CallOfDutyGameSettingViewModel.LockOriginal(); flag = true; break; case CurrentGame.FreeFire: restartReq = this.FreeFireGameSettingViewModel.Save(restartReq); this.FreeFireGameSettingViewModel.LockOriginal(); flag = true; break; case CurrentGame.OtherApp: restartReq = this.OtherAppGameSetting.Save(restartReq); this.OtherAppGameSetting.LockOriginal(); flag = true; break; } if (flag) { ClientStats.SendMiscellaneousStatsAsync("game_setting", RegistryManager.Instance.UserGuid, this.AppName, "Save", RegistryManager.Instance.ClientVersion, RegistryManager.Instance.Version, RegistryManager.Instance.Oem, (string)null, (string)null, "Android"); } if (this.mPreviousCursorMode != this.CursorMode) { RegistryManager.Instance.CustomCursorEnabled = this.CursorMode == CursorMode.Custom; foreach (MainWindow mainWindow in BlueStacksUIUtils.DictWindows.Values) { mainWindow.mCommonHandler.SetCustomCursorForApp(this.PackageName); } this.mPreviousCursorMode = this.CursorMode; ClientStats.SendMiscellaneousStatsAsync("game_setting", RegistryManager.Instance.UserGuid, "Is Custom Cursor", (this.CursorMode == CursorMode.Custom).ToString((IFormatProvider)CultureInfo.InvariantCulture), RegistryManager.Instance.ClientVersion, RegistryManager.Instance.Version, RegistryManager.Instance.Oem, (string)null, (string)null, "Android"); } this.AddToastPopup(LocaleStrings.GetLocalizedString("STRING_CHANGES_SAVED", "")); if (!restartReq) { return; } GameSettingViewModel.RestartApp(this.mParentWindow, this.AppName); }