Ability to change color of dispbottom

jTynne

High Council
Messages
249
Points
0
Emulator
Not sure if it's possible at all, however, it would be pretty spiffy if there were a means of changing the color of dispbottom instead of the green that looks like guild chat.

e.g.

dispbottom "Girl, this text is red and fieeerrrce dah-ling!",0xFF0000;

 
Last edited by a moderator:
+1 on this <3

 
+1000.
 
Also, it would be great whether instead of changing the entire line, dispbottom could be colored like mes messages, only selected words, but I think that this is impossible... xD
 
Well i have made this mod, i will share once i reach home.

 
+1
default_smile.png


 
Script.c

Place This above "BUILDIN_FUNC(dispbottom)"

/*========================================== * Coloured DispBottom [By Dastgir] *------------------------------------------*/BUILDIN_FUNC(dispbottom2){ TBL_PC *sd=script_rid2sd(st); const char *message; unsigned long color; message=script_getstr(st,3); color=strtoul(script_getstr(st,2),NULL,0); if(sd) clif_colormes_e(sd,color,message); return 0;}

In the Same file

Place This below "BUILDIN_DEF(showevent, "ii"),":

BUILDIN_DEF( dispbottom2, "ss"), //[By Dastgir] 
In Clif.C:

Place this at end of file:

// Modification of clif_messagecolor to send colored messages to players to chat log only (doesn't display overhead)// 02c1 <packet len>.W <id>.L <color>.L <message>.?B// [By Dastgir]int clif_colormes_e(struct map_session_data * sd,unsigned long color1, const char* msg) { unsigned short msg_len = strlen(msg) + 1; WFIFOHEAD(sd->fd,msg_len + 12); WFIFOW(sd->fd,0) = 0x2C1; WFIFOW(sd->fd,2) = msg_len + 12; WFIFOL(sd->fd,4) = 0; WFIFOL(sd->fd,8) = (color1&0x0000FF) << 16 | (color1&0x00FF00) | (color1&0xFF0000) >> 16; // RGB -> BGR safestrncpy((char*)WFIFOP(sd->fd,12), msg, msg_len); clif_send(WFIFOP(sd->fd,0), WFIFOW(sd->fd,2), &sd->bl, SELF); return 0;} 

In Clif.H

Place this at the end:

int clif_colormes_e(struct map_session_data * sd,unsigned long color1, const char* msg); //[By Dastgir] 

So the Format you will use

dispbottom2("0x00FF00","MESSAGE");

OR

dispbottom2 "0x00FF00","MESSAGE";

REPLACE 0x00FF00 to any colour code.

 
UPDATED command:

Script.c:

find

/*========================================== * Displays a message for the player only (like system messages like "you got an apple" ) *------------------------------------------*/BUILDIN(dispbottom){  TBL_PC *sd=script->rid2sd(st);  const char *message;  message=script_getstr(st,2);  if(sd)    clif_disp_onlyself(sd,message,(int)strlen(message));  return true;}

put after

/*========================================== * Coloured DispBottom [By Dastgir] *------------------------------------------*/BUILDIN(dispbottom2){  TBL_PC *sd=script_rid2sd(st);  const char *message;  unsigned long color;  message=script_getstr(st,3);  color=strtoul(script_getstr(st,2),NULL,0);  if(sd)    clif->colormes_e(sd,color,message);  return 0;}

then find

Code:
BUILDIN_DEF(dispbottom,"s"), //added from jA [Lupus]
put after

Code:
BUILDIN_DEF(dispbottom2,"ss"),
Clif.h:

find

int (*colormes) (int fd, enum clif_colors color, const char* msg);

put after

int (*colormes_e) (struct map_session_data * sd,unsigned long color1, const char* msg);   //[By Dastgir]

Clif.c:

find

Code:
// Modification of clif_messagecolor to send colored messages to players to chat log only (doesn't display overhead)/// 02c1 <packet len>.W <id>.L <color>.L <message>.?Bint clif_colormes(int fd, enum clif_colors color, const char* msg) {    size_t msg_len = strlen(msg) + 1;    WFIFOHEAD(fd,msg_len + 12);    WFIFOW(fd,0) = 0x2C1;    WFIFOW(fd,2) = msg_len + 12;    WFIFOL(fd,4) = 0;    WFIFOL(fd,8) = color_table[color];    safestrncpy((char*)WFIFOP(fd,12), msg, msg_len);    WFIFOSET(fd, msg_len + 12);    return 0;}
put after

// [By Dastgir]int clif_colormes_e(struct map_session_data * sd,unsigned long color1, const char* msg) { unsigned short msg_len = strlen(msg) + 1;   WFIFOHEAD(sd->fd,msg_len + 12);   WFIFOW(sd->fd,0) = 0x2C1;   WFIFOW(sd->fd,2) = msg_len + 12;   WFIFOL(sd->fd,4) = 0;   WFIFOL(sd->fd,8) = (color1&0x0000FF) << 16 | (color1&0x00FF00) | (color1&0xFF0000) >> 16; // RGB -> BGR   safestrncpy((char*)WFIFOP(sd->fd,12), msg, msg_len);   clif_send(WFIFOP(sd->fd,0), WFIFOW(sd->fd,2), &sd->bl, SELF);   return 0;}

then find

clif->colormes = clif_colormes;

put after

clif->colormes_e = clif_colormes_e;

recompile and be happy. syntax is the same.

Code:
dispbottom2 "0x0000FF","Hello"; // Will send message Hello in blue to player
 
Last edited by a moderator:
Back
Top