Jump to content

PM in chat (with source)


Recommended Posts


 

Hi, here is a good tutorial for PM chatting.

 

interfaceModule.py

 

search:

 

def MakeHyperlinkTooltip(self, hyperlink):

 

replace with:

 

	def MakeHyperlinkTooltip(self, hyperlink):
		tokens = hyperlink.split(":")
		if tokens and len(tokens):
			type = tokens[0]
			if "item" == type:
				self.hyperlinkItemTooltip.SetHyperlinkItem(tokens)
			elif "link" == type:
				if tokens[1][:4] == "www.":
					webbrowser.open_new(tokens[1])
				elif tokens[1] == "http" or tokens[1] == "https":
					webbrowser.open_new(tokens[1]+":"+tokens[2])
			elif "Chitra" == type or "msg" == type and str(tokens[1]) != player.GetMainCharacterName():
				self.OpenWhisperDialog(str(tokens[1]))				

 

constInfo.py

 

add:

 

Chitra = ''

 

uichat.py

 

search:

 

def __SendShoutChatPacket(self, text):

 

replace with:

 

	def __SendShoutChatPacket(self, text):

		if 1 == len(text):
			self.RunCloseEvent()
			return

		if app.GetTime() < self.lastShoutTime + 10:
			chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_SHOUT_LIMIT)
			self.__ResetChat()
			return

		self.__SendChatPacket(constInfo.Chitra+'|cFF0080FF|HChitra:'+str(player.GetName())+'|h[PM]|h|r' + text[1:], chat.CHAT_TYPE_SHOUT)
		self.__ResetChat()
		self.lastShoutTime = app.GetTime()

 

Hope it is useful.

 


 

  • Metin2 Dev 1
  • Confused 1
  • Good 1
  • Love 2
Link to comment
Share on other sites

On 10/17/2019 at 2:03 AM, Nezuko said:


 

Hi, here is a good tutorial for PM chatting.

 

interfaceModule.py

 

search:

 


def MakeHyperlinkTooltip(self, hyperlink):

 

replace with:

 


	def MakeHyperlinkTooltip(self, hyperlink):
		tokens = hyperlink.split(":")
		if tokens and len(tokens):
			type = tokens[0]
			if "item" == type:
				self.hyperlinkItemTooltip.SetHyperlinkItem(tokens)
			elif "link" == type:
				if tokens[1][:4] == "www.":
					webbrowser.open_new(tokens[1])
				elif tokens[1] == "http" or tokens[1] == "https":
					webbrowser.open_new(tokens[1]+":"+tokens[2])
			elif "Chitra" == type or "msg" == type and str(tokens[1]) != player.GetMainCharacterName():
				self.OpenWhisperDialog(str(tokens[1]))				

 

constInfo.py

 

add:

 


Chitra = ''

 

uichat.py

 

search:

 


def __SendShoutChatPacket(self, text):

 

replace with:

 


	def __SendShoutChatPacket(self, text):

		if 1 == len(text):
			self.RunCloseEvent()
			return

		if app.GetTime() < self.lastShoutTime + 10:
			chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_SHOUT_LIMIT)
			self.__ResetChat()
			return

		self.__SendChatPacket(constInfo.Chitra+'|cFF0080FF|HChitra:'+str(player.GetName())+'|h[PM]|h|r' + text[1:], chat.CHAT_TYPE_SHOUT)
		self.__ResetChat()
		self.lastShoutTime = app.GetTime()

 

Hope it is useful.

 



 

in the source, not in the python.

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.