-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add menu to display the license texts from inside the game
- Loading branch information
Showing
12 changed files
with
263 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de | ||
Copyright (c) 2009-2016, The OpenClonk Team and contributors | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
|
||
(This is the ISC license. <http://opensource.org/licenses/ISC>) | ||
|
||
Portions of the code have been contributed by other authors: | ||
Copyright (c) 2006-2007 Alexander Post | ||
Copyright (c) 2004-2013 Armin Burgmeier | ||
Copyright (c) 2005-2006, 2008-2010 Asmageddon | ||
Copyright (c) 2010, 2012 Benjamin Herr | ||
Copyright (c) 2006, 2012 Bernhard Bonigl | ||
Copyright (c) 2009-2010 Carl-Philip Hänsch | ||
Copyright (c) 2001 Carlo Teubner | ||
Copyright (c) 2009, 2011-2013 David Dormagen | ||
Copyright (c) 2011-2012 Felix Wagner | ||
Copyright (c) 2006 Florian Groß | ||
Copyright (c) 2004-2012 Günther Brammer | ||
Copyright (c) 2006-2008 Julian Raschke | ||
Copyright (c) 2010-2012 Julius Michaelis | ||
Copyright (c) 2010-2011 Maikel de Vries | ||
Copyright (c) 2010 Manuel Riecke | ||
Copyright (c) 2009 Mark Haßelbusch | ||
Copyright (c) 2009-2012 Martin Plicht | ||
Copyright (c) 1998-2009 Matthes Bender | ||
Copyright (c) 2001 Michael Käser | ||
Copyright (c) 2009 mizipzor | ||
Copyright (c) 2009-2013 Nicolas Hake | ||
Copyright (c) 2013 Oliver Schneider | ||
Copyright (c) 2010 Peewee | ||
Copyright (c) 2001-2011 Peter Wortmann | ||
Copyright (c) 2012 Philipp Kern | ||
Copyright (c) 2009-2010 Richard Gerum | ||
Copyright (c) 2001-2013 Sven Eberhardt | ||
Copyright (c) 2004-2005, 2009-2013 Tobias Zwick | ||
|
||
Code inside the "thirdparty" directory has been included for convenience | ||
and may be licensed under different terms. See the respective directories | ||
for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'Clonk' is a registered trademark of Matthes Bender. It may be used within | ||
software products which are using source code or game content as made public | ||
on the Clonk website (or derived from such) with the following limitations: | ||
|
||
If the word 'Clonk' is used as the name of anything in your software product | ||
then you must include the following notice in a suitable place (e.g. credits | ||
screen): 'Clonk' is a registered trademark of Matthes Bender. | ||
|
||
If the title of your software product contains the word 'Clonk' then you must | ||
PREFIX the word with an added name of your choosing, e.g. 'MyClonk' or | ||
'PortableClonk' and you must include the trademark notice above in a suitable | ||
place (e.g. credits screen or splash screen). | ||
|
||
If you are making your source code or game content available to other parties | ||
in a way which allows adaptation you must include a copy of this license along | ||
with any other applicable licenses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* OpenClonk, http://www.openclonk.org | ||
* | ||
* Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/ | ||
* Copyright (c) 2010-2020, The OpenClonk Team and contributors | ||
* | ||
* Distributed under the terms of the ISC license; see accompanying file | ||
* "COPYING" for details. | ||
* | ||
* "Clonk" is a registered trademark of Matthes Bender, used with permission. | ||
* See accompanying file "TRADEMARK" for details. | ||
* | ||
* To redistribute this file separately, substitute the full license texts | ||
* for the above references. | ||
*/ | ||
// About/credits screen | ||
|
||
#include "C4Include.h" | ||
#include "gui/C4StartupLegalDlg.h" | ||
|
||
#include "C4Version.h" | ||
#include "graphics/C4GraphicsResource.h" | ||
#include "game/C4Application.h" | ||
|
||
#include <fstream> | ||
|
||
|
||
// Sorted by commit count this release, e.g.: git shortlog -s v7.0.. | sort -rn | ||
// Stuff from the milestone project sorted in-between as those commits usually end up squashed. | ||
|
||
// ------------------------------------------------ | ||
// --- C4StartupLegalDlg | ||
|
||
C4StartupLegalDlg::C4StartupLegalDlg() : C4StartupDlg(LoadResStr("IDS_DLG_DISPLAYLEGALNOTICE")) | ||
{ | ||
// ctor | ||
UpdateSize(); | ||
|
||
C4Rect rcClient = GetContainedClientRect(); | ||
|
||
// bottom line buttons and copyright messages | ||
C4GUI::ComponentAligner caMain(rcClient, 0,0, true); | ||
C4GUI::ComponentAligner caButtons(caMain.GetFromBottom(caMain.GetHeight()*1/8), 0,0, false); | ||
C4GUI::CallbackButton<C4StartupLegalDlg> *btn; | ||
int32_t iButtonWidth = caButtons.GetInnerWidth() / 4; | ||
AddElement(btn = new C4GUI::CallbackButton<C4StartupLegalDlg>(LoadResStr("IDS_BTN_BACK"), caButtons.GetGridCell(0,3,0,1,iButtonWidth,C4GUI_ButtonHgt,true), &C4StartupLegalDlg::OnBackBtn)); | ||
btn->SetToolTip(LoadResStr("IDS_DLGTIP_BACKMAIN")); | ||
|
||
C4Rect rect = caMain.GetFromTop(caMain.GetHeight()); | ||
auto textbox = new C4GUI::TextWindow(rect, 0, 0, 0, 100, 4096, "", true, nullptr, 0, true); | ||
AddElement(textbox); | ||
textbox->SetDecoration(false, false, nullptr, true); | ||
|
||
C4Group licenses; | ||
licenses.OpenAsChild(&::Application.SystemGroup, "Legal.ocg"); | ||
StdStrBuf licenseName; | ||
while (licenses.FindNextEntry("*.txt", &licenseName)) { | ||
std::string licenseNameCut(licenseName.getData(), std::max<size_t>(licenseName.getLength() - 4, 0)); | ||
textbox->AddTextLine(licenseNameCut.c_str(), &::GraphicsResource.TitleFont, C4GUI_NotifyFontClr, false, true); | ||
char * licenseContent = nullptr; size_t licenseSize; | ||
licenses.LoadEntry(licenseName.getData(), &licenseContent, &licenseSize, 1); | ||
textbox->AddTextLine(licenseContent, &::GraphicsResource.TextFont, C4GUI_MessageFontClr, false, true); | ||
free(licenseContent); | ||
textbox->AddTextLine(" ", &::GraphicsResource.TitleFont, C4GUI_MessageFontClr, false, true); | ||
} | ||
textbox->UpdateHeight(); | ||
} | ||
|
||
C4StartupLegalDlg::~C4StartupLegalDlg() = default; | ||
|
||
void C4StartupLegalDlg::DoBack() | ||
{ | ||
C4Startup::Get()->SwitchDialog(C4Startup::SDID_About); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* OpenClonk, http://www.openclonk.org | ||
* | ||
* Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/ | ||
* Copyright (c) 2013-2020, The OpenClonk Team and contributors | ||
* | ||
* Distributed under the terms of the ISC license; see accompanying file | ||
* "COPYING" for details. | ||
* | ||
* "Clonk" is a registered trademark of Matthes Bender, used with permission. | ||
* See accompanying file "TRADEMARK" for details. | ||
* | ||
* To redistribute this file separately, substitute the full license texts | ||
* for the above references. | ||
*/ | ||
// Credits screen | ||
|
||
#ifndef INC_C4StartupLegalDlg | ||
#define INC_C4StartupLegalDlg | ||
|
||
#include "gui/C4Startup.h" | ||
|
||
// startup dialog: credits | ||
class C4StartupLegalDlg : public C4StartupDlg | ||
{ | ||
public: | ||
C4StartupLegalDlg(); | ||
~C4StartupLegalDlg() override; | ||
|
||
protected: | ||
bool OnEnter() override { DoBack(); return true; } | ||
bool OnEscape() override { DoBack(); return true; } | ||
void DrawElement(C4TargetFacet &) override {} | ||
bool KeyBack() { DoBack(); return true; } | ||
void OnBackBtn(C4GUI::Control *) { DoBack(); } | ||
|
||
public: | ||
|
||
void DoBack(); // back to main menu | ||
}; | ||
|
||
|
||
#endif // INC_C4StartupLegalDlg |