hedgewars/uSound.pas
changeset 4398 36d7e4b6ca81
parent 4377 43945842da0c
child 4403 0dfe26f48ec1
--- a/hedgewars/uSound.pas	Sun Nov 21 09:37:48 2010 -0500
+++ b/hedgewars/uSound.pas	Sun Nov 21 17:48:58 2010 +0300
@@ -46,7 +46,7 @@
 
 
 implementation
-uses uMisc, uVariables, uConsole, uUtils, uIO;
+uses uMisc, uVariables, uConsole, uUtils, uIO, uCommands;
 
 const chanTPU = 32;
 var Volume: LongInt;
@@ -317,8 +317,17 @@
     Mix_ResumeMusic(Mus);
 end;
 
+procedure chVoicepack(var s: shortstring);
+begin
+    if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/voicepack"', true);
+    if s[1]='"' then Delete(s, 1, 1);
+    if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
+    CurrentTeam^.voicepack:= AskForVoicepack(s)
+end;
+
 procedure initModule;
 begin
+    RegisterVariable('voicepack', vtCommand, @chVoicepack, false);
     MusicFN:='';
 end;