1
0
forked from mirrors/0ad

Cinema Path GUI hiding and silhouettes fixes.

Let the JS GUI take care of hiding the GUI and silhouettes and remove
the according hardcoding in the engine following 89aef0b6eb.
Thereby fix some bugs (like not having hid the GUI if there was a
message box or different page shown while playing a path) and
fix these two hotkeys broken by 5d49e6c456.

Differential Revision: https://code.wildfiregames.com/D631
Fixes #4633
Reviewed By: Vladislav
This was SVN commit r19797.
This commit is contained in:
elexis
2017-06-17 14:17:30 +00:00
parent 2cd7c62c0f
commit cfd08bbf28
7 changed files with 40 additions and 42 deletions
-30
View File
@@ -62,9 +62,6 @@ void CCinemaManager::Update(const float deltaRealTime) const
if (!cmpCinemaManager)
return;
UpdateSessionVisibility();
UpdateSilhouettesVisibility();
if (IsPlaying())
cmpCinemaManager->PlayQueue(deltaRealTime, g_Game->GetView()->GetCamera());
}
@@ -77,33 +74,6 @@ void CCinemaManager::Render() const
DrawPaths();
}
void CCinemaManager::UpdateSessionVisibility() const
{
// TODO: Enabling/Disabling does not work if the session GUI page is not the top page.
// This can happen in various situations, for example when the player wins/loses the game
// while the cinematic is running (a message box is the top page in this case).
IGUIObject *sn = g_GUI->FindObjectByName("sn");
if (!sn)
return;
bool hidden = false;
GUI<bool>::GetSetting(sn, "hidden", hidden);
if (hidden != IsPlaying())
sn->SetSetting("hidden", IsPlaying() ? L"true" : L"false");
}
void CCinemaManager::UpdateSilhouettesVisibility() const
{
if (!CRenderer::IsInitialised())
return;
bool silhouettes = false;
CFG_GET_VAL("silhouettes", silhouettes);
g_Renderer.SetOptionBool(CRenderer::Option::OPT_SILHOUETTES, !IsEnabled() && silhouettes);
}
void CCinemaManager::DrawPaths() const
{
CmpPtr<ICmpCinemaManager> cmpCinemaManager(g_Game->GetSimulation2()->GetSimContext().GetSystemEntity());