hedgewars/uFLGameConfig.pas
branchqmlfrontend
changeset 10819 57e21f7621b0
parent 10612 eb3c1a289a23
child 10888 a04e04aaf599
--- a/hedgewars/uFLGameConfig.pas	Sat Feb 07 23:26:14 2015 +0300
+++ b/hedgewars/uFLGameConfig.pas	Sun Feb 08 00:10:05 2015 +0300
@@ -13,13 +13,14 @@
 function  getSeed: PChar; cdecl;
 procedure setTheme(themeName: PChar); cdecl;
 procedure setScript(scriptName: PChar); cdecl;
+procedure setScheme(schemeName: PChar); cdecl;
 
 procedure tryAddTeam(teamName: PChar); cdecl;
 procedure tryRemoveTeam(teamName: PChar); cdecl;
 procedure changeTeamColor(teamName: PChar; dir: LongInt); cdecl;
 
 implementation
-uses uFLIPC, hwengine, uFLUtils, uFLTeams, uFLData;
+uses uFLIPC, hwengine, uFLUtils, uFLTeams, uFLData, uFLSChemes;
 
 var guiCallbackPointer: pointer;
     guiCallbackFunction: TGUICallback;
@@ -33,6 +34,7 @@
             seed: shortstring;
             theme: shortstring;
             script: shortstring;
+            scheme: TScheme;
             mapgen: Longint;
             gameType: TGameType;
             teams: array[0..7] of TTeam;
@@ -65,6 +67,8 @@
             ipcToEngine('e$mapgen ' + intToStr(mapgen));
             ipcToEngine('e$theme ' + theme);
 
+            sendSchemeConfig(scheme);
+
             i:= 0;
             while (i < 8) and (teams[i].hogsNumber > 0) do
                 begin
@@ -323,4 +327,13 @@
         currentConfig.script:= ''
 end;
 
+procedure setScheme(schemeName: PChar); cdecl;
+var scheme: PScheme;
+begin
+    scheme:= schemeByName(schemeName);
+
+    if scheme <> nil then
+        currentConfig.scheme:= scheme^
+end;
+
 end.