X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fmapvoting.qc;h=9feb6e826d500a5e5bad8129cd9e099f393fed89;hb=0cc98396bb3b7ab6949a021298c86656bad4b24d;hp=4cb8dad05fff509e7a905ffc6627a850df8459fb;hpb=c5d2e002cfd511eaf1b1267ab49cd90161f08052;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 4cb8dad05..9feb6e826 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -28,6 +28,8 @@ string MapVote_FormatMapItem(float id, string map, float count, float maxwidth, post = _(" (1 vote)"); else if(count >= 0) post = sprintf(_(" (%d votes)"), count); + else + post = ""; } else post = ""; @@ -50,7 +52,7 @@ vector MapVote_RGB(float id, float count) void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, string pic, float count, float id) { - vector img_size; + vector img_size = '0 0 0'; vector rgb; string label; float text_size; @@ -169,15 +171,18 @@ void MapVote_Draw() float center; float columns, rows; float tsize; - vector dist; + vector dist = '0 0 0'; 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 @@ -194,6 +199,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); @@ -205,6 +211,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; @@ -253,7 +260,7 @@ void MapVote_Draw() MapVote_DrawAbstain(pos, isize, xmax - xmin, tmp, i); } - drawpic(mv_mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), '32 32 0', '1 1 1', autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL); + drawpic(mv_mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), '32 32 0', '1 1 1', 1 - autocvar__menu_alpha, DRAWFLAG_NORMAL); } void Cmd_MapVote_MapDownload(float argc) @@ -333,8 +340,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) @@ -404,6 +411,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;