mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-10-04 05:50:15 +00:00
NOISSUE meow meow prototype
This commit is contained in:
parent
08f85f1a93
commit
e2378c79ff
@ -88,6 +88,7 @@ find_package(Qt5Concurrent REQUIRED)
|
||||
find_package(Qt5Network REQUIRED)
|
||||
find_package(Qt5Test REQUIRED)
|
||||
find_package(Qt5Xml REQUIRED)
|
||||
find_package(Qt5Multimedia REQUIRED)
|
||||
|
||||
# The Qt5 cmake files don't provide its install paths, so ask qmake.
|
||||
include(QMakeQuery)
|
||||
|
@ -297,7 +297,7 @@ qt5_add_resources(MULTIMC_RESOURCES ${MULTIMC_QRCS})
|
||||
|
||||
# Add executable
|
||||
add_executable(MultiMC MACOSX_BUNDLE WIN32 ${MULTIMC_SOURCES} ${MULTIMC_UI} ${MULTIMC_RESOURCES} ${MULTIMC_RCS})
|
||||
target_link_libraries(MultiMC MultiMC_gui ${QUAZIP_LIBRARIES} hoedown MultiMC_rainbow LocalPeer ganalytics)
|
||||
target_link_libraries(MultiMC MultiMC_gui ${QUAZIP_LIBRARIES} hoedown MultiMC_rainbow LocalPeer ganalytics Qt5::Multimedia)
|
||||
if(DEFINED MultiMC_APP_BINARY_NAME)
|
||||
set_target_properties(MultiMC PROPERTIES OUTPUT_NAME "${MultiMC_APP_BINARY_NAME}")
|
||||
endif()
|
||||
|
@ -1285,7 +1285,7 @@ void MainWindow::downloadUpdates(GoUpdate::Status status)
|
||||
|
||||
void MainWindow::onCatToggled(bool state)
|
||||
{
|
||||
setCatBackground(state);
|
||||
setCatBackground(state, false);
|
||||
MMC->settings()->set("TheCat", state);
|
||||
}
|
||||
|
||||
@ -1299,8 +1299,9 @@ T non_stupid_abs(T in)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setCatBackground(bool enabled)
|
||||
void MainWindow::setCatBackground(bool enabled, bool initial)
|
||||
{
|
||||
static int currentMeow = 0;
|
||||
if (enabled)
|
||||
{
|
||||
QDateTime now = QDateTime::currentDateTime();
|
||||
@ -1317,9 +1318,28 @@ GroupView
|
||||
background-repeat: none;
|
||||
background-color:palette(base);
|
||||
})").arg(cat));
|
||||
if(!initial) {
|
||||
const char * sounds[] = {
|
||||
"/home/peterix/meows/Fiona52fixed.wav",
|
||||
"/home/peterix/meows/Fiona72.wav",
|
||||
"/home/peterix/meows/Fiona76.wav",
|
||||
"/home/peterix/meows/Fiona81.wav",
|
||||
"/home/peterix/meows/Fiona85.wav"
|
||||
};
|
||||
qDebug() << "PLAY MEOW" << currentMeow;
|
||||
meow.setSource(QUrl::fromLocalFile(sounds[currentMeow]));
|
||||
meow.setLoopCount(1);
|
||||
meow.play();
|
||||
int newMeow = qrand() % 4;
|
||||
if(newMeow == currentMeow) {
|
||||
newMeow++;
|
||||
}
|
||||
currentMeow = newMeow;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
meow.stop();
|
||||
view->setStyleSheet(QString());
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <QMainWindow>
|
||||
#include <QProcess>
|
||||
#include <QTimer>
|
||||
#include <QtMultimedia/QSoundEffect>
|
||||
|
||||
#include "BaseInstance.h"
|
||||
#include "minecraft/auth/MojangAccount.h"
|
||||
@ -189,7 +190,7 @@ private slots:
|
||||
private:
|
||||
void addInstance(QString url = QString());
|
||||
void activateInstance(InstancePtr instance);
|
||||
void setCatBackground(bool enabled);
|
||||
void setCatBackground(bool enabled, bool initial = true);
|
||||
void updateInstanceToolIcon(QString new_icon);
|
||||
void setSelectedInstanceById(const QString &id);
|
||||
|
||||
@ -200,6 +201,8 @@ private:
|
||||
private:
|
||||
std::unique_ptr<Ui> ui;
|
||||
|
||||
QSoundEffect meow;
|
||||
|
||||
// these are managed by Qt's memory management model!
|
||||
GroupView *view = nullptr;
|
||||
InstanceProxyModel *proxymodel = nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user