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/
|
2014-01-24 08:33:47 +00:00
|
|
|
* Copyright (c) 2010-2014, 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
|
|
|
|
|
|
|
|
#include <C4Include.h>
|
|
|
|
#include <C4StartupAboutDlg.h>
|
|
|
|
#include <C4UpdateDlg.h>
|
2010-06-27 00:42:48 +00:00
|
|
|
#include <C4GraphicsResource.h>
|
2010-12-26 20:39:52 +00:00
|
|
|
#include <C4Version.h>
|
2009-05-08 13:28:41 +00:00
|
|
|
|
|
|
|
#include <C4StartupMainDlg.h>
|
|
|
|
|
|
|
|
// ------------------------------------------------
|
|
|
|
// --- 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;
|
2010-04-18 21:13:37 +00:00
|
|
|
#ifdef HAVE_FMOD
|
|
|
|
AddElement(new C4GUI::Label("Using FMOD Sound System, copyright (c) Firelight Technologies Pty, Ltd., 1994-2010.",
|
|
|
|
caMain.GetFromBottom(rUseFont.GetLineHeight())));
|
|
|
|
#endif
|
2009-05-08 13:28:41 +00:00
|
|
|
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
|
2010-03-28 18:58:01 +00:00
|
|
|
}
|
2009-05-08 13:28:41 +00:00
|
|
|
|
|
|
|
C4StartupAboutDlg::~C4StartupAboutDlg()
|
2010-03-28 18:58:01 +00:00
|
|
|
{
|
|
|
|
}
|
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
|
|
|
{
|
2014-01-24 08:33:47 +00:00
|
|
|
C4Startup::Get()->Graphics.fctAboutBG.Draw(cgo, false, 0, 0, true);
|
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
|