#include "thani.h"
 
thani::thani()
{
	pix_001.load(":/Interface/Interface/reload.png");
}

void thani::run()
{
	pix_001.fill(QColor(171,164,154,progress));
	hdlmsk->setPixmap(pix_001);

	if ( sens == 1 )
	{
		if ( progress < 240 )
		{
			progress=progress+40;
			QTimer::singleShot(20, this, SLOT(boucle()));
		}
		else
		{
			if ( isrender == 1 )
			{
				emit fincache();
			}
			else
			{
				if ( isrender != 999 )
				{
					emit lockbar();
				}
			}
		}
	}
	else
	{
		if ( progress > 0 )
		{
			progress=progress-40;
			QTimer::singleShot(20, this, SLOT(boucle()));
		}
		else
		{
			hdlmsk->hide();
			emit finanim();
		}		
	}
}

void thani::boucle()
{
	run();
}

