hedgewars/hwengine.pas
branchqmlfrontend
changeset 11828 a69124eb7ce7
parent 11827 8c71c5a1172f
parent 11776 f2031643fe98
child 11841 6adf27e85cae
--- a/hedgewars/hwengine.pas	Tue May 17 23:18:08 2016 +0300
+++ b/hedgewars/hwengine.pas	Tue May 17 23:29:49 2016 +0300
@@ -42,6 +42,22 @@
 implementation
 uses uFLUICallback, uFLTypes;
 
+// TODO localization support
+procedure ShowCredits();
+var themeCredits, mapCredits: shortstring;
+begin
+    if Length(cMapName) > 0 then
+        begin
+        mapCredits:= read1stLn(cPathz[ptMapCurrent] + '/credits.txt');
+        if Length(mapCredits) > 0 then
+            AddChatString(char(#11) + '© Map: ' + mapCredits);
+        end;
+
+        themeCredits:= read1stLn(cPathz[ptCurrTheme] + '/credits.txt');
+        if Length(themeCredits) > 0 then
+            AddChatString(char(#12) + '© Theme: ' + themeCredits);
+end;
+
 ///////////////////////////////////////////////////////////////////////////////
 function DoTimer(Lag: LongInt): boolean;
 var s: shortstring;
@@ -86,6 +102,7 @@
                 with TeamsArray[t]^ do
                     MaxTeamHealth:= TeamHealth;
             RecountAllTeamsHealth;
+            if not cOnlyStats then ShowCredits;
             GameState:= gsGame;
             end;
         gsConfirm, gsGame, gsChat: