some initial credits-display implementation
authorsheepluva
Fri, 29 Apr 2016 00:56:04 +0200
changeset 11774 8b17caab10ec
parent 11773 b58dd09ea950
child 11775 68f26b6a3a7d
some initial credits-display implementation
CREDITS
hedgewars/hwengine.pas
share/hedgewars/Data/Maps/Bamboo/CMakeLists.txt
share/hedgewars/Data/Maps/Bamboo/credits.txt
share/hedgewars/Data/Maps/BambooPlinko/CMakeLists.txt
share/hedgewars/Data/Maps/BambooPlinko/credits.txt
share/hedgewars/Data/Maps/Bath/CMakeLists.txt
share/hedgewars/Data/Maps/Bath/credits.txt
share/hedgewars/Data/Maps/Castle/CMakeLists.txt
share/hedgewars/Data/Maps/Castle/credits.txt
share/hedgewars/Data/Maps/EarthRise/CMakeLists.txt
share/hedgewars/Data/Maps/EarthRise/credits.txt
share/hedgewars/Data/Maps/Hedgelove/CMakeLists.txt
share/hedgewars/Data/Maps/Hedgelove/credits.txt
share/hedgewars/Data/Maps/Hydrant/CMakeLists.txt
share/hedgewars/Data/Maps/Hydrant/credits.txt
share/hedgewars/Data/Maps/Mushrooms/CMakeLists.txt
share/hedgewars/Data/Maps/Mushrooms/credits.txt
share/hedgewars/Data/Maps/PirateFlag/CMakeLists.txt
share/hedgewars/Data/Maps/PirateFlag/credits.txt
share/hedgewars/Data/Maps/Plane/CMakeLists.txt
share/hedgewars/Data/Maps/Plane/credits.txt
share/hedgewars/Data/Maps/ShoppaKing/CMakeLists.txt
share/hedgewars/Data/Maps/ShoppaKing/credits.txt
share/hedgewars/Data/Maps/Sticks/CMakeLists.txt
share/hedgewars/Data/Maps/Sticks/credits.txt
share/hedgewars/Data/Maps/TrophyRace/CMakeLists.txt
share/hedgewars/Data/Maps/TrophyRace/credits.txt
share/hedgewars/Data/Themes/Bamboo/CMakeLists.txt
share/hedgewars/Data/Themes/Bamboo/credits.txt
share/hedgewars/Data/Themes/Cave/CMakeLists.txt
share/hedgewars/Data/Themes/Cave/credits.txt
share/hedgewars/Data/Themes/City/CMakeLists.txt
share/hedgewars/Data/Themes/City/credits.txt
share/hedgewars/Data/Themes/EarthRise/CMakeLists.txt
share/hedgewars/Data/Themes/EarthRise/credits.txt
share/hedgewars/Data/Themes/Freeway/CMakeLists.txt
share/hedgewars/Data/Themes/Freeway/credits.txt
share/hedgewars/Data/Themes/Hell/CMakeLists.txt
share/hedgewars/Data/Themes/Hell/credits.txt
share/hedgewars/Data/Themes/Jungle/CMakeLists.txt
share/hedgewars/Data/Themes/Jungle/credits.txt
share/hedgewars/Data/Themes/Nature/CMakeLists.txt
share/hedgewars/Data/Themes/Nature/credits.txt
share/hedgewars/Data/Themes/Sheep/CMakeLists.txt
share/hedgewars/Data/Themes/Sheep/credits.txt
share/hedgewars/Data/Themes/Snow/CMakeLists.txt
share/hedgewars/Data/Themes/Snow/credits.txt
--- a/CREDITS	Thu Apr 28 21:28:22 2016 +0200
+++ b/CREDITS	Fri Apr 29 00:56:04 2016 +0200
@@ -39,7 +39,7 @@
 - Joshua Frese <joshfrese@gmail.com> -> Bamboo (2008), EarthRise (2008), Freeway (2008), BambooPlinko (2008)
 - Stanko Tadić <stanko@mfhinc.net> -> Castle (2008), PirateFlag (2008)
 - dctPL -> Sticks (2010)
