Jump to content
  • 0
Sign in to follow this  
jTynne

Ability to change color of dispbottom

Question

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;

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
+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

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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

BUILDIN_DEF(dispbottom,"s"), //added from jA [Lupus]

 

put after

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

// 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.

 

dispbottom2 "0x0000FF","Hello"; // Will send message Hello in blue to player
Edited by Oxxy

Share this post


Link to post
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
Answer this question...

×   Pasted as rich text.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.