Danbias/Code/Game/GameClient/GameClientState/RespawnUI.cpp

77 lines
1.6 KiB
C++
Raw Normal View History

2014-02-19 13:15:19 +01:00
#include "RespawnUI.h"
using namespace ::DanBias::Client;
using namespace ::Oyster::Network;
using namespace ::Utility::Value;
using namespace ::Oyster::Math;
2014-02-19 13:15:19 +01:00
RespawnUI::RespawnUI() :
GameStateUI()
{
/* Should never be called! */
this->netClient = nullptr;
this->countDown = 0.0f;
}
RespawnUI::RespawnUI( NetworkClient *connection, float delay ) :
GameStateUI()
{
this->netClient = connection;
this->countDown = delay;
this->text = nullptr;
2014-02-19 13:15:19 +01:00
}
RespawnUI::~RespawnUI() { /* Do nothing */ }
bool RespawnUI::Init()
{
// z value should be between 0.5 - 0.9 so that it will be behind other states
// add textures and text
2014-02-25 14:08:15 +01:00
this->text = new Text_UI(L"DEAD", Float3(0.35f,0.35f,0.5f), Float2(0.5f,0.2f));
return true;
}
2014-02-19 13:15:19 +01:00
GameStateUI::UIState RespawnUI::Update( float deltaTime )
{
this->countDown = Max( this->countDown - deltaTime, 0.0f );
// countDown == 0
// return UIState_gaming state;
2014-02-19 13:15:19 +01:00
return this->nextState;
}
bool RespawnUI::HaveGUIRender() const
{
return false; // TODO: change to true when we want UI elements like a crosshair
}
bool RespawnUI::HaveTextRender() const
{
return true; // TODO: change to true when we want UI elements like a chat window
2014-02-19 13:15:19 +01:00
}
void RespawnUI::RenderGUI() const
{
// TODO:BLOODY SCREEN
2014-02-19 13:15:19 +01:00
}
void RespawnUI::RenderText() const
{
this->text->RenderText();
2014-02-19 13:15:19 +01:00
// TODO: Text countdown somewhere on screen would be nice
}
bool RespawnUI::Release()
{
// TODO: Release UI components here.
if(this->text)
delete this->text;
2014-02-19 13:15:19 +01:00
return true;
}
void RespawnUI::SetCountdown( float cd )
{
this->countDown = cd;
// this text should be rendered
}
2014-02-19 13:15:19 +01:00