public static void LoadAllSettings() { Globals.gameInstance.settingsManager = new SettingsManager(); Globals.gameInstance.settingsManager.Load(); ResolutionConfig.LoadGraphicalSettings(); AudioConfig.LoadAudioSettings(); ControlsConfig.LoadControlsSettings(); }
static public void Init(ref GraphicsDeviceManager device) { //_Width = device.PreferredBackBufferWidth; //_Height = device.PreferredBackBufferHeight; _Device = device; _dirtyMatrix = true; ResolutionConfig.SetValidResolutionOptions(); _Width = ResolutionConfig.GetCurrentResolution().Item1; _Height = ResolutionConfig.GetCurrentResolution().Item2; _VWidth = ResolutionConfig.virtualResolution.Item1; _VHeight = ResolutionConfig.virtualResolution.Item2; _FullScreen = ResolutionConfig.isFullScreen; xOffset = 0; yOffset = 0; ApplyResolutionSettings(); }
public override void LoadContent() { resolutionSelectionMenu = new ResolutionSelectionMenu(this); menuBackground = Globals.content.Load <Texture2D>("Menues/PauseMenu/pause-menu-background"); fullScreenCheckedTexture = Globals.content.Load <Texture2D>("Menues/MenuHelpers/menu-button-blank-checked"); fullScreenUncheckedTexture = Globals.content.Load <Texture2D>("Menues/MenuHelpers/menu-button-blank-unchecked"); Vector2 buttonSize = new Vector2(400, 80); resolutionLabel = new MenuLabel( Globals.content.Load <SpriteFont>("Fonts/arial-bold-40"), new Vector2(ResolutionConfig.virtualResolution.Item1 / 2, 540), ResolutionConfig.GetCurrentResolution().Item1 + " x " + ResolutionConfig.GetCurrentResolution().Item2, Color.White ); resolutionButton = new MenuButton( new Vector2(760, 430), this, buttonSize, "Resolution" ); fullScreenButton = new MenuButton( new Vector2(760, 580), this, buttonSize, "Full Screen", fullScreenUncheckedTexture ); applyChangesButton = new MenuButton( new Vector2(760, 680), this, buttonSize, "Apply Changes" ); backButton = new MenuButton( new Vector2(760, 780), this, buttonSize, "Back" ); labelList.Add(resolutionLabel); buttonList.Add(resolutionButton); buttonList.Add(fullScreenButton); buttonList.Add(applyChangesButton); buttonList.Add(backButton); subMenues.Add(resolutionSelectionMenu); LayoutVisualsToActualSettings(); foreach (MenuScreen subMenu in subMenues) { subMenu.LoadContent(); } }
private void ApplyChangesButtonPressed() { bool isFullScreen = fullScreenChecked; ResolutionConfig.SetResolution(currentResolutionIndex, isFullScreen); }