private void comboBoxResolutions_SelectedIndexChanged(object sender, EventArgs e) { pDropdownItem selected = (pDropdownItem)comboBoxResolutions.SelectedItem; if (selected.Value == null) { if (comboBoxResolutions.Items.Count <= comboBoxResolutions.SelectedIndex + 1) { return; } selected = (pDropdownItem)comboBoxResolutions.SelectedItem; } string[] split = ((string)selected.Value).Split('x'); int width = Int32.Parse(split[0]); int height = Int32.Parse(split[1]); if (ConfigManager.sFullscreen.Value) { ConfigManager.sWidthFullscreen.Value = width; ConfigManager.sHeightFullscreen.Value = height; } else { ConfigManager.sWidth.Value = width; ConfigManager.sHeight.Value = height; } }
protected void initializeSettings() { checkBoxFullScreen.Checked = ConfigManager.sFullscreen.Value; releaseStreams.Items.Clear(); foreach (pDropdownItem i in Options.DropdownItemsReleaseStream) { releaseStreams.Items.Add(i); if ((ReleaseStream)i.Value == ConfigManager.sReleaseStream.Value) { releaseStreams.SelectedItem = i; } } comboBoxFrameLimiter.Items.Clear(); foreach (pDropdownItem i in Options.DropdownItemsFrameLimiter) { comboBoxFrameLimiter.Items.Add(i); if ((FrameSync)i.Value == ConfigManager.sFrameSync.Value) { comboBoxFrameLimiter.SelectedItem = i; } } comboBoxResolutions.Items.Clear(); Options.UpdateResolutions(resolutionDropdown); foreach (pText t in resolutionDropdown.OptionsSprites) { if (t is pTextAwesome) { continue; } pDropdownItem item = new pDropdownItem(t.Text, t.Tag); comboBoxResolutions.Items.Add(item); if ((string)t.Tag == (string)resolutionDropdown.SelectedObject) { comboBoxResolutions.SelectedItem = item; } } checkBoxCompatibilityMode.Checked = ConfigManager.sCompatibilityContext.Value; }