/** * @file rex/ui/overlay/simple_settings_overlay.h * * @brief Curated user-facing settings overlay. */ #pragma once #include #include #include #include #include #include namespace rex::ui { void EnsureSimpleSettingsConfig(const std::filesystem::path& config_path); void SaveSimpleSettingsConfig(const std::filesystem::path& config_path); struct SimpleProfileInfo { std::string id; std::string gamertag; bool signed_in = true; }; struct SimpleProfileState { std::vector profiles; int selected_index = 0; }; class SimpleSettingsDialog final : public ImGuiDialog { public: using LoadProfilesCallback = std::function; using SaveProfileCallback = std::function; using CloseSettingsCallback = std::function; using CloseGameCallback = std::function; using RestartGameCallback = std::function; SimpleSettingsDialog(ImGuiDrawer* drawer, std::filesystem::path config_path, LoadProfilesCallback load_profiles, SaveProfileCallback save_profile, CloseSettingsCallback close_settings, CloseGameCallback close_game, RestartGameCallback restart_game); ~SimpleSettingsDialog(); void Show(); void Toggle(); void Hide(); bool visible() const { return visible_; } protected: void OnDraw(ImGuiIO& io) override; private: void LoadSettingsFromCvars(); bool HasSettingsChanges() const; void ReloadProfiles(); void SaveVideo(); void SaveProfile(); std::filesystem::path config_path_; LoadProfilesCallback load_profiles_; SaveProfileCallback save_profile_; CloseSettingsCallback close_settings_; CloseGameCallback close_game_; RestartGameCallback restart_game_; SimpleProfileState profiles_; bool visible_ = false; GraphicsDeviceList device_list_; int device_index_ = 0; int resolution_scale_index_ = 0; int frame_cap_index_ = 0; int aspect_ratio_index_ = 0; float field_of_view_ = 60.0f; bool fullscreen_ = true; bool vsync_ = false; bool tearing_ = true; bool mnk_mode_ = false; bool mnk_capture_mouse_ = false; int selected_tab_ = 0; bool profile_signed_in_ = true; char gamertag_buf_[32] = {}; }; } // namespace rex::ui