2009-05-08 13:28:41 +00:00
/*
* OpenClonk , http : //www.openclonk.org
*
2013-12-17 20:01:09 +00:00
* Copyright ( c ) 2001 - 2009 , RedWolf Design GmbH , http : //www.clonk.de/
2016-04-03 18:18:29 +00:00
* Copyright ( c ) 2010 - 2016 , The OpenClonk Team and contributors
2009-05-08 13:28:41 +00:00
*
2013-12-17 20:01:09 +00:00
* Distributed under the terms of the ISC license ; see accompanying file
* " COPYING " for details .
2009-05-08 13:28:41 +00:00
*
2013-12-17 20:01:09 +00:00
* " Clonk " is a registered trademark of Matthes Bender , used with permission .
* See accompanying file " TRADEMARK " for details .
2009-05-08 13:28:41 +00:00
*
2013-12-17 20:01:09 +00:00
* To redistribute this file separately , substitute the full license texts
* for the above references .
2009-05-08 13:28:41 +00:00
*/
// About/credits screen
2016-04-03 18:07:56 +00:00
# include "C4Include.h"
# include "gui/C4StartupAboutDlg.h"
2015-01-02 20:13:26 +00:00
2016-04-03 18:07:56 +00:00
# include "C4Version.h"
2017-04-30 08:49:09 +00:00
# include "graphics/C4GraphicsResource.h"
# include "gui/C4UpdateDlg.h"
2009-05-08 13:28:41 +00:00
2017-12-20 23:02:28 +00:00
struct PersonList
{
struct Entry
{
const char * name , * nick ;
} ;
virtual void WriteTo ( C4GUI : : TextWindow * textbox , CStdFont & font ) = 0 ;
virtual ~ PersonList ( ) { }
} ;
static struct DeveloperList : public PersonList
{
std : : vector < Entry > developers ;
DeveloperList ( std : : initializer_list < Entry > l ) : developers ( l ) { }
void WriteTo ( C4GUI : : TextWindow * textbox , CStdFont & font )
{
for ( auto & p : developers )
{
textbox - > AddTextLine ( FormatString ( " %s <c f7f76f>(%s)</c> " , p . name , p . nick ) . getData ( ) , & font , C4GUI_MessageFontClr , false , true ) ;
}
}
}
// the following lists are all sorted by all-time commit count: git shortlog -s | sort -rn
engineAndTools =
{
{ " Sven Eberhardt " , " Sven2 " } ,
{ " Günther Brammer " , " Günther " } ,
{ " Nicolas Hake " , " Isilkor " } ,
{ " Armin Burgmeier " , " Clonk-Karl " } ,
{ " Lukas Werling " , " Luchs " } ,
{ " Julius Michaelis " , " JCaesar " } ,
{ " Peter Wortmann " , " PeterW " } ,
} ,
scriptingAndContent =
{
{ " Maikel de Vries " , " Maikel " } ,
{ " David Dormagen " , " Zapper " } ,
{ " Mark Haßelbusch " , " Marky " } ,
{ " Felix Wagner " , " Clonkonaut " } ,
{ " Bernhard Bonigl " , " Boni " } ,
} ,
administration =
{
{ " Tobias Zwick " , " Newton " } ,
} ,
artAndContent =
{
{ " Charles Spurrill " , " Ringwaul " } ,
{ " Richard Gerum " , " Randrian " } ,
{ " Timo Stabbert " , " Mimmo " } ,
{ " Matthias Rottländer " , " Matthi " } ,
} ,
musicAndSound =
{
{ " David Oerther " , " ala " } ,
{ " Martin Strohmeier " , " K-Pone " } ,
} ;
static struct ContributorList : public PersonList
{
static const std : : vector < Entry > contributorsThisRelease , contributors , packageMaintainers ;
StdStrBuf ConcatNames ( const std : : vector < Entry > & names )
{
StdStrBuf result ;
for ( auto & p : names )
{
if ( result . getLength ( ) ) result . Append ( " , " ) ;
if ( p . nick )
result . AppendFormat ( " %s <c f7f76f>(%s)</c> " , p . name , p . nick ) ;
else
result . Append ( p . name ) ;
}
return result ;
}
void WriteTo ( C4GUI : : TextWindow * textbox , CStdFont & font )
{
StdStrBuf text ;
text = " <c ff0000>Contributors for OpenClonk 8.0:</c> " ;
text . Append ( ConcatNames ( contributorsThisRelease ) ) ;
textbox - > AddTextLine ( text . getData ( ) , & font , C4GUI_MessageFontClr , false , true ) ;
text = " <c ff0000>Previous contributors:</c> " ;
text . Append ( ConcatNames ( contributors ) ) ;
textbox - > AddTextLine ( text . getData ( ) , & font , C4GUI_MessageFontClr , false , true ) ;
text = " <c ff0000>Also thanks to our Linux package maintainers</c> " ;
text . Append ( ConcatNames ( packageMaintainers ) ) ;
text . Append ( " , and more " ) ;
textbox - > AddTextLine ( text . getData ( ) , & font , C4GUI_MessageFontClr , false , true ) ;
text = " Finally, a big thanks to Matthes Bender and all those who contributed to previous Clonk titles for the passion they put into the game and for agreeing to make Clonk open source. " ;
textbox - > AddTextLine ( text . getData ( ) , & font , C4GUI_MessageFontClr , false , true ) ;
}
} contributors ;
// Sorted by commit count this release, e.g.: git shortlog -s v7.0.. | sort -rn
2018-01-07 17:10:52 +00:00
// Stuff from the milestone project sorted in-between as those commits usually end up squashed.
2017-12-20 23:02:28 +00:00
const std : : vector < ContributorList : : Entry > ContributorList : : contributorsThisRelease = {
2018-01-07 17:10:52 +00:00
{ " George Tokmaji " , " Fulgen " } , // 75 commits
{ " Martin Adam " , " Win " } , // lava core animal
{ " Merten Ehmig " , " pluto " } , // helmet
{ " Florian Graier " , " Nachtfalter " } , // tree and guidepost
{ " Foaly " , nullptr } , // "another decorative deciduous tree"
{ " Dominik Bayerl " , " Kanibal " } , // 7 commits
{ " Linus Heckemann " , " sphalerite " } , // 6 commits
{ " Pyrit " , nullptr } , // texture to sproutberry bush
{ " Armin Schäfer " , nullptr } , // 5 commits
{ " Tushar Maheshwari " , nullptr } , // 4 commits
{ " jok " , nullptr } , // 3 commits
{ " Tarte " , nullptr } , // fixed normal map for brick textures
{ " Philip Kern " , " pkern " } , // 2 commits
{ " Matthias Mailänder " , nullptr } , // 1 commit
{ " marsmoon " , nullptr } , // 1 commit
2017-12-20 23:02:28 +00:00
} ;
// First real names sorted by last name (sort -k2), then nicks (sort)
const std : : vector < ContributorList : : Entry > ContributorList : : contributors = {
{ " Tim Blume " , nullptr } ,
{ " Sven-Hendrik Haase " , nullptr } ,
{ " Carl-Philip Hänsch " , " Carli " } ,
{ " Jan Heberer " , nullptr } ,
{ " Benjamin Herr " , " Loriel " } ,
{ " Philip Holzmann " , " Batman " } ,
{ " Lauri Niskanen " , " Ape " } ,
{ " Johannes Nixdorf " , " mixi " } ,
{ " Misty de Meo " , nullptr } , // note: three part name
{ " Fabian Pietsch " , nullptr } ,
{ " Manuel Rieke " , " MrBeast " } ,
{ " Felix Riese " , " Fungiform " } ,
{ " Sebastian Rühl " , nullptr } ,
{ " Oliver Schneider " , " ker " } ,
{ " Lorenz Schwittmann " , nullptr } ,
{ " Alexander Semeniuk " , " AlteredARMOR " } ,
{ " Daniel Theuke " , " ST-DDT " } ,
{ " Andriel " , nullptr } ,
{ " Apfelclonk " , nullptr } ,
{ " Asmageddon " , nullptr } ,
{ " Checkmaty " , nullptr } ,
{ " Clonkine " , nullptr } ,
{ " dylanstrategie " , nullptr } ,
{ " Faby " , nullptr } ,
{ " grgecko " , nullptr } ,
{ " Gurkenglas " , nullptr } ,
{ " hasufell " , nullptr } ,
{ " Koronis " , nullptr } ,
{ " mizipzor " , nullptr } ,
{ " Peewee " , nullptr } ,
{ " Russell " , nullptr } ,
{ " Stan " , nullptr } ,
{ " TomyLobo " , nullptr } ,
} ;
// Sorted alphabetically: sort -k2
const std : : vector < ContributorList : : Entry > ContributorList : : packageMaintainers = {
{ " Benedict Etzel " , " B_E " } , // Arch
{ " Linus Heckemann " , " sphalerite " } , // NixOS
{ " Philip Kern " , " pkern " } , // Debian
{ " Matthias Mailänder " , nullptr } , // OpenSUSE
{ " Julian Ospald " , " hasufell " } , // Gentoo
{ " Kevin Zeng " , nullptr } , // FreeBSD
} ;
2009-05-08 13:28:41 +00:00
// ------------------------------------------------
// --- C4StartupAboutDlg
2014-01-24 08:33:47 +00:00
C4StartupAboutDlg : : C4StartupAboutDlg ( ) : C4StartupDlg ( LoadResStr ( " IDS_DLG_ABOUT " ) )
2010-03-28 18:58:01 +00:00
{
2009-05-08 13:28:41 +00:00
// ctor
UpdateSize ( ) ;
2010-06-27 00:42:48 +00:00
CStdFont & rUseFont = : : GraphicsResource . TextFont ;
2014-01-24 08:33:47 +00:00
C4Rect rcClient = GetContainedClientRect ( ) ;
2009-05-08 13:28:41 +00:00
2010-04-18 21:13:37 +00:00
// bottom line buttons and copyright messages
2009-05-08 13:28:41 +00:00
C4GUI : : ComponentAligner caMain ( rcClient , 0 , 0 , true ) ;
C4GUI : : ComponentAligner caButtons ( caMain . GetFromBottom ( caMain . GetHeight ( ) * 1 / 8 ) , 0 , 0 , false ) ;
C4GUI : : CallbackButton < C4StartupAboutDlg > * btn ;
int32_t iButtonWidth = caButtons . GetInnerWidth ( ) / 4 ;
AddElement ( btn = new C4GUI : : CallbackButton < C4StartupAboutDlg > ( LoadResStr ( " IDS_BTN_BACK " ) , caButtons . GetGridCell ( 0 , 3 , 0 , 1 , iButtonWidth , C4GUI_ButtonHgt , true ) , & C4StartupAboutDlg : : OnBackBtn ) ) ;
btn - > SetToolTip ( LoadResStr ( " IDS_DLGTIP_BACKMAIN " ) ) ;
2010-12-26 20:39:52 +00:00
# ifdef WITH_AUTOMATIC_UPDATE
2009-05-08 13:28:41 +00:00
AddElement ( btn = new C4GUI : : CallbackButton < C4StartupAboutDlg > ( LoadResStr ( " IDS_BTN_CHECKFORUPDATES " ) , caButtons . GetGridCell ( 2 , 3 , 0 , 1 , iButtonWidth , C4GUI_ButtonHgt , true ) , & C4StartupAboutDlg : : OnUpdateBtn ) ) ;
btn - > SetToolTip ( LoadResStr ( " IDS_DESC_CHECKONLINEFORNEWVERSIONS " ) ) ;
2010-12-26 20:39:52 +00:00
# endif
2015-08-09 17:16:39 +00:00
AddElement ( new C4GUI : : Label ( " 'Clonk' is a registered trademark of Matthes Bender. " ,
caButtons . GetFromBottom ( rUseFont . GetLineHeight ( ) ) ) ) ;
2017-12-20 23:02:28 +00:00
C4GUI : : ComponentAligner caDevelopers ( caMain . GetFromTop ( caMain . GetHeight ( ) * 1 / 2 ) , 0 , 0 , false ) ;
C4GUI : : ComponentAligner caContributors ( caMain . GetFromTop ( caMain . GetHeight ( ) ) , 0 , 0 , false ) ;
DrawPersonList ( C4StartupAboutEngineAndTools , engineAndTools , caDevelopers . GetFromLeft ( caMain . GetWidth ( ) * 1 / 3 ) ) ;
C4GUI : : ComponentAligner caDevelopersCol2 ( caDevelopers . GetFromLeft ( caMain . GetWidth ( ) * 1 / 3 ) , 0 , 0 , false ) ;
DrawPersonList ( C4StartupAboutScriptingAndContent , scriptingAndContent , caDevelopersCol2 . GetFromTop ( caDevelopers . GetHeight ( ) * 2 / 3 ) ) ;
DrawPersonList ( C4StartupAboutAdministration , administration , caDevelopersCol2 . GetFromTop ( caDevelopers . GetHeight ( ) * 1 / 3 ) ) ;
C4GUI : : ComponentAligner caDevelopersCol3 ( caDevelopers . GetFromLeft ( caMain . GetWidth ( ) * 1 / 3 ) , 0 , 0 , false ) ;
DrawPersonList ( C4StartupAboutArtAndContent , artAndContent , caDevelopersCol3 . GetFromTop ( caDevelopers . GetHeight ( ) * 2 / 3 ) ) ;
DrawPersonList ( C4StartupAboutMusicAndSound , musicAndSound , caDevelopersCol3 . GetFromTop ( caDevelopers . GetHeight ( ) * 1 / 3 ) ) ;
DrawPersonList ( C4StartupAboutContributors , contributors , caContributors . GetFromTop ( caContributors . GetHeight ( ) ) ) ;
2010-03-28 18:58:01 +00:00
}
2009-05-08 13:28:41 +00:00
2017-05-03 18:28:00 +00:00
C4StartupAboutDlg : : ~ C4StartupAboutDlg ( ) = default ;
2009-05-08 13:28:41 +00:00
2017-12-20 23:02:28 +00:00
void C4StartupAboutDlg : : DrawPersonList ( int title , PersonList & persons , C4Rect & rect )
{
CStdFont & rUseFont = : : GraphicsResource . TextFont ;
auto image = C4Startup : : Get ( ) - > Graphics . fctAboutTitles . GetPhase ( 0 , title ) ;
int height = 2 * rUseFont . GetFontHeight ( ) , width = std : : min ( image . GetWidthByHeight ( height ) , rect . Wdt ) ;
auto picture = new C4GUI : : Picture ( C4Rect ( rect . x , rect . y , width , height ) , true ) ;
AddElement ( picture ) ;
picture - > SetFacet ( image ) ;
rect . y + = height ; rect . Hgt - = height ;
auto textbox = new C4GUI : : TextWindow ( rect , 0 , 0 , 0 , 100 , 4096 , " " , true , nullptr , 0 , true ) ;
AddElement ( textbox ) ;
textbox - > SetDecoration ( false , false , nullptr , true ) ;
persons . WriteTo ( textbox , rUseFont ) ;
textbox - > UpdateHeight ( ) ;
}
2009-05-08 13:28:41 +00:00
void C4StartupAboutDlg : : DoBack ( )
2010-03-28 18:58:01 +00:00
{
2009-05-08 13:28:41 +00:00
C4Startup : : Get ( ) - > SwitchDialog ( C4Startup : : SDID_Main ) ;
2010-03-28 18:58:01 +00:00
}
2009-05-08 13:28:41 +00:00
void C4StartupAboutDlg : : DrawElement ( C4TargetFacet & cgo )
2010-03-28 18:58:01 +00:00
{
}
2009-05-08 13:28:41 +00:00
2010-12-26 20:39:52 +00:00
# ifdef WITH_AUTOMATIC_UPDATE
2009-05-08 13:28:41 +00:00
void C4StartupAboutDlg : : OnUpdateBtn ( C4GUI : : Control * btn )
2010-03-28 18:58:01 +00:00
{
2009-05-08 13:28:41 +00:00
C4UpdateDlg : : CheckForUpdates ( GetScreen ( ) ) ;
2010-03-28 18:58:01 +00:00
}
2010-12-26 20:39:52 +00:00
# endif