CHANGED: #1471 CInterfaceAnim no longer depends on Ryzom game related code.

This commit is contained in:
dfighter1985 2012-07-01 03:45:38 +02:00
parent bf624b79ec
commit 70fb3d6412
3 changed files with 30 additions and 39 deletions

View file

@ -924,6 +924,31 @@ bool CStringPostProcessNPCRemoveTitle::cbIDStringReceived(ucstring &inOut)
// ***************************************************************************
class CAHAnimStart : public IActionHandler
{
public:
virtual void execute (CCtrlBase * /* pCaller */, const std::string &Params)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
string sAnim = getParam(Params, "anim");
pIM->startAnim(sAnim);
}
};
REGISTER_ACTION_HANDLER (CAHAnimStart, "anim_start");
// ***************************************************************************
class CAHAnimStop : public IActionHandler
{
public:
virtual void execute (CCtrlBase * /* pCaller */, const std::string &Params)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
string sAnim = getParam(Params, "anim");
pIM->stopAnim(sAnim);
}
};
REGISTER_ACTION_HANDLER (CAHAnimStop, "anim_stop");

View file

@ -14,17 +14,11 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
// ----------------------------------------------------------------------------
#include "stdpch.h"
#include "interface_anim.h" #include "interface_anim.h"
#include "interface_manager.h" #include "nel/gui/widget_manager.h"
#include "nel/gui/interface_expr.h" #include "nel/gui/interface_expr.h"
#include "nel/misc/xml_auto_ptr.h" #include "nel/misc/xml_auto_ptr.h"
#include "nel/gui/action_handler.h" #include "nel/gui/action_handler.h"
#include "../time_client.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
using namespace std; using namespace std;
@ -591,11 +585,13 @@ void CInterfaceAnim::update()
if ((_Duration == 0) || (_Finished)) if ((_Duration == 0) || (_Finished))
return; return;
const CWidgetManager::SInterfaceTimes &times = CWidgetManager::getInstance()->getInterfaceTimes();
// Delta time limiter // Delta time limiter
if (DT > 0.1) if ( ( times.frameDiffMs / 1000.0f ) > 0.1)
_CurrentTime += 0.1; _CurrentTime += 0.1;
else else
_CurrentTime += DT; _CurrentTime += ( times.frameDiffMs / 1000.0f );
// Stop the anim if we have to // Stop the anim if we have to
if (_AnimHasToBeStopped) if (_AnimHasToBeStopped)
@ -640,37 +636,8 @@ void CInterfaceAnim::stop()
{ {
_Finished = true; _Finished = true;
CInterfaceManager *pIM = CInterfaceManager::getInstance();
if (!_AHOnFinish.empty()) if (!_AHOnFinish.empty())
CAHManager::getInstance()->runActionHandler(_AHOnFinish, _Parent, _AHOnFinishParams); CAHManager::getInstance()->runActionHandler(_AHOnFinish, _Parent, _AHOnFinishParams);
} }
// **************************
// Action handlers associated
// **************************
// ***************************************************************************
class CAHAnimStart : public IActionHandler
{
public:
virtual void execute (CCtrlBase * /* pCaller */, const std::string &Params)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
string sAnim = getParam(Params, "anim");
pIM->startAnim(sAnim);
}
};
REGISTER_ACTION_HANDLER (CAHAnimStart, "anim_start");
// ***************************************************************************
class CAHAnimStop : public IActionHandler
{
public:
virtual void execute (CCtrlBase * /* pCaller */, const std::string &Params)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
string sAnim = getParam(Params, "anim");
pIM->stopAnim(sAnim);
}
};
REGISTER_ACTION_HANDLER (CAHAnimStop, "anim_stop");

View file

@ -22,7 +22,6 @@
#include "nel/gui/interface_property.h" #include "nel/gui/interface_property.h"
#include "nel/gui/interface_group.h" #include "nel/gui/interface_group.h"
#include "nel/gui/interface_link.h" #include "nel/gui/interface_link.h"
#include "nel/3d/u_track.h" #include "nel/3d/u_track.h"
/** /**