/* * DisplayServerMessage: Display message from server, extracting any style or color codes. * color and style give default style and color values. */ void DisplayServerMessage(char *message, COLORREF start_color, BYTE start_style) { EditBoxStartAdd(); DisplayMessage(message, start_color, start_style); EditBoxEndAdd(); }
/* * GroupPrint: Display the members of the group with the given name. */ void GroupPrint(char *group_name) { UserGroup g; int i, index; COLORREF color; BYTE style; ID id; char buf[MAX_CHARNAME + 10]; index = FindGroupByName(group_name); switch (index) { case GROUP_NOMATCH: GameMessage(GetString(hInst, IDS_BADGROUPNAME)); break; case GROUP_AMBIGUOUS: GameMessage(GetString(hInst, IDS_DUPLICATEGROUPNAME)); break; default: group_name = groups[index]; GroupLoad(group_name, &g); GameMessagePrintf(GetString(hInst, IDS_GROUPMEMBERS), MAX_GROUPNAME, group_name); color = RGB(0, 0, 0); style = STYLE_NORMAL; EditBoxStartAdd(); for (i=0; i < g.num_users; i++) { if (i != 0) DisplayMessage(", ", color, style); id = FindPlayerByNameExact(g.names[i]); // Show player in red if logged on if (id == 0 || id == INVALID_ID) DisplayMessage(g.names[i], color, style); else { sprintf(buf, "~r%s~n", g.names[i]); DisplayMessage(buf, color, style); } } EditBoxEndAdd(); break; } }
/* * GroupsPrint: Display a list of all defined groups. */ void GroupsPrint(void) { int i; COLORREF color; BYTE style; if (num_groups == 0) { GameMessage(GetString(hInst, IDS_NOGROUPS)); return; } GameMessage(GetString(hInst, IDS_GROUPLIST)); color = RGB(0, 0, 0); style = STYLE_NORMAL; EditBoxStartAdd(); for (i=0; i < num_groups; i++) { if (i != 0) DisplayMessage(", ", color, style); DisplayMessage(groups[i], color, style); } EditBoxEndAdd(); }