* Create selection zones to remember the last card the cursor was on.
This commit is contained in:
jean.chalard
2009-09-12 12:57:50 +00:00
parent 23fb17e58e
commit 34d973c60d
10 changed files with 73 additions and 26 deletions

View File

@@ -94,7 +94,25 @@ bool CardSelector::CheckUserInput(u32 key)
default:
return false;
}
if (active != oldactive) { oldactive->Leaving(key); active->Entering(); }
if (active != oldactive)
{
SelectorZone oldowner, owner;
if (CardView *q = dynamic_cast<CardView*>(oldactive)) oldowner = q->owner; else oldowner = nullZone;
if (CardView *q = dynamic_cast<CardView*>(active)) owner = q->owner; else owner = nullZone;
if (oldowner != owner)
{
if (nullZone != owner)
if (PlayGuiObject* old = lasts[owner]) active = old;
lasts[oldowner] = oldactive;
}
}
if (active != oldactive)
{
{ CardView* c = dynamic_cast<CardView*>(oldactive); if (c) c->zoom = 1.0; }
{ CardView* c = dynamic_cast<CardView*>(active); if (c) c->zoom = 1.4; }
oldactive->Leaving(key);
active->Entering();
}
return true;
}