Jump to content
  • 0

How can I change "PM" in shout?


ReFresh

Question

17 answers to this question

Recommended Posts

  • 0
  • Silver
1 hour ago, Aerrow said:

Search for "[PM]" in uichat.py, if not there search in the source (mainly in the server source).

The click function intrested me too.

Here is it:
 

def __SendShoutChatPacket(self, text):

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

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

        a = net.GetServerInfo()
        Metin2 = a[-3:]
        if not self.Mapy():
            self.__SendChatPacket(constInfo.Metin2 +'|cFFFFFF00|HMetin2:' + str(player.GetName()) + '|h[PM]|h|r ' + ': ' + text[1:], chat.CHAT_TYPE_SHOUT)    
            self.__ResetChat()
            self.lastShoutTime = app.GetTime()

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • 0

If you want to use the original, change like this:

 

	def __SendShoutChatPacket(self, text):

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

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

		self.__SendChatPacket(text[1:], chat.CHAT_TYPE_SHOUT)
		self.__ResetChat()

		self.lastShoutTime = app.GetTime()

 

 

Link to comment
Share on other sites

  • 0
  • Silver
1 hour ago, Aerrow said:

If you want to use the original, change like this:

 

	def __SendShoutChatPacket(self, text):

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

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

		self.__SendChatPacket(text[1:], chat.CHAT_TYPE_SHOUT)
		self.__ResetChat()

		self.lastShoutTime = app.GetTime()

 

 

I don't want the original. I want replace the "PM" with this: When I click on the name somebody in shout, chat whisper will open. 

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • 0
  • Developer

If you search further, you'll see that this was made by Sanchez a few time ago:

 

Quote

Maybe someone interested, here it is for the source:

Open game/input_main.cpp and search for this:

 

int len = snprintf(chatbuf, sizeof(chatbuf), "%s : %s", ch->GetName(), buf);

 

Replace with this:

	int len;
	if (pinfo->type == CHAT_TYPE_SHOUT)
	{
		len = snprintf(chatbuf, sizeof(chatbuf), "|Hmsg:%s|h%s|h|r : %s", ch->GetName(), ch->GetName(), buf);
	}
	else
	{
		len = snprintf(chatbuf, sizeof(chatbuf), "%s : %s", ch->GetName(), buf);
	}    int len;

 

On client-side just do the modifications in the interfacemodule.py, the uichat.py modification is not required anymore.

 

 

  • Love 1

when you return 0 and server doesn't boot:

unknown.png

Link to comment
Share on other sites

  • 0
On 16/5/2016 at 6:50 PM, PACI said:

If you search further, you'll see that this was made by Sanchez a few time ago:

 

 

 

Hey :) I tried it it works good but there is one problem: the name appears twice. If I make it like this

len = snprintf(chatbuf, sizeof(chatbuf), "|Hmsg:%s|h|r : %s", ch->GetName(), buf);

the click doens't work...

Link to comment
Share on other sites

  • 0
  • Developer

Try this then:

  • Add the changes made by Sanchez
  • Now open your interfaceModule.py, search for the MakeHyperlinkTooltip function and make it look like this: 2572c0d91d.png

 

Should be enough I think.

Edited by Metin2 Dev
Core X - External 2 Internal

when you return 0 and server doesn't boot:

unknown.png

Link to comment
Share on other sites

  • 0
On 23/8/2016 at 5:42 PM, PACI said:

Try this then:

  • Add the changes made by Sanchez
  • Now open your interfaceModule.py, search for the MakeHyperlinkTooltip function and make it look like this: 2572c0d91d.png

 

Should be enough I think.

Click to PM function not working :/

interfaceModule.py:

Spoiler

def MakeHyperlinkTooltip(self, hyperlink):
        tokens = hyperlink.split(":")
        if tokens and len(tokens):
            type = tokens[0]
            if "item" == type:
                self.hyperlinkItemTooltip.SetHyperlinkItem(tokens)
            elif "msg" == type:
                self.OpenWhisperDialog(str(tokens[1]))

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
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


  • Activity

    1. 3

      Once upon a time...

    2. 1183

      [40250] Reference Serverfile + Client + Src [15 Available Languages]

    3. 3

      Once upon a time...

    4. 3

      Once upon a time...

    5. 0

      problem ability

    6. 0

      Transmutation system error "unknow command server"

    7. 39

      Official Transmutation / Change Look

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.