From 6352e8e3196f78388b6c771073f9e03eaa612673 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 20 Jun 2023 14:33:09 +1000 Subject: everything everywhere all at once --- source/frontend/StarKeybindingsMenu.hpp | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 source/frontend/StarKeybindingsMenu.hpp (limited to 'source/frontend/StarKeybindingsMenu.hpp') diff --git a/source/frontend/StarKeybindingsMenu.hpp b/source/frontend/StarKeybindingsMenu.hpp new file mode 100644 index 0000000..3393b35 --- /dev/null +++ b/source/frontend/StarKeybindingsMenu.hpp @@ -0,0 +1,49 @@ +#ifndef STAR_KEYBINDINGS_MENU_HPP +#define STAR_KEYBINDINGS_MENU_HPP + +#include "StarPane.hpp" + +namespace Star { + +STAR_CLASS(TabSetWidget); +STAR_CLASS(ListWidget); +STAR_CLASS(KeybindingsMenu); + +class KeybindingsMenu : public Pane { +public: + KeybindingsMenu(); + + // We need to handle our own Esc dismissal + KeyboardCaptureMode keyboardCaptured() const override; + bool sendEvent(InputEvent const& event) override; + + void show() override; + void dismissed() override; + +private: + void buildListsFromConfig(); + bool activateBinding(Widget* widget); + void setKeybinding(KeyChord desc); + void clearActive(); + void exitActiveMode(); + void apply(); + void revert(); + void resetDefaults(); + + Widget* m_activeKeybinding; + + Map m_childToAction; + TabSetWidgetPtr m_tabSet; + ListWidgetPtr m_playerList; + ListWidgetPtr m_toolBarList; + ListWidgetPtr m_gameList; + + Json m_origConfiguration; + + size_t m_maxBindings; + KeyMod m_currentMods; +}; + +} + +#endif -- cgit v1.2.3