Skip to content

Commit 4824a5d

Browse files
committed
clean up the credits and styling
1 parent 93fb8ab commit 4824a5d

9 files changed

Lines changed: 118 additions & 77 deletions

File tree

53 KB
Loading

qtfred/resources/resources.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,6 @@
7474
<file>images/wingform.png</file>
7575
<file>images/zoomext.png</file>
7676
<file>images/zoomsel.png</file>
77+
<file>images/fred_about.png</file>
7778
</qresource>
7879
</RCC>

qtfred/source_groups.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ add_file_folder("Resources/Images"
396396
resources/images/freddoc.ico
397397
resources/images/fred.ico
398398
resources/images/fredknows.png
399+
resources/images/fred_about.png
399400
resources/images/fred_splash.png
400401
resources/images/green_do.png
401402
resources/images/next.png

qtfred/src/mission/dialogs/AboutDialogModel.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <project.h>
66
#include <graphics/2d.h>
77

8+
extern const char* fs2_open_credit_text;
9+
810
namespace fso::fred::dialogs {
911

1012
AboutDialogModel::AboutDialogModel(QObject* parent, EditorViewport* viewport)
@@ -42,4 +44,43 @@ SCP_string AboutDialogModel::getVersionString() const
4244
return result;
4345
}
4446

47+
SCP_string AboutDialogModel::getCopyrightString() const
48+
{
49+
return "Based on FRED2_OPEN: Copyright \xc2\xa9 1999 Volition, Inc. All Rights Reserved";
50+
}
51+
52+
SCP_vector<SCP_string> AboutDialogModel::getQtFREDCredits() const
53+
{
54+
return {
55+
"Initial Qt port by groscask",
56+
"Developed to replace FRED2: Cyborg, m!m, Mike \"MjnMixael\" Nelson, The Force",
57+
"With contributions from: BMagnu, DahBlount, Goober5000, jg18, niffiwan, plieblang, the-maddin, z64555",
58+
};
59+
}
60+
61+
SCP_vector<SCP_string> AboutDialogModel::getGraphicsCredits() const
62+
{
63+
switch (gr_screen.mode) {
64+
case GR_OPENGL:
65+
return {
66+
"Ported to OpenGL by RandomTiger",
67+
"Original FSO OpenGL port by Phreak and Fry_Day",
68+
};
69+
case GR_VULKAN:
70+
// TODO: Add Vulkan port credits when available
71+
return { "Vulkan not ported yet" };
72+
}
73+
return {};
74+
}
75+
76+
SCP_string AboutDialogModel::getSCPCreditsText() const
77+
{
78+
return fs2_open_credit_text;
79+
}
80+
81+
SCP_string AboutDialogModel::getQuoteString() const
82+
{
83+
return "FRED2 has been deprecated. We regret nothing.";
84+
}
85+
4586
} // namespace fso::fred::dialogs

qtfred/src/mission/dialogs/AboutDialogModel.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ class AboutDialogModel : public AbstractDialogModel {
1616
void reject() override;
1717

1818
SCP_string getVersionString() const;
19+
SCP_string getCopyrightString() const;
20+
SCP_vector<SCP_string> getQtFREDCredits() const;
21+
SCP_vector<SCP_string> getGraphicsCredits() const;
22+
SCP_string getSCPCreditsText() const;
23+
SCP_string getQuoteString() const;
1924
};
2025

2126
} // namespace fso::fred::dialogs

