J :
* Fix a bug where the closest card to the old coordinates of a no more inplay card would be chosen regardless of whether it complies with the user's request.
This commit is contained in:
@@ -73,7 +73,9 @@ CardSelector::Target* CardSelector::fetchMemory(SelectorMemory& memory)
|
|||||||
}
|
}
|
||||||
// We come here if the card is not in the selector any more, or if
|
// We come here if the card is not in the selector any more, or if
|
||||||
// it is there but it is now refused by the limitor.
|
// it is there but it is now refused by the limitor.
|
||||||
return closest<True>(cards, limitor, memory.x, memory.y);
|
PlayGuiObject* x = closest<True>(cards, limitor, memory.x, memory.y);
|
||||||
|
CardView* c = dynamic_cast<CardView*>(x);
|
||||||
|
return x;
|
||||||
}
|
}
|
||||||
template<>
|
template<>
|
||||||
void CardSelector::Push()
|
void CardSelector::Push()
|
||||||
@@ -155,15 +157,24 @@ bool CardSelector::CheckUserInput(u32 key)
|
|||||||
if (oldowner != owner)
|
if (oldowner != owner)
|
||||||
{
|
{
|
||||||
if (nullZone != owner)
|
if (nullZone != owner)
|
||||||
|
{
|
||||||
if (PlayGuiObject* old = fetchMemory(lasts[owner]))
|
if (PlayGuiObject* old = fetchMemory(lasts[owner]))
|
||||||
active = old;
|
switch (key)
|
||||||
|
{
|
||||||
|
case PSP_CTRL_LEFT: if (old->x < oldactive->x) active = old; break;
|
||||||
|
case PSP_CTRL_RIGHT: if (old->x > oldactive->x) active = old; break;
|
||||||
|
case PSP_CTRL_UP: if (old->y < oldactive->y) active = old; break;
|
||||||
|
case PSP_CTRL_DOWN: if (old->y > oldactive->y) active = old; break;
|
||||||
|
default: if (old) active = old; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
lasts[oldowner] = SelectorMemory(oldactive);
|
lasts[oldowner] = SelectorMemory(oldactive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (active != oldactive)
|
if (active != oldactive)
|
||||||
{
|
{
|
||||||
{ 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*>(oldactive); if (c) c->zoom = 1.0; }
|
||||||
{ CardView* c = dynamic_cast<CardView*>(active); if (c) c->zoom = 1.4; } //Is this needed, I think it is one in Entering() ?
|
{ CardView* c = dynamic_cast<CardView*>(active); if (c) c->zoom = 1.4; }
|
||||||
if (oldactive) oldactive->Leaving(0);
|
if (oldactive) oldactive->Leaving(0);
|
||||||
if (active) active->Entering();
|
if (active) active->Entering();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user