Hey there~
I want to switch the order of the name and title, but after a few hours, I give up. So, it would be nice if you could help me out with my problem.
Here is my problem: When you use 'setunittitle', the title appears above the NPC name. As an example:
But I want the title beneath the name, like here:
"I know I could simply use the name in 'setunittitle' and change the NPC name to the title name,
but, well... that's not the intended use, is it?"
In clif.cpp, the section where the name and title are defined is located:
void clif_name( struct block_list* src, struct block_list *bl, send_target target ){
case BL_HOM:
case BL_MER:
case BL_PET:
case BL_NPC:
case BL_ELEM: {
PACKET_ZC_ACK_REQNAMEALL_NPC packet = { 0 };
packet.packet_id = HEADER_ZC_ACK_REQNAMEALL_NPC;
packet.gid = bl->id;
switch (bl->type) {
case BL_HOM:
memcpy(packet.name, ((TBL_HOM *)bl)->homunculus.name, NAME_LENGTH);
break;
case BL_MER:
memcpy(packet.name, ((TBL_MER *)bl)->db->name.c_str(), NAME_LENGTH);
break;
case BL_PET:
safestrncpy(packet.name, ((TBL_PET *)bl)->pet.name, NAME_LENGTH);
break;
case BL_NPC:
safestrncpy(packet.name, ((TBL_NPC *)bl)->name, NAME_LENGTH);
break;
case BL_ELEM:
safestrncpy(packet.name, ((TBL_ELEM *)bl)->db->name.c_str(), NAME_LENGTH);
break;
}
#if PACKETVER_MAIN_NUM >= 20180207 || PACKETVER_RE_NUM >= 20171129 || PACKETVER_ZERO_NUM >= 20171130
unit_data *ud = unit_bl2ud(bl);
if (ud != nullptr) {
memcpy(packet.title, ud->title, NAME_LENGTH);
packet.groupId = ud->group_id;
}
#endif
clif_send(&packet, sizeof(packet), src, target);
}
The next consideration is whether it would be possible to add a function that centers the name beneath the title.
As you can observe, when the name is shorter than the title, it looks quite unappealing.
It would be a good change for rAthena, I think, as I am not the only one bothered by this and centering the name would be a generally positive modification.
I would greatly appreciate it if someone could provide me with the solution. Thank you.