Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
mapvoting.qh File Reference
Include dependency graph for mapvoting.qh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void Cmd_MapVote_MapDownload (int argc)
float MapVote_InputEvent (float bInputType, float nPrimary, float nSecondary)
void Net_MapVote_Picture ()
bool PreviewExists (string name)

Variables

bool autocvar_cl_readpicture_force
float autocvar_hud_panel_mapvote_highlight_border = 1
string autocvar_menu_skin
bool mv_active
int mv_winner
float xmax
float xmin
float ymax
float ymin

Function Documentation

◆ Cmd_MapVote_MapDownload()

void Cmd_MapVote_MapDownload ( int argc)

Definition at line 647 of file mapvoting.qc.

648{
649 TC(int, argc);
650
651 if (argc != 2 || !mv_pk3list)
652 {
653 LOG_INFO(_("mv_mapdownload: ^3You're not supposed to use this command on your own!"));
654 return;
655 }
656
657 entity pak;
658 const int id = stof(argv(1));
659 for (pak = mv_pk3list; pak; pak = pak.chain)
660 if (pak.sv_entnum == id)
661 break;
662
663 if (!pak || pak.sv_entnum != id)
664 {
665 LOG_INFO(_("^1Error:^7 Couldn't find pak index."));
666 return;
667 }
668
669 if (PreviewExists(pak.message))
670 {
671 mv_preview[id] = true;
672 return;
673 }
674 else
675 {
676 LOG_INFO(_("Requesting preview..."));
677 localcmd("\ncmd mv_getpicture ", ftos(id), "\n");
678 }
679}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
bool PreviewExists(string name)
Definition mapvoting.qc:59
entity mv_pk3list
Definition mapvoting.qc:30
float mv_preview[MAPVOTE_COUNT]
Definition mapvoting.qc:25
#define TC(T, sym)
Definition _all.inc:82
#define LOG_INFO(...)
Definition log.qh:65
void localcmd(string command,...)
float stof(string val,...)
string ftos(float f)
string argv(float n)

References argv(), entity(), ftos(), localcmd(), LOG_INFO, mv_pk3list, mv_preview, PreviewExists(), stof(), and TC.

Referenced by LocalCommand_mv_download(), and MapVote_CheckPK3().

◆ MapVote_InputEvent()

float MapVote_InputEvent ( float bInputType,
float nPrimary,
float nSecondary )

◆ Net_MapVote_Picture()

void Net_MapVote_Picture ( )

Definition at line 1110 of file mapvoting.qc.

1111{
1112 const int type = ReadByte();
1113 mv_preview[type] = true;
1114 mv_pics[type] = strzone(ReadPicture());
1115}
string mv_pics[MAPVOTE_COUNT]
Definition mapvoting.qc:21
int ReadByte()
string strzone(string s)

References mv_pics, mv_preview, ReadByte(), and strzone().

Referenced by NET_HANDLE().

◆ PreviewExists()

bool PreviewExists ( string name)

Definition at line 59 of file mapvoting.qc.

60{
62 return false;
63
64 if (fexists(strcat(name, ".tga"))) return true;
65 if (fexists(strcat(name, ".png"))) return true;
66 if (fexists(strcat(name, ".jpg"))) return true;
67 if (fexists(strcat(name, ".pcx"))) return true;
68
69 return false;
70}
bool autocvar_cl_readpicture_force
Definition mapvoting.qh:5
ERASEABLE bool fexists(string f)
Definition file.qh:4
string name
Definition menu.qh:30
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))

References autocvar_cl_readpicture_force, fexists(), name, and strcat().

Referenced by Cmd_MapVote_MapDownload(), GameTypeVote_ReadOption(), and MapVote_CheckPic().

Variable Documentation

◆ autocvar_cl_readpicture_force

bool autocvar_cl_readpicture_force

Definition at line 5 of file mapvoting.qh.

Referenced by PreviewExists().

◆ autocvar_hud_panel_mapvote_highlight_border

float autocvar_hud_panel_mapvote_highlight_border = 1

Definition at line 6 of file mapvoting.qh.

Referenced by GameTypeVote_DrawGameTypeItem(), and MapVote_DrawMapItem().

◆ autocvar_menu_skin

string autocvar_menu_skin

Definition at line 7 of file mapvoting.qh.

Referenced by GameTypeVote_ReadOption(), and minigame_texture().

◆ mv_active

◆ mv_winner

◆ xmax

float xmax

Definition at line 19 of file mapvoting.qh.

Referenced by MapVote_Draw().

◆ xmin

float xmin

Definition at line 19 of file mapvoting.qh.

Referenced by MapVote_Draw().

◆ ymax

float ymax

Definition at line 19 of file mapvoting.qh.

Referenced by MapVote_Draw().

◆ ymin

float ymin

Definition at line 19 of file mapvoting.qh.

Referenced by MapVote_Draw().