-- wolfmark & Dragonfly -> TrophyRace (2010), ShoppaKing (2010)
+- wolfmarc & Dragonfly -> TrophyRace (2010), ShoppaKing (2010)
 
 ==========
 = MUSIC
--- a/hedgewars/hwengine.pas	Thu Apr 28 21:28:22 2016 +0200
+++ b/hedgewars/hwengine.pas	Fri Apr 29 00:56:04 2016 +0200
@@ -52,6 +52,39 @@
 procedure freeEverything(complete:boolean); forward;
 {$ENDIF}
 
+function read1stLn(filePath: shortstring): shortstring;
+var f: pfsFile;
+begin
+    read1stLn:= '';
+    if pfsExists(filePath) then
+        begin
+        f:= pfsOpenRead(filePath);
+        if (not pfsEOF(f)) and allOK then
+            pfsReadLn(f, read1stLn);
+        pfsClose(f);
+        f:= nil;
+        end;
+end;
+
+// 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(6) + '© Map: ' + mapCredits);
+        end;
+
+        themeCredits:= read1stLn(cPathz[ptCurrTheme] + '/credits.txt');
+        if Length(themeCredits) > 0 then
+            AddChatString(char(8) + '© Theme: ' + themeCredits);
+
+        //AddChatString(char(9) + '© Hats : TODO');
+        //AddChatString(char(2) + '© Music : TODO');
+end;
+
 ///////////////////////////////////////////////////////////////////////////////
 function DoTimer(Lag: LongInt): boolean;
 var s: shortstring;
@@ -96,6 +129,7 @@
                 with TeamsArray[t]^ do
                     MaxTeamHealth:= TeamHealth;
             RecountAllTeamsHealth;
+            ShowCredits;
             GameState:= gsGame;
             end;
         gsConfirm, gsGame, gsChat:
--- a/share/hedgewars/Data/Maps/Bamboo/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Maps/Bamboo/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -2,4 +2,5 @@
     map.png
     map.cfg
     preview.png
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Maps/Bamboo)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Maps/Bamboo/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+Joshua Frese
\ No newline at end of file
--- a/share/hedgewars/Data/Maps/BambooPlinko/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Maps/BambooPlinko/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -2,4 +2,5 @@
     map.png
     map.cfg
     preview.png
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Maps/BambooPlinko)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Maps/BambooPlinko/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+Joshua Frese
\ No newline at end of file
--- a/share/hedgewars/Data/Maps/Bath/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Maps/Bath/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -2,4 +2,5 @@
     map.png
     map.cfg
     preview.png
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Maps/Bath)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Maps/Bath/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+John Dum
--- a/share/hedgewars/Data/Maps/Castle/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Maps/Castle/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -3,4 +3,5 @@
     mask.png
     map.cfg
     preview.png
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Maps/Castle)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Maps/Castle/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+Stanko Tadić
\ No newline at end of file
--- a/share/hedgewars/Data/Maps/EarthRise/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Maps/EarthRise/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -3,4 +3,5 @@
     mask.png
     map.cfg
     preview.png
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Maps/EarthRise)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Maps/EarthRise/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+Joshua Frese
\ No newline at end of file
--- a/share/hedgewars/Data/Maps/Hedgelove/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Maps/Hedgelove/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -2,4 +2,5 @@
     map.png
     map.cfg
     preview.png
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Maps/Hedgelove)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Maps/Hedgelove/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+John Dum
--- a/share/hedgewars/Data/Maps/Hydrant/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Maps/Hydrant/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -2,4 +2,5 @@
     map.png
     map.cfg
     preview.png
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Maps/Hydrant)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Maps/Hydrant/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+John Dum
--- a/share/hedgewars/Data/Maps/Mushrooms/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Maps/Mushrooms/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -3,4 +3,5 @@
     mask.png
     map.cfg
     preview.png
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Maps/Mushrooms)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Maps/Mushrooms/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+John Dum
--- a/share/hedgewars/Data/Maps/PirateFlag/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Maps/PirateFlag/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -2,5 +2,6 @@
     map.png
     map.cfg
     preview.png
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Maps/PirateFlag)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Maps/PirateFlag/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+Stanko Tadić
\ No newline at end of file
--- a/share/hedgewars/Data/Maps/Plane/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Maps/Plane/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -2,5 +2,6 @@
     map.png
     map.cfg
     preview.png
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Maps/Plane)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Maps/Plane/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+John Dum
--- a/share/hedgewars/Data/Maps/ShoppaKing/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Maps/ShoppaKing/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -2,4 +2,5 @@
     map.png
     map.cfg
     preview.png
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Maps/ShoppaKing)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Maps/ShoppaKing/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+wolfmarc & Dragonfly
\ No newline at end of file
--- a/share/hedgewars/Data/Maps/Sticks/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Maps/Sticks/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -2,4 +2,5 @@
     map.png
     map.cfg
     preview.png
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Maps/Sticks)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Maps/Sticks/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+dctPL
\ No newline at end of file
--- a/share/hedgewars/Data/Maps/TrophyRace/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Maps/TrophyRace/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -5,4 +5,5 @@
     mask.png
     preview.png
     desc.txt
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Maps/TrophyRace)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Maps/TrophyRace/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+wolfmarc & Dragonfly
\ No newline at end of file
--- a/share/hedgewars/Data/Themes/Bamboo/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Themes/Bamboo/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -3,4 +3,5 @@
 install(FILES
     theme.cfg
     ${images}
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Themes/Bamboo)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Themes/Bamboo/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+Joshua Frese
\ No newline at end of file
--- a/share/hedgewars/Data/Themes/Cave/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Themes/Cave/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -1,6 +1,8 @@
 file(GLOB images *.png)
