about summary refs log tree commit diff
path: root/src/game/client/components/menus.hpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-10-06 18:05:01 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-10-06 18:05:01 +0000
commit12472ef7f405f5e8eb620059cbf95926a458538a (patch)
tree712cc453e491ff46c96b48785a94093b1d17cb1f /src/game/client/components/menus.hpp
parentd1b55351ccc2252917ad494b74bb6ad562df34ce (diff)
downloadzcatch-12472ef7f405f5e8eb620059cbf95926a458538a.tar.gz
zcatch-12472ef7f405f5e8eb620059cbf95926a458538a.zip
major update. continued on ban support. added demo recording (client and server side). added demo player. added demo menu. demos have some quirks and file size optimizations havn't been done yet. some interface tweaks
Diffstat (limited to 'src/game/client/components/menus.hpp')
-rw-r--r--src/game/client/components/menus.hpp39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/game/client/components/menus.hpp b/src/game/client/components/menus.hpp
index 8aae925f..51090b93 100644
--- a/src/game/client/components/menus.hpp
+++ b/src/game/client/components/menus.hpp
@@ -15,6 +15,9 @@ class MENUS : public COMPONENT
 	
 	static vec4 button_color_mul(const void *id);
 
+
+	static void ui_draw_demoplayer_button(const void *id, const char *text, int checked, const RECT *r, const void *extra);
+
 	static void ui_draw_browse_icon(int what, const RECT *r);
 	static void ui_draw_menu_button(const void *id, const char *text, int checked, const RECT *r, const void *extra);
 	static void ui_draw_keyselect_button(const void *id, const char *text, int checked, const RECT *r, const void *extra);
@@ -33,6 +36,19 @@ class MENUS : public COMPONENT
 	static int ui_do_key_reader(void *id, const RECT *rect, int key);
 	static void ui_do_getbuttons(int start, int stop, RECT view);
 
+	struct LISTBOXITEM
+	{
+		int visible;
+		int selected;
+		RECT rect;
+	};
+	
+	static void ui_do_listbox_start(void *id, const RECT *rect, float row_height, const char *title, int num_items, int selected_index);
+	static LISTBOXITEM ui_do_listbox_nextitem(void *id);
+	static int ui_do_listbox_end();
+	
+	//static void demolist_listdir_callback(const char *name, int is_dir, void *user);
+	//static void demolist_list_callback(const RECT *rect, int index, void *user);
 
 	enum
 	{
@@ -53,6 +69,7 @@ class MENUS : public COMPONENT
 		PAGE_INTERNET,
 		PAGE_LAN,
 		PAGE_FAVORITES,
+		PAGE_DEMOS,
 		PAGE_SETTINGS,
 		PAGE_SYSTEM,
 	};
@@ -71,7 +88,9 @@ class MENUS : public COMPONENT
 	static int num_inputevents;
 	
 	// some settings
-	float button_height;
+	static float button_height;
+	static float listheader_height;
+	static float fontmod_height;
 	
 	// for graphic settings
 	bool need_restart;
@@ -79,6 +98,20 @@ class MENUS : public COMPONENT
 	// for call vote
 	int callvote_selectedplayer;
 	int callvote_selectedmap;
+	
+	// demo
+	struct DEMOITEM
+	{
+		char filename[512];
+		char name[256];
+	};
+	
+	DEMOITEM *demos;
+	int num_demos;
+		
+	void demolist_populate();
+	static void demolist_count_callback(const char *name, int is_dir, void *user);
+	static void demolist_fetch_callback(const char *name, int is_dir, void *user);
 
 	// found in menus.cpp
 	int render();
@@ -87,6 +120,10 @@ class MENUS : public COMPONENT
 	int render_menubar(RECT r);
 	void render_news(RECT main_view);
 	
+	// found in menus_demo.cpp
+	void render_demoplayer(RECT main_view);
+	void render_demolist(RECT main_view);
+	
 	// found in menus_ingame.cpp
 	void render_game(RECT main_view);
 	void render_serverinfo(RECT main_view);