From 87edc4883783b6bcc43621be98dc6c793f8edae2 Mon Sep 17 00:00:00 2001 From: blub0 Date: Mon, 28 Jul 2008 19:01:09 +0000 Subject: [PATCH] move abstain vote to the center and fix size calc for evilish odd numbers of votable maps :P git-svn-id: svn://svn.icculus.org/nexuiz/trunk@3966 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/client/mapvoting.qc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/data/qcsrc/client/mapvoting.qc b/data/qcsrc/client/mapvoting.qc index b04f2a68c..0dde3b373 100644 --- a/data/qcsrc/client/mapvoting.qc +++ b/data/qcsrc/client/mapvoting.qc @@ -158,10 +158,12 @@ void MapVote_Draw() // base for multi-column stuff... ymin = pos_y; + if(mv_abstain) + mv_num_maps -= 1; + if(mv_num_maps > 5) { - //xmax = 0.5*(xmax - xmin); - isize = (ymax - pos_y - mv_num_maps*10) / floor(0.5*mv_num_maps); // or ceil? + isize = (ymax - pos_y - mv_num_maps*10) / ceil(0.5*mv_num_maps); pos_x = xmin + 0.25*(xmax-xmin); } else { isize = (ymax - pos_y - mv_num_maps*10) / mv_num_maps; @@ -169,10 +171,10 @@ void MapVote_Draw() } ymax -= isize; - for(i = 0; i < (mv_num_maps - mv_abstain); ++i) + for(i = 0; i < mv_num_maps; ++i) { // base for multi-column stuff - if(pos_y >= ymax) + if(pos_y > ymax) { pos_y = ymin; pos_x = xmin + 0.75*(xmax-xmin); @@ -193,8 +195,14 @@ void MapVote_Draw() MapVote_DrawMapNotAvailable(pos, isize, map, tmp, i); pos_y += isize + 10; } + + if(mv_abstain) + mv_num_maps++; + if(mv_abstain && i < mv_num_maps) { tmp = mv_votes[i]; + pos_y = ymax + isize - sbar_fontsize_y; + pos_x = (xmax+xmin)*0.5; MapVote_DrawAbstain(pos, isize, tmp, i); } } -- 2.39.2