Hide demo player fully

This commit is contained in:
def 2014-01-15 15:08:00 +01:00
parent 1e1ef2843d
commit ca9b68b317

View file

@ -54,10 +54,10 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
const float Margins = 5.0f; const float Margins = 5.0f;
float TotalHeight; float TotalHeight;
if(m_MenuActive) if(!m_MenuActive)
return;
TotalHeight = SeekBarHeight+ButtonbarHeight+NameBarHeight+Margins*3; TotalHeight = SeekBarHeight+ButtonbarHeight+NameBarHeight+Margins*3;
else
TotalHeight = SeekBarHeight+Margins*2;
MainView.HSplitBottom(TotalHeight, 0, &MainView); MainView.HSplitBottom(TotalHeight, 0, &MainView);
MainView.VSplitLeft(50.0f, 0, &MainView); MainView.VSplitLeft(50.0f, 0, &MainView);
@ -72,15 +72,10 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
int CurrentTick = pInfo->m_CurrentTick - pInfo->m_FirstTick; int CurrentTick = pInfo->m_CurrentTick - pInfo->m_FirstTick;
int TotalTicks = pInfo->m_LastTick - pInfo->m_FirstTick; int TotalTicks = pInfo->m_LastTick - pInfo->m_FirstTick;
if(m_MenuActive)
{
MainView.HSplitTop(SeekBarHeight, &SeekBar, &ButtonBar); MainView.HSplitTop(SeekBarHeight, &SeekBar, &ButtonBar);
ButtonBar.HSplitTop(Margins, 0, &ButtonBar); ButtonBar.HSplitTop(Margins, 0, &ButtonBar);
ButtonBar.HSplitBottom(NameBarHeight, &ButtonBar, &NameBar); ButtonBar.HSplitBottom(NameBarHeight, &ButtonBar, &NameBar);
NameBar.HSplitTop(4.0f, 0, &NameBar); NameBar.HSplitTop(4.0f, 0, &NameBar);
}
else
SeekBar = MainView;
// do seekbar // do seekbar
{ {
@ -157,8 +152,6 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
bool IncreaseDemoSpeed = false, DecreaseDemoSpeed = false; bool IncreaseDemoSpeed = false, DecreaseDemoSpeed = false;
if(m_MenuActive)
{
// do buttons // do buttons
CUIRect Button; CUIRect Button;
@ -226,7 +219,6 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
TextRender()->SetCursor(&Cursor, NameBar.x, NameBar.y, Button.h*0.5f, TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END); TextRender()->SetCursor(&Cursor, NameBar.x, NameBar.y, Button.h*0.5f, TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END);
Cursor.m_LineWidth = MainView.w; Cursor.m_LineWidth = MainView.w;
TextRender()->TextEx(&Cursor, aBuf, -1); TextRender()->TextEx(&Cursor, aBuf, -1);
}
if(IncreaseDemoSpeed || Input()->KeyPresses(KEY_MOUSE_WHEEL_UP)) if(IncreaseDemoSpeed || Input()->KeyPresses(KEY_MOUSE_WHEEL_UP))
{ {