public void SetResolution() { if (!initok) { return; } ischange = true; int width = ResolutionList[dropdown.value].x; int height = ResolutionList[dropdown.value].y; var r = Screen.currentResolution; if (width != r.width || height != r.height) { Screen.SetResolution(width, height, SettingData.instance.fullScreen); } MessageWindow.CheckMessage(51, 80, () => { // 是否保存设置 SettingData.instance.resolutionl_width = width; SettingData.instance.resolutionl_height = height; }, () => { Screen.SetResolution(SettingData.instance.resolutionl_width, SettingData.instance.resolutionl_height, SettingData.instance.fullScreen); initok = false; int idx = GetResolutionOptions(); dropdown.value = idx; initok = true; }, 5, 0); }
public override void ClickClose() { if (wait_key >= 0) { return; } if (ischange) { MessageWindow.CheckMessage(51, 81, () => { base.ClickClose(); SettingData.SaveSetting(); }, () => { base.ClickClose(); SettingData.Rest(); }); } else { base.ClickClose(); } }