Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Recommended Posts

spacer.png

 

In the gaming world, communication is key to fostering interaction and teamwork among players. This guide details how to enable private messaging (PM) functionality within a global chat system, allowing users to send messages to one another directly.

System Modifications

The enhancements will be split across multiple files, including updates to the header, input handling, and the interface module, ensuring a cohesive implementation of the private messaging feature.

Code Updates

Step 1: Modify the Header File service.h

To begin, you need to define a macro that will enable the private messaging feature within the global chat system:

 
This is the hidden content, please

This declaration allows the corresponding feature to be toggled on or off as needed.

Step 2: Update Input Handling in input_main.cpp

Next, we need to modify how chat messages are formatted in the chat system. Locate the specific section where messages are being constructed and make the necessary adjustments:

 
This is the hidden content, please

In this code, we check if the message type is a shout. If so, we format it differently to indicate it’s a private message. For all other message types, the default formatting is applied.

Step 3: Adjust the Interface Module in interfacemodule.py

Lastly, we will update the Python interface module to handle hyperlink tooltips properly, especially for private messages. Find the method that generates tooltips and modify it as follows:

 
This is the hidden content, please

In this adjustment, the function checks if the hyperlink is for an item or a private message. If it's a PM, it invokes the whisper dialog, allowing the player to respond directly.

By integrating these changes, players will now have the ability to send private messages within the global chat environment. This feature enhances communication and promotes a more interactive gaming community.

 

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...