diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-19 03:19:38 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-19 03:19:38 +0000 |
commit | 0d432961a29d509cd0d1fa80361f04009dcf9c17 (patch) | |
tree | bc7536b0ac454a3c466c904123b41498dc6b1905 /ui/modeHelper.h | |
parent | Replace basic query tool with a ImGui version (diff) | |
download | ilt-0d432961a29d509cd0d1fa80361f04009dcf9c17.tar.bz2 ilt-0d432961a29d509cd0d1fa80361f04009dcf9c17.tar.xz ilt-0d432961a29d509cd0d1fa80361f04009dcf9c17.zip |
Remove lots of stuff not required or superseded with ImGui use
Diffstat (limited to 'ui/modeHelper.h')
-rw-r--r-- | ui/modeHelper.h | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/ui/modeHelper.h b/ui/modeHelper.h deleted file mode 100644 index d20f2db..0000000 --- a/ui/modeHelper.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include <memory> -union SDL_Event; - -enum ModeSecondClick { Unset, Reset, NoAction }; - -template<typename Target, ModeSecondClick msc = ModeSecondClick::Unset> class Mode { -public: - explicit Mode(Target & t) : target {t} { } - - Target & target; - - template<typename Mode, typename... Params> - auto - toggle(Params &&... params) - { - return [params..., this](const SDL_Event &) { - toggleSetMode<Mode>(std::forward<Params>(params)...); - }; - } - -private: - template<typename Mode, typename... Params> - void - toggleSetMode(Params &&... params) - { - if (dynamic_cast<Mode *>(target.get())) { - if constexpr (msc == ModeSecondClick::Unset) { - target.reset(); - } - if constexpr (msc == ModeSecondClick::Reset) { - target = std::make_unique<Mode>(std::forward<Params>(params)...); - } - } - else { - target = std::make_unique<Mode>(std::forward<Params>(params)...); - } - } -}; |