76 string pre = sprintf(
"%d. ",
id + 1);
80 post = _(
" (1 vote)");
82 post = sprintf(_(
" (%d votes)"), _count);
93 return strcat(pre, map, post);
110 rgb =
'1 1 0' +
eZ * (time_frac >= 1 ? 1 :
sqrt(time_frac));
138 vector rect_pos = pos -
'0.5 0.5 0' * rect_margin;
139 vector rect_size =
'1 1 0';
140 rect_size.x = tsize + rect_margin;
141 rect_size.y = maxh + rect_margin;
174 if (maxh < image_size.y)
175 image_size =
'1 1 0' * maxh;
178 pos.x += image_size.x + desc_padding;
183 tsize -= image_size.x + desc_padding;
185 string thelabel =
mv_desc[id], ts;
202 next.origin = pos - offset;
215 offset.y += maxh * 0.5;
224 if (time_frac >= 0 && time_frac < 1)
226 const float extra_padding =
min(desc_padding, title_gap);
227 const float transition_progress = (1 -
sqrt(time_frac));
228 image_size *= transition_progress * (extra_padding / image_size.x) + 1;
229 offset_padding = transition_progress * extra_padding *
'-0.5 -0.5 0';
232 offset_padding =
'0 0 0';
273 vector rect_pos = pos -
'0.5 0.5 0' * rect_margin;
274 vector rect_size =
'1 1 0';
275 rect_size.x = tsize + rect_margin;
276 rect_size.y = isize + rect_margin;
278 const float img_ar = 4/3;
279 vector img_size =
'0 0 0';
280 img_size.x =
min(tsize, isize * img_ar);
281 img_size.y = img_size.x / img_ar;
283 img_size.x = img_size.y * img_ar;
292 const float save_rect_sizex = rect_size.x;
293 rect_size.x =
max(img_size.x, text_size) + rect_margin;
294 rect_pos.x += (save_rect_sizex - rect_size.x) * 0.5;
297 text_pos.x = pos.x + (tsize - text_size) * 0.5;
298 text_pos.y = pos.y + img_size.y;
301 pos.x += (tsize - img_size.x) * 0.5;
374 theAlpha = (1 -
sqrt(time_frac));
388 TC(
int, i);
TC(
int, m);
391 eX * (gridspec.x * r)
393 eY * (gridspec.y * (i - r) / m);
403 for (
float c, r = 0; r < rows; ++r)
404 for (c = 0; c < columns; ++c)
405 if (
mousepos.x >= topleft.x + cellsize.x * c
406 &&
mousepos.x <= topleft.x + cellsize.x * (c + 1)
407 &&
mousepos.y >= topleft.y + cellsize.y * r
408 &&
mousepos.y <= topleft.y + cellsize.y * (r + 1))
458 string map = (
gametypevote) ? _(
"Decide the gametype") : _(
"Vote for a map");
499 ymax -= abstain_spacing;
503 ymax -= suggester_spacing;
509 const float rows = table_size.y;
513 dist.y = (
ymax - pos.y) / rows;
521 dist.y =
min(dist.y, dist.x / item_aspect);
527 dist.x =
min(dist.x, dist.y * item_aspect);
531 if (dist.x / dist.y > item_aspect)
532 dist.x = dist.y * item_aspect;
534 dist.y = dist.x / item_aspect;
538 xmin = pos.x += offset;
540 offset = ((
ymax - pos.y) - dist.y * rows) * 0.5;
578 void(
vector,
float,
float,
string,
string,
float,
int,
int) DrawItem;
595 pos.y =
ymax + abstain_spacing;
601 pos.y += suggester_spacing;
610 startsize.x = startsize.y * 4/3;
616 endsize.x = endsize.y * 4/3;
623 const float theAlpha = f;
625 vector img_size = endsize * f + startsize * (1 - f);
626 vector img_pos = endpos * f + startpos * (1 - f);
632 const float suggester_startposy = pos.y;
634 pos.y = suggester_endposy * f + suggester_startposy * (1 - f);
651 LOG_INFO(_(
"mv_mapdownload: ^3You're not supposed to use this command on your own!"));
658 if (pak.sv_entnum ==
id)
661 if (!pak || pak.sv_entnum !=
id)
663 LOG_INFO(_(
"^1Error:^7 Couldn't find pak index."));
674 LOG_INFO(_(
"Requesting preview..."));
691 localcmd(
"\ncurl --pak ", pk3,
"; wait; cl_cmd mv_download ",
itos(
id),
"\n");
762 string basetype =
"";
788 mv_picpath =
strcat(
"gfx/menu/wickedx/gametype_", basetype);
824 const int gametypevote_flags =
ReadByte();
826 if (gametypevote_flags)
932 static int first_digit = 0;
951 const bool key_pressed = (bInputType == 0);
973 if (!key_pressed)
return false;
1026 first_digit =
imp % 10;
1030 imp = first_digit * 10 + (
imp % 10);
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void drawborderlines(float thickness, vector pos, vector dim, vector color, float theAlpha, float drawflag)
#define drawcolorcodedstring(position, text, scale, alpha, flag)
#define drawstring(position, text, scale, rgb, alpha, flag)
#define drawpic(position, pic, size, rgb, alpha, flag)
#define draw_beginBoldFont()
#define drawfill(position, size, rgb, alpha, flag)
#define draw_endBoldFont()
void Cmd_MapVote_MapDownload(int argc)
bool mv_selection_keyboard
void MapVote_Draw_Export(int fh)
void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string gtype, string pic, int _count, int id, int most_votes)
float mv_select_lasttime[MAPVOTE_COUNT]
vector gtv_text_size_small
void GameTypeVote_ReadOption(int i)
void MapVote_UpdateMask()
int mv_flags[MAPVOTE_COUNT]
int mv_flags_start[MAPVOTE_COUNT]
string ssdirs[NUM_SSDIRS]
void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, string pic, int _count, int id, int most_votes)
int MapVote_MoveRight(int pos)
vector MapVote_GridVec(vector gridspec, int i, int m)
void MapVote_CheckPic(string pic, string pk3, int id)
string mv_entries[MAPVOTE_COUNT]
void MapVote_DrawMapPicture(string pic, vector pos, vector img_size, float theAlpha)
void MapVote_CheckPK3(string pic, string pk3, int id)
void MapVote_ReadOption(int i)
bool PreviewExists(string name)
void MapVote_SendChoice(int index)
void MapVote_UpdateVotes()
void Net_MapVote_Picture()
int MapVote_MoveLeft(int pos)
float MapVote_InputEvent(int bInputType, float nPrimary, float nSecondary)
float mv_suggester_cachetime
string mv_suggester_cache
string mv_desc[MAPVOTE_COUNT]
string mv_data[MAPVOTE_COUNT]
vector MapVote_RGB(int id)
void MapVote_DrawSuggester(vector pos)
int mv_votes[MAPVOTE_COUNT]
string MapVote_FormatMapItem(int id, string map, int _count, float maxwidth, vector fontsize, int most_votes)
int MapVote_MoveUp(int pos)
void MapVote_DrawAbstain(vector pos, float tsize, int _count, int id)
int MapVote_MoveDown(int pos)
string mv_suggester[MAPVOTE_COUNT]
float mv_preview[MAPVOTE_COUNT]
float MapVote_Selection(vector topleft, vector cellsize, float rows, float columns)
string mv_pics[MAPVOTE_COUNT]
bool autocvar_cl_readpicture_force
float autocvar_hud_panel_mapvote_highlight_border
string autocvar_menu_skin
ERASEABLE string rgb_to_hexcolor(vector rgb)
string textShortenToWidth(string theText, float maxWidth, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
string getWrappedLine(float maxWidth, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
string getWrappedLine_remaining
#define count_seconds(time)
const float DRAWFLAG_NORMAL
vector drawgetimagesize(string pic)
#define tokenizebyseparator
ERASEABLE bool fexists(string f)
void HUD_Panel_LoadCvars()
vector HUD_GetFontsize(string cvarname)
vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspect)
#define HUD_Panel_DrawBg()
bool autocvar_hud_cursormode
#define HUD_Write_Cvar(cvar)
noref float vid_conheight
#define NET_HANDLE(id, param)
string MapInfo_Type_Description(Gametype t)
string MapInfo_Type_ToText(Gametype t)
Gametype MapInfo_Type_FromString(string gtype, bool dowarn, bool is_q3compat)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
#define make_pure(e)
direct use is
ERASEABLE string ColorTranslateRGB(string s)
float stringwidth_nocolors(string s, vector theSize)
float stringwidth_colors(string s, vector theSize)