Esempio n. 1
0
void PropAnimator::AnimateProp(Prop &prop , QWidget *parent, QRect geometry)
{
    for(int i = 0 ; i < cfg->getPropList().size() ; i++)
    {
        if(prop.getID() == cfg->getPropList().at(i).getID())
        {
            this->prop = cfg->getPropList().at(i);
        }
    }


//    audioPlayer->setSourceData(cfg->getPluginPath() + QString("PropSound\\%1.wav").arg(this->prop.getID()),
//                               AudioPlayer::eSourceFile,
//                               AudioPlayer::eDecodeWAV);
//    audioPlayer->start(false, false);



    aniLabel = new QLabel(parent);
    aniLabel->setGeometry(geometry);
    aniCount = 0;
    if(this->prop.getIsComplexAni())
    {
        isComplexAni = true;
        aniPath = cfg->getPluginPath() + "PropAnimation\\" +
                  QString("%1Prop\\%1_head").arg(prop.getID()).arg(prop.getID());
        state = "head";
        aniTimer.start();
    }
    else
    {
        isComplexAni = false;
        //test
        prop.setID(PROP_ID_SCRAWL);
        //--test end--
        aniPath = cfg->getPluginPath() + "PropAnimation\\" +
                  QString("%1Prop\\%2").arg(prop.getID()).arg(prop.getID());
        aniTimer.start();
    }
}
Esempio n. 2
0
void PKRoomWidget::updateProp(Player player,Prop prop)
{
    PKRoomWidgetDebug("PKRoomWidget updateProp");
    switch (prop.getID())
    {
    case PROP_ID_LUCKYWING:
    {
        propWidget->updateLuckyWing();
        animeMgr->addAnimation(this , QRect(268 , 14 , 300 , 180) ,prop);
        break;
    }
    case PROP_ID_PIG:
    {
        animeMgr->addAnimation(this , QRect(353 , 90 , 160 , 120) , prop);
        break;
    }
    case PROP_ID_KISS:
    {
        animeMgr->addAnimation(this , randomArea(QRect(0 , 0 , 200 , 200 )) ,prop);
        break;
    }
    case PROP_ID_SCRAWL:
    {
        animeMgr->addAnimation(this , QRect(ui->lyricWidget->x() ,ui->lyricWidget->y() - 30 ,305 , 105) , prop);
        break;
    }
    case PROP_ID_FROG:
    {
        animeMgr->addAnimation(this , QRect(0 , 90 , 260 , 100) , prop);
        break;
    }

    case PROP_ID_TRANSFORMER:
    case PROP_ID_TOMCAT:
    {
        peopleAnimeWidget->animateProp(prop);
    }

    default:
        break;
    }
    messageWidget->updateMessage(player, prop);
}