Jump to content
metin2dev
Metin2International
Sign in to follow this  
Abel(Tiger)

[C++] Blink/Alert in Taskbar

Recommended Posts

What is this ? :

"When a player sends you a message icon taskbar starts flashing."

https://www.youtube.com/watch?v=s2LkFrfrrhk

[File: Client/root/InterfaceModule.py]

//1.) Search:  2x

btn.Flash() #in function def RecvWhisper(self, name):

//2.) Add bellow:

app.FlashApplication()

[File: Source/src/Client/UserInterface/PythonApplication.cpp]

//1.) Search:

void CPythonApplication::Clear()
{
	m_pySystem.Clear();
}

//2.) Add bellow:

#include <Windows.h>
void CPythonApplication::FlashApplication()
{
	HWND hWnd = GetWindowHandle();
	FLASHWINFO fi;
	fi.cbSize = sizeof(FLASHWINFO);
	fi.hwnd = hWnd;
	fi.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
	fi.uCount = 0;
	fi.dwTimeout = 0;
	FlashWindowEx(&fi);
}

[File: Source/src/Client/UserInterface/PythonApplication.h]

 

//1.) Search:

void SetForceSightRange(int iRange);

//2.) Add bellow:

void FlashApplication();

[File: Source/src/Client/UserInterface/PythonApplicationModule.cpp]

 

//1.) Search:

PyObject* appLogoClose(PyObject* poSelf, PyObject* poArgs)
{
	//CPythonApplication::Instance().OnLogoClose();
	return Py_BuildNone();
}

//2.) Add bellow:

PyObject* appFlashApplication(PyObject* poSelf, PyObject* poArgs)
{
	CPythonApplication::Instance().FlashApplication();
	return Py_BuildNone();
}

//3.) Search:

{ "OnLogoClose",				appLogoClose,					METH_VARARGS },

//4.) Add bellow:

{ "FlashApplication",			appFlashApplication,			METH_VARARGS },

 

  • Like 16
  • Thanks 1

Share this post


Link to post
Share on other sites

When I saw it I said LOL! :mellow:

	if (CPythonChat::WHISPER_TYPE_CHAT == whisperPacket.bType || CPythonChat::WHISPER_TYPE_GM == whisperPacket.bType)
	{
#ifdef ENABLE_WHISPER_FLASHING
		FLASHWINFO flashInfo;
		flashInfo.cbSize = sizeof(flashInfo);
		flashInfo.hwnd = CPythonApplication::Instance().GetWindowHandle();
		flashInfo.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
		flashInfo.uCount = 0;
		flashInfo.dwTimeout = 0;
		FlashWindowEx(&flashInfo);
#endif
		_snprintf(line, sizeof(line), "%s : %s", whisperPacket.szNameFrom, buf);
		PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnRecvWhisper", Py_BuildValue("(iss)", (int) whisperPacket.bType, whisperPacket.szNameFrom, line));
	}

10€ for nothing xD

  • Like 2

Share this post


Link to post
Share on other sites
27 minutes ago, xP3NG3Rx said:

When I saw it I said LOL! :mellow:


	if (CPythonChat::WHISPER_TYPE_CHAT == whisperPacket.bType || CPythonChat::WHISPER_TYPE_GM == whisperPacket.bType)
	{
#ifdef ENABLE_WHISPER_FLASHING
		FLASHWINFO flashInfo;
		flashInfo.cbSize = sizeof(flashInfo);
		flashInfo.hwnd = CPythonApplication::Instance().GetWindowHandle();
		flashInfo.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
		flashInfo.uCount = 0;
		flashInfo.dwTimeout = 0;
		FlashWindowEx(&flashInfo);
#endif
		_snprintf(line, sizeof(line), "%s : %s", whisperPacket.szNameFrom, buf);
		PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnRecvWhisper", Py_BuildValue("(iss)", (int) whisperPacket.bType, whisperPacket.szNameFrom, line));
	}

10€ for nothing xD

With module you can use in another scope . For example put app.FlashApplication() in game.py (in def Open(self)) and if you dead and restart in city with client minimized this help you :)) or can put in switchbot when this finish(more servers use switchboot).

Who want just for whishper can use xP3NG3Rx version .It is better.

Share this post


Link to post
Share on other sites

True, but I not prefer switchbot, or something to use the flashing by other states, this is the reason why I did like this way.

  • Like 1

Share this post


Link to post
Share on other sites

it works like a charm ! but one little problem have the system when i write a second message to my secondary character and the whisper is already open he does not blink again when i write the second message to her. any solution for that ?

  • Like 1

Share this post


Link to post
Share on other sites

The blinking method has been called when the whisper dialog is closed or minimized, I think you have to implement a new function like a kind of "seen" stuff, when a message arrives it starts to blinking and when you click on the dialog it stops. It sucks when you already "in" the board, because if a message arrives it would start to blink and you have to click out and click in again to stop it. Btw there is the "OnTop" function for to begin.

I know it isn't impossible but these things are too little to take it too serious :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×