Fixed fadein for listbox.

Added AlphaChilds method to animated controls.
Auto add map extension to maps.
This commit is contained in:
spartanj@gmail.com
2012-04-26 17:04:24 -03:00
parent c671d311ba
commit 0182ee6e3e
6 changed files with 34 additions and 6 deletions

View File

@@ -740,7 +740,13 @@ void cMapEditor::MapOpen( const cUIEvent * Event ) {
void cMapEditor::MapSave( const cUIEvent * Event ) {
cUICommonDialog * CDL = reinterpret_cast<cUICommonDialog*> ( Event->Ctrl() );
mUIMap->Map()->Save( CDL->GetFullPath() );
std::string path( CDL->GetFullPath() );
if ( path.substr( path.size() - 4 ) != ".eem" ) {
path += ".eem";
}
mUIMap->Map()->Save( path );
}
void cMapEditor::FileMenuClick( const cUIEvent * Event ) {

View File

@@ -79,6 +79,22 @@ void cUIControlAnim::Alpha( const eeFloat& alpha ) {
OnAlphaChange();
}
void cUIControlAnim::AlphaChilds( const eeFloat &alpha ) {
cUIControlAnim * AnimChild;
cUIControl * CurChild = mChild;
while ( NULL != CurChild ) {
if ( CurChild->IsAnimated() ) {
AnimChild = reinterpret_cast<cUIControlAnim*> ( CurChild );
AnimChild->Alpha( alpha );
AnimChild->AlphaChilds( alpha );
}
CurChild = CurChild->NextGet();
}
}
void cUIControlAnim::MatrixSet() {
if ( mScale != 1.f || mAngle != 0.f ) {
cGlobalBatchRenderer::instance()->Draw();

View File

@@ -31,6 +31,8 @@ class EE_API cUIControlAnim : public cUIDragable {
virtual void Alpha( const eeFloat& alpha );
virtual void AlphaChilds( const eeFloat& alpha );
bool Animating();
void StartAlphaAnim( const eeFloat& From, const eeFloat& To, const eeFloat& TotalTime, const bool& AlphaChilds = true, const EE_INTERPOLATION& Type = LINEAR, cInterpolation::OnPathEndCallback PathEndCallback = cInterpolation::OnPathEndCallback() );

View File

@@ -884,7 +884,14 @@ Uint32 cUIListBox::OnMessage( const cUIMessage * Msg ) {
}
void cUIListBox::OnAlphaChange() {
cUIControlAnim::OnAlphaChange();
cUIComplexControl::OnAlphaChange();
if ( mItems.size() ) {
for ( Uint32 i = mVisibleFirst; i <= mVisibleLast; i++ ) {
if ( NULL != mItems[i] )
mItems[i]->Alpha( mAlpha );
}
}
mVScrollBar->Alpha( mAlpha );
mHScrollBar->Alpha( mAlpha );

View File

@@ -80,9 +80,6 @@ void cUIListBoxItem::Update() {
cUIListBox * LBParent = reinterpret_cast<cUIListBox*> ( Parent()->Parent() );
Uint32 Flags = cUIManager::instance()->GetInput()->ClickTrigger();
if ( NULL != LBParent && LBParent->Alpha() != mAlpha )
Alpha( LBParent->Alpha() );
if ( IsMouseOver() ) {
if ( Flags & EE_BUTTONS_WUWD && LBParent->VerticalScrollBar()->Visible() ) {
LBParent->VerticalScrollBar()->Slider()->ManageClick( Flags );

View File

@@ -397,7 +397,7 @@ void cUIManager::AddToCloseQueue( cUIControl * Ctrl ) {
}
void cUIManager::CheckClose() {
if ( mCloseList.size() ) {
if ( !mCloseList.empty() ) {
for ( std::list<cUIControl*>::iterator it = mCloseList.begin(); it != mCloseList.end(); it++ ) {
eeDelete( *it );
}