Index: binaries/data/mods/public/gui/lobby/lobby.js =================================================================== --- binaries/data/mods/public/gui/lobby/lobby.js +++ binaries/data/mods/public/gui/lobby/lobby.js @@ -1279,7 +1279,10 @@ msg.text = msg.text.replace(g_Username, colorPlayerName(g_Username)); if (!msg.historic && msg.text.toLowerCase().indexOf(g_Username.toLowerCase()) != -1) + { soundNotification("nick"); + Engine.RaiseWindow(); + } } } Index: source/gui/scripting/JSInterface_GUIManager.h =================================================================== --- source/gui/scripting/JSInterface_GUIManager.h +++ source/gui/scripting/JSInterface_GUIManager.h @@ -30,6 +30,7 @@ JS::Value GetGUIObjectByName(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name); std::wstring SetCursor(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& name); void ResetCursor(ScriptInterface::CxPrivate* pCxPrivate); + void RaiseWindow(ScriptInterface::CxPrivate* pCxPrivate); bool TemplateExists(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); CParamNode GetTemplate(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); Index: source/gui/scripting/JSInterface_GUIManager.cpp =================================================================== --- source/gui/scripting/JSInterface_GUIManager.cpp +++ source/gui/scripting/JSInterface_GUIManager.cpp @@ -67,6 +67,11 @@ g_GUI->ResetCursor(); } +void JSI_GUIManager::RaiseWindow(ScriptInterface::CxPrivate* UNUSED(pCxPrivate)) +{ + g_VideoMode.RaiseWindow(); +} + bool JSI_GUIManager::TemplateExists(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& templateName) { return g_GUI->TemplateExists(templateName); @@ -86,6 +91,7 @@ scriptInterface.RegisterFunction("GetGUIObjectByName"); scriptInterface.RegisterFunction("SetCursor"); scriptInterface.RegisterFunction("ResetCursor"); + scriptInterface.RegisterFunction("RaiseWindow"); scriptInterface.RegisterFunction("TemplateExists"); scriptInterface.RegisterFunction("GetTemplate"); } Index: source/ps/VideoMode.h =================================================================== --- source/ps/VideoMode.h +++ source/ps/VideoMode.h @@ -81,6 +81,7 @@ SDL_Window* GetWindow(); void SetWindowIcon(); + void RaiseWindow(); private: void ReadConfig(); Index: source/ps/VideoMode.cpp =================================================================== --- source/ps/VideoMode.cpp +++ source/ps/VideoMode.cpp @@ -525,3 +525,8 @@ SDL_SetWindowIcon(m_Window, iconSurface); SDL_FreeSurface(iconSurface); } + +void CVideoMode::RaiseWindow() +{ + SDL_RaiseWindow(m_Window); +}