Jump to content

[Request] Level & Time before Name [Source]


Recommended Posts

  • Active+ Member

From some ... places.. 

It is not tested, personally I don't like changes like that in the whisper window so.. idk. I believe there is something on this forum regarding your request. The photo looks too familiar to me. 

 

uiwhisper.py opens

# arat #

def SendWhisper(self):

# içinde #

net.SendWhisperPacket(self.targetName, text)
            self.chatLine.SetText("")

            chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() + " : " + text)

# deÄŸiÅŸtir #

SaatKac = time.strftime("%H:%M")
            net.SendWhisperPacket(self.targetName, " |cff00ccff[" + SaatKac + "]|cff00FF7F " + ":" + text)
            self.chatLine.SetText("")
            chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() +  ": " + " |cff00ccff[" + SaatKac + "]|cFFFF6060 " + ":" + text)


MUST BE

def SendWhisper(self):
        import time
        import player
        text = self.chatLine.GetText()
        textLength = len(text)
        if textLength > 0:
            if net.IsInsultIn(text):
                chat.AppendChat(chat.CHAT_TYPE_INFO, locale.CHAT_INSULT_STRING)
                return
            SaatKac = time.strftime("%H:%M")
            net.SendWhisperPacket(self.targetName, " |cff00ccff[" + SaatKac + "]|cff00FF7F " + ":" + text)
            self.chatLine.SetText("")
            chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() +  ": " + " |cff00ccff[" + SaatKac + "]|cFFFF6060 " + ":" + text)

Please let me know if it worked. I'm curious. 

  • Premium

Hey,

tried that, but it doesnt work. 😅 It just adds all the ColorCodes before the message.

The picture is the last post from this topic https://metin2.dev/topic/30634-howto-add-level-and-time-in-pm/ .

Someone mentioned there is a way to change it in Source which is what I am searching 😛 

But thank you anyway!

  • Love 1
  • 3 months later...
  • Active+ Member
On 8/12/2024 at 1:30 PM, KOrgaz said:

Hey,

tried that, but it doesnt work. 😅 It just adds all the ColorCodes before the message.

The picture is the last post from this topic https://metin2.dev/topic/30634-howto-add-level-and-time-in-pm/ .

Someone mentioned there is a way to change it in Source which is what I am searching 😛 

But thank you anyway!

You don't need source code for that, just modify uiwhisper.py like that:

## Add if you don't have
import time

## Search for:
                chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_INSULT_STRING)
                return

## Add Below:
			time_whisper = time.strftime("%H:%M:%S")
			level = player.GetStatus(player.LEVEL)
			lv_whisper = "{}".format(level)
			whisper_message = "|cff45b053[" + lv_whisper + "]|h|r |cff2184b5[" + time_whisper + "]|h|r "

## Search for:
            net.SendWhisperPacket(self.targetName, text)

## Replace with:
            net.SendWhisperPacket(self.targetName, whisper_message)

## Search for:
                chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() + " : " + text)

## Replace with:
                chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, whisper_message + player.GetName() + " : " + text)

If you want to modify the color for the level change 45b053 with the hexcolor you want, if you want to modify the time color change 2184b5 with the hexcolor you prefer.

Result:

.png

Edited by [GF]Froslass
  • Active+ Member
2 hours ago, KOrgaz said:

That won't work as you are only sending the Level + Time. So it will only show "[50] [08:00:43]" as received message for the User tst. No actual message is sent in the SendWhisper Package.

Yeah i know, i realized that right after i posted the message 😅 I tried to cancel the message but i couldn't.. i'll release a full system in a couple of days tho, after i'm done with my university exam 🫡

 

Edit: you could actually just replace this, adding the + text, if you don't mind having the level/hour on the right of the username instead of the left, but anyway i will release a full system with everything in place in a couple of days

whisper_message = "|cff45b053[" + lv_whisper + "]|h|r |cff2184b5[" + time_whisper + "]|h|r :" + text

 

Edited by [GF]Froslass
  • Love 1
  • 4 months later...
  • 10 months later...

Hi, why is it that when I put in the system it asks for inspection glass?

When I remove the time from it, the client dies.

https://metin2.download/picture/Yfomh9AQFXpKLP99cNU6oG6Dwp12r2d1/.png

Please help me. 




Edited by Metin2 Dev International
Core X - External 2 Internal

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.