- for (g=0, i=0, j=cpm_index; i<CENTERPRINT_MAX_MSGS; ++i, ++j)
- {
- // if the notification starts with ^BOLD make it bold (e.g. frag messages);
- is_bold = (substring(centerprint_messages[j], 0, 5) == BOLD_OPERATOR);
- // remove ^BOLD so it doesn't get printed onscreen
- if (is_bold)
- strcpy(centerprint_message, substring(centerprint_messages[j], 5, -1));
+
+ // Show title if available
+ if(centerprint_title) {
+ vector fontsize = cp_fontsize * autocvar_hud_panel_centerprint_fontscale_title;
+ float width = stringwidth(centerprint_title, true, fontsize);
+
+ pos.x = panel_pos.x + (panel_size.x - width) * align;
+
+ if (autocvar_hud_panel_centerprint_flip)
+ pos.y -= fontsize.y;
+ if (centerprint_title_offset && align == 0.5)
+ pos.x += centerprint_title_offset * CENTERPRINT_BASE_SIZE * autocvar_hud_panel_centerprint_fontscale_title;
+
+ drawcolorcodedstring(pos, centerprint_title, fontsize, 1, DRAWFLAG_NORMAL);
+
+ if (autocvar_hud_panel_centerprint_flip)
+ pos.y -= cp_fontsize.y * CENTERPRINT_TITLE_SPACING;
+ else
+ pos.y += fontsize.y + (hud_fontsize.y * CENTERPRINT_TITLE_SPACING);
+
+ drawfill(pos, vec2(width, 1), '1 1 1', 1, DRAWFLAG_NORMAL);
+
+ if (autocvar_hud_panel_centerprint_flip)
+ pos.y -= cp_fontsize.y * CENTERPRINT_TITLE_SPACING;