Fixed animations on transitions and pause menu

This commit is contained in:
KiritoDev 2021-06-01 21:26:10 -05:00
parent 75d1bb3488
commit a4e1e1b032
4 changed files with 13 additions and 5 deletions

View File

@ -33,6 +33,7 @@
extern s8 gDialogCourseActNum;
extern s8 gHudFlash;
extern s16 gMenuMode;
struct DialogEntry
{

View File

@ -15,6 +15,7 @@ extern "C" {
#include "game/level_update.h"
#include "audio/external.h"
#include "audio_defines.h"
#include "game/area.h"
}
std::map<std::string, Achievement*> registeredAchievements;
@ -132,12 +133,14 @@ namespace MoonInternal{
}
}
aEntry->width = MathUtil::Lerp(aEntry->width, !shouldClose ? achievementWidth : 0, !shouldClose ? 0.2f : 0.35f);
aEntry->dead = shouldClose && aEntry->width <= 0;
if(gMenuMode == -1 && !gWarpTransition.isActive){
aEntry->width = MathUtil::Lerp(aEntry->width, !shouldClose ? achievementWidth : 0, !shouldClose ? 0.2f : 0.35f);
aEntry->dead = shouldClose && aEntry->width <= 0;
aEntry->y = MathUtil::Lerp(aEntry->y, !shouldClose ? aEntry->height + 20 : 0, !shouldClose ? 0.4f : 0.35f);
aEntry->y = MathUtil::Lerp(aEntry->y, !shouldClose ? aEntry->height + 20 : 0, !shouldClose ? 0.4f : 0.35f);
aEntry->launchTime++;
aEntry->launchTime++;
}
return;
}
}

View File

@ -126,6 +126,8 @@ namespace MoonInternal {
obtainedAchievements.push_back(rAchievements->achievement->id);
}
if(cheatsGotEnabled) obtainedAchievements.clear();
cfg->setArray<string>("game.achievements", obtainedAchievements);
cfg->setBool("game.updated", cheatsGotEnabled);
@ -187,6 +189,7 @@ namespace MoonInternal {
entries.push_back(entry);
}
if(cheatsGotEnabled) entries.clear();
gSaveBuffer.files[fileIndex][0].flags |= (1 << 0);
// Backup is nessecary for saving recent progress after gameover

View File

@ -7,6 +7,7 @@
extern "C" {
#include "moon/utils/moon-gfx.h"
#include "game/ingame_menu.h"
}
using json = nlohmann::json;
@ -22,7 +23,7 @@ void AnimatedModifier::onInit(){
AnimatedEntry* entry = textures[texName];
Frame *frame = entry->frames[entry->lastFrame];
if(moon_get_milliseconds() >= entry->lastTime + frame->delay){
if(moon_get_milliseconds() >= entry->lastTime + frame->delay && gMenuMode == -1){
int maxFrames = entry->frames.size() - 1;
bool reachMax = (entry->lastFrame < maxFrames);
if(entry->bounce){