#pragma once
#include "../panel.qh"

bool autocvar_cl_deathscoreboard;
float autocvar_cl_deathscoreboard_delay = 1;
string autocvar_scoreboard_columns;
float autocvar_hud_panel_scoreboard_namesize = 15;

string autocvar__nextmap;
// no reason for get_nextmap to be a function for now
// macro to not have an unnecessary function call stackframe
#define GET_NEXTMAP() autocvar__nextmap

bool sb_showscores; // set by +showscores engine command

bool scoreboard_active;
float scoreboard_fade_alpha;
float scoreboard_acc_fade_alpha;
float scoreboard_itemstats_fade_alpha;

float scoreboard_top;
float scoreboard_bottom;
float scoreboard_left;
float scoreboard_right;

int numplayers;
int ts_min, ts_max; ///< team size

.bool ignored; // player is ignored

void Cmd_Scoreboard_SetFields(int argc);
void Scoreboard_InitScores();
void Scoreboard_UpdatePlayerTeams();
void Scoreboard_UpdatePlayerPos(entity pl);
void Scoreboard_UpdateTeamPos(entity Team);
bool Scoreboard_WouldDraw();
void Scoreboard_UI_Enable(int mode);

int scoreboard_ui_enabled;
bool autocvar__scoreboard_team_selection;
float HUD_Scoreboard_InputEvent(float bInputType, float nPrimary, float nSecondary);

int scoreboard_selected_panel;
float scoreboard_selected_panel_time;
entity scoreboard_selected_player;
entity scoreboard_selected_team;
int scoreboard_selected_columns_layout;

// start from 1
int SB_PANEL_FIRST       = 1;
int SB_PANEL_SCOREBOARD  = 1;
int SB_PANEL_RANKINGS    = 2;
int SB_PANEL_MAX         = 2;
