1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Use ResourcePath for audio files

This commit is contained in:
Ivan Savenko
2023-09-04 13:03:15 +03:00
parent 97b7d44c88
commit 8dfdfffd87
59 changed files with 195 additions and 192 deletions

View File

@@ -75,7 +75,7 @@ CCampaignScreen::CCampaignScreen(const JsonNode & config)
void CCampaignScreen::activate()
{
CCS->musich->playMusic("Music/MainMenu", true, false);
CCS->musich->playMusic(AudioPath::builtin("Music/MainMenu"), true, false);
CWindowObject::activate();
}
@@ -129,12 +129,12 @@ void CCampaignScreen::CCampaignButton::show(Canvas & to)
// Play the campaign button video when the mouse cursor is placed over the button
if(isHovered())
{
if(CCS->videoh->fname != video)
if(CCS->videoh->fname != video.addPrefix("VIDEO/"))
CCS->videoh->open(video);
CCS->videoh->update(pos.x, pos.y, to.getInternalSurface(), true, false); // plays sequentially frame by frame, starts at the beginning when the video is over
}
else if(CCS->videoh->fname == video) // When you got out of the bounds of the button then close the video
else if(CCS->videoh->fname == video.addPrefix("VIDEO/")) // When you got out of the bounds of the button then close the video
{
CCS->videoh->close();
redraw();