ui/about: Add 'Thank You' images to the About dialog
Images were created by the talented Inga (https://twitter.com/IngaPotejto).
This commit is contained in:
parent
1b26d0e477
commit
9db3dfd874
|
|
@ -20,6 +20,7 @@
|
||||||
#include "ui-about.hpp"
|
#include "ui-about.hpp"
|
||||||
#include <obs-frontend-api.h>
|
#include <obs-frontend-api.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <random>
|
||||||
#include "ui-about-entry.hpp"
|
#include "ui-about-entry.hpp"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
@ -37,6 +38,12 @@ constexpr std::string_view text_social_twitch = "Twitch";
|
||||||
constexpr std::string_view text_social_twitter = "Twitter";
|
constexpr std::string_view text_social_twitter = "Twitter";
|
||||||
constexpr std::string_view text_social_youtube = "YouTube";
|
constexpr std::string_view text_social_youtube = "YouTube";
|
||||||
|
|
||||||
|
static const std::vector<std::string_view> _thankyous = {
|
||||||
|
":/thankyou/thankyou_cat",
|
||||||
|
":/thankyou/thankyou_otter",
|
||||||
|
":/thankyou/thankyou_fox",
|
||||||
|
};
|
||||||
|
|
||||||
static const std::list<streamfx::ui::about::entry> _entries = {
|
static const std::list<streamfx::ui::about::entry> _entries = {
|
||||||
// Contributers
|
// Contributers
|
||||||
streamfx::ui::about::entry{"Michael \"Xaymar\" Dirks", streamfx::ui::about::role_type::CONTRIBUTOR, "",
|
streamfx::ui::about::entry{"Michael \"Xaymar\" Dirks", streamfx::ui::about::role_type::CONTRIBUTOR, "",
|
||||||
|
|
@ -63,7 +70,7 @@ static const std::list<streamfx::ui::about::entry> _entries = {
|
||||||
"https://facebook.com/nanitotv", text_social_facebook.data()},
|
"https://facebook.com/nanitotv", text_social_facebook.data()},
|
||||||
|
|
||||||
// Separator
|
// Separator
|
||||||
streamfx::ui::about::entry{"", streamfx::ui::about::role_type::NONE, "", streamfx::ui::about::link_type::NONE, "",
|
streamfx::ui::about::entry{"", streamfx::ui::about::role_type::THANKYOU, "", streamfx::ui::about::link_type::NONE, "",
|
||||||
"", streamfx::ui::about::link_type::NONE, "", ""},
|
"", streamfx::ui::about::link_type::NONE, "", ""},
|
||||||
|
|
||||||
// Supporters
|
// Supporters
|
||||||
|
|
@ -86,8 +93,8 @@ static const std::list<streamfx::ui::about::entry> _entries = {
|
||||||
"https://www.twitch.tv/thenordern", text_social_twitch.data()},
|
"https://www.twitch.tv/thenordern", text_social_twitch.data()},
|
||||||
|
|
||||||
// Separator
|
// Separator
|
||||||
streamfx::ui::about::entry{"", streamfx::ui::about::role_type::NONE, "", streamfx::ui::about::link_type::NONE, "",
|
streamfx::ui::about::entry{"", streamfx::ui::about::role_type::THANKYOU, "", streamfx::ui::about::link_type::NONE,
|
||||||
"", streamfx::ui::about::link_type::NONE, "", ""},
|
"", "", streamfx::ui::about::link_type::NONE, "", ""},
|
||||||
|
|
||||||
// Family
|
// Family
|
||||||
streamfx::ui::about::entry{"Andrea Stenschke", streamfx::ui::about::role_type::FAMILY, "Xaymar",
|
streamfx::ui::about::entry{"Andrea Stenschke", streamfx::ui::about::role_type::FAMILY, "Xaymar",
|
||||||
|
|
@ -110,22 +117,26 @@ static const std::list<streamfx::ui::about::entry> _entries = {
|
||||||
text_social_twitch.data(), streamfx::ui::about::link_type::GENERIC,
|
text_social_twitch.data(), streamfx::ui::about::link_type::GENERIC,
|
||||||
"https://worldofdex.de", "Website"},
|
"https://worldofdex.de", "Website"},
|
||||||
|
|
||||||
|
// Separator
|
||||||
|
streamfx::ui::about::entry{"", streamfx::ui::about::role_type::SPACER, "", streamfx::ui::about::link_type::NONE, "",
|
||||||
|
"", streamfx::ui::about::link_type::NONE, "", ""},
|
||||||
|
|
||||||
// Friends
|
// Friends
|
||||||
streamfx::ui::about::entry{"Axelle", streamfx::ui::about::role_type::FRIEND, "Xaymar",
|
streamfx::ui::about::entry{"Axelle", streamfx::ui::about::role_type::FRIEND, "Xaymar",
|
||||||
streamfx::ui::about::link_type::SOCIAL_TWITCH, "https://www.twitch.tv/axelle123",
|
streamfx::ui::about::link_type::SOCIAL_TWITCH, "https://www.twitch.tv/axelle123",
|
||||||
text_social_twitch.data(), streamfx::ui::about::link_type::SOCIAL_TWITTER,
|
text_social_twitch.data(), streamfx::ui::about::link_type::SOCIAL_TWITTER,
|
||||||
"https://twitter.com/AxellesNobody", text_social_twitter.data()},
|
"https://twitter.com/AxellesNobody", text_social_twitter.data()},
|
||||||
|
|
||||||
// Separator
|
|
||||||
streamfx::ui::about::entry{"", streamfx::ui::about::role_type::NONE, "", streamfx::ui::about::link_type::NONE, "",
|
|
||||||
"", streamfx::ui::about::link_type::NONE, "", ""},
|
|
||||||
|
|
||||||
// Creators
|
// Creators
|
||||||
streamfx::ui::about::entry{"EposVox", streamfx::ui::about::role_type::CREATOR, "",
|
streamfx::ui::about::entry{"EposVox", streamfx::ui::about::role_type::CREATOR, "",
|
||||||
streamfx::ui::about::link_type::SOCIAL_TWITCH, "https://www.twitch.tv/EposVox",
|
streamfx::ui::about::link_type::SOCIAL_TWITCH, "https://www.twitch.tv/EposVox",
|
||||||
text_social_twitch.data(), streamfx::ui::about::link_type::SOCIAL_YOUTUBE,
|
text_social_twitch.data(), streamfx::ui::about::link_type::SOCIAL_YOUTUBE,
|
||||||
"https://youtube.com/c/EposVox", text_social_youtube.data()},
|
"https://youtube.com/c/EposVox", text_social_youtube.data()},
|
||||||
|
|
||||||
|
// Separator
|
||||||
|
streamfx::ui::about::entry{"", streamfx::ui::about::role_type::THANKYOU, "", streamfx::ui::about::link_type::NONE,
|
||||||
|
"", "", streamfx::ui::about::link_type::NONE, "", ""},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
streamfx::ui::about::about() : QDialog(reinterpret_cast<QWidget*>(obs_frontend_get_main_window()))
|
streamfx::ui::about::about() : QDialog(reinterpret_cast<QWidget*>(obs_frontend_get_main_window()))
|
||||||
|
|
@ -135,12 +146,16 @@ streamfx::ui::about::about() : QDialog(reinterpret_cast<QWidget*>(obs_frontend_g
|
||||||
// Remove some extra styling.
|
// Remove some extra styling.
|
||||||
setWindowFlag(Qt::WindowContextHelpButtonHint, false); // Remove the unimplemented help button.
|
setWindowFlag(Qt::WindowContextHelpButtonHint, false); // Remove the unimplemented help button.
|
||||||
|
|
||||||
|
// Random thing
|
||||||
|
auto rnd = std::uniform_int_distribution(size_t(0), _thankyous.size() - 1);
|
||||||
|
std::mt19937_64 rnde;
|
||||||
|
|
||||||
// Thank every single helper.
|
// Thank every single helper.
|
||||||
bool column_selector = false;
|
bool column_selector = false;
|
||||||
size_t row_selector = 0;
|
size_t row_selector = 0;
|
||||||
QGridLayout* content_layout = dynamic_cast<QGridLayout*>(content->layout());
|
QGridLayout* content_layout = dynamic_cast<QGridLayout*>(content->layout());
|
||||||
for (auto entry : _entries) {
|
for (auto entry : _entries) {
|
||||||
if (entry.name.size() == 0) {
|
if (entry.role == role_type::SPACER) {
|
||||||
row_selector += 2;
|
row_selector += 2;
|
||||||
column_selector = 0;
|
column_selector = 0;
|
||||||
|
|
||||||
|
|
@ -159,6 +174,21 @@ streamfx::ui::about::about() : QDialog(reinterpret_cast<QWidget*>(obs_frontend_g
|
||||||
separator->setLineWidth(1);
|
separator->setLineWidth(1);
|
||||||
content_layout->addWidget(separator, static_cast<int>(row_selector - 1), 0, 1, 2);
|
content_layout->addWidget(separator, static_cast<int>(row_selector - 1), 0, 1, 2);
|
||||||
content_layout->setRowStretch(static_cast<int>(row_selector - 1), 0);
|
content_layout->setRowStretch(static_cast<int>(row_selector - 1), 0);
|
||||||
|
} else if (entry.role == role_type::THANKYOU) {
|
||||||
|
row_selector += 2;
|
||||||
|
column_selector = 0;
|
||||||
|
|
||||||
|
auto element = new QLabel(content);
|
||||||
|
|
||||||
|
auto elrnd = rnd(rnde);
|
||||||
|
element->setPixmap(QPixmap(_thankyous.at(elrnd).data()));
|
||||||
|
|
||||||
|
element->setScaledContents(true);
|
||||||
|
element->setFixedSize(384, 384);
|
||||||
|
|
||||||
|
content_layout->addWidget(element, static_cast<int>(row_selector - 1), 0, 1, 2,
|
||||||
|
Qt::AlignTop | Qt::AlignHCenter);
|
||||||
|
content_layout->setRowStretch(static_cast<int>(row_selector - 1), 0);
|
||||||
} else {
|
} else {
|
||||||
streamfx::ui::about_entry* v = new streamfx::ui::about_entry(content, entry);
|
streamfx::ui::about_entry* v = new streamfx::ui::about_entry(content, entry);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ namespace streamfx::ui {
|
||||||
public:
|
public:
|
||||||
enum class role_type : std::int32_t {
|
enum class role_type : std::int32_t {
|
||||||
NONE,
|
NONE,
|
||||||
|
SPACER,
|
||||||
|
THANKYOU,
|
||||||
CONTRIBUTOR,
|
CONTRIBUTOR,
|
||||||
TRANSLATOR,
|
TRANSLATOR,
|
||||||
FAMILY,
|
FAMILY,
|
||||||
|
|
@ -45,6 +47,7 @@ namespace streamfx::ui {
|
||||||
GITHUB_SUPPORTER,
|
GITHUB_SUPPORTER,
|
||||||
TWITCH_SUPPORTER,
|
TWITCH_SUPPORTER,
|
||||||
CREATOR,
|
CREATOR,
|
||||||
|
|
||||||
};
|
};
|
||||||
enum class link_type : std::int32_t {
|
enum class link_type : std::int32_t {
|
||||||
NONE,
|
NONE,
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,11 @@
|
||||||
<qresource prefix="logos">
|
<qresource prefix="logos">
|
||||||
<file alias="streamfx_logo">logo.png</file>
|
<file alias="streamfx_logo">logo.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
<qresource prefix="thankyou">
|
||||||
|
<file alias="thankyou_cat">thankyou_cat.png</file>
|
||||||
|
<file alias="thankyou_fox">thankyou_fox.png</file>
|
||||||
|
<file alias="thankyou_otter">thankyou_otter.png</file>
|
||||||
|
</qresource>
|
||||||
<qresource prefix="linktype">
|
<qresource prefix="linktype">
|
||||||
<file alias="discord">linktype_discord.png</file>
|
<file alias="discord">linktype_discord.png</file>
|
||||||
<file alias="facebook">linktype_facebook.png</file>
|
<file alias="facebook">linktype_facebook.png</file>
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 439 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 429 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 324 KiB |
Loading…
Reference in New Issue