mirror of
https://github.com/isledecomp/LEGOIslandRebuilder.git
synced 2024-11-27 01:25:36 -05:00
patch: add random option for transition animation
This commit is contained in:
parent
375b8cbd4a
commit
b8ee9b0ece
2 changed files with 10 additions and 2 deletions
|
@ -740,6 +740,8 @@ _CRTIMP size_t __cdecl InterceptFread(void *buffer, size_t size, size_t count, F
|
||||||
startTransitionFunction startTransitionOriginal = NULL;
|
startTransitionFunction startTransitionOriginal = NULL;
|
||||||
MxResult MxTransitionManager::InterceptStartTransition(TransitionType animationType, int speed, byte unk, bool playMusicInTransition)
|
MxResult MxTransitionManager::InterceptStartTransition(TransitionType animationType, int speed, byte unk, bool playMusicInTransition)
|
||||||
{
|
{
|
||||||
|
speed = config.GetInt("TransitionSpeed");
|
||||||
|
|
||||||
std::string animation_type = config.GetString("TransitionType");
|
std::string animation_type = config.GetString("TransitionType");
|
||||||
|
|
||||||
if (animation_type == "No Animation") {
|
if (animation_type == "No Animation") {
|
||||||
|
@ -752,9 +754,14 @@ MxResult MxTransitionManager::InterceptStartTransition(TransitionType animationT
|
||||||
animationType = VERTICAL_WIPE;
|
animationType = VERTICAL_WIPE;
|
||||||
} else if (animation_type == "Window") {
|
} else if (animation_type == "Window") {
|
||||||
animationType = WINDOW;
|
animationType = WINDOW;
|
||||||
|
} else if (animation_type == "Random") {
|
||||||
|
animationType = (TransitionType)(rand() % 4 + 2);
|
||||||
|
// The Pixelation animation runs much faster by nature than the other animations,
|
||||||
|
// this magic is to make the speed inconsistency feel less jarring
|
||||||
|
if (animationType == PIXELATION && speed < 30) {
|
||||||
|
speed += 25;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
speed = config.GetInt(_T("TransitionSpeed"));
|
|
||||||
|
|
||||||
return (this->*startTransitionOriginal)(animationType, speed, unk, playMusicInTransition);
|
return (this->*startTransitionOriginal)(animationType, speed, unk, playMusicInTransition);
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,6 +188,7 @@ PatchGrid::PatchGrid()
|
||||||
animationList.push_back("Pixelation");
|
animationList.push_back("Pixelation");
|
||||||
animationList.push_back("Vertical Wipe");
|
animationList.push_back("Vertical Wipe");
|
||||||
animationList.push_back("Window");
|
animationList.push_back("Window");
|
||||||
|
animationList.push_back("Random");
|
||||||
AddPatch("TransitionType",
|
AddPatch("TransitionType",
|
||||||
"Change LEGO Island's transition animation.",
|
"Change LEGO Island's transition animation.",
|
||||||
AddComboItem(sectionGraphics, "Transition Type", animationList, 2));
|
AddComboItem(sectionGraphics, "Transition Type", animationList, 2));
|
||||||
|
|
Loading…
Reference in a new issue