|
|
@ -273,6 +273,73 @@ void setOutGameFullScreen()
|
|
|
|
CViewRenderer::getInstance()->setInterfaceScale(1.0f, 1024, 768);
|
|
|
|
CViewRenderer::getInstance()->setInterfaceScale(1.0f, 1024, 768);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class CSoundGlobalMenu
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
CSoundGlobalMenu()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_MusicWantedAsync= false;
|
|
|
|
|
|
|
|
_NbFrameBeforeChange= NbFrameBeforeChangeMax;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
void setMusic(const string &music, bool async);
|
|
|
|
|
|
|
|
void updateSound();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
string _MusicPlayed;
|
|
|
|
|
|
|
|
string _MusicWanted;
|
|
|
|
|
|
|
|
bool _MusicWantedAsync;
|
|
|
|
|
|
|
|
sint _NbFrameBeforeChange;
|
|
|
|
|
|
|
|
enum {NbFrameBeforeChangeMax= 10};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CSoundGlobalMenu::reset()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_MusicPlayed.clear();
|
|
|
|
|
|
|
|
_MusicWanted.clear();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CSoundGlobalMenu::updateSound()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// **** update the music played
|
|
|
|
|
|
|
|
// The first music played is the music played at loading, before select char
|
|
|
|
|
|
|
|
if (_MusicPlayed.empty())
|
|
|
|
|
|
|
|
_MusicPlayed = toLower(LoadingMusic.empty() ? ClientCfg.StartMusic : LoadingMusic);
|
|
|
|
|
|
|
|
if (_MusicWanted.empty())
|
|
|
|
|
|
|
|
_MusicWanted = toLower(LoadingMusic.empty() ? ClientCfg.StartMusic : LoadingMusic);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// because music is changed when the player select other race for instance,
|
|
|
|
|
|
|
|
// wait the 3D to load (stall some secs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if the wanted music is the same as the one currently playing, just continue playing
|
|
|
|
|
|
|
|
if(_MusicPlayed!=_MusicWanted)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// wait nbFrameBeforeChangeMax before actually changing the music
|
|
|
|
|
|
|
|
_NbFrameBeforeChange--;
|
|
|
|
|
|
|
|
if(_NbFrameBeforeChange<=0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_MusicPlayed= _MusicWanted;
|
|
|
|
|
|
|
|
// play the music
|
|
|
|
|
|
|
|
if (SoundMngr != NULL)
|
|
|
|
|
|
|
|
SoundMngr->playMusic(_MusicPlayed, 500, _MusicWantedAsync, true, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// **** update mngr
|
|
|
|
|
|
|
|
if (SoundMngr != NULL)
|
|
|
|
|
|
|
|
SoundMngr->update();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CSoundGlobalMenu::setMusic(const string &music, bool async)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_MusicWanted= toLower(music);
|
|
|
|
|
|
|
|
_MusicWantedAsync= async;
|
|
|
|
|
|
|
|
// reset the counter
|
|
|
|
|
|
|
|
_NbFrameBeforeChange= NbFrameBeforeChangeMax;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static CSoundGlobalMenu SoundGlobalMenu;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// New version of the menu after the server connection
|
|
|
|
// New version of the menu after the server connection
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -405,6 +472,8 @@ bool connection (const string &cookie, const string &fsaddr)
|
|
|
|
InterfaceState = GLOBAL_MENU;
|
|
|
|
InterfaceState = GLOBAL_MENU;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// No loading music here, this is right before character selection, using the existing music
|
|
|
|
|
|
|
|
|
|
|
|
// Create the loading texture. We can't do that before because we need to add search path first.
|
|
|
|
// Create the loading texture. We can't do that before because we need to add search path first.
|
|
|
|
beginLoading (LoadBackground);
|
|
|
|
beginLoading (LoadBackground);
|
|
|
|
UseEscapeDuringLoading = USE_ESCAPE_DURING_LOADING;
|
|
|
|
UseEscapeDuringLoading = USE_ESCAPE_DURING_LOADING;
|
|
|
@ -507,6 +576,7 @@ bool reconnection()
|
|
|
|
ProgressBar.setFontFactor(1.0f);
|
|
|
|
ProgressBar.setFontFactor(1.0f);
|
|
|
|
|
|
|
|
|
|
|
|
// Init out game
|
|
|
|
// Init out game
|
|
|
|
|
|
|
|
SoundGlobalMenu.reset();
|
|
|
|
pIM->initOutGame();
|
|
|
|
pIM->initOutGame();
|
|
|
|
|
|
|
|
|
|
|
|
// Hide cursor for interface
|
|
|
|
// Hide cursor for interface
|
|
|
@ -522,6 +592,9 @@ bool reconnection()
|
|
|
|
|
|
|
|
|
|
|
|
FarTP.setOutgame();
|
|
|
|
FarTP.setOutgame();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (SoundMngr)
|
|
|
|
|
|
|
|
SoundMngr->setupFadeSound(1.0f, 1.0f);
|
|
|
|
|
|
|
|
|
|
|
|
// these two globals sequence GlobalMenu to display the character select dialog
|
|
|
|
// these two globals sequence GlobalMenu to display the character select dialog
|
|
|
|
WaitServerAnswer = true;
|
|
|
|
WaitServerAnswer = true;
|
|
|
|
userChar = true;
|
|
|
|
userChar = true;
|
|
|
@ -556,6 +629,8 @@ bool reconnection()
|
|
|
|
// this also kicks the state machine to sendReady() so we stop spinning in farTPmainLoop
|
|
|
|
// this also kicks the state machine to sendReady() so we stop spinning in farTPmainLoop
|
|
|
|
FarTP.setIngame();
|
|
|
|
FarTP.setIngame();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Not loading music here, this is before character selection, keep existing music
|
|
|
|
|
|
|
|
|
|
|
|
// Create the loading texture. We can't do that before because we need to add search path first.
|
|
|
|
// Create the loading texture. We can't do that before because we need to add search path first.
|
|
|
|
beginLoading (LoadBackground);
|
|
|
|
beginLoading (LoadBackground);
|
|
|
|
UseEscapeDuringLoading = USE_ESCAPE_DURING_LOADING;
|
|
|
|
UseEscapeDuringLoading = USE_ESCAPE_DURING_LOADING;
|
|
|
@ -731,66 +806,6 @@ std::string buildPlayerNameForSaveFile(const ucstring &playerNameIn)
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class CSoundGlobalMenu
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
CSoundGlobalMenu()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_MusicWantedAsync= false;
|
|
|
|
|
|
|
|
_NbFrameBeforeChange= NbFrameBeforeChangeMax;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void setMusic(const string &music, bool async);
|
|
|
|
|
|
|
|
void updateSound();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
string _MusicPlayed;
|
|
|
|
|
|
|
|
string _MusicWanted;
|
|
|
|
|
|
|
|
bool _MusicWantedAsync;
|
|
|
|
|
|
|
|
sint _NbFrameBeforeChange;
|
|
|
|
|
|
|
|
enum {NbFrameBeforeChangeMax= 10};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CSoundGlobalMenu::updateSound()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// **** update the music played
|
|
|
|
|
|
|
|
// The first music played is the music played at loading, before select char
|
|
|
|
|
|
|
|
if(_MusicPlayed.empty())
|
|
|
|
|
|
|
|
_MusicPlayed= toLower(ClientCfg.SoundOutGameMusic);
|
|
|
|
|
|
|
|
if(_MusicWanted.empty())
|
|
|
|
|
|
|
|
_MusicWanted= toLower(ClientCfg.SoundOutGameMusic);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// because music is changed when the player select other race for instance,
|
|
|
|
|
|
|
|
// wait the 3D to load (stall some secs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if the wanted music is the same as the one currently playing, just continue playing
|
|
|
|
|
|
|
|
if(_MusicPlayed!=_MusicWanted)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// wait nbFrameBeforeChangeMax before actually changing the music
|
|
|
|
|
|
|
|
_NbFrameBeforeChange--;
|
|
|
|
|
|
|
|
if(_NbFrameBeforeChange<=0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_MusicPlayed= _MusicWanted;
|
|
|
|
|
|
|
|
// play the music
|
|
|
|
|
|
|
|
if (SoundMngr != NULL)
|
|
|
|
|
|
|
|
SoundMngr->playMusic(_MusicPlayed, 500, _MusicWantedAsync, true, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// **** update mngr
|
|
|
|
|
|
|
|
if (SoundMngr != NULL)
|
|
|
|
|
|
|
|
SoundMngr->update();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CSoundGlobalMenu::setMusic(const string &music, bool async)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_MusicWanted= toLower(music);
|
|
|
|
|
|
|
|
_MusicWantedAsync= async;
|
|
|
|
|
|
|
|
// reset the counter
|
|
|
|
|
|
|
|
_NbFrameBeforeChange= NbFrameBeforeChangeMax;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static CSoundGlobalMenu SoundGlobalMenu;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static bool LuaBGDSuccessFlag = true; // tmp, for debug
|
|
|
|
static bool LuaBGDSuccessFlag = true; // tmp, for debug
|
|
|
|
|
|
|
|
|
|
|
@ -2041,8 +2056,8 @@ public:
|
|
|
|
fromString(getParam(Params, "async"), async);
|
|
|
|
fromString(getParam(Params, "async"), async);
|
|
|
|
|
|
|
|
|
|
|
|
// if empty name, return to default mode
|
|
|
|
// if empty name, return to default mode
|
|
|
|
if(sName.empty())
|
|
|
|
if (sName.empty())
|
|
|
|
sName= ClientCfg.SoundOutGameMusic;
|
|
|
|
sName = ClientCfg.TeleportLoadingMusic;
|
|
|
|
|
|
|
|
|
|
|
|
// change the music
|
|
|
|
// change the music
|
|
|
|
SoundGlobalMenu.setMusic(sName, async);
|
|
|
|
SoundGlobalMenu.setMusic(sName, async);
|
|
|
|