1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-05 00:49:09 +02:00

use video player for spellbook animation

This commit is contained in:
Laserlicht
2024-11-29 21:58:20 +01:00
parent 7fdddee503
commit 8808c9538c
6 changed files with 16 additions and 73 deletions

View File

@ -30,6 +30,7 @@
#include "../widgets/CTextInput.h"
#include "../widgets/TextControls.h"
#include "../widgets/Buttons.h"
#include "../widgets/VideoWidget.h"
#include "../adventureMap/AdventureMapInterface.h"
#include "../render/AssetGenerator.h"
@ -395,6 +396,8 @@ void CSpellWindow::fRcornerb()
void CSpellWindow::show(Canvas & to)
{
if(video)
video->show(to);
statusBar->show(to);
}
@ -493,14 +496,22 @@ void CSpellWindow::setCurrentPage(int value)
void CSpellWindow::turnPageLeft()
{
OBJECT_CONSTRUCTION;
if(settings["video"]["spellbookAnimation"].Bool() && !isBigSpellbook)
CCS->videoh->playSpellbookAnimation(VideoPath::builtin("PGTRNLFT.SMK"), pos.topLeft() + Point(13, 14));
video = std::make_shared<VideoWidgetOnce>(Point(13, 14), VideoPath::builtin("PGTRNLFT.SMK"), false, [this](){
video.reset();
redraw();
});
}
void CSpellWindow::turnPageRight()
{
OBJECT_CONSTRUCTION;
if(settings["video"]["spellbookAnimation"].Bool() && !isBigSpellbook)
CCS->videoh->playSpellbookAnimation(VideoPath::builtin("PGTRNRGH.SMK"), pos.topLeft() + Point(13, 14));
video = std::make_shared<VideoWidgetOnce>(Point(13, 14), VideoPath::builtin("PGTRNRGH.SMK"), false, [this](){
video.reset();
redraw();
});
}
void CSpellWindow::keyPressed(EShortcut key)