#pragma once #include "StaticPage.hpp" #include "../GsrInfo.hpp" #include "../Config.hpp" #include #include namespace gsr { class Overlay; class GsrPage; class PageStack; class ScrollablePage; class Subsection; class RadioButton; class Button; class List; class CustomRendererWidget; enum ConfigureHotkeyType { NONE, REPLAY_START_STOP, REPLAY_SAVE, RECORD_START_STOP, RECORD_PAUSE_UNPAUSE, STREAM_START_STOP, SHOW_HIDE }; class GlobalSettingsPage : public StaticPage { public: GlobalSettingsPage(Overlay *overlay, const GsrInfo *gsr_info, Config &config, PageStack *page_stack); GlobalSettingsPage(const GlobalSettingsPage&) = delete; GlobalSettingsPage& operator=(const GlobalSettingsPage&) = delete; void load(); void save(); void on_navigate_away_from_page() override; bool on_event(mgl::Event &event, mgl::Window &window, mgl::vec2f offset) override; std::function on_startup_changed; std::function on_click_exit_program_button; std::function on_keyboard_hotkey_changed; std::function on_joystick_hotkey_changed; private: void load_hotkeys(); std::unique_ptr create_appearance_subsection(ScrollablePage *parent_page); std::unique_ptr create_startup_subsection(ScrollablePage *parent_page); std::unique_ptr create_enable_keyboard_hotkeys_button(); std::unique_ptr create_enable_joystick_hotkeys_button(); std::unique_ptr create_show_hide_hotkey_options(); std::unique_ptr create_replay_hotkey_options(); std::unique_ptr create_record_hotkey_options(); std::unique_ptr create_stream_hotkey_options(); std::unique_ptr create_hotkey_control_buttons(); std::unique_ptr create_hotkey_subsection(ScrollablePage *parent_page); std::unique_ptr