Hopefully fix GroupList tweening weirdness

This commit is contained in:
Glenn Maynard
2003-09-03 06:47:10 +00:00
parent 352df48614
commit 3f0557139b
3 changed files with 21 additions and 19 deletions
+4 -2
View File
@@ -486,8 +486,10 @@ StartX=0
StartY=-136
SpacingX=0
SpacingY=28
GainFocusCommand=glowshift;effectperiod,0.5;linear,0.2;x,-40
LoseFocusCommand=stoptweening;stopeffect;linear,0.2;x,0
GainFocusGroupCommand=stoptweening;linear,0.2;x,-40
LoseFocusGroupCommand=stoptweening;linear,0.2;x,0
GainFocusItemCommand=glowshift;effectperiod,0.5
LoseFocusItemCommand=stopeffect
HideItemCommand=linear,0.2;diffusealpha,0
ShowItemCommand=stoptweening;linear,0.2;diffusealpha,1;zoom,1.0;
# This just selects the type of tweening used for scrolling the list; it shouldn't actually
+16 -17
View File
@@ -12,8 +12,10 @@
#define SPACING_X THEME->GetMetricF("GroupList","SpacingX")
#define SPACING_Y THEME->GetMetricF("GroupList","SpacingY")
#define SCROLL_TWEEN_COMMAND THEME->GetMetric ("GroupList","ScrollTweenCommand")
#define GAIN_FOCUS_COMMAND THEME->GetMetric ("GroupList","GainFocusCommand")
#define LOSE_FOCUS_COMMAND THEME->GetMetric ("GroupList","LoseFocusCommand")
#define GAIN_FOCUS_ITEM_COMMAND THEME->GetMetric ("GroupList","GainFocusItemCommand")
#define LOSE_FOCUS_ITEM_COMMAND THEME->GetMetric ("GroupList","LoseFocusItemCommand")
#define GAIN_FOCUS_GROUP_COMMAND THEME->GetMetric ("GroupList","GainFocusGroupCommand")
#define LOSE_FOCUS_GROUP_COMMAND THEME->GetMetric ("GroupList","LoseFocusGroupCommand")
#define HIDE_ITEM_COMMAND THEME->GetMetric ("GroupList","HideItemCommand")
#define SHOW_ITEM_COMMAND THEME->GetMetric ("GroupList","ShowItemCommand")
@@ -30,6 +32,7 @@ GroupList::~GroupList()
{
delete m_sprButtons[i];
delete m_textLabels[i];
delete m_ButtonFrames[i];
}
}
@@ -50,17 +53,20 @@ void GroupList::Load( const CStringArray& asGroupNames )
{
Sprite *button = new Sprite;
BitmapText *label = new BitmapText;
ActorFrame *frame = new ActorFrame;
m_sprButtons.push_back( button );
m_textLabels.push_back( label );
m_ButtonFrames.push_back( frame );
button->Load( THEME->GetPathToG("GroupList bar") );
label->LoadFromFont( THEME->GetPathToF("GroupList label") );
label->SetShadowLength( 2 );
label->SetText( SONGMAN->ShortenGroupName( asGroupNames[i] ) );
m_Frame.AddChild( button );
m_Frame.AddChild( label );
frame->AddChild( button );
frame->AddChild( label );
m_Frame.AddChild( frame );
button->SetXY( START_X + i*SPACING_X, START_Y + i*SPACING_Y );
label->SetXY( START_X + i*SPACING_X, START_Y + i*SPACING_Y );
@@ -98,8 +104,9 @@ void GroupList::ResetTextSize( int i )
void GroupList::BeforeChange()
{
m_sprButtons[m_iSelection]->Command( LOSE_FOCUS_COMMAND );
m_textLabels[m_iSelection]->Command( LOSE_FOCUS_COMMAND );
m_sprButtons[m_iSelection]->Command( LOSE_FOCUS_ITEM_COMMAND );
m_textLabels[m_iSelection]->Command( LOSE_FOCUS_ITEM_COMMAND );
m_ButtonFrames[m_iSelection]->Command( LOSE_FOCUS_GROUP_COMMAND );
}
@@ -129,8 +136,9 @@ void GroupList::AfterChange()
m_bHidden[i] = IsHidden;
}
m_sprButtons[m_iSelection]->Command( GAIN_FOCUS_COMMAND );
m_textLabels[m_iSelection]->Command( GAIN_FOCUS_COMMAND );
m_sprButtons[m_iSelection]->Command( GAIN_FOCUS_ITEM_COMMAND );
m_textLabels[m_iSelection]->Command( GAIN_FOCUS_ITEM_COMMAND );
m_ButtonFrames[m_iSelection]->Command( GAIN_FOCUS_GROUP_COMMAND );
}
void GroupList::Up()
@@ -175,15 +183,6 @@ void GroupList::SetSelection( unsigned sel )
AfterChange();
}
/* either tweened off screen (to come on screen),
tweened off screen (invisible),
onscreen (unselected),
or onscreen (selected)
coming on/ofscreen is internal
always invis<->unselected<->selected
*/
void GroupList::TweenOnScreen()
{
+1
View File
@@ -9,6 +9,7 @@ class GroupList: public ActorFrame {
ActorFrame m_Frame;
vector<Sprite *> m_sprButtons;
vector<BitmapText *> m_textLabels;
vector<ActorFrame *> m_ButtonFrames;
vector<CString> m_asLabels;
vector<bool> m_bHidden;