X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fmapvoting.qc;h=7aad4c4ffdd77b543bee03f612b6fe67e85a02f2;hb=64b6c7420b3e1c307f408a9f17d9c765a268621a;hp=5492d51940575232f481e59cdc6b9adbdbdf9331;hpb=3743f4e292e9c54dcea9c86d21f9a8b82b6b1758;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 5492d5194..7aad4c4ff 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -68,14 +68,14 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin text_size = stringwidth(label, false, hud_fontsize); - float alpha; + float theAlpha; if (count < 0 && mv_top2_alpha) - alpha = mv_top2_alpha; + theAlpha = mv_top2_alpha; else - alpha = 1; + theAlpha = 1; pos_x -= text_size*0.5; - drawstring(pos, label, hud_fontsize, rgb, alpha, DRAWFLAG_NORMAL); + drawstring(pos, label, hud_fontsize, rgb, theAlpha, DRAWFLAG_NORMAL); pos_x = pos_x + text_size*0.5 - img_size_x*0.5; pos_y = pos_y - img_size_y; @@ -84,18 +84,20 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin img_size -= (autocvar_scoreboard_border_thickness * 2) * '1 1 0'; if(pic == "") { - drawfill(pos, img_size, '.5 .5 .5', .7 * alpha, DRAWFLAG_NORMAL); + drawfill(pos, img_size, '.5 .5 .5', .7 * theAlpha, DRAWFLAG_NORMAL); } else { - if(fexists(strcat(pic, ".jpg")) || fexists(strcat(pic, ".png")) || fexists(strcat(pic, ".tga"))) - drawpic(pos, pic, img_size, '1 1 1', alpha, DRAWFLAG_NORMAL); + if(drawgetimagesize(pic) == '0 0 0') + drawpic(pos, draw_UseSkinFor("nopreview_map"), img_size, '1 1 1', theAlpha, DRAWFLAG_NORMAL); + else + drawpic(pos, pic, img_size, '1 1 1', theAlpha, DRAWFLAG_NORMAL); } if(id == mv_ownvote) - drawborderlines(autocvar_scoreboard_border_thickness, pos, img_size, rgb, alpha, DRAWFLAG_NORMAL); + drawborderlines(autocvar_scoreboard_border_thickness, pos, img_size, rgb, theAlpha, DRAWFLAG_NORMAL); else - drawborderlines(autocvar_scoreboard_border_thickness, pos, img_size, '0 0 0', alpha, DRAWFLAG_NORMAL); + drawborderlines(autocvar_scoreboard_border_thickness, pos, img_size, '0 0 0', theAlpha, DRAWFLAG_NORMAL); if(id == mv_selection && count >= 0) drawfill(pos, img_size, '1 1 1', 0.1, DRAWFLAG_NORMAL); @@ -172,10 +174,13 @@ void MapVote_Draw() if(!mv_active) return; - mv_mousepos = mv_mousepos + getmousepos(); - - mv_mousepos_x = bound(0, mv_mousepos_x, vid_conwidth); - mv_mousepos_y = bound(0, mv_mousepos_y, vid_conheight); + if not(autocvar_hud_cursormode) + { + mv_mousepos = mv_mousepos + getmousepos(); + + mv_mousepos_x = bound(0, mv_mousepos_x, vid_conwidth); + mv_mousepos_y = bound(0, mv_mousepos_y, vid_conheight); + } center = (vid_conwidth - 1)/2; xmin = vid_conwidth*0.05; // 5% border must suffice @@ -192,6 +197,7 @@ void MapVote_Draw() pos_y = ymin; pos_z = 0; + draw_beginBoldFont(); map = _("Vote for a map"); pos_x = center - stringwidth(map, false, '12 0 0'); drawstring(pos, map, '24 24 0', '1 1 1', 1, DRAWFLAG_NORMAL); @@ -203,6 +209,7 @@ void MapVote_Draw() drawstring(pos, map, '16 16 0', '0 1 0', 1, DRAWFLAG_NORMAL); pos_y += 22; pos_x = xmin; + draw_endBoldFont(); // base for multi-column stuff... ymin = pos_y; @@ -281,7 +288,7 @@ void Cmd_MapVote_MapDownload(float argc) return; } else { print(_("Requesting preview...\n")); - localcmd(strcat("\ncmd mv_getpic ", ftos(id), "\n")); + localcmd(strcat("\ncmd mv_getpicture ", ftos(id), "\n")); } } @@ -331,8 +338,8 @@ void MapVote_Init() precache_sound ("misc/invshot.wav"); mv_active = 1; - - mv_mousepos = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight; + if(autocvar_hud_cursormode) { setcursormode(1); } + else { mv_mousepos = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight; } mv_selection = -1; for(n_ssdirs = 0; ; ++n_ssdirs) @@ -359,8 +366,8 @@ void MapVote_Init() else mv_maps_mask = ReadShort(); - // Assume mv_pk3list is NULL, there should only be 1 mapvote per round - mv_pk3list = NULL; // I'm still paranoid! + // Assume mv_pk3list is world, there should only be 1 mapvote per round + mv_pk3list = world; // I'm still paranoid! for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2) { @@ -402,6 +409,13 @@ float MapVote_InputEvent(float bInputType, float nPrimary, float nSecondary) if (!mv_active) return false; + if(bInputType == 3) + { + mv_mousepos_x = nPrimary; + mv_mousepos_y = nSecondary; + return true; + } + if (bInputType != 0) return false;