Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
cl_mapvoting.qh File Reference
#include "mapvoting.qh"
Include dependency graph for cl_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)
void MapVote_CheckPic (string pic, string pk3, int id)
float MapVote_InputEvent (float bInputType, float nPrimary, float nSecondary)
bool PreviewExists (string name)

Variables

bool autocvar_cl_readpicture_force
float autocvar_hud_panel_mapvote_highlight_border = 1
string autocvar_menu_skin
bool gametypevote
vector gtv_text_size
vector gtv_text_size_small
bool mv_active
string mv_chosenmap
int mv_columns
string mv_data [MAPVOTE_COUNT]
 (shared) map pk3 name/gametype human readable name
string mv_desc [MAPVOTE_COUNT]
 (gt) gametype description
int mv_flags_start [MAPVOTE_COUNT]
 (gt) mv_flags initially
int mv_mouse_selection
int mv_ownvote
string mv_pics [MAPVOTE_COUNT]
 (shared) pic file location
entity mv_pk3list
float mv_preview [MAPVOTE_COUNT]
 (shared) whether there is a pic
float mv_reduce_alpha
float mv_select_lasttime [MAPVOTE_COUNT]
int mv_selection
bool mv_selection_keyboard
string mv_suggester_cache
float mv_suggester_cachetime
int mv_tie_winner
float mv_winner_alpha
float mv_winner_time

Function Documentation

◆ Cmd_MapVote_MapDownload()

void Cmd_MapVote_MapDownload ( int argc)

Definition at line 599 of file cl_mapvoting.qc.

600{
601 TC(int, argc);
602
603 if (argc != 2 || !mv_pk3list)
604 {
605 LOG_INFO(_("mv_mapdownload: ^3You're not supposed to use this command on your own!"));
606 return;
607 }
608
609 entity pak;
610 int id = stoi(argv(1));
611 for (pak = mv_pk3list; pak; pak = pak.chain)
612 if (pak.sv_entnum == id)
613 break;
614
615 if (!pak || pak.sv_entnum != id)
616 {
617 LOG_INFO(_("^1Error:^7 Couldn't find pak index."));
618 return;
619 }
620
621 if (PreviewExists(pak.message))
622 {
623 mv_preview[id] = true;
624 return;
625 }
626 else
627 {
628 LOG_INFO(_("Requesting preview..."));
629 localcmd("\ncmd mv_getpicture ", ftos(id), "\n");
630 }
631}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
bool PreviewExists(string name)
entity mv_pk3list
float mv_preview[MAPVOTE_COUNT]
(shared) whether there is a pic
#define stoi(s)
Definition int.qh:4
#define TC(T, sym)
Definition _all.inc:82
#define LOG_INFO(...)
Definition log.qh:62
void localcmd(string command,...)
string ftos(float f)
string argv(float n)

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

Referenced by LocalCommand_mv_download(), and MapVote_CheckPK3().

◆ MapVote_CheckPic()

void MapVote_CheckPic ( string pic,
string pk3,
int id )

Definition at line 650 of file cl_mapvoting.qc.

651{
652 TC(int, id);
653 // never try to retrieve a pic for the "don't care" 'map'
654 if (mv_abstain && id == mv_count - 1)
655 return;
656
657 if (PreviewExists(pic))
658 {
659 mv_preview[id] = true;
660 return;
661 }
662 MapVote_CheckPK3(pic, pk3, id);
663}
void MapVote_CheckPK3(string pic, string pk3, int id)
bool mv_abstain
(shared) if abstaining is possible, false in gametype voting
Definition mapvoting.qh:21
int mv_count
(shared) number of maps/gametypes
Definition mapvoting.qh:14

References MapVote_CheckPK3(), mv_abstain, mv_count, mv_preview, PreviewExists(), and TC.

Referenced by MapVote_ReadOption().

◆ MapVote_InputEvent()

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

◆ PreviewExists()

bool PreviewExists ( string name)

Definition at line 22 of file cl_mapvoting.qc.

23{
25 return false;
26
27 if (fexists(strcat(name, ".tga"))
28 || fexists(strcat(name, ".png"))
29 || fexists(strcat(name, ".jpg"))
30 || fexists(strcat(name, ".pcx")))
31 return true;
32
33 return false;
34}
bool autocvar_cl_readpicture_force
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 cl_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 cl_mapvoting.qh.

