Render (updated) credits with C4GUI

install-platforms
Lukas Werling 2017-12-21 00:02:28 +01:00
parent 3b358e0a98
commit e83ca471c0
6 changed files with 211 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

View File

@ -43,8 +43,8 @@ bool C4StartupGraphics::Init()
Game.SetInitProgress(38.0f);
if (!LoadFile(fctDlgPaper, "StartupDlgPaper")) return false;
if (!LoadFile(fctPlrPropBG, "StartupPlrPropBG")) return false;
if (!LoadFile(fctAboutBG, "StartupAboutBG")) return false;
fctAboutBG.GetFace().SetBackground();
if (!LoadFile(fctAboutTitles, "StartupAboutTitles")) return false;
fctAboutTitles.Set(fctAboutTitles.Surface,0,0,fctAboutTitles.Surface->Wdt,fctAboutTitles.Surface->Hgt/C4StartupAboutTitleCount);
if (!LoadFile(fctStartupLogo, "StartupLogo")) return false;
::GraphicsResource.ProgressStart = 92;
::GraphicsResource.ProgressIncrement = 0.5;

View File

@ -32,6 +32,18 @@ const int32_t
C4StartupBtnBorderColor1 = 0xffccc3b4,
C4StartupBtnBorderColor2 = 0xff94846a;
// Titles in StartupAboutTitles
enum
{
C4StartupAboutEngineAndTools,
C4StartupAboutScriptingAndContent,
C4StartupAboutAdministration,
C4StartupAboutArtAndContent,
C4StartupAboutMusicAndSound,
C4StartupAboutContributors,
C4StartupAboutTitleCount
};
// graphics needed only by startup
class C4StartupGraphics
{
@ -40,8 +52,8 @@ private:
public:
// backgrounds
C4FacetID fctPlrPropBG; // for player property subpage
C4FacetID fctAboutBG; // for about screen
C4FacetID fctPlrPropBG; // for player property subpage
C4FacetID fctAboutTitles; // for about screen
C4FacetID fctDlgPaper;
C4FacetID fctStartupLogo; // logo

View File

@ -22,6 +22,169 @@
#include "graphics/C4GraphicsResource.h"
#include "gui/C4UpdateDlg.h"
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
const std::vector<ContributorList::Entry> ContributorList::contributorsThisRelease = {
{"Fulgen", nullptr},
{"Linus Heckemann", "sphalerite"},
{"Dominik Bayerl", "Kanibal"},
{"Armin Schäfer", nullptr},
{"Tushar Maheshwari", nullptr},
{"jok", nullptr},
{"Philip Kern", "pkern"},
{"Matthias Mailänder", nullptr},
{"marsmoon", nullptr},
};
// First real names sorted by last name (sort -k2), then nicks (sort)
const std::vector<ContributorList::Entry> ContributorList::contributors = {
{"Martin Adam", "Win"},
{"Tim Blume", nullptr},
{"Merten Ehmig", "pluto"},
{"Florian Graier", "Nachtfalter"},
{"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},
{"Pyrit", 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
};
// ------------------------------------------------
// --- C4StartupAboutDlg
@ -47,10 +210,40 @@ C4StartupAboutDlg::C4StartupAboutDlg() : C4StartupDlg(LoadResStr("IDS_DLG_ABOUT"
AddElement(new C4GUI::Label("'Clonk' is a registered trademark of Matthes Bender.",
caButtons.GetFromBottom(rUseFont.GetLineHeight())));
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()));
}
C4StartupAboutDlg::~C4StartupAboutDlg() = default;
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();
}
void C4StartupAboutDlg::DoBack()
{
C4Startup::Get()->SwitchDialog(C4Startup::SDID_Main);
@ -58,7 +251,6 @@ void C4StartupAboutDlg::DoBack()
void C4StartupAboutDlg::DrawElement(C4TargetFacet &cgo)
{
C4Startup::Get()->Graphics.fctAboutBG.Draw(cgo, true, 0, 0, true);
}
#ifdef WITH_AUTOMATIC_UPDATE

View File

@ -37,6 +37,8 @@ protected:
void OnUpdateBtn(C4GUI::Control *btn);
#endif
private:
void DrawPersonList(int title, struct PersonList&, C4Rect& rect);
public:
void DoBack(); // back to main menu