From 9f5537d936da565d8c8df615fb7c9db0a5caf847 Mon Sep 17 00:00:00 2001 From: leozamboni Date: Fri, 4 Nov 2022 15:09:57 -0300 Subject: feat: spooky cat for halloween Signed-off-by: leozamboni --- launcher/resources/backgrounds/backgrounds.qrc | 1 + launcher/resources/backgrounds/kitteh-ween.png | Bin 0 -> 94677 bytes launcher/ui/MainWindow.cpp | 9 +++++---- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 launcher/resources/backgrounds/kitteh-ween.png (limited to 'launcher') diff --git a/launcher/resources/backgrounds/backgrounds.qrc b/launcher/resources/backgrounds/backgrounds.qrc index fb426707..652e7084 100644 --- a/launcher/resources/backgrounds/backgrounds.qrc +++ b/launcher/resources/backgrounds/backgrounds.qrc @@ -4,6 +4,7 @@ kitteh.png kitteh-xmas.png kitteh-bday.png + kitteh-ween.png rory.png rory-xmas.png rory-bday.png diff --git a/launcher/resources/backgrounds/kitteh-ween.png b/launcher/resources/backgrounds/kitteh-ween.png new file mode 100644 index 00000000..deb0bebb Binary files /dev/null and b/launcher/resources/backgrounds/kitteh-ween.png differ diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 28eaa741..afbc505e 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1560,12 +1560,13 @@ void MainWindow::setCatBackground(bool enabled) QDateTime now = QDateTime::currentDateTime(); QDateTime birthday(QDate(now.date().year(), 11, 30), QTime(0, 0)); QDateTime xmas(QDate(now.date().year(), 12, 25), QTime(0, 0)); + QDateTime halloween(QDate(now.date().year(), 10, 31), QTime(0, 0)); QString cat = APPLICATION->settings()->get("BackgroundCat").toString(); - - if(non_stupid_abs(now.daysTo(xmas)) <= 4) { + if (non_stupid_abs(now.daysTo(xmas)) <= 4) { cat += "-xmas"; - } - else if (non_stupid_abs(now.daysTo(birthday)) <= 12) { + } else if (cat == "kitteh" && non_stupid_abs(now.daysTo(halloween)) <= 4) { + cat += "-ween"; + } else if (non_stupid_abs(now.daysTo(birthday)) <= 12) { cat += "-bday"; } view->setStyleSheet(QString(R"( -- cgit