about summary refs log tree commit diff
path: root/src/game/client/components/voting.hpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-11-08 12:50:46 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-11-08 12:50:46 +0000
commit388a04d957a0fd9af9287cbe6f1ee905371886c7 (patch)
treea493826c21bfca82dbd7b122d859025e0693c62e /src/game/client/components/voting.hpp
parent4fa7806009ec4b6acfbf545e56d22e87ea5fa3f2 (diff)
downloadzcatch-388a04d957a0fd9af9287cbe6f1ee905371886c7.tar.gz
zcatch-388a04d957a0fd9af9287cbe6f1ee905371886c7.zip
better voting support
Diffstat (limited to 'src/game/client/components/voting.hpp')
-rw-r--r--src/game/client/components/voting.hpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/game/client/components/voting.hpp b/src/game/client/components/voting.hpp
index 78e561c7..3341edea 100644
--- a/src/game/client/components/voting.hpp
+++ b/src/game/client/components/voting.hpp
@@ -1,17 +1,14 @@
 #include <game/client/component.hpp>
 #include <game/client/ui.hpp>
 
-class VOTING : public COMPONENT
+extern "C"
 {
-	/*
-	void render_goals(float x, float y, float w);
-	void render_spectators(float x, float y, float w);
-	void render_scoreboard(float x, float y, float w, int team, const char *title);
+	#include <engine/e_memheap.h>
+}
 
-	static void con_key_scoreboard(void *result, void *user_data);
-	
-	bool active;
-	*/
+class VOTING : public COMPONENT
+{
+	HEAP *heap;
 
 	static void con_callvote(void *result, void *user_data);
 	static void con_vote(void *result, void *user_data);
@@ -21,9 +18,20 @@ class VOTING : public COMPONENT
 	char command[512];
 	int voted;
 	
+	void clearoptions();
 	void callvote(const char *type, const char *value);
 	
 public:
+
+	struct VOTEOPTION
+	{
+		VOTEOPTION *next;
+		VOTEOPTION *prev;
+		char command[1];
+	};
+	VOTEOPTION *first;
+	VOTEOPTION *last;
+
 	VOTING();
 	virtual void on_reset();
 	virtual void on_console_init();
@@ -33,7 +41,7 @@ public:
 	void render_bars(RECT bars, bool text);
 	
 	void callvote_kick(int client_id);
-	void callvote_map(const char *map);
+	void callvote_option(int option);
 	
 	void vote(int v); // -1 = no, 1 = yes