1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Queue screen fade operations invoked by scripts

This commit is contained in:
MiroslavR 2014-12-01 19:13:04 +01:00
parent f56debdb11
commit 6e1a11f322
4 changed files with 18 additions and 15 deletions

View File

@ -330,11 +330,11 @@ namespace MWBase
virtual void pinWindow (MWGui::GuiWindow window) = 0; virtual void pinWindow (MWGui::GuiWindow window) = 0;
/// Fade the screen in, over \a time seconds /// Fade the screen in, over \a time seconds
virtual void fadeScreenIn(const float time) = 0; virtual void fadeScreenIn(const float time, bool clearQueue=true) = 0;
/// Fade the screen out to black, over \a time seconds /// Fade the screen out to black, over \a time seconds
virtual void fadeScreenOut(const float time) = 0; virtual void fadeScreenOut(const float time, bool clearQueue=true) = 0;
/// Fade the screen to a specified percentage of black, over \a time seconds /// Fade the screen to a specified percentage of black, over \a time seconds
virtual void fadeScreenTo(const int percent, const float time) = 0; virtual void fadeScreenTo(const int percent, const float time, bool clearQueue=true) = 0;
/// Darken the screen to a specified percentage /// Darken the screen to a specified percentage
virtual void setBlindness(const int percent) = 0; virtual void setBlindness(const int percent) = 0;

View File

@ -1748,21 +1748,24 @@ namespace MWGui
updateVisible(); updateVisible();
} }
void WindowManager::fadeScreenIn(const float time) void WindowManager::fadeScreenIn(const float time, bool clearQueue)
{ {
mScreenFader->clearQueue(); if (clearQueue)
mScreenFader->clearQueue();
mScreenFader->fadeOut(time); mScreenFader->fadeOut(time);
} }
void WindowManager::fadeScreenOut(const float time) void WindowManager::fadeScreenOut(const float time, bool clearQueue)
{ {
mScreenFader->clearQueue(); if (clearQueue)
mScreenFader->clearQueue();
mScreenFader->fadeIn(time); mScreenFader->fadeIn(time);
} }
void WindowManager::fadeScreenTo(const int percent, const float time) void WindowManager::fadeScreenTo(const int percent, const float time, bool clearQueue)
{ {
mScreenFader->clearQueue(); if (clearQueue)
mScreenFader->clearQueue();
mScreenFader->fadeTo(percent, time); mScreenFader->fadeTo(percent, time);
} }

View File

@ -325,11 +325,11 @@ namespace MWGui
virtual void pinWindow (MWGui::GuiWindow window); virtual void pinWindow (MWGui::GuiWindow window);
/// Fade the screen in, over \a time seconds /// Fade the screen in, over \a time seconds
virtual void fadeScreenIn(const float time); virtual void fadeScreenIn(const float time, bool clearQueue);
/// Fade the screen out to black, over \a time seconds /// Fade the screen out to black, over \a time seconds
virtual void fadeScreenOut(const float time); virtual void fadeScreenOut(const float time, bool clearQueue);
/// Fade the screen to a specified percentage of black, over \a time seconds /// Fade the screen to a specified percentage of black, over \a time seconds
virtual void fadeScreenTo(const int percent, const float time); virtual void fadeScreenTo(const int percent, const float time, bool clearQueue);
/// Darken the screen to a specified percentage /// Darken the screen to a specified percentage
virtual void setBlindness(const int percent); virtual void setBlindness(const int percent);

View File

@ -246,7 +246,7 @@ namespace MWScript
Interpreter::Type_Float time = runtime[0].mFloat; Interpreter::Type_Float time = runtime[0].mFloat;
runtime.pop(); runtime.pop();
MWBase::Environment::get().getWindowManager()->fadeScreenIn(time); MWBase::Environment::get().getWindowManager()->fadeScreenIn(time, false);
} }
}; };
@ -259,7 +259,7 @@ namespace MWScript
Interpreter::Type_Float time = runtime[0].mFloat; Interpreter::Type_Float time = runtime[0].mFloat;
runtime.pop(); runtime.pop();
MWBase::Environment::get().getWindowManager()->fadeScreenOut(time); MWBase::Environment::get().getWindowManager()->fadeScreenOut(time, false);
} }
}; };
@ -275,7 +275,7 @@ namespace MWScript
Interpreter::Type_Float time = runtime[0].mFloat; Interpreter::Type_Float time = runtime[0].mFloat;
runtime.pop(); runtime.pop();
MWBase::Environment::get().getWindowManager()->fadeScreenTo(alpha, time); MWBase::Environment::get().getWindowManager()->fadeScreenTo(alpha, time, false);
} }
}; };