X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fmapvoting.qc;h=61ba69b6a277c03eacab792d0feade3bc69f9970;hp=03e94dc7f304238bc916443bc4a6fbef512d7bc7;hb=9ff975c1d5a91d3e27ea7f77c30375b50f2c15a6;hpb=69eda62d02bc02ff50547bad514af3f7ce487413 diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 03e94dc7f3..61ba69b6a2 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -321,6 +321,8 @@ float MapVote_Selection(vector topleft, vector cellsize, float rows, float colum return mv_mouse_selection; } +vector prev_mousepos; +// draws map vote or gametype vote void MapVote_Draw() { string map; @@ -339,10 +341,11 @@ void MapVote_Draw() if (!autocvar_hud_cursormode) { - vector mpos = mousepos; - update_mousepos(); - if (mpos.x != mousepos.x || mpos.y != mousepos.y) + if (mousepos.x != prev_mousepos.x || mousepos.y != prev_mousepos.y) + { mv_selection_keyboard = 0; + prev_mousepos = mousepos; + } } center = (vid_conwidth - 1)/2; @@ -357,6 +360,11 @@ void MapVote_Draw() ymax -= chat_sizey; hud_fontsize = HUD_GetFontsize("hud_fontsize"); + if (gametypevote) + { + gtv_text_size = hud_fontsize * 1.4; + gtv_text_size_small = hud_fontsize * 1.1; + } pos.y = ymin; pos.z = 0; @@ -457,7 +465,7 @@ void MapVote_Draw() mv_selection = MapVote_Selection(pos, dist, rows, mv_columns); if (mv_top2_time) - mv_top2_alpha = max(0.2, 1 - (time - mv_top2_time)*(time - mv_top2_time)); + mv_top2_alpha = max(0.2, 1 - (time - mv_top2_time) ** 2); void (vector, float, float, string, string, float, float) DrawItem; @@ -485,8 +493,6 @@ void MapVote_Draw() pos.x = (xmax+xmin)*0.5; MapVote_DrawAbstain(pos, dist.x, xmax - xmin, tmp, i); } - - draw_cursor_normal(mousepos, '1 1 1', panel_fg_alpha); } void Cmd_MapVote_MapDownload(int argc) @@ -649,8 +655,7 @@ void GameTypeVote_ReadOption(int i) void MapVote_Init() { mv_active = 1; - if(autocvar_hud_cursormode) setcursormode(1); - else mousepos = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight; + if(!autocvar_hud_cursormode) mousepos = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight; mv_selection = -1; mv_selection_keyboard = 0; @@ -681,9 +686,6 @@ void MapVote_Init() mapvote_chosenmap = strzone(ReadString()); if ( gametypevote == 2 ) gametypevote = 0; - - gtv_text_size = hud_fontsize*1.4; - gtv_text_size_small = hud_fontsize*1.1; } MapVote_ReadMask();