+void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string gtype, string pic, float _count, int id)
+{
+ float alpha;
+ float desc_padding = gtv_text_size.x * 3;
+ float rect_margin = hud_fontsize.y / 2;
+ vector rect_pos = pos - '0.5 0.5 0' * rect_margin;
+ vector rect_size = '1 1 0';
+ rect_size.x = tsize + rect_margin;
+ rect_size.y = maxh + rect_margin;
+ vector rgb = MapVote_RGB(id);
+ vector offset = pos;
+ float nlines = 0;
+
+ if(mv_avail_start[id] != GTV_AVAILABLE)
+ alpha = 0.2;
+ else if ( mv_avail[id] != GTV_AVAILABLE && mv_top2_alpha)
+ alpha = mv_top2_alpha;
+ else
+ alpha = 1;
+
+ if(id == mv_selection && mv_avail[id] == GTV_AVAILABLE)
+ {
+ drawfill(rect_pos, rect_size, '1 1 1', 0.1, DRAWFLAG_NORMAL);
+ }
+ if(id == mv_ownvote)
+ {
+ drawfill(rect_pos, rect_size, rgb, 0.1*alpha, DRAWFLAG_NORMAL);
+ drawborderlines(autocvar_scoreboard_border_thickness, rect_pos, rect_size, rgb, alpha, DRAWFLAG_NORMAL);
+ }
+
+ entity title;
+ title = spawn();
+ title.message = MapVote_FormatMapItem(id, MapInfo_Type_ToText(MapInfo_Type_FromString(gtype)),
+ _count, tsize, gtv_text_size);
+ title.origin = pos-offset;
+
+ pos.y += gtv_text_size_small.y;
+ pos.y += gtv_text_size.y/2;
+
+ maxh -= gtv_text_size.y;
+
+ entity picent = spawn();
+ picent.origin = pos-offset;
+ picent.maxs = '1 1 0 ' * min(maxh, desc_padding) * 0.8;
+
+ pos.x += desc_padding;
+ tsize -= desc_padding;
+
+ string thelabel = GameTypeVote_DescriptionByID(id), ts;
+ entity last = title;
+ entity next = world;
+ if( thelabel != "")
+ {
+ float i,n = tokenizebyseparator(thelabel, "\n");
+ for(i = 0; i < n && maxh > (nlines+1)*gtv_text_size_small.y; ++i)
+ {
+ getWrappedLine_remaining = argv(i);
+ while(getWrappedLine_remaining && maxh > (nlines+1)*gtv_text_size_small.y)
+ {
+ ts = getWrappedLine(tsize, gtv_text_size_small, stringwidth_colors);
+ if (ts != "")
+ {
+ next = spawn();
+ next.message = ts;
+ next.origin = pos-offset;
+ last.chain = next;
+ last = next;
+ pos.y += gtv_text_size_small.y;
+ nlines++;
+ }
+ }
+ }
+ }
+
+ maxh -= max(nlines*gtv_text_size_small.y,picent.maxs.y);
+ if ( maxh > 0 )
+ offset.y += maxh/2;
+ drawstring(title.origin+offset, title.message, gtv_text_size, rgb, alpha, DRAWFLAG_NORMAL);
+
+ if(pic != "")
+ drawpic(picent.origin+offset, pic, picent.maxs, '1 1 1', alpha, DRAWFLAG_NORMAL);
+
+ for ( last = title.chain; last ; )
+ {
+ drawstring(last.origin+offset, last.message, gtv_text_size_small, '1 1 1', alpha, DRAWFLAG_NORMAL);
+ next = last;
+ last = last.chain;
+ remove(next);
+ }
+
+ remove(picent);
+ remove(title);
+}
+
+void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, string pic, float _count, int id)