|
group2 0.1.0
CSE 125 Group 2
|
Shared tabbed settings editor used by front-end screens and the pause menu. More...
#include <SettingsEditor.hpp>
Classes | |
| struct | ListeningBinding |
Public Member Functions | |
| void | open (const UserSettings &settings) |
| Open the editor with a fresh draft copied from live settings. | |
| void | close () |
| Close the editor and discard transient UI state. | |
| bool | isOpen () const |
| True while the settings editor is active. | |
| bool | handleEscape (const UserSettings &settings) |
| Handle Escape according to the current listening/dirty/modal state. | |
| bool | consumeEvent (const SDL_Event &event) |
| Consume input events while the editor owns menu focus. | |
| SettingsEditorResult | render (UserSettings &settings, std::string_view settingsPath, float uiScale) |
| Draw the tabbed editor inside the current ImGui window. | |
Private Types | |
| enum class | Tab { General , Audio , KeyboardMouse , Controller } |
Private Member Functions | |
| void | resetDraft (const UserSettings &settings) |
| void | closeEditor () |
| bool | requestClose (const UserSettings &settings) |
| void | requestDiscardConfirm () |
| void | apply (UserSettings &settings, std::string_view settingsPath, SettingsEditorResult &result) |
| void | resetToDefaults (UserSettings &settings) |
| void | restoreOriginalAudioSettings (UserSettings &settings) |
| void | updateLiveAudioSettings (UserSettings &settings) |
| void | renderGeneralTab () |
| void | renderAudioTab (UserSettings &settings) |
| void | renderKeyboardMouseTab (float uiScale) |
| void | renderControllerTab (float uiScale) |
| void | renderBindingsTable (BindingDevice device, float uiScale) |
Private Attributes | |
| bool | open_ = false |
| Tab | activeTab_ = Tab::General |
| InputBindings | draftBindings_ = InputBindings::defaults() |
| float | draftMouseSensitivity_ = user_settings::kDefaultMouseSensitivity |
| float | draftHorizontalFovDegrees_ = 110.0f |
| bool | draftShowControllerBindings_ = false |
| float | draftGamepadYawSensitivity_ = 6.0f |
| float | draftGamepadPitchSensitivity_ = 6.0f |
| float | draftGamepadLookDeadzone_ = 0.0f |
| float | draftGamepadMoveDeadzone_ = 0.0f |
| bool | draftAimAssistEnabled_ = true |
| float | draftAimAssistStrength_ = 1.0f |
| bool | draftGamepadSwapSticks_ = false |
| bool | draftMuzzleFlashEnabled_ = true |
| float | draftMusicVolume_ = 0.7f |
| float | draftSfxVolume_ = 1.0f |
| std::string | draftAudioOutputDeviceName_ |
| std::string | draftAudioInputDeviceName_ |
| float | originalMusicVolume_ = 0.7f |
| float | originalSfxVolume_ = 1.0f |
| std::string | originalAudioOutputDeviceName_ |
| std::string | originalAudioInputDeviceName_ |
| bool | dirty_ = false |
| std::optional< ListeningBinding > | listeningBinding_ |
| std::string | statusMessage_ |
| ConfirmModal | confirm_ |
Shared tabbed settings editor used by front-end screens and the pause menu.
|
strongprivate |
|
private |
| void SettingsEditor::close | ( | ) |
Close the editor and discard transient UI state.
|
private |
| bool SettingsEditor::consumeEvent | ( | const SDL_Event & | event | ) |
Consume input events while the editor owns menu focus.
| bool SettingsEditor::handleEscape | ( | const UserSettings & | settings | ) |
Handle Escape according to the current listening/dirty/modal state.
|
nodiscard |
True while the settings editor is active.
| void SettingsEditor::open | ( | const UserSettings & | settings | ) |
Open the editor with a fresh draft copied from live settings.
| SettingsEditorResult SettingsEditor::render | ( | UserSettings & | settings, |
| std::string_view | settingsPath, | ||
| float | uiScale ) |
Draw the tabbed editor inside the current ImGui window.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |