Phase bar is now clickable/touchable and animated.

This commit is contained in:
Xawotihs
2011-08-01 21:26:12 +00:00
parent 32a5b7bb92
commit 097c40149d
3 changed files with 55 additions and 5 deletions
+19
View File
@@ -1,6 +1,7 @@
#include "PrecompiledHeader.h"
#include "MTGGamePhase.h"
#include "GuiPhaseBar.h"
MTGGamePhase::MTGGamePhase(int id) :
ActionElement(id)
@@ -40,7 +41,25 @@ bool MTGGamePhase::CheckUserInput(JButton key)
GameObserver * game = GameObserver::GetInstance();
if (activeState == INACTIVE)
{
int x1,y1;
JButton trigger = (options[Options::REVERSETRIGGERS].number ? JGE_BTN_NEXT : JGE_BTN_PREV);
if(JGE::GetInstance()->GetLeftClickCoordinates(x1, y1))
{
if(x1 < 28 && y1 <185 && y1 > 106)
{ /* See GuiPhaseBar to understand where those values come from */
GuiPhaseBar::GetInstance()->Zoom(1.4);
if(key == JGE_BTN_OK)
{
key = trigger;
JGE::GetInstance()->LeftClickedProcessed();
}
}
else
{
GuiPhaseBar::GetInstance()->Zoom(1.0);
}
}
if ((trigger == key) && game->currentActionPlayer == game->currentlyActing())
{
activeState = ACTIVE;