Example #1
0
        /// <summary>
        /// State's render
        /// </summary>
        /// <param name="time"><see cref="GameTime"/></param>
        public override void Render(GameTime time)
        {
            DH.RenderScene(Scene, () => {
                DH.Raw(_content.TEXUI_MenuBG, 32, 0);

                _backButton.Display( );
                if (_changedConfig.Count > 0)
                {
                    _saveButton.Display( );
                }

                int half_size = (_config.WindowWidth - 288) / 2;

                DH.Text(_font, "section_general", 296, 48, align: AlignType.LB);
                DH.Line(288, 56, 288 + half_size, 56);
                DisplayOption(0, "language", () => _translations[_cfg["language"].ToString( )], 56);

                DH.Text(_font, "section_graphics", 296, 120, align: AlignType.LB);
                DH.Line(288, 128, 288 + half_size, 128);
                DisplayOption(0, "window_mode", () => LANG.Get("mode_" + ((bool)_cfg["window_fullscreen"] ? "fullscreen" : "window")), 128);
                DisplayOption(1, "resolution", () => $"{_cfg["window_width"]}x{_cfg["window_height"]}", 160);

                DH.Text(_font, "section_audio", 296, 224, align: AlignType.LB);
                DH.Line(288, 232, 288 + half_size, 232);
                DisplayOption(0, "master_volume", () => $"{((float)_cfg["master_volume"] * 100):0}%", 232);
                DisplayOption(1, "music_volume", () => $"{((float)_cfg["music_volume"] * 100):0}%", 264);
                DisplayOption(2, "sound_volume", () => $"{((float)_cfg["sound_volume"] * 100):0}%", 296);

                DH.Text(_font, "section_controls", 296 + half_size, 48, align: AlignType.LB);
                DH.Line(288 + half_size, 56, _config.WindowWidth, 56);
                DisplayOption(0, "key_console", () => $"{_cfg["key_console"]}", 56, true);
                DisplayOption(1, "key_pause", () => $"{_cfg["key_pause"]}", 88, true);
                DisplayOption(2, "key_move_up", () => $"{_cfg["key_move_up"]}", 120, true);
                DisplayOption(3, "key_move_down", () => $"{_cfg["key_move_down"]}", 152, true);
                DisplayOption(4, "key_move_left", () => $"{_cfg["key_move_left"]}", 184, true);
                DisplayOption(5, "key_move_right", () => $"{_cfg["key_move_right"]}", 216, true);

                DH.Line(288 + half_size, 56, 288 + half_size, 256);
            });
        }