qtfred/src/ui/FredView.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ void FredView::initializeStatusBar() {
403403

404404
_statusBarUnitsLabel = new QLabel();
405405
statusBar()->addPermanentWidget(_statusBarUnitsLabel);
406+
407+
statusBar()->showMessage(tr("Every great mission starts here. No pressure."));
406408
}
407409
void FredView::updateUI() {
408410
if (!_viewport) {

qtfred/src/ui/dialogs/AboutDialog.cpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,62 @@
66
#include "ui_AboutDialog.h"
77

88
#include <QtGui/QDesktopServices>
9+
#include <QtGui/QPixmap>
910
#include <QtCore/QUrl>
1011
#include <QtWidgets/QApplication>
12+
#include <QtWidgets/QDialog>
13+
#include <QtWidgets/QDialogButtonBox>
14+
#include <QtWidgets/QPlainTextEdit>
15+
#include <QtWidgets/QVBoxLayout>
1116

1217
namespace fso::fred::dialogs {
1318

19+
static QString joinLines(const SCP_vector<SCP_string>& lines)
20+
{
21+
QStringList parts;
22+
for (const auto& line : lines)
23+
parts << QString::fromStdString(line);
24+
return parts.join('\n');
25+
}
26+
1427
AboutDialog::AboutDialog(QWidget* parent, EditorViewport* viewport)
1528
: QDialog(parent),
1629
ui(new Ui::AboutDialog()),
1730
_model(new AboutDialogModel(this, viewport))
1831
{
1932
ui->setupUi(this);
33+
34+
connect(ui->okBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
35+
36+
ui->logoLabel->setPixmap(
37+
QPixmap(":/images/fred_about.png").scaled(128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation));
38+
2039
ui->labelVersion->setText(QString::fromStdString(_model->getVersionString()));
40+
ui->labelCopyright->setText(QString::fromStdString(_model->getCopyrightString()));
41+
ui->labelQtFREDCredits->setText(joinLines(_model->getQtFREDCredits()));
42+
ui->labelGraphicsCredits->setText(joinLines(_model->getGraphicsCredits()));
43+
ui->labelQuote->setText(QString::fromStdString(_model->getQuoteString()));
44+
}
45+
46+
void AboutDialog::on_scpCreditsButton_clicked()
47+
{
48+
auto* dialog = new QDialog(this);
49+
dialog->setWindowTitle(tr("SCP Team Credits"));
50+
dialog->setAttribute(Qt::WA_DeleteOnClose);
51+
dialog->resize(500, 600);
52+
53+
auto* layout = new QVBoxLayout(dialog);
54+
55+
auto* textEdit = new QPlainTextEdit(dialog);
56+
textEdit->setReadOnly(true);
57+
textEdit->setPlainText(QString::fromStdString(_model->getSCPCreditsText()));
58+
layout->addWidget(textEdit);
59+
60+
auto* buttons = new QDialogButtonBox(QDialogButtonBox::Close, dialog);
61+
connect(buttons, &QDialogButtonBox::rejected, dialog, &QDialog::reject);
62+
layout->addWidget(buttons);
63+
64+
dialog->show();
2165
}
2266

2367
void AboutDialog::on_reportBugButton_clicked()

qtfred/src/ui/dialogs/AboutDialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class AboutDialog : public QDialog {
2020
~AboutDialog() override = default;
2121

2222
private slots:
23+
void on_scpCreditsButton_clicked();
2324
void on_reportBugButton_clicked();
2425
void on_visitForumsButton_clicked();
2526
void on_aboutQtButton_clicked();

qtfred/ui/AboutDialog.ui

Lines changed: 23 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>756</width>
10-
<height>233</height>
9+
<width>720</width>
10+
<height>260</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>About qtFRED</string>
1515
</property>
16-
<layout class="QGridLayout" name="gridLayout">
16+
<layout class="QHBoxLayout" name="mainLayout">
1717
<property name="sizeConstraint">
1818
<enum>QLayout::SetFixedSize</enum>
1919
</property>
20-
<item row="0" column="0" rowspan="3" alignment="Qt::AlignHCenter|Qt::AlignVCenter">
21-
<widget class="QLabel" name="label_7">
20+
<item>
21+
<widget class="QLabel" name="logoLabel">
2222
<property name="sizePolicy">
2323
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
2424
<horstretch>0</horstretch>
@@ -40,48 +40,24 @@
4040
<property name="text">
4141
<string/>
4242
</property>
43-
<property name="pixmap">
44-
<pixmap resource="../resources/resources.qrc">:/images/V_fred.ico</pixmap>
45-
</property>
46-
<property name="scaledContents">
47-
<bool>true</bool>
48-
</property>
4943
<property name="alignment">
5044
<set>Qt::AlignCenter</set>
5145
</property>
52-
<property name="wordWrap">
53-
<bool>false</bool>
54-
</property>
5546
</widget>
5647
</item>
57-
<item row="0" column="1" rowspan="11">
58-
<layout class="QVBoxLayout" name="verticalLayout_2">
48+
<item>
49+
<layout class="QVBoxLayout" name="textLayout">
5950
<item>
6051
<widget class="QLabel" name="labelVersion">
61-
<property name="sizePolicy">
62-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
63-
<horstretch>0</horstretch>
64-
<verstretch>0</verstretch>
65-
</sizepolicy>
66-
</property>
6752
<property name="text">
68-
<string>qtFRED - FreeSpace Editor, Version xx.yy.zz</string>
53+
<string/>
6954
</property>
7055
</widget>
7156
</item>
7257
<item>
73-
<widget class="QLabel" name="label_3">
74-
<property name="sizePolicy">
75-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
76-
<horstretch>0</horstretch>
77-
<verstretch>0</verstretch>
78-
</sizepolicy>
79-
</property>
58+
<widget class="QLabel" name="labelCopyright">
8059
<property name="text">
81-
<string>Based on FRED2_OPEN: Copyright © 1999 Volition, Inc. All Rights Reserved</string>
82-
</property>
83-
<property name="wordWrap">
84-
<bool>false</bool>
60+
<string/>
8561
</property>
8662
</widget>
8763
</item>
@@ -102,50 +78,29 @@
10278
</spacer>
10379
</item>
10480
<item>
105-
<widget class="QLabel" name="label_4">
106-
<property name="sizePolicy">
107-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
108-
<horstretch>0</horstretch>
109-
<verstretch>0</verstretch>
110-
</sizepolicy>
111-
</property>
81+
<widget class="QLabel" name="labelQtFREDCredits">
11282
<property name="text">
113-
<string>qtFRED port done by groscask (Initial port), DahBlount, m!m, and z64555.</string>
83+
<string/>
11484
</property>
11585
<property name="wordWrap">
116-
<bool>false</bool>
86+
<bool>true</bool>
11787
</property>
11888
</widget>
11989
</item>
12090
<item>
121-
<widget class="QLabel" name="label_5">
122-
<property name="sizePolicy">
123-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
124-
<horstretch>0</horstretch>
125-
<verstretch>0</verstretch>
126-
</sizepolicy>
127-
</property>
91+
<widget class="QPushButton" name="scpCreditsButton">
12892
<property name="text">
129-
<string>Ported to OpenGL by RandomTiger</string>
130-
</property>
131-
<property name="wordWrap">
132-
<bool>false</bool>
93+
<string>Supported by the entire SCP team</string>
13394
</property>
13495
</widget>
13596
</item>
13697
<item>
137-
<widget class="QLabel" name="label_6">
138-
<property name="sizePolicy">
139-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
140-
<horstretch>0</horstretch>
141-
<verstretch>0</verstretch>
142-
</sizepolicy>
143-
</property>
98+
<widget class="QLabel" name="labelGraphicsCredits">
14499
<property name="text">
145-
<string>Original FSO OpenGL port by Phreak and Fry_Day</string>
100+
<string/>
146101
</property>
147102
<property name="wordWrap">
148-
<bool>false</bool>
103+
<bool>true</bool>
149104
</property>
150105
</widget>
151106
</item>
@@ -157,18 +112,9 @@
157112
</widget>
158113
</item>
159114
<item>
160-
<widget class="QLabel" name="label">
161-
<property name="sizePolicy">
162-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
163-
<horstretch>0</horstretch>
164-
<verstretch>0</verstretch>
165-
</sizepolicy>
166-
</property>
167-
<property name="frameShape">
168-
<enum>QFrame::NoFrame</enum>
169-
</property>
115+
<widget class="QLabel" name="labelQuote">
170116
<property name="text">
171-
<string>&quot;FRED2 is the omega of all giant unwieldy pieces of code. It's big, it's horrifying, and it just doesn't care. View it at your own risk.&quot; - Dave Baranec</string>
117+
<string/>
172118
</property>
173119
<property name="wordWrap">
174120
<bool>true</bool>
@@ -190,8 +136,8 @@
190136
</item>
191137
</layout>
192138
</item>
193-
<item row="0" column="2" rowspan="11">
194-
<layout class="QVBoxLayout" name="verticalLayout">
139+
<item>
140+
<layout class="QVBoxLayout" name="buttonLayout">
195141
<item>
196142
<widget class="QDialogButtonBox" name="okBox">
197143
<property name="sizePolicy">
@@ -204,7 +150,7 @@
204150
<enum>Qt::Vertical</enum>
205151
</property>
206152
<property name="standardButtons">
207-
<set>QDialogButtonBox::Ok</set>
153+
<set>QDialogButtonBox::Close</set>
208154
</property>
209155
</widget>
210156
</item>

0 commit comments

Comments
 (0)