• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Yet another question re OTClient

Dercas

Active Member
Joined
Nov 15, 2008
Messages
88
Reaction score
29
Hi all,

So, I've had to add to the OTClient Name Displacement
( Name Displacement (https://xtibia.com/forum/topic/247641-name-displacement/) )

& I've been trying to do the same for the placement of the messages. The character's name is moved so the messages must be moved too or it looks silly.
As far as I know it's statictext.cpp that's responsible for the position of the messages sent by players:

C++:
void StaticText::drawText(const Point& dest, const Rect& parentRect)
{
    Size textSize = m_cachedText.getTextSize();
    Rect rect = Rect(dest - Point(textSize.width() / 2, textSize.height()) + Point(20, 5), textSize);
    Rect boundRect = rect;
    boundRect.bind(parentRect);


    // draw only if the real center is not too far from the parent center, or its a yell
    //if(g_map.isAwareOfPosition(m_position) || isYell()) {
    m_cachedText.draw(boundRect, m_color);
    //}
}

I was thinking to do it in two ways:

1. adjust the name-displacement to affect messages too, something like:

Code:
    Rect rect = Rect(dest - Point(textSize.width() / 2, textSize.height()) + Point(20, 5), textSize);

changed to:
Code:
    Rect rect = Rect(dest - Point(textSize.width() / 2, textSize.height()) + Point(20 + thingType->getNameDisplacement().x, 5+thingType->getNameDisplacement().y), textSize);

(code isn't 1:1 like i tried but you get the point)


2. something like name displacement so that I got in things.otml:

Code:
creatures:
<LookID>
name-displacement: X Y
text-displacement: X Y

So, I've followed similar steps like it's for the name displacament but I've failed and it doesn't work..

Any ideas?
I'm out of ideas how to adjust the height/width position of messages.

Thank you in advnace!

/edit
It'd be perfect if I could adjust messages position per each outfit/mount separetly.
 
Last edited:
Back
Top