mirror of
https://github.com/glest/glest-source.git
synced 2025-02-25 12:12:25 +01:00
sound is no more switched on when switching factions ( not a 100% fix but I think good enough )
This commit is contained in:
parent
de0362e8d8
commit
e311c439f6
@ -65,6 +65,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
|
||||
soundConnectionCount=0;
|
||||
|
||||
this->factionVideo = NULL;
|
||||
factionVideoSwitchedOffVolume=false;
|
||||
currentTechName_factionPreview="";
|
||||
currentFactionName_factionPreview="";
|
||||
|
||||
@ -3723,6 +3724,7 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
|
||||
SoundRenderer &soundRenderer= SoundRenderer::getInstance();
|
||||
if(CoreData::getInstance().getMenuMusic()->getVolume() != 0) {
|
||||
CoreData::getInstance().getMenuMusic()->setVolume(0);
|
||||
factionVideoSwitchedOffVolume=true;
|
||||
}
|
||||
|
||||
if(currentFactionLogo != factionVideoUrl) {
|
||||
@ -3763,8 +3765,11 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
|
||||
//switch on music again!!
|
||||
Config &config = Config::getInstance();
|
||||
float configVolume = (config.getInt("SoundVolumeMusic") / 100.f);
|
||||
if(CoreData::getInstance().getMenuMusic()->getVolume() != configVolume) {
|
||||
CoreData::getInstance().getMenuMusic()->setVolume(configVolume);
|
||||
if(factionVideoSwitchedOffVolume){
|
||||
if(CoreData::getInstance().getMenuMusic()->getVolume() != configVolume) {
|
||||
CoreData::getInstance().getMenuMusic()->setVolume(configVolume);
|
||||
}
|
||||
factionVideoSwitchedOffVolume=false;
|
||||
}
|
||||
|
||||
if(factionVideo != NULL) {
|
||||
|
@ -132,6 +132,7 @@ private:
|
||||
string currentFactionLogo;
|
||||
Texture2D *factionTexture;
|
||||
Shared::Graphics::VideoPlayer *factionVideo;
|
||||
bool factionVideoSwitchedOffVolume;
|
||||
|
||||
MapPreview mapPreview;
|
||||
|
||||
|
@ -69,6 +69,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
|
||||
this->masterserverModeMinimalResources = true;
|
||||
this->parentMenuState=parentMenuState;
|
||||
this->factionVideo = NULL;
|
||||
factionVideoSwitchedOffVolume=false;
|
||||
|
||||
//printf("this->masterserverMode = %d [%d]\n",this->masterserverMode,masterserverMode);
|
||||
|
||||
@ -2571,6 +2572,7 @@ void MenuStateCustomGame::update() {
|
||||
SoundRenderer &soundRenderer= SoundRenderer::getInstance();
|
||||
if(CoreData::getInstance().getMenuMusic()->getVolume() != 0) {
|
||||
CoreData::getInstance().getMenuMusic()->setVolume(0);
|
||||
factionVideoSwitchedOffVolume=true;
|
||||
}
|
||||
|
||||
if(currentFactionLogo != factionVideoUrl) {
|
||||
@ -2611,8 +2613,11 @@ void MenuStateCustomGame::update() {
|
||||
//switch on music again!!
|
||||
Config &config = Config::getInstance();
|
||||
float configVolume = (config.getInt("SoundVolumeMusic") / 100.f);
|
||||
if(CoreData::getInstance().getMenuMusic()->getVolume() != configVolume) {
|
||||
CoreData::getInstance().getMenuMusic()->setVolume(configVolume);
|
||||
if(factionVideoSwitchedOffVolume){
|
||||
if(CoreData::getInstance().getMenuMusic()->getVolume() != configVolume) {
|
||||
CoreData::getInstance().getMenuMusic()->setVolume(configVolume);
|
||||
}
|
||||
factionVideoSwitchedOffVolume=false;
|
||||
}
|
||||
|
||||
if(factionVideo != NULL) {
|
||||
|
@ -173,6 +173,7 @@ private:
|
||||
string currentFactionLogo;
|
||||
Texture2D *factionTexture;
|
||||
Shared::Graphics::VideoPlayer *factionVideo;
|
||||
bool factionVideoSwitchedOffVolume;
|
||||
|
||||
MapPreview mapPreview;
|
||||
Texture2D *mapPreviewTexture;
|
||||
|
@ -1663,7 +1663,6 @@ void World::initUnits() {
|
||||
// }
|
||||
// }
|
||||
placeUnitAtLocation(map.getStartLocation(startLocationIndex), generationArea, unit, true);
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] unit created for unit [%s]\n",__FILE__,__FUNCTION__,__LINE__,unit->toString().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user