#pragma once

bool autocvar__hud_configure;
bool autocvar_hud_configure_checkcollisions;
bool autocvar_hud_configure_grid;
float autocvar_hud_configure_grid_alpha;
string autocvar_hud_configure_vertical_lines = "0.5";
bool autocvar_hud_configure_teamcolorforced;

const int S_MOUSE1 = 1;
const int S_MOUSE2 = 2;
const int S_MOUSE3 = 4;
int mouseClicked;
int prevMouseClicked; // previous state
float prevMouseClickedTime; // time during previous left mouse click, to check for doubleclicks
vector prevMouseClickedPos; // pos during previous left mouse click, to check for doubleclicks

float hud_configure_prev;
float hud_configure_checkcollisions;
vector hud_configure_gridSize;
vector hud_configure_realGridSize;
float hud_configure_menu_open; // 1 showing the entire HUD, 2 showing only the clicked panel
float hud_configure_centerline_time;

void HUD_Panel_ExportCfg(string cfgname);

void HUD_Panel_Mouse();

void HUD_Configure_Frame();

void HUD_Configure_PostDraw();

float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary);

void HUD_Panel_EnableMenu();

void HUD_Panel_FirstInDrawQ(float id);

#define HUD_Write(s) fputs(fh, s)
#define HUD_Write_Cvar(cvar) HUD_Write(strcat("seta ", cvar, " \"", cvar_string(cvar), "\"\n"))
#define HUD_Write_PanelCvar(cvar_suf) str = strcat("hud_panel_", panel.panel_name, cvar_suf), HUD_Write_Cvar(str)
