diff --git a/planet/Graphics.ocg/StartupAboutBG.png b/planet/Graphics.ocg/StartupAboutBG.png deleted file mode 100644 index 2d1234e52..000000000 Binary files a/planet/Graphics.ocg/StartupAboutBG.png and /dev/null differ diff --git a/planet/Graphics.ocg/StartupAboutTitles.png b/planet/Graphics.ocg/StartupAboutTitles.png new file mode 100644 index 000000000..7eb60da68 Binary files /dev/null and b/planet/Graphics.ocg/StartupAboutTitles.png differ diff --git a/src/gui/C4Startup.cpp b/src/gui/C4Startup.cpp index 9967cb952..8ee1d6415 100644 --- a/src/gui/C4Startup.cpp +++ b/src/gui/C4Startup.cpp @@ -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; diff --git a/src/gui/C4Startup.h b/src/gui/C4Startup.h index 40a095220..c90b0eafc 100644 --- a/src/gui/C4Startup.h +++ b/src/gui/C4Startup.h @@ -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 diff --git a/src/gui/C4StartupAboutDlg.cpp b/src/gui/C4StartupAboutDlg.cpp index 8396a11fc..af376bb87 100644 --- a/src/gui/C4StartupAboutDlg.cpp +++ b/src/gui/C4StartupAboutDlg.cpp @@ -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 developers; + + DeveloperList(std::initializer_list l) : developers(l) { } + + void WriteTo(C4GUI::TextWindow *textbox, CStdFont &font) + { + for (auto& p : developers) + { + textbox->AddTextLine(FormatString("%s (%s)", 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 contributorsThisRelease, contributors, packageMaintainers; + + StdStrBuf ConcatNames(const std::vector& names) + { + StdStrBuf result; + for (auto& p : names) + { + if (result.getLength()) result.Append(", "); + if (p.nick) + result.AppendFormat("%s (%s)", p.name, p.nick); + else + result.Append(p.name); + } + return result; + } + + void WriteTo(C4GUI::TextWindow *textbox, CStdFont &font) + { + StdStrBuf text; + text = "Contributors for OpenClonk 8.0: "; + text.Append(ConcatNames(contributorsThisRelease)); + textbox->AddTextLine(text.getData(), &font, C4GUI_MessageFontClr, false, true); + + text = "Previous contributors: "; + text.Append(ConcatNames(contributors)); + textbox->AddTextLine(text.getData(), &font, C4GUI_MessageFontClr, false, true); + + text = "Also thanks to our Linux package maintainers "; + 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::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::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::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 diff --git a/src/gui/C4StartupAboutDlg.h b/src/gui/C4StartupAboutDlg.h index a489138c0..f95767b44 100644 --- a/src/gui/C4StartupAboutDlg.h +++ b/src/gui/C4StartupAboutDlg.h @@ -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