chore: drop KonamiCode
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
f85683cb3b
commit
cde45e5e11
@ -588,10 +588,6 @@ SET(LAUNCHER_SOURCES
|
|||||||
VersionProxyModel.cpp
|
VersionProxyModel.cpp
|
||||||
HoeDown.h
|
HoeDown.h
|
||||||
|
|
||||||
# Super secret!
|
|
||||||
KonamiCode.h
|
|
||||||
KonamiCode.cpp
|
|
||||||
|
|
||||||
# Bundled resources
|
# Bundled resources
|
||||||
resources/backgrounds/backgrounds.qrc
|
resources/backgrounds/backgrounds.qrc
|
||||||
resources/multimc/multimc.qrc
|
resources/multimc/multimc.qrc
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
#include "KonamiCode.h"
|
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
const std::array<Qt::Key, 10> konamiCode =
|
|
||||||
{
|
|
||||||
{
|
|
||||||
Qt::Key_Up, Qt::Key_Up,
|
|
||||||
Qt::Key_Down, Qt::Key_Down,
|
|
||||||
Qt::Key_Left, Qt::Key_Right,
|
|
||||||
Qt::Key_Left, Qt::Key_Right,
|
|
||||||
Qt::Key_B, Qt::Key_A
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
KonamiCode::KonamiCode(QObject* parent) : QObject(parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void KonamiCode::input(QEvent* event)
|
|
||||||
{
|
|
||||||
if( event->type() == QEvent::KeyPress )
|
|
||||||
{
|
|
||||||
QKeyEvent *keyEvent = static_cast<QKeyEvent*>( event );
|
|
||||||
auto key = Qt::Key(keyEvent->key());
|
|
||||||
if(key == konamiCode[m_progress])
|
|
||||||
{
|
|
||||||
m_progress ++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_progress = 0;
|
|
||||||
}
|
|
||||||
if(m_progress == static_cast<int>(konamiCode.size()))
|
|
||||||
{
|
|
||||||
m_progress = 0;
|
|
||||||
emit triggered();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <QKeyEvent>
|
|
||||||
|
|
||||||
class KonamiCode : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
KonamiCode(QObject *parent = 0);
|
|
||||||
void input(QEvent *event);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void triggered();
|
|
||||||
|
|
||||||
private:
|
|
||||||
int m_progress = 0;
|
|
||||||
};
|
|
@ -105,7 +105,6 @@
|
|||||||
#include "ui/dialogs/ExportInstanceDialog.h"
|
#include "ui/dialogs/ExportInstanceDialog.h"
|
||||||
|
|
||||||
#include "UpdateController.h"
|
#include "UpdateController.h"
|
||||||
#include "KonamiCode.h"
|
|
||||||
|
|
||||||
#include "InstanceImportTask.h"
|
#include "InstanceImportTask.h"
|
||||||
#include "InstanceCopyTask.h"
|
#include "InstanceCopyTask.h"
|
||||||
@ -848,12 +847,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
|
|||||||
connect(q, SIGNAL(activated()), qApp, SLOT(quit()));
|
connect(q, SIGNAL(activated()), qApp, SLOT(quit()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Konami Code
|
|
||||||
{
|
|
||||||
secretEventFilter = new KonamiCode(this);
|
|
||||||
connect(secretEventFilter, &KonamiCode::triggered, this, &MainWindow::konamiTriggered);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the news label to the news toolbar.
|
// Add the news label to the news toolbar.
|
||||||
{
|
{
|
||||||
m_newsChecker.reset(new NewsChecker(APPLICATION->network(), BuildConfig.NEWS_RSS_URL));
|
m_newsChecker.reset(new NewsChecker(APPLICATION->network(), BuildConfig.NEWS_RSS_URL));
|
||||||
@ -1040,11 +1033,6 @@ QMenu * MainWindow::createPopupMenu()
|
|||||||
return filteredMenu;
|
return filteredMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::konamiTriggered()
|
|
||||||
{
|
|
||||||
qDebug() << "Super Secret Mode ACTIVATED!";
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::showInstanceContextMenu(const QPoint &pos, InstancePtr inst)
|
void MainWindow::showInstanceContextMenu(const QPoint &pos, InstancePtr inst)
|
||||||
{
|
{
|
||||||
QList<QAction *> actions;
|
QList<QAction *> actions;
|
||||||
@ -1330,7 +1318,6 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *ev)
|
|||||||
{
|
{
|
||||||
if (ev->type() == QEvent::KeyPress)
|
if (ev->type() == QEvent::KeyPress)
|
||||||
{
|
{
|
||||||
secretEventFilter->input(ev);
|
|
||||||
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(ev);
|
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(ev);
|
||||||
switch (keyEvent->key())
|
switch (keyEvent->key())
|
||||||
{
|
{
|
||||||
|
@ -59,7 +59,6 @@ class QLabel;
|
|||||||
class InstanceView;
|
class InstanceView;
|
||||||
class MinecraftLauncher;
|
class MinecraftLauncher;
|
||||||
class BaseProfilerFactory;
|
class BaseProfilerFactory;
|
||||||
class KonamiCode;
|
|
||||||
class InstanceTask;
|
class InstanceTask;
|
||||||
|
|
||||||
class MainWindow : public QMainWindow
|
class MainWindow : public QMainWindow
|
||||||
@ -197,8 +196,6 @@ private slots:
|
|||||||
*/
|
*/
|
||||||
void downloadUpdates(GoUpdate::Status status);
|
void downloadUpdates(GoUpdate::Status status);
|
||||||
|
|
||||||
void konamiTriggered();
|
|
||||||
|
|
||||||
void globalSettingsClosed();
|
void globalSettingsClosed();
|
||||||
|
|
||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MAC
|
||||||
@ -230,7 +227,6 @@ private:
|
|||||||
QLabel *m_statusCenter = nullptr;
|
QLabel *m_statusCenter = nullptr;
|
||||||
QMenu *accountMenu = nullptr;
|
QMenu *accountMenu = nullptr;
|
||||||
QToolButton *accountMenuButton = nullptr;
|
QToolButton *accountMenuButton = nullptr;
|
||||||
KonamiCode * secretEventFilter = nullptr;
|
|
||||||
|
|
||||||
unique_qobject_ptr<NewsChecker> m_newsChecker;
|
unique_qobject_ptr<NewsChecker> m_newsChecker;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user