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 @@ -1275,7 +1275,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 @@ -23,6 +23,7 @@ #include "gui/IGUIObject.h" #include "scriptinterface/ScriptInterface.h" #include "ps/GameSetup/Config.h" +#include "ps/VideoMode.h" // Note that the initData argument may only contain clonable data. // Functions aren't supported for example! @@ -67,6 +68,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 +92,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,21 @@ SDL_SetWindowIcon(m_Window, iconSurface); SDL_FreeSurface(iconSurface); } + +void CVideoMode::RaiseWindow() +{ +#ifdef __WXMSW__ + SDL_SysWMinfo systemInfo; SDL_VERSION(&systemInfo.version); + SDL_GetWindowWMInfo(m_Window, &systemInfo); + + FLASHWINFO flash; + flash.cbSize = sizeof(FLASHWINFO); + flash.hwnd = systemInfo.info.win.window; + flash.dwFlags = FLASHW_TIMERNOFG; + flash.uCount = 1; + flash.dwTimeout = 500; + FlashWindowEx(&flash); +#else + SDL_RaiseWindow(m_Window); +#endif +}