Referenced by GameTypeVote_DrawGameTypeItem(), and MapVote_DrawMapItem().

◆ autocvar_menu_skin

string autocvar_menu_skin

Definition at line 7 of file cl_mapvoting.qh.

Referenced by GameTypeVote_ReadOption(), and minigame_texture().

◆ gametypevote

◆ gtv_text_size

vector gtv_text_size

Definition at line 40 of file cl_mapvoting.qh.

Referenced by GameTypeVote_DrawGameTypeItem(), and MapVote_Draw().

◆ gtv_text_size_small

vector gtv_text_size_small

Definition at line 41 of file cl_mapvoting.qh.

Referenced by GameTypeVote_DrawGameTypeItem(), and MapVote_Draw().

◆ mv_active

◆ mv_chosenmap

string mv_chosenmap

Definition at line 39 of file cl_mapvoting.qh.

Referenced by MapVote_Draw(), and MapVote_Init_Client().

◆ mv_columns

int mv_columns

Definition at line 33 of file cl_mapvoting.qh.

Referenced by MapVote_Draw(), MapVote_MoveDown(), and MapVote_MoveUp().

◆ mv_data

(shared) map pk3 name/gametype human readable name

Definition at line 17 of file cl_mapvoting.qh.

Referenced by GameTypeVote_DrawGameTypeItem(), GameTypeVote_ReadOption(), and MapVote_ReadOption().

◆ mv_desc

(gt) gametype description

Definition at line 20 of file cl_mapvoting.qh.

Referenced by GameTypeVote_DrawGameTypeItem(), and GameTypeVote_ReadOption().

◆ mv_flags_start

int mv_flags_start[MAPVOTE_COUNT]

(gt) mv_flags initially

Definition at line 21 of file cl_mapvoting.qh.

Referenced by GameTypeVote_DrawGameTypeItem(), and MapVote_Init_Client().

◆ mv_mouse_selection

int mv_mouse_selection

Definition at line 34 of file cl_mapvoting.qh.

Referenced by MapVote_InputEvent(), and MapVote_Selection().

◆ mv_ownvote

◆ mv_pics

(shared) pic file location

Definition at line 19 of file cl_mapvoting.qh.

Referenced by GameTypeVote_ReadOption(), MapVote_Draw(), MapVote_ReadOption(), and NET_HANDLE().

◆ mv_pk3list

entity mv_pk3list

Definition at line 23 of file cl_mapvoting.qh.

Referenced by Cmd_MapVote_MapDownload(), MapVote_CheckPK3(), and MapVote_Init_Client().

◆ mv_preview

float mv_preview[MAPVOTE_COUNT]

(shared) whether there is a pic

Definition at line 18 of file cl_mapvoting.qh.

Referenced by Cmd_MapVote_MapDownload(), GameTypeVote_ReadOption(), MapVote_CheckPic(), MapVote_Draw(), MapVote_ReadOption(), and NET_HANDLE().

◆ mv_reduce_alpha

float mv_reduce_alpha

◆ mv_select_lasttime

◆ mv_selection

◆ mv_selection_keyboard

bool mv_selection_keyboard

Definition at line 35 of file cl_mapvoting.qh.

Referenced by MapVote_Init_Client(), MapVote_InputEvent(), and MapVote_Selection().

◆ mv_suggester_cache

string mv_suggester_cache

Definition at line 29 of file cl_mapvoting.qh.

Referenced by MapVote_DrawSuggester(), and MapVote_Init_Client().

◆ mv_suggester_cachetime

float mv_suggester_cachetime

Definition at line 30 of file cl_mapvoting.qh.

Referenced by MapVote_DrawSuggester(), and MapVote_Init_Client().

◆ mv_tie_winner

int mv_tie_winner

◆ mv_winner_alpha

float mv_winner_alpha

Definition at line 28 of file cl_mapvoting.qh.

Referenced by MapVote_Draw(), MapVote_DrawAbstain(), and MapVote_DrawMapItem().

◆ mv_winner_time