mirror of
https://github.com/DarkStore-3DS/Universal-Core.git
synced 2026-07-02 16:59:05 +00:00
Add support for key repeats via UC_KEY_REPEAT flag
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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!)
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user