diff --git a/gui.cpp b/gui.cpp index 3cf1e4c..e48fd3f 100644 --- a/gui.cpp +++ b/gui.cpp @@ -340,11 +340,34 @@ void Gui::DrawScreen(bool stack) { Do the current screen's logic. u32 hDown: The hidKeysDown() variable. + u32 hDownRepeat: the hidKeysDownRepeat() variable. u32 hHeld: The hidKeysHeld() variable. touchPosition touch: The touchPosition variable. bool waitFade: If waiting for the fade until control of the screen or not. bool stack: If using the stack-screens. */ +#ifdef UC_KEY_REPEAT +void Gui::ScreenLogic(u32 hDown, u32 hDownRepeat, u32 hHeld, touchPosition touch, bool waitFade, bool stack) { + if (waitFade) { + if (!fadein && !fadeout && !fadein2 && !fadeout2) { + if (!stack) { + if (usedScreen) usedScreen->Logic(hDown, hDownRepeat, hHeld, touch); + + } else { + if (!screens.empty()) screens.top()->Logic(hDown, hDownRepeat, hHeld, touch); + } + } + + } else { + if (!stack) { + if (usedScreen) usedScreen->Logic(hDown, hDownRepeat, hHeld, touch); + + } else { + if (!screens.empty()) screens.top()->Logic(hDown, hDownRepeat, hHeld, touch); + } + } +} +#else void Gui::ScreenLogic(u32 hDown, u32 hHeld, touchPosition touch, bool waitFade, bool stack) { if (waitFade) { if (!fadein && !fadeout && !fadein2 && !fadeout2) { @@ -365,6 +388,7 @@ void Gui::ScreenLogic(u32 hDown, u32 hHeld, touchPosition touch, bool waitFade, } } } +#endif /* Move's the tempScreen to the used one. diff --git a/gui.hpp b/gui.hpp index b97d0e3..07c2dc0 100644 --- a/gui.hpp +++ b/gui.hpp @@ -188,12 +188,17 @@ namespace Gui { Used for the current Screen's Logic. (Optional!) hDown: the hidKeysDown() variable. + hDownRepeat: the hidKeysDownRepeat() variable. hHeld: the HidKeysHeld() variable. touch: The TouchPosition variable. waitFade: Wheter to wait until the fade ends. stack: Is it the stack variant? */ + #ifdef UC_KEY_REPEAT + void ScreenLogic(u32 hDown, u32 hDownRepeat, u32 hHeld, touchPosition touch, bool waitFade = true, bool stack = false); + #else void ScreenLogic(u32 hDown, u32 hHeld, touchPosition touch, bool waitFade = true, bool stack = false); + #endif /* Transfer the Temp Screen to the used one. (Optional!) diff --git a/screen.hpp b/screen.hpp index ddb02b8..379edac 100644 --- a/screen.hpp +++ b/screen.hpp @@ -33,7 +33,11 @@ class Screen { public: virtual ~Screen() {} +#ifdef UC_KEY_REPEAT + virtual void Logic(u32 hDown, u32 hDownRepeat, u32 hHeld, touchPosition touch) = 0; +#else virtual void Logic(u32 hDown, u32 hHeld, touchPosition touch) = 0; +#endif virtual void Draw() const = 0; };