diff --git a/source/ui/ui-about.cpp b/source/ui/ui-about.cpp index d96e146a..679d6619 100644 --- a/source/ui/ui-about.cpp +++ b/source/ui/ui-about.cpp @@ -20,6 +20,7 @@ #include "ui-about.hpp" #include #include +#include #include "ui-about-entry.hpp" #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_youtube = "YouTube"; +static const std::vector _thankyous = { + ":/thankyou/thankyou_cat", + ":/thankyou/thankyou_otter", + ":/thankyou/thankyou_fox", +}; + static const std::list _entries = { // Contributers streamfx::ui::about::entry{"Michael \"Xaymar\" Dirks", streamfx::ui::about::role_type::CONTRIBUTOR, "", @@ -63,7 +70,7 @@ static const std::list _entries = { "https://facebook.com/nanitotv", text_social_facebook.data()}, // 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, "", ""}, // Supporters @@ -86,8 +93,8 @@ static const std::list _entries = { "https://www.twitch.tv/thenordern", text_social_twitch.data()}, // Separator - streamfx::ui::about::entry{"", streamfx::ui::about::role_type::NONE, "", streamfx::ui::about::link_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, "", ""}, // Family streamfx::ui::about::entry{"Andrea Stenschke", streamfx::ui::about::role_type::FAMILY, "Xaymar", @@ -110,22 +117,26 @@ static const std::list _entries = { text_social_twitch.data(), streamfx::ui::about::link_type::GENERIC, "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 streamfx::ui::about::entry{"Axelle", streamfx::ui::about::role_type::FRIEND, "Xaymar", streamfx::ui::about::link_type::SOCIAL_TWITCH, "https://www.twitch.tv/axelle123", text_social_twitch.data(), streamfx::ui::about::link_type::SOCIAL_TWITTER, "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 streamfx::ui::about::entry{"EposVox", streamfx::ui::about::role_type::CREATOR, "", streamfx::ui::about::link_type::SOCIAL_TWITCH, "https://www.twitch.tv/EposVox", text_social_twitch.data(), streamfx::ui::about::link_type::SOCIAL_YOUTUBE, "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(obs_frontend_get_main_window())) @@ -135,12 +146,16 @@ streamfx::ui::about::about() : QDialog(reinterpret_cast(obs_frontend_g // Remove some extra styling. 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. bool column_selector = false; size_t row_selector = 0; QGridLayout* content_layout = dynamic_cast(content->layout()); for (auto entry : _entries) { - if (entry.name.size() == 0) { + if (entry.role == role_type::SPACER) { row_selector += 2; column_selector = 0; @@ -159,6 +174,21 @@ streamfx::ui::about::about() : QDialog(reinterpret_cast(obs_frontend_g separator->setLineWidth(1); content_layout->addWidget(separator, static_cast(row_selector - 1), 0, 1, 2); content_layout->setRowStretch(static_cast(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(row_selector - 1), 0, 1, 2, + Qt::AlignTop | Qt::AlignHCenter); + content_layout->setRowStretch(static_cast(row_selector - 1), 0); } else { streamfx::ui::about_entry* v = new streamfx::ui::about_entry(content, entry); diff --git a/source/ui/ui-about.hpp b/source/ui/ui-about.hpp index d3d7c9de..d00e6f7b 100644 --- a/source/ui/ui-about.hpp +++ b/source/ui/ui-about.hpp @@ -37,6 +37,8 @@ namespace streamfx::ui { public: enum class role_type : std::int32_t { NONE, + SPACER, + THANKYOU, CONTRIBUTOR, TRANSLATOR, FAMILY, @@ -45,6 +47,7 @@ namespace streamfx::ui { GITHUB_SUPPORTER, TWITCH_SUPPORTER, CREATOR, + }; enum class link_type : std::int32_t { NONE, diff --git a/ui/streamfx.qrc b/ui/streamfx.qrc index 152443de..55b7e115 100644 --- a/ui/streamfx.qrc +++ b/ui/streamfx.qrc @@ -2,6 +2,11 @@ logo.png + + thankyou_cat.png + thankyou_fox.png + thankyou_otter.png + linktype_discord.png linktype_facebook.png diff --git a/ui/thankyou_cat.png b/ui/thankyou_cat.png new file mode 100644 index 00000000..8b5328f0 Binary files /dev/null and b/ui/thankyou_cat.png differ diff --git a/ui/thankyou_fox.png b/ui/thankyou_fox.png new file mode 100644 index 00000000..b708db3f Binary files /dev/null and b/ui/thankyou_fox.png differ diff --git a/ui/thankyou_otter.png b/ui/thankyou_otter.png new file mode 100644 index 00000000..63c81a93 Binary files /dev/null and b/ui/thankyou_otter.png differ