hedgewars/uFLUICallback.pas
branchqmlfrontend
changeset 11827 8c71c5a1172f
parent 10951 89a7f617e091
child 11842 93e6c401cc3d
--- a/hedgewars/uFLUICallback.pas	Sun May 01 21:09:45 2016 +0200
+++ b/hedgewars/uFLUICallback.pas	Tue May 17 23:18:08 2016 +0300
@@ -10,10 +10,26 @@
 
 var uiCallbackPointer: pointer;
     uiCallbackFunction: TUICallback;
+    isGame: boolean;
 
 procedure engineMessageCallback(p: pointer; msg: PChar; len: Longword);
 begin
-    if len = 128 * 256 then uiCallbackFunction(uiCallbackPointer, mtPreview, msg, len)
+    if msg^ = 'T' then
+    begin
+        inc(msg);
+        isGame:= msg^ = 'G';
+        exit;
+    end;
+
+    if isGame then
+    begin
+    end
+    else begin
+        if len = 128 * 256 then
+            uiCallbackFunction(uiCallbackPointer, mtPreview, msg, len)
+        else if len = 1 then
+            uiCallbackFunction(uiCallbackPointer, mtPreviewHogCount, msg, len)
+    end;
 end;
 
 procedure registerUIMessagesCallback(p: pointer; f: TUICallback); cdecl;