- disable main menu background video playback when showing faction preview video
This commit is contained in:
parent
c629fae830
commit
90b0d96b5d
|
@ -1869,7 +1869,7 @@ void runTechValidationForPath(string techPath, string techName,
|
||||||
printf("\nWarning, duplicate files were detected - START:\n=====================\n");
|
printf("\nWarning, duplicate files were detected - START:\n=====================\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("----- START duplicate files for CRC [%d] count [%d] first file is [%s]\n",iterMap->first,fileList.size(),fileList[0].c_str());
|
printf("----- START duplicate files for CRC [%d] count [%lu] first file is [%s]\n",iterMap->first,fileList.size(),fileList[0].c_str());
|
||||||
|
|
||||||
map<string,int> parentList;
|
map<string,int> parentList;
|
||||||
for(unsigned int idx = 0; idx < fileList.size(); ++idx) {
|
for(unsigned int idx = 0; idx < fileList.size(); ++idx) {
|
||||||
|
@ -1909,7 +1909,7 @@ void runTechValidationForPath(string techPath, string techName,
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("----- Finding parents for duplicate files [%d] first file is [%s]\n",fileList.size(),fileList[0].c_str());
|
printf("----- Finding parents for duplicate files [%lu] first file is [%s]\n",fileList.size(),fileList[0].c_str());
|
||||||
|
|
||||||
for(map<string,int>::iterator iterMap1 = parentList.begin();
|
for(map<string,int>::iterator iterMap1 = parentList.begin();
|
||||||
iterMap1 != parentList.end(); ++iterMap1) {
|
iterMap1 != parentList.end(); ++iterMap1) {
|
||||||
|
@ -1923,7 +1923,7 @@ void runTechValidationForPath(string techPath, string techName,
|
||||||
if(purgeDuplicateFiles == true) {
|
if(purgeDuplicateFiles == true) {
|
||||||
//printf("\nPurge Duplicate Files detected - START:\n=====================\n");
|
//printf("\nPurge Duplicate Files detected - START:\n=====================\n");
|
||||||
|
|
||||||
printf("----- move / remove duplicate files [%d] first file is [%s]\n",fileList.size(),fileList[0].c_str());
|
printf("----- move / remove duplicate files [%lu] first file is [%s]\n",fileList.size(),fileList[0].c_str());
|
||||||
// First move first duplicate to commondata and delete all other copies
|
// First move first duplicate to commondata and delete all other copies
|
||||||
string newCommonFileName = "";
|
string newCommonFileName = "";
|
||||||
for(unsigned int idx = 0; idx < fileList.size(); ++idx) {
|
for(unsigned int idx = 0; idx < fileList.size(); ++idx) {
|
||||||
|
@ -1932,7 +1932,7 @@ void runTechValidationForPath(string techPath, string techName,
|
||||||
if(fileExt == "wav" || fileExt == "ogg") {
|
if(fileExt == "wav" || fileExt == "ogg") {
|
||||||
off_t fileSize = getFileSize(duplicateFile);
|
off_t fileSize = getFileSize(duplicateFile);
|
||||||
|
|
||||||
printf("#1 [%d / %d] removing duplicate [%s]\n",idx,fileList.size(),duplicateFile.c_str());
|
printf("#1 [%d / %lu] removing duplicate [%s]\n",idx,fileList.size(),duplicateFile.c_str());
|
||||||
|
|
||||||
if(idx == 0) {
|
if(idx == 0) {
|
||||||
newCommonFileName = "$COMMONDATAPATH/sounds/" + extractFileFromDirectoryPath(duplicateFile);
|
newCommonFileName = "$COMMONDATAPATH/sounds/" + extractFileFromDirectoryPath(duplicateFile);
|
||||||
|
@ -2000,7 +2000,7 @@ void runTechValidationForPath(string techPath, string techName,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("----- update XML files fpr duplicate files [%d] first file is [%s]\n",fileList.size(),fileList[0].c_str());
|
printf("----- update XML files for duplicate files [%lu] first file is [%s]\n",fileList.size(),fileList[0].c_str());
|
||||||
std::map<string,int> mapUniqueParentList;
|
std::map<string,int> mapUniqueParentList;
|
||||||
|
|
||||||
// Update the XML files to point to the new single copy in commondata
|
// Update the XML files to point to the new single copy in commondata
|
||||||
|
@ -2122,7 +2122,7 @@ void runTechValidationForPath(string techPath, string techName,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
printf("----- END duplicate files [%d] first file is [%s]\n",fileList.size(),fileList[0].c_str());
|
printf("----- END duplicate files [%lu] first file is [%s]\n",fileList.size(),fileList[0].c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(foundDuplicates == true) {
|
if(foundDuplicates == true) {
|
||||||
|
|
|
@ -103,6 +103,10 @@ MainMenu::~MainMenu() {
|
||||||
void MainMenu::init() {
|
void MainMenu::init() {
|
||||||
Renderer::getInstance().initMenu(this);
|
Renderer::getInstance().initMenu(this);
|
||||||
|
|
||||||
|
initBackgroundVideo();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainMenu::initBackgroundVideo() {
|
||||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
||||||
Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true &&
|
Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true &&
|
||||||
CoreData::getInstance().hasMainMenuVideoFilename() == true) {
|
CoreData::getInstance().hasMainMenuVideoFilename() == true) {
|
||||||
|
@ -138,6 +142,19 @@ void MainMenu::render() {
|
||||||
|
|
||||||
if(state->isMasterserverMode() == false) {
|
if(state->isMasterserverMode() == false) {
|
||||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
|
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
|
||||||
|
|
||||||
|
if(state->isVideoPlaying() == true) {
|
||||||
|
if(menuBackgroundVideo != NULL) {
|
||||||
|
if(menuBackgroundVideo->isPlaying() == true) {
|
||||||
|
menuBackgroundVideo->closePlayer();
|
||||||
|
delete menuBackgroundVideo;
|
||||||
|
menuBackgroundVideo = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(menuBackgroundVideo == NULL) {
|
||||||
|
initBackgroundVideo();
|
||||||
|
}
|
||||||
renderer.clearBuffers();
|
renderer.clearBuffers();
|
||||||
|
|
||||||
//3d
|
//3d
|
||||||
|
|
|
@ -59,6 +59,8 @@ private:
|
||||||
int mouseX, mouseY;
|
int mouseX, mouseY;
|
||||||
int mouse2dAnim;
|
int mouse2dAnim;
|
||||||
|
|
||||||
|
void initBackgroundVideo();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MainMenu(Program *program);
|
MainMenu(Program *program);
|
||||||
~MainMenu();
|
~MainMenu();
|
||||||
|
@ -118,6 +120,8 @@ public:
|
||||||
virtual bool isInSpecialKeyCaptureEvent() { return false; }
|
virtual bool isInSpecialKeyCaptureEvent() { return false; }
|
||||||
virtual void consoleAddLine(string line);
|
virtual void consoleAddLine(string line);
|
||||||
virtual void reloadUI();
|
virtual void reloadUI();
|
||||||
|
|
||||||
|
virtual bool isVideoPlaying() { return false; };
|
||||||
};
|
};
|
||||||
|
|
||||||
}}//end namespace
|
}}//end namespace
|
||||||
|
|
|
@ -1667,6 +1667,14 @@ void MenuStateConnectedGame::mouseMove(int x, int y, const MouseState *ms) {
|
||||||
buttonRestoreLastSettings.mouseMove(x, y);
|
buttonRestoreLastSettings.mouseMove(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MenuStateConnectedGame::isVideoPlaying() {
|
||||||
|
bool result = false;
|
||||||
|
if(factionVideo != NULL) {
|
||||||
|
result = factionVideo->isPlaying();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
void MenuStateConnectedGame::render() {
|
void MenuStateConnectedGame::render() {
|
||||||
try {
|
try {
|
||||||
Renderer &renderer= Renderer::getInstance();
|
Renderer &renderer= Renderer::getInstance();
|
||||||
|
|
|
@ -214,6 +214,8 @@ public:
|
||||||
|
|
||||||
virtual void reloadUI();
|
virtual void reloadUI();
|
||||||
|
|
||||||
|
virtual bool isVideoPlaying();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool hasNetworkGameSettings();
|
bool hasNetworkGameSettings();
|
||||||
|
|
|
@ -1736,6 +1736,14 @@ bool MenuStateCustomGame::isMasterserverMode() const {
|
||||||
//return false;
|
//return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MenuStateCustomGame::isVideoPlaying() {
|
||||||
|
bool result = false;
|
||||||
|
if(factionVideo != NULL) {
|
||||||
|
result = factionVideo->isPlaying();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
void MenuStateCustomGame::render() {
|
void MenuStateCustomGame::render() {
|
||||||
try {
|
try {
|
||||||
Renderer &renderer= Renderer::getInstance();
|
Renderer &renderer= Renderer::getInstance();
|
||||||
|
|
|
@ -223,6 +223,7 @@ public:
|
||||||
virtual bool isInSpecialKeyCaptureEvent();
|
virtual bool isInSpecialKeyCaptureEvent();
|
||||||
virtual bool isMasterserverMode() const;
|
virtual bool isMasterserverMode() const;
|
||||||
|
|
||||||
|
virtual bool isVideoPlaying();
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool hasNetworkGameSettings();
|
bool hasNetworkGameSettings();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user