X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fmapvoting.qc;h=7071231651b2b69149bbbd2bf226abfe1df95496;hp=6610f80362b3d8b3241dff339cf409fec5a51288;hb=a685802e37c3d93737d62224bc84f950cc086b4c;hpb=3de5549a700520f8ef62400b42acf3db8eb00514 diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 6610f80362..7071231651 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -1,18 +1,13 @@ #include "mapvoting.qh" -#include "_all.qh" -#include "hud.qh" +#include "hud/all.qh" #include "scoreboard.qh" -#include "../common/mapinfo.qh" -#include "../common/util.qh" - -#include "../dpdefs/keycodes.qh" +#include int mv_num_maps; -float mv_active; string mv_maps[MAPVOTE_COUNT]; string mv_pics[MAPVOTE_COUNT]; string mv_pk3[MAPVOTE_COUNT]; // map pk3 name or gametype human readable name @@ -487,7 +482,7 @@ void MapVote_Draw() MapVote_DrawAbstain(pos, dist.x, xmax - xmin, tmp, i); } - drawpic(mv_mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), '32 32 0', '1 1 1', 1 - autocvar__menu_alpha, DRAWFLAG_NORMAL); + draw_cursor_normal(mv_mousepos, '1 1 1', 1 - autocvar__menu_alpha); } void Cmd_MapVote_MapDownload(float argc) @@ -496,7 +491,7 @@ void Cmd_MapVote_MapDownload(float argc) if(argc != 2 || !mv_pk3list) { - print(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n")); + LOG_INFO(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n")); return; } @@ -506,7 +501,7 @@ void Cmd_MapVote_MapDownload(float argc) break; if(!pak || pak.sv_entnum != id) { - print(_("^1Error:^7 Couldn't find pak index.\n")); + LOG_INFO(_("^1Error:^7 Couldn't find pak index.\n")); return; } @@ -515,7 +510,7 @@ void Cmd_MapVote_MapDownload(float argc) mv_preview[id] = true; return; } else { - print(_("Requesting preview...\n")); + LOG_INFO(_("Requesting preview...\n")); localcmd(strcat("\ncmd mv_getpicture ", ftos(id), "\n")); } } @@ -631,8 +626,6 @@ void GameTypeVote_ReadOption(int i) void MapVote_Init() { - precache_sound ("misc/invshot.wav"); - mv_active = 1; if(autocvar_hud_cursormode) { setcursormode(1); } else { mv_mousepos = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight; } @@ -858,9 +851,11 @@ void MapVote_UpdateVotes() mv_ownvote = ReadByte()-1; } -void Ent_MapVote() +NET_HANDLE(ENT_CLIENT_MAPVOTE, bool isnew) { + make_pure(this); int sf = ReadByte(); + return = true; if(sf & 1) MapVote_Init(); @@ -872,6 +867,12 @@ void Ent_MapVote() MapVote_UpdateVotes(); } +NET_HANDLE(TE_CSQC_PICTURE, bool isNew) +{ + Net_MapVote_Picture(); + return true; +} + void Net_MapVote_Picture() { int type = ReadByte();