about summary refs log tree commit diff
path: root/src/game/client/gameclient.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2009-06-13 17:18:06 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2009-06-13 17:18:06 +0000
commitbc20e9c433c1c7bd2a9516a936d1d7ffee1e90f2 (patch)
tree172eb47c01b26969ccda334006f83859f43abe90 /src/game/client/gameclient.cpp
parent6d9ccee95dd99fecda3a6ba62c2768b4d39f69e5 (diff)
downloadzcatch-bc20e9c433c1c7bd2a9516a936d1d7ffee1e90f2.tar.gz
zcatch-bc20e9c433c1c7bd2a9516a936d1d7ffee1e90f2.zip
localization update
Diffstat (limited to 'src/game/client/gameclient.cpp')
-rw-r--r--src/game/client/gameclient.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp
index ae501fa2..834aa29b 100644
--- a/src/game/client/gameclient.cpp
+++ b/src/game/client/gameclient.cpp
@@ -6,6 +6,7 @@
 #include <game/generated/gc_data.hpp>
 
 #include <game/layers.hpp>
+#include <game/localization.hpp>
 #include "render.hpp"
 
 #include "gameclient.hpp"
@@ -158,7 +159,10 @@ void GAMECLIENT::on_console_init()
 	input.add(&emoticon);
 	input.add(controls);
 	input.add(binds);
-		
+	
+	//	
+	MACRO_REGISTER_COMMAND("language", "s", CFGFLAG_CLIENT, con_language, this, "Sets the language");
+	
 	// add the some console commands
 	MACRO_REGISTER_COMMAND("team", "i", CFGFLAG_CLIENT, con_team, this, "Switch team");
 	MACRO_REGISTER_COMMAND("kill", "", CFGFLAG_CLIENT, con_kill, this, "Kill yourself");
@@ -881,3 +885,10 @@ void GAMECLIENT::con_kill(void *result, void *user_data)
 {
 	((GAMECLIENT*)user_data)->send_kill(-1);
 }
+
+void GAMECLIENT::con_language(void *result, void *user_data)
+{
+	char buf[128];
+	str_format(buf, sizeof(buf), "data/languages/%s.txt", console_arg_string(result, 0));
+	localization.load(buf);
+}