#pragma once

#include "listbox.qh"
CLASS(XonoticCvarList, XonoticListBox)
	METHOD(XonoticCvarList, configureXonoticCvarList, void(entity));
	ATTRIB(XonoticCvarList, rowsPerItem, float, 1);
	METHOD(XonoticCvarList, drawListBoxItem, void(entity, int, vector, bool, bool));
	METHOD(XonoticCvarList, resizeNotify, void(entity, vector, vector, vector, vector));
	METHOD(XonoticCvarList, keyDown, float(entity, float, float, float));
	METHOD(XonoticCvarList, showNotify, void(entity));
	METHOD(XonoticCvarList, hideNotify, void(entity));

	METHOD(XonoticCvarList, destroy, void(entity));

	ATTRIB(XonoticCvarList, realFontSize, vector, '0 0 0');
	ATTRIB(XonoticCvarList, realUpperMargin, float, 0);
	ATTRIB(XonoticCvarList, columnNameOrigin, float, 0);
	ATTRIB(XonoticCvarList, columnNameSize, float, 0);
	ATTRIB(XonoticCvarList, columnValueOrigin, float, 0);
	ATTRIB(XonoticCvarList, columnValueSize, float, 0);

	METHOD(XonoticCvarList, mouseRelease, float(entity, vector));
	METHOD(XonoticCvarList, setSelected, void(entity, float));
	METHOD(XonoticCvarList, updateCvarType, bool(entity));

	ATTRIB(XonoticCvarList, controlledTextbox, entity);
	ATTRIB(XonoticCvarList, cvarlistResultCountBox, entity);
	ATTRIB(XonoticCvarList, cvarNameBox, entity);
	ATTRIB(XonoticCvarList, cvarDescriptionBox, entity);
	ATTRIB(XonoticCvarList, cvarTypeBox, entity);
	ATTRIB(XonoticCvarList, cvarValueBox, entity);
	ATTRIB(XonoticCvarList, cvarDefaultBox, entity);
	ATTRIB(XonoticCvarList, cvarNeedsForcing, bool, false);

	ATTRIB(XonoticCvarList, handle, float, -1);
	ATTRIB(XonoticCvarList, cvarName, string);
	ATTRIB(XonoticCvarList, cvarDescription, string);
	ATTRIB(XonoticCvarList, cvarType, string);
	ATTRIB(XonoticCvarList, cvarDefault, string);
ENDCLASS(XonoticCvarList)
entity makeXonoticCvarList();
void CvarList_Filter_Change(entity box, entity me);
void CvarList_Filter_ModifiedCvars(entity box, entity me);
void CvarList_Filter_Descriptions(entity box, entity me);
void CvarList_Value_Change(entity box, entity me);
void CvarList_Revert_Click(entity btn, entity me);
void CvarList_End_Editing(entity box, entity me);

bool autocvar_menu_cvarlist_onlymodified;
bool autocvar_menu_cvarlist_descriptions;
