mirror of
https://github.com/izzy2lost/ppsspp.git
synced 2026-03-10 12:43:04 -07:00
UI: Fix issues with insta-close pop ups.
Not that these should happen, but at least should make sure they work.
This commit is contained in:
@@ -249,16 +249,10 @@ bool PopupScreen::key(const KeyInput &key) {
|
||||
void PopupScreen::update() {
|
||||
UIDialogScreen::update();
|
||||
|
||||
static const int FRAMES_LEAD_IN = 6;
|
||||
static const int FRAMES_LEAD_OUT = 4;
|
||||
|
||||
float animatePos = 1.0f;
|
||||
|
||||
++frames_;
|
||||
if (frames_ < FRAMES_LEAD_IN) {
|
||||
float leadIn = bezierEaseInOut(frames_ * (1.0f / (float)FRAMES_LEAD_IN));
|
||||
animatePos = leadIn;
|
||||
} else if (finishFrame_ > 0) {
|
||||
if (finishFrame_ >= 0) {
|
||||
float leadOut = bezierEaseInOut((frames_ - finishFrame_) * (1.0f / (float)FRAMES_LEAD_OUT));
|
||||
animatePos = 1.0f - leadOut;
|
||||
|
||||
@@ -266,6 +260,9 @@ void PopupScreen::update() {
|
||||
// Actual finish happens here.
|
||||
screenManager()->finishDialog(this, finishResult_);
|
||||
}
|
||||
} else if (frames_ < FRAMES_LEAD_IN) {
|
||||
float leadIn = bezierEaseInOut(frames_ * (1.0f / (float)FRAMES_LEAD_IN));
|
||||
animatePos = leadIn;
|
||||
}
|
||||
|
||||
if (animatePos < 1.0f) {
|
||||
|
||||
@@ -91,8 +91,13 @@ private:
|
||||
std::string button1_;
|
||||
std::string button2_;
|
||||
|
||||
enum {
|
||||
FRAMES_LEAD_IN = 6,
|
||||
FRAMES_LEAD_OUT = 4,
|
||||
};
|
||||
|
||||
int frames_ = 0;
|
||||
int finishFrame_ = 0;
|
||||
int finishFrame_ = -1;
|
||||
DialogResult finishResult_;
|
||||
bool hasPopupOrigin_ = false;
|
||||
Point popupOrigin_;
|
||||
|
||||
Reference in New Issue
Block a user