Use the latch in dialogs throughout.

This makes it so that rapid fire works for them as well.
This commit is contained in:
Unknown W. Brackets committed 2014-02-02 15:48:29 -08:00
1 parent c9c179d233
commit 77acd0729f
6 files changed
+18 -15

No files matched your search

+9 -2
View File
@@ -18,6 +18,7 @@
#include "i18n/i18n.h"
#include "Common/ChunkFile.h"
#include "Core/HLE/sceCtrl.h"
#include "Core/Util/PPGeDraw.h"
#include "Core/Dialog/PSPDialog.h"
@@ -124,14 +125,20 @@ pspUtilityDialogCommon *PSPDialog::GetCommonParam()
return 0;
}
void PSPDialog::UpdateButtons()
{
lastButtons = __CtrlPeekButtons();
buttons = __CtrlReadLatch();
}
bool PSPDialog::IsButtonPressed(int checkButton)
{
return !isFading && !(lastButtons & checkButton) && (buttons & checkButton);
return !isFading && (buttons & checkButton);
}
bool PSPDialog::IsButtonHeld(int checkButton, int &framesHeld, int framesHeldThreshold, int framesHeldRepeatRate)
{
bool btnWasHeldLastFrame = (lastButtons & checkButton) && (buttons & checkButton);
bool btnWasHeldLastFrame = (lastButtons & checkButton) && (__CtrlPeekButtons() & checkButton);
if (!isFading && btnWasHeldLastFrame) {
framesHeld++;
}