218 connect(ui.pageOptions->WeaponNew, SIGNAL(clicked()), this, SLOT(GoToSelectNewWeapon())); |
218 connect(ui.pageOptions->WeaponNew, SIGNAL(clicked()), this, SLOT(GoToSelectNewWeapon())); |
219 connect(ui.pageOptions->WeaponDelete, SIGNAL(clicked()), this, SLOT(DeleteWeaponSet())); |
219 connect(ui.pageOptions->WeaponDelete, SIGNAL(clicked()), this, SLOT(DeleteWeaponSet())); |
220 connect(ui.pageOptions->SchemeEdit, SIGNAL(clicked()), this, SLOT(GoToEditScheme())); |
220 connect(ui.pageOptions->SchemeEdit, SIGNAL(clicked()), this, SLOT(GoToEditScheme())); |
221 connect(ui.pageOptions->SchemeNew, SIGNAL(clicked()), this, SLOT(GoToNewScheme())); |
221 connect(ui.pageOptions->SchemeNew, SIGNAL(clicked()), this, SLOT(GoToNewScheme())); |
222 connect(ui.pageOptions->SchemeDelete, SIGNAL(clicked()), this, SLOT(DeleteScheme())); |
222 connect(ui.pageOptions->SchemeDelete, SIGNAL(clicked()), this, SLOT(DeleteScheme())); |
|
223 connect(ui.pageOptions->CBFrontendEffects, SIGNAL(toggled(bool)), this, SLOT(onFrontendEffects(bool)) ); |
223 connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsChanged()), this, SLOT(UpdateWeapons())); |
224 connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsChanged()), this, SLOT(UpdateWeapons())); |
224 |
225 |
225 connect(ui.pageNet->BtnSpecifyServer, SIGNAL(clicked()), this, SLOT(NetConnect())); |
226 connect(ui.pageNet->BtnSpecifyServer, SIGNAL(clicked()), this, SLOT(NetConnect())); |
226 connect(ui.pageNet->BtnNetSvrStart, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); |
227 connect(ui.pageNet->BtnNetSvrStart, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); |
227 pageSwitchMapper->setMapping(ui.pageNet->BtnNetSvrStart, ID_PAGE_NETSERVER); |
228 pageSwitchMapper->setMapping(ui.pageNet->BtnNetSvrStart, ID_PAGE_NETSERVER); |
281 ammoSchemeModel = new AmmoSchemeModel(this, cfgdir->absolutePath() + "/schemes.ini"); |
282 ammoSchemeModel = new AmmoSchemeModel(this, cfgdir->absolutePath() + "/schemes.ini"); |
282 ui.pageScheme->setModel(ammoSchemeModel); |
283 ui.pageScheme->setModel(ammoSchemeModel); |
283 ui.pageMultiplayer->gameCFG->GameSchemes->setModel(ammoSchemeModel); |
284 ui.pageMultiplayer->gameCFG->GameSchemes->setModel(ammoSchemeModel); |
284 ui.pageOptions->SchemesName->setModel(ammoSchemeModel); |
285 ui.pageOptions->SchemesName->setModel(ammoSchemeModel); |
285 |
286 |
286 wBackground = NULL; |
287 wBackground = new BGWidget(this); |
287 if (config->isFrontendEffects()) { |
288 wBackground->setFixedSize(this->width(), this->height()); |
288 wBackground = new BGWidget(this); |
289 wBackground->lower(); |
289 wBackground->setFixedSize(this->width(), this->height()); |
290 wBackground->init(); |
290 wBackground->lower(); |
291 wBackground->enabled = config->isFrontendEffects(); |
291 wBackground->init(); |
292 wBackground->startAnimation(); |
292 wBackground->startAnimation(); |
|
293 } |
|
294 |
293 |
295 //Install all eventFilters : |
294 //Install all eventFilters : |
296 |
295 |
297 MouseOverFilter *filter = new MouseOverFilter(); |
296 MouseOverFilter *filter = new MouseOverFilter(); |
298 filter->setUi(&ui); |
297 filter->setUi(&ui); |
595 ui.Pages->widget(id)->setGraphicsEffect(effectNew); |
603 ui.Pages->widget(id)->setGraphicsEffect(effectNew); |
596 |
604 |
597 QGraphicsOpacityEffect *effectLast = new QGraphicsOpacityEffect(ui.Pages->widget(lastid)); |
605 QGraphicsOpacityEffect *effectLast = new QGraphicsOpacityEffect(ui.Pages->widget(lastid)); |
598 ui.Pages->widget(lastid)->setGraphicsEffect(effectLast); |
606 ui.Pages->widget(lastid)->setGraphicsEffect(effectLast); |
599 #endif |
607 #endif |
|
608 // no effects, means 0 effect duration :D |
|
609 int duration = config->isFrontendEffects() ? 500 : 0; |
600 |
610 |
601 //New page animation |
611 //New page animation |
602 animationNewSlide = new QPropertyAnimation(ui.Pages->widget(id), "pos"); |
612 animationNewSlide = new QPropertyAnimation(ui.Pages->widget(id), "pos"); |
603 animationNewSlide->setDuration(500); |
613 animationNewSlide->setDuration(duration); |
604 animationNewSlide->setStartValue(QPoint(width()/coeff, 0)); |
614 animationNewSlide->setStartValue(QPoint(width()/coeff, 0)); |
605 animationNewSlide->setEndValue(QPoint(0, 0)); |
615 animationNewSlide->setEndValue(QPoint(0, 0)); |
606 animationNewSlide->setEasingCurve(QEasingCurve::OutExpo); |
616 animationNewSlide->setEasingCurve(QEasingCurve::OutExpo); |
607 |
617 |
608 #ifndef Q_OS_MAC |
618 #ifndef Q_OS_MAC |
609 animationNewOpacity = new QPropertyAnimation(effectNew, "opacity"); |
619 animationNewOpacity = new QPropertyAnimation(effectNew, "opacity"); |
610 animationNewOpacity->setDuration(500); |
620 animationNewOpacity->setDuration(duration); |
611 animationNewOpacity->setStartValue(0.01); |
621 animationNewOpacity->setStartValue(0.01); |
612 animationNewOpacity->setEndValue(1); |
622 animationNewOpacity->setEndValue(1); |
613 animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo); |
623 animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo); |
614 #endif |
624 #endif |
615 |
625 |
616 //Last page animation |
626 //Last page animation |
617 ui.Pages->widget(lastid)->setHidden(false); |
627 ui.Pages->widget(lastid)->setHidden(false); |
618 |
628 |
619 animationOldSlide = new QPropertyAnimation(ui.Pages->widget(lastid), "pos"); |
629 animationOldSlide = new QPropertyAnimation(ui.Pages->widget(lastid), "pos"); |
620 animationOldSlide->setDuration(500); |
630 animationOldSlide->setDuration(duration); |
621 animationOldSlide->setStartValue(QPoint(0, 0)); |
631 animationOldSlide->setStartValue(QPoint(0, 0)); |
622 animationOldSlide->setEndValue(QPoint(-width()/coeff, 0)); |
632 animationOldSlide->setEndValue(QPoint(-width()/coeff, 0)); |
623 animationOldSlide->setEasingCurve(QEasingCurve::OutExpo); |
633 animationOldSlide->setEasingCurve(QEasingCurve::OutExpo); |
624 |
634 |
625 #ifndef Q_OS_MAC |
635 #ifndef Q_OS_MAC |
626 animationOldOpacity = new QPropertyAnimation(effectLast, "opacity"); |
636 animationOldOpacity = new QPropertyAnimation(effectLast, "opacity"); |
627 animationOldOpacity->setDuration(500); |
637 animationOldOpacity->setDuration(duration); |
628 animationOldOpacity->setStartValue(1); |
638 animationOldOpacity->setStartValue(1); |
629 animationOldOpacity->setEndValue(0.01); |
639 animationOldOpacity->setEndValue(0.01); |
630 animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo); |
640 animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo); |
631 #endif |
641 #endif |
632 |
642 |
702 ui.Pages->widget(id)->setGraphicsEffect(effectNew); |
712 ui.Pages->widget(id)->setGraphicsEffect(effectNew); |
703 |
713 |
704 QGraphicsOpacityEffect *effectLast = new QGraphicsOpacityEffect(ui.Pages->widget(curid)); |
714 QGraphicsOpacityEffect *effectLast = new QGraphicsOpacityEffect(ui.Pages->widget(curid)); |
705 ui.Pages->widget(curid)->setGraphicsEffect(effectLast); |
715 ui.Pages->widget(curid)->setGraphicsEffect(effectLast); |
706 #endif |
716 #endif |
|
717 // no effects, means 0 effect duration :D |
|
718 int duration = config->isFrontendEffects() ? 500 : 0; |
707 |
719 |
708 //Last page animation |
720 //Last page animation |
709 animationOldSlide = new QPropertyAnimation(ui.Pages->widget(id), "pos"); |
721 animationOldSlide = new QPropertyAnimation(ui.Pages->widget(id), "pos"); |
710 animationOldSlide->setDuration(500); |
722 animationOldSlide->setDuration(duration); |
711 animationOldSlide->setStartValue(QPoint(-width()/coeff, 0)); |
723 animationOldSlide->setStartValue(QPoint(-width()/coeff, 0)); |
712 animationOldSlide->setEndValue(QPoint(0, 0)); |
724 animationOldSlide->setEndValue(QPoint(0, 0)); |
713 animationOldSlide->setEasingCurve(QEasingCurve::OutExpo); |
725 animationOldSlide->setEasingCurve(QEasingCurve::OutExpo); |
714 |
726 |
715 #ifndef Q_OS_MAC |
727 #ifndef Q_OS_MAC |
716 animationOldOpacity = new QPropertyAnimation(effectLast, "opacity"); |
728 animationOldOpacity = new QPropertyAnimation(effectLast, "opacity"); |
717 animationOldOpacity->setDuration(500); |
729 animationOldOpacity->setDuration(duration); |
718 animationOldOpacity->setStartValue(1); |
730 animationOldOpacity->setStartValue(1); |
719 animationOldOpacity->setEndValue(0.01); |
731 animationOldOpacity->setEndValue(0.01); |
720 animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo); |
732 animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo); |
721 #endif |
733 #endif |
722 //New page animation |
734 //New page animation |
723 ui.Pages->widget(curid)->setHidden(false); |
735 ui.Pages->widget(curid)->setHidden(false); |
724 |
736 |
725 animationNewSlide = new QPropertyAnimation(ui.Pages->widget(curid), "pos"); |
737 animationNewSlide = new QPropertyAnimation(ui.Pages->widget(curid), "pos"); |
726 animationNewSlide->setDuration(500); |
738 animationNewSlide->setDuration(duration); |
727 animationNewSlide->setStartValue(QPoint(0, 0)); |
739 animationNewSlide->setStartValue(QPoint(0, 0)); |
728 animationNewSlide->setEndValue(QPoint(width()/coeff, 0)); |
740 animationNewSlide->setEndValue(QPoint(width()/coeff, 0)); |
729 animationNewSlide->setEasingCurve(QEasingCurve::OutExpo); |
741 animationNewSlide->setEasingCurve(QEasingCurve::OutExpo); |
730 |
742 |
731 #ifndef Q_OS_MAC |
743 #ifndef Q_OS_MAC |
732 animationNewOpacity = new QPropertyAnimation(effectNew, "opacity"); |
744 animationNewOpacity = new QPropertyAnimation(effectNew, "opacity"); |
733 animationNewOpacity->setDuration(500); |
745 animationNewOpacity->setDuration(duration); |
734 animationNewOpacity->setStartValue(0.01); |
746 animationNewOpacity->setStartValue(0.01); |
735 animationNewOpacity->setEndValue(1); |
747 animationNewOpacity->setEndValue(1); |
736 animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo); |
748 animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo); |
737 #endif |
749 #endif |
738 |
750 |