mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-12 08:40:19 +00:00
Merge pull request #445 from TingPing/ulistcolors
Add option to color nicknames in the userlist to match the chat
This commit is contained in:
@@ -465,6 +465,7 @@ const struct prefs vars[] =
|
||||
{"gui_tray_minimize", P_OFFINT (hex_gui_tray_minimize), TYPE_BOOL},
|
||||
{"gui_tray_quiet", P_OFFINT (hex_gui_tray_quiet), TYPE_BOOL},
|
||||
{"gui_ulist_buttons", P_OFFINT (hex_gui_ulist_buttons), TYPE_BOOL},
|
||||
{"gui_ulist_color", P_OFFINT (hex_gui_ulist_color), TYPE_BOOL},
|
||||
{"gui_ulist_count", P_OFFINT (hex_gui_ulist_count), TYPE_BOOL},
|
||||
{"gui_ulist_doubleclick", P_OFFSET (hex_gui_ulist_doubleclick), TYPE_STR},
|
||||
{"gui_ulist_hide", P_OFFINT (hex_gui_ulist_hide), TYPE_BOOL},
|
||||
|
||||
@@ -157,6 +157,7 @@ struct hexchatprefs
|
||||
unsigned int hex_gui_tray_minimize;
|
||||
unsigned int hex_gui_tray_quiet;
|
||||
unsigned int hex_gui_ulist_buttons;
|
||||
unsigned int hex_gui_ulist_color;
|
||||
unsigned int hex_gui_ulist_count;
|
||||
unsigned int hex_gui_ulist_hide;
|
||||
unsigned int hex_gui_ulist_icons;
|
||||
|
||||
@@ -2006,8 +2006,8 @@ pevt_build_string (const char *input, char **output, int *max_arg)
|
||||
|
||||
static char rcolors[] = { 19, 20, 22, 24, 25, 26, 27, 28, 29 };
|
||||
|
||||
static int
|
||||
color_of (char *name)
|
||||
int
|
||||
text_color_of (char *name)
|
||||
{
|
||||
int i = 0, sum = 0;
|
||||
|
||||
@@ -2030,7 +2030,7 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d)
|
||||
|
||||
if (prefs.hex_text_color_nicks && (index == XP_TE_CHANACTION || index == XP_TE_CHANMSG))
|
||||
{
|
||||
snprintf (tbuf, sizeof (tbuf), "\003%d%s", color_of (a), a);
|
||||
snprintf (tbuf, sizeof (tbuf), "\003%d%s", text_color_of (a), a);
|
||||
a = tbuf;
|
||||
stripcolor_args &= ~ARG_FLAG(1); /* don't strip color from this argument */
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ void pevent_save (char *fn);
|
||||
int pevt_build_string (const char *input, char **output, int *max_arg);
|
||||
int pevent_load (char *filename);
|
||||
void pevent_make_pntevts (void);
|
||||
int text_color_of (char *name);
|
||||
void text_emit (int index, session *sess, char *a, char *b, char *c, char *d);
|
||||
int text_emit_by_name (char *name, session *sess, char *a, char *b, char *c, char *d);
|
||||
char *text_validate (char **text, int *len);
|
||||
|
||||
Reference in New Issue
Block a user