+file(GLOB credits.txt credits)
 
 install(FILES
     theme.cfg
     ${images}
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Themes/Cave)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Themes/Cave/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+Guillaume Englert
--- a/share/hedgewars/Data/Themes/City/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Themes/City/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -3,4 +3,5 @@
 install(FILES
     theme.cfg
     ${images}
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Themes/City)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Themes/City/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+John Dum
\ No newline at end of file
--- a/share/hedgewars/Data/Themes/EarthRise/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Themes/EarthRise/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -3,4 +3,5 @@
 install(FILES
     theme.cfg
     ${images}
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Themes/EarthRise)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Themes/EarthRise/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+Joshua Frese
\ No newline at end of file
--- a/share/hedgewars/Data/Themes/Freeway/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Themes/Freeway/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -3,4 +3,5 @@
 install(FILES
     theme.cfg
     ${images}
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Themes/Freeway)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Themes/Freeway/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+Joshua Frese
\ No newline at end of file
--- a/share/hedgewars/Data/Themes/Hell/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Themes/Hell/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -3,4 +3,5 @@
 install(FILES
     theme.cfg
     ${images}
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Themes/Hell)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Themes/Hell/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+Stanko Tadić
\ No newline at end of file
--- a/share/hedgewars/Data/Themes/Jungle/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Themes/Jungle/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -3,4 +3,5 @@
 install(FILES
     theme.cfg
     ${images}
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Themes/Jungle)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Themes/Jungle/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+KoRn666
\ No newline at end of file
--- a/share/hedgewars/Data/Themes/Nature/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Themes/Nature/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -3,4 +3,5 @@
 install(FILES
     theme.cfg
     ${images}
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Themes/Nature)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Themes/Nature/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+John Dum
\ No newline at end of file
--- a/share/hedgewars/Data/Themes/Sheep/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Themes/Sheep/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -3,4 +3,5 @@
 install(FILES
     theme.cfg
     ${images}
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Themes/Sheep)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Themes/Sheep/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+Julien Koesten
\ No newline at end of file
--- a/share/hedgewars/Data/Themes/Snow/CMakeLists.txt	Thu Apr 28 21:28:22 2016 +0200
+++ b/share/hedgewars/Data/Themes/Snow/CMakeLists.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -3,4 +3,5 @@
 install(FILES
     theme.cfg
     ${images}
+    credits.txt
     DESTINATION ${SHAREPATH}Data/Themes/Snow)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Themes/Snow/credits.txt	Fri Apr 29 00:56:04 2016 +0200
@@ -0,0 +1,1 @@
+John Dum
\ No newline at end of file