J :
* Fix u32 into JButtons. * Add a few comments. * Remove useless variables.
This commit is contained in:
@@ -50,7 +50,7 @@ int ActionLayer::reactToTargetClick(ActionElement* ability, Targetable * card){
|
||||
return result;
|
||||
}
|
||||
|
||||
bool ActionLayer::CheckUserInput(u32 key){
|
||||
bool ActionLayer::CheckUserInput(JButton key){
|
||||
GameObserver * g = GameObserver::GetInstance();
|
||||
if (g->waitForExtraPayment && key == JGE_BTN_SEC){
|
||||
g->waitForExtraPayment = NULL;
|
||||
|
||||
@@ -620,8 +620,8 @@ void ActionStack::endOfInterruption(){
|
||||
}
|
||||
|
||||
|
||||
bool ActionStack::CheckUserInput(u32 key){
|
||||
u32 trigger = (options[Options::REVERSETRIGGERS].number ? JGE_BTN_NEXT : JGE_BTN_PREV);
|
||||
bool ActionStack::CheckUserInput(JButton key){
|
||||
JButton trigger = (options[Options::REVERSETRIGGERS].number ? JGE_BTN_NEXT : JGE_BTN_PREV);
|
||||
if (mode == ACTIONSTACK_STANDARD){
|
||||
if (askIfWishesToInterrupt){
|
||||
if (JGE_BTN_SEC == key){
|
||||
|
||||
@@ -77,7 +77,7 @@ void CardDisplay::Update(float dt){
|
||||
if (update) init(zone);
|
||||
}
|
||||
|
||||
bool CardDisplay::CheckUserInput(u32 key){
|
||||
bool CardDisplay::CheckUserInput(JButton key){
|
||||
if (JGE_BTN_SEC == key)
|
||||
{
|
||||
if (listener){
|
||||
@@ -136,6 +136,8 @@ bool CardDisplay::CheckUserInput(u32 key){
|
||||
}
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
using std::cout;
|
||||
|
||||
// The X lib annoyingly defines True to be 1, leading to
|
||||
// hard to understand syntax errors. Not using it, so it's
|
||||
// safe to undefine it.
|
||||
#ifdef True
|
||||
#undef True
|
||||
#endif
|
||||
@@ -98,13 +101,13 @@ void CardSelector::Pop()
|
||||
{
|
||||
{ CardView* c = dynamic_cast<CardView*>(oldactive); if (c) c->zoom = 1.0; } //Is this needed, I think it is one in Leaving(0) ?
|
||||
{ CardView* c = dynamic_cast<CardView*>(active); if (c) c->zoom = 1.4; } //Is this needed, I think it is one in Entering() ?
|
||||
if (oldactive) oldactive->Leaving(0);
|
||||
if (oldactive) oldactive->Leaving(JGE_BTN_NONE);
|
||||
if (active) active->Entering();
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
bool CardSelector::CheckUserInput(u32 key)
|
||||
bool CardSelector::CheckUserInput(JButton key)
|
||||
{
|
||||
if (!active)
|
||||
{
|
||||
@@ -175,7 +178,7 @@ bool CardSelector::CheckUserInput(u32 key)
|
||||
{
|
||||
{ CardView* c = dynamic_cast<CardView*>(oldactive); if (c) c->zoom = 1.0; }
|
||||
{ CardView* c = dynamic_cast<CardView*>(active); if (c) c->zoom = 1.4; }
|
||||
if (oldactive) oldactive->Leaving(0);
|
||||
if (oldactive) oldactive->Leaving(JGE_BTN_NONE);
|
||||
if (active) active->Entering();
|
||||
}
|
||||
return true;
|
||||
@@ -248,7 +251,7 @@ void CardSelector::Limit(LimitorFunctor<Target>* limitor, SelectorZone destzone)
|
||||
{
|
||||
{ CardView* c = dynamic_cast<CardView*>(oldactive); if (c) c->zoom = 1.0; }
|
||||
{ CardView* c = dynamic_cast<CardView*>(active); if (c) c->zoom = 1.4; }
|
||||
if (oldactive) oldactive->Leaving(0);
|
||||
if (oldactive) oldactive->Leaving(JGE_BTN_NONE);
|
||||
if (active) active->Entering();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ void DuelLayers::init(){
|
||||
}
|
||||
|
||||
void DuelLayers::CheckUserInput(int isAI){
|
||||
u32 key;
|
||||
JButton key;
|
||||
while ((key = JGE::GetInstance()->ReadButton())){
|
||||
if ((!isAI) && (0 != key))
|
||||
{
|
||||
|
||||
@@ -66,7 +66,7 @@ int GuiAvatars::receiveEventMinus(WEvent* e)
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool GuiAvatars::CheckUserInput(u32 key){
|
||||
bool GuiAvatars::CheckUserInput(JButton key){
|
||||
if (self->CheckUserInput(key)) return true;
|
||||
if (opponent->CheckUserInput(key)) return true;
|
||||
if (selfGraveyard->CheckUserInput(key)) return true;
|
||||
|
||||
@@ -137,7 +137,7 @@ bool GuiCombat::clickOK(){
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GuiCombat::CheckUserInput(u32 key)
|
||||
bool GuiCombat::CheckUserInput(JButton key)
|
||||
{
|
||||
if (NONE == cursor_pos) return false;
|
||||
DamagerDamaged* oldActive = active;
|
||||
@@ -251,6 +251,8 @@ bool GuiCombat::CheckUserInput(u32 key)
|
||||
if (options[Options::REVERSETRIGGERS].number) return false;
|
||||
active = activeAtk = NULL; cursor_pos = OK;
|
||||
break;
|
||||
default:
|
||||
;
|
||||
}
|
||||
if (oldActive != active)
|
||||
{
|
||||
|
||||
@@ -137,9 +137,9 @@ void GuiHandSelf::Repos()
|
||||
}
|
||||
}
|
||||
|
||||
bool GuiHandSelf::CheckUserInput(u32 key)
|
||||
bool GuiHandSelf::CheckUserInput(JButton key)
|
||||
{
|
||||
u32 trigger = (options[Options::REVERSETRIGGERS].number ? JGE_BTN_PREV : JGE_BTN_NEXT);
|
||||
JButton trigger = (options[Options::REVERSETRIGGERS].number ? JGE_BTN_PREV : JGE_BTN_NEXT);
|
||||
if (trigger == key)
|
||||
{
|
||||
state = (Open == state ? Closed : Open);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "GuiMessageBox.h"
|
||||
|
||||
bool GuiMessageBox::CheckUserInput(u32 key){
|
||||
bool GuiMessageBox::CheckUserInput(JButton key){
|
||||
if (mActionButton == key)
|
||||
{
|
||||
if (mObjects[mCurr] != NULL && mObjects[mCurr]->ButtonPressed())
|
||||
|
||||
@@ -7,7 +7,7 @@ void GuiStatic::Entering()
|
||||
{
|
||||
parent->Activate(this);
|
||||
}
|
||||
bool GuiStatic::Leaving(u32 key)
|
||||
bool GuiStatic::Leaving(JButton key)
|
||||
{
|
||||
parent->Deactivate(this);
|
||||
return false;
|
||||
@@ -151,7 +151,7 @@ void GuiGameZone::ButtonPressed(int controllerId, int controlId){
|
||||
GameObserver::GetInstance()->ButtonPressed(this);
|
||||
}
|
||||
|
||||
bool GuiGameZone::CheckUserInput(u32 key){
|
||||
bool GuiGameZone::CheckUserInput(JButton key){
|
||||
if (showCards) return cd->CheckUserInput(key);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -30,10 +30,10 @@ void MTGGamePhase::Update(float dt){
|
||||
|
||||
}
|
||||
|
||||
bool MTGGamePhase::CheckUserInput(u32 key){
|
||||
bool MTGGamePhase::CheckUserInput(JButton key){
|
||||
GameObserver * game = GameObserver::GetInstance();
|
||||
if (activeState == INACTIVE){
|
||||
u32 trigger = (options[Options::REVERSETRIGGERS].number ? JGE_BTN_NEXT : JGE_BTN_PREV);
|
||||
JButton trigger = (options[Options::REVERSETRIGGERS].number ? JGE_BTN_NEXT : JGE_BTN_PREV);
|
||||
if ((trigger == key) && game->currentActionPlayer == game->currentlyActing())
|
||||
{
|
||||
activeState = ACTIVE;
|
||||
|
||||
@@ -94,7 +94,7 @@ void MenuItem::Entering()
|
||||
}
|
||||
|
||||
|
||||
bool MenuItem::Leaving(u32 key)
|
||||
bool MenuItem::Leaving(JButton key)
|
||||
{
|
||||
mParticleSys->Stop(true);
|
||||
mHasFocus = false;
|
||||
|
||||
@@ -85,7 +85,7 @@ void PlayGuiObjectController::Update(float dt){
|
||||
}
|
||||
|
||||
|
||||
bool PlayGuiObjectController::CheckUserInput(u32 key){
|
||||
bool PlayGuiObjectController::CheckUserInput(JButton key){
|
||||
/*
|
||||
if (!mCount)
|
||||
return false;
|
||||
|
||||
@@ -53,7 +53,7 @@ void SimpleMenuItem::Entering()
|
||||
}
|
||||
|
||||
|
||||
bool SimpleMenuItem::Leaving(u32 key)
|
||||
bool SimpleMenuItem::Leaving(JButton key)
|
||||
{
|
||||
mHasFocus = false;
|
||||
return true;
|
||||
|
||||
@@ -196,7 +196,7 @@ void SimplePad::MoveSelection(unsigned char moveto)
|
||||
|
||||
void SimplePad::Update(float dt){
|
||||
JGE * mEngine = JGE::GetInstance();
|
||||
u32 key = mEngine->ReadButton();
|
||||
JButton key = mEngine->ReadButton();
|
||||
|
||||
//Start button changes capslock setting.
|
||||
if (key == JGE_BTN_MENU)
|
||||
|
||||
@@ -52,7 +52,7 @@ void StoryChoice::Entering()
|
||||
}
|
||||
|
||||
|
||||
bool StoryChoice::Leaving(u32 key)
|
||||
bool StoryChoice::Leaving(JButton key)
|
||||
{
|
||||
mHasFocus = false;
|
||||
mTargetScale = 1.0f;
|
||||
@@ -267,4 +267,4 @@ StoryFlow::~StoryFlow(){
|
||||
SAFE_DELETE(i->second);
|
||||
}
|
||||
pages.clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user