Commit 669464b6 authored by Stefan Majewsky's avatar Stefan Majewsky

Add the missing parts of the mouse interaction config UI.

Known problems:
* UI does not respect button/wheel compatibility hint of Interactor.
* Changed configuration is not saved to disk.
Also, I do not like this type of UI anymore.
* It's a mess already with the default configuration.
* The workflow feels strange. (It's probably just that the interface
  doesn't scale, I do not feel these problems in the Plasma
  ContainmentActions dialog.)

svn path=/trunk/KDE/kdegames/palapeli/; revision=1112697
parent 4f304f9b
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS USE_LOCAL_LIBPALA) set_directory_properties(PROPERTIES COMPILE_DEFINITIONS USE_LOCAL_LIBPALA)
set(palapeli_SRCS set(palapeli_SRCS
config/interactorwidget.cpp
config/interactormanagerwidget.cpp
config/mouseinputbutton.cpp config/mouseinputbutton.cpp
creator/propertywidget.cpp creator/propertywidget.cpp
creator/puzzlecreator.cpp creator/puzzlecreator.cpp
......
/***************************************************************************
* Copyright 2010 Stefan Majewsky <majewsky@gmx.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
***************************************************************************/
#include "interactormanagerwidget.h"
#include "interactorwidget.h"
#include "../engine/interactormanager.h"
#include <QGridLayout>
#include <QLabel>//FIXME: remove
#include <QPushButton>
#include <QSpacerItem>
#include <QVBoxLayout>
#include <KIcon>
#include <KLocalizedString>
Palapeli::InteractorManagerWidget::InteractorManagerWidget(Palapeli::InteractorManager* manager, QWidget* parent)
: QWidget(parent)
, m_manager(manager)
, m_contentsLayout(new QGridLayout)
, m_addButton(0)
{
//setup layouts
QVBoxLayout* mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addLayout(m_contentsLayout);
mainLayout->addWidget(new QLabel(QLatin1String("Changes are applied immediately. (TODO: Change before release)")));
mainLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding));
m_contentsLayout->setContentsMargins(0, 0, 0, 0);
//create interactor widgets for existing triggers
for (int i = 0; i < m_manager->triggers().size(); ++i)
triggerAdded(i);
connect(m_manager, SIGNAL(triggerAdded(int)), SLOT(triggerAdded(int)));
//add "Add action" button
m_addButton = new QPushButton(KIcon("list-add"), i18n("Add Action..."));
m_addButton->setToolTip(i18n("Add another mouse action"));
m_contentsLayout->addWidget(m_addButton, m_manager->triggers().size() + 1, 0);
connect(m_addButton, SIGNAL(clicked()), SLOT(addRequest()));
}
Palapeli::InteractorManagerWidget::~InteractorManagerWidget()
{
//NOTE: We cannot use QObject::setParent to delete the interactor widgets, because when QObjectPrivate::deleteChildren is invoked by this->~QObject(), the subwidgets of the interactor widgets have already been destroyed by this->~QWidget().
qDeleteAll(m_interactorWidgets);
}
void Palapeli::InteractorManagerWidget::addRequest()
{
//create new empty trigger
Palapeli::AssociatedInteractorTrigger dummyTrigger;
dummyTrigger.second = m_manager->interactors()[0];
m_manager->addTrigger(dummyTrigger);
//This will send a triggerAdded() signal.
}
void Palapeli::InteractorManagerWidget::triggerAdded(int index)
{
Palapeli::InteractorWidget* iWidget = new Palapeli::InteractorWidget(m_manager, index, m_contentsLayout);
m_interactorWidgets << iWidget;
connect(iWidget, SIGNAL(destroyed(QObject*)), SLOT(interactorWidgetDestroyed(QObject*)));
if (m_addButton)
{
m_contentsLayout->removeWidget(m_addButton);
m_contentsLayout->addWidget(m_addButton, m_manager->triggers().size() + 1, 0);
}
}
void Palapeli::InteractorManagerWidget::interactorWidgetDestroyed(QObject* object)
{
m_interactorWidgets.removeAll(reinterpret_cast<Palapeli::InteractorWidget*>(object));
m_contentsLayout->removeWidget(m_addButton);
m_contentsLayout->addWidget(m_addButton, m_manager->triggers().size(), 0);
}
#include "interactormanagerwidget.moc"
/***************************************************************************
* Copyright 2010 Stefan Majewsky <majewsky@gmx.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
***************************************************************************/
#ifndef PALAPELI_INTERACTORMANAGERWIDGET_H
#define PALAPELI_INTERACTORMANAGERWIDGET_H
#include "../engine/interactorutils.h"
class QGridLayout;
class QPushButton;
#include <QWidget>
//TODO: distinguish mouse and wheel interactors
namespace Palapeli
{
class InteractorManager;
class InteractorWidget;
class InteractorManagerWidget : public QWidget
{
Q_OBJECT
public:
InteractorManagerWidget(Palapeli::InteractorManager* manager, QWidget* parent = 0);
~InteractorManagerWidget();
private Q_SLOTS:
void addRequest();
void triggerAdded(int index);
void interactorWidgetDestroyed(QObject* object);
//TODO: void triggerChanged(int triggerIndex); -> write configuration!
private:
void addInteractorWidgetInternal(Palapeli::InteractorWidget* iWidget);
Palapeli::InteractorManager* m_manager;
//widgets
QGridLayout* m_contentsLayout;
QPushButton* m_addButton;
QList<Palapeli::InteractorWidget*> m_interactorWidgets;
};
}
#endif // PALAPELI_INTERACTORMANAGERWIDGET_H
/***************************************************************************
* Copyright 2010 Stefan Majewsky <majewsky@gmx.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
***************************************************************************/
#include "interactorwidget.h"
#include "mouseinputbutton.h"
#include "../engine/interactor.h"
#include "../engine/interactormanager.h"
#include <QComboBox>
#include <QGridLayout>
#include <QTimer>
#include <QToolButton>
#include <KIcon>
Palapeli::InteractorWidget::InteractorWidget(Palapeli::InteractorManager* manager, int index, QGridLayout* parent)
: m_manager(manager)
, m_index(index)
, m_layout(parent)
, m_inputButton(new Palapeli::MouseInputButton)
, m_pluginList(new QComboBox)
, m_removeButton(new QToolButton)
{
Q_ASSERT(m_index >= 0 && m_index < m_manager->triggers().size());
//read trigger, load interactor list
const Palapeli::AssociatedInteractorTrigger trigger = manager->triggers()[m_index];
foreach (Palapeli::Interactor* interactor, manager->interactors())
{
m_pluginList->addItem(interactor->icon(), interactor->description(), qVariantFromValue(interactor));
if (interactor == trigger.second)
//select current interactor
m_pluginList->setCurrentIndex(m_pluginList->count() - 1);
}
//configure buttons
m_inputButton->setTrigger(trigger.first);
m_removeButton->setIcon(KIcon("list-remove"));
//add widgets to layout (WARNING: When changing this, also adjust triggerRemovedFromManager().)
m_layout->addWidget(m_inputButton, m_index, 0);
m_layout->addWidget(m_pluginList, m_index, 1);
m_layout->addWidget(m_removeButton, m_index, 2);
//wire up stuff
connect(m_manager, SIGNAL(triggerRemoved(int)), SLOT(triggerRemovedFromManager(int)));
connect(m_inputButton, SIGNAL(triggerChanged(const Palapeli::InteractorTrigger&)), SLOT(triggerChanged(const Palapeli::InteractorTrigger&)));
connect(m_pluginList, SIGNAL(currentIndexChanged(int)), SLOT(interactorChanged(int)));
connect(m_removeButton, SIGNAL(clicked()), SLOT(removeRequest()));
//start trigger capture if necessary
if (!trigger.first.isValid())
QTimer::singleShot(0, m_inputButton, SLOT(captureTrigger())); //NOTE: We have to delay this operation because the widget needs to be displayed first, in order to be able to gain focus.
}
Palapeli::InteractorWidget::~InteractorWidget()
{
delete m_inputButton;
delete m_pluginList;
delete m_removeButton;
}
void Palapeli::InteractorWidget::triggerChanged(const Palapeli::InteractorTrigger& trigger)
{
Palapeli::AssociatedInteractorTrigger aTrigger = m_manager->triggers()[m_index];
aTrigger.first = trigger;
m_manager->changeTrigger(m_index, aTrigger);
}
void Palapeli::InteractorWidget::interactorChanged(int interactorIndex)
{
Palapeli::AssociatedInteractorTrigger trigger = m_manager->triggers()[m_index];
trigger.second = m_pluginList->itemData(interactorIndex).value<Palapeli::Interactor*>();
m_manager->changeTrigger(m_index, trigger);
}
void Palapeli::InteractorWidget::removeRequest()
{
m_manager->removeTrigger(m_index);
//NOTE: The rest is done in triggerRemovedFromManager().
}
void Palapeli::InteractorWidget::triggerRemovedFromManager(int triggerIndex)
{
if (triggerIndex == m_index)
deleteLater();
else if (triggerIndex < m_index)
{
//This widget has moved up one position in the list because something before it was removed.
--m_index;
m_layout->removeWidget(m_inputButton);
m_layout->removeWidget(m_pluginList);
m_layout->removeWidget(m_removeButton);
m_layout->addWidget(m_inputButton, m_index, 0);
m_layout->addWidget(m_pluginList, m_index, 1);
m_layout->addWidget(m_removeButton, m_index, 2);
}
}
#include "interactorwidget.moc"
/***************************************************************************
* Copyright 2010 Stefan Majewsky <majewsky@gmx.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
***************************************************************************/
#ifndef PALAPELI_INTERACTORWIDGET_H
#define PALAPELI_INTERACTORWIDGET_H
#include "../engine/interactorutils.h"
class QComboBox;
class QGridLayout;
class QToolButton;
namespace Palapeli
{
class InteractorManager;
class MouseInputButton;
class InteractorWidget : public QObject
{
Q_OBJECT
public:
//HACK: The parent is a layout because one cannot insert rows into a QGridLayout.
///\param index the index of the trigger that this widget should represent. If smaller than zero, an empty trigger will be inserted into the InteractorManager, and this
InteractorWidget(Palapeli::InteractorManager* manager, int index, QGridLayout* parent);
virtual ~InteractorWidget();
private Q_SLOTS:
void triggerChanged(const Palapeli::InteractorTrigger& trigger);
void interactorChanged(int interactorIndex);
void removeRequest();
void triggerRemovedFromManager(int triggerIndex);
private:
//run-time context
Palapeli::InteractorManager* m_manager;
int m_index;
QGridLayout* m_layout;
//widgets
Palapeli::MouseInputButton* m_inputButton;
QComboBox* m_pluginList;
QToolButton* m_removeButton;
};
}
#endif // PALAPELI_INTERACTORWIDGET_H
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <QApplication> #include <QApplication>
#include <QKeyEvent> #include <QKeyEvent>
#include <KIcon>
#include <KLocalizedString> #include <KLocalizedString>
const QString Palapeli::MouseInputButton::DefaultText = i18n("Set Trigger..."); const QString Palapeli::MouseInputButton::DefaultText = i18n("Set Trigger...");
...@@ -29,12 +30,13 @@ const QString Palapeli::MouseInputButton::DefaultToolTip = i18n("Click to change ...@@ -29,12 +30,13 @@ const QString Palapeli::MouseInputButton::DefaultToolTip = i18n("Click to change
Palapeli::MouseInputButton::MouseInputButton(QWidget* parent) Palapeli::MouseInputButton::MouseInputButton(QWidget* parent)
: QPushButton(parent) : QPushButton(parent)
, m_noButtonAllowed(true) , m_noButtonAllowed(true)
, m_requiresValidation(true) , m_requiresValidation(false)
{ {
qRegisterMetaType<Palapeli::InteractorTrigger>(); qRegisterMetaType<Palapeli::InteractorTrigger>();
connect(this, SIGNAL(clicked()), SLOT(captureTrigger())); connect(this, SIGNAL(clicked()), SLOT(captureTrigger()));
setCheckable(true); setCheckable(true);
setChecked(false); setChecked(false);
setIcon(KIcon("input-mouse"));
setText(DefaultText); setText(DefaultText);
setToolTip(DefaultToolTip); setToolTip(DefaultToolTip);
} }
...@@ -69,6 +71,7 @@ void Palapeli::MouseInputButton::captureTrigger() ...@@ -69,6 +71,7 @@ void Palapeli::MouseInputButton::captureTrigger()
setChecked(true); setChecked(true);
setText(i18n("Input here...")); setText(i18n("Input here..."));
setToolTip(i18n("Hold down the modifier keys you want, then click a mouse button or scroll a mouse wheel here")); setToolTip(i18n("Hold down the modifier keys you want, then click a mouse button or scroll a mouse wheel here"));
setFocus(Qt::MouseFocusReason);
} }
void Palapeli::MouseInputButton::clearTrigger() void Palapeli::MouseInputButton::clearTrigger()
...@@ -143,7 +146,7 @@ bool Palapeli::MouseInputButton::event(QEvent* event) ...@@ -143,7 +146,7 @@ bool Palapeli::MouseInputButton::event(QEvent* event)
void Palapeli::MouseInputButton::setTrigger(const Palapeli::InteractorTrigger& trigger) void Palapeli::MouseInputButton::setTrigger(const Palapeli::InteractorTrigger& trigger)
{ {
//NOTE: Invalid triggers need not be confirmed (esp. calls to clearTrigger()). //NOTE: Invalid triggers need not be confirmed (esp. calls to clearTrigger()).
if (m_requiresValidation && trigger.isValid() && trigger != m_trigger) if (m_requiresValidation && trigger.isValid() && m_trigger != trigger)
{ {
m_stagedTrigger = trigger; m_stagedTrigger = trigger;
emit triggerRequest(trigger); emit triggerRequest(trigger);
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <QEvent> #include <QEvent>
#include <QGraphicsView> #include <QGraphicsView>
#include <QIcon> #include <QIcon>
#include <QMetaType>
namespace Palapeli namespace Palapeli
{ {
...@@ -79,5 +80,6 @@ namespace Palapeli ...@@ -79,5 +80,6 @@ namespace Palapeli
} }
Q_DECLARE_OPERATORS_FOR_FLAGS(Palapeli::InteractorTypes) Q_DECLARE_OPERATORS_FOR_FLAGS(Palapeli::InteractorTypes)
Q_DECLARE_METATYPE(Palapeli::Interactor*)
#endif // PALAPELI_INTERACTOR_H #endif // PALAPELI_INTERACTOR_H
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
#include <QWheelEvent> #include <QWheelEvent>
Palapeli::InteractorManager::InteractorManager(QGraphicsView* view) Palapeli::InteractorManager::InteractorManager(QGraphicsView* view)
: m_view(view) : QObject(view)
, m_view(view)
{ {
//create interactors //create interactors
m_interactors["MovePiece"] = new Palapeli::MovePieceInteractor(view); m_interactors["MovePiece"] = new Palapeli::MovePieceInteractor(view);
...@@ -196,6 +197,8 @@ void Palapeli::InteractorManager::handleMouseEvent(const Palapeli::MouseEvent& p ...@@ -196,6 +197,8 @@ void Palapeli::InteractorManager::handleMouseEvent(const Palapeli::MouseEvent& p
bool Palapeli::InteractorManager::testTrigger(const Palapeli::InteractorTrigger& trigger, QWheelEvent* event) bool Palapeli::InteractorManager::testTrigger(const Palapeli::InteractorTrigger& trigger, QWheelEvent* event)
{ {
if (!trigger.isValid())
return false;
return trigger.modifiers() == event->modifiers() return trigger.modifiers() == event->modifiers()
&& trigger.wheelDirection() == event->orientation() && trigger.wheelDirection() == event->orientation()
&& trigger.wheelDirection() != 0; && trigger.wheelDirection() != 0;
...@@ -203,6 +206,8 @@ bool Palapeli::InteractorManager::testTrigger(const Palapeli::InteractorTrigger& ...@@ -203,6 +206,8 @@ bool Palapeli::InteractorManager::testTrigger(const Palapeli::InteractorTrigger&
bool Palapeli::InteractorManager::testTrigger(const Palapeli::InteractorTrigger& trigger, QMouseEvent* event) bool Palapeli::InteractorManager::testTrigger(const Palapeli::InteractorTrigger& trigger, QMouseEvent* event)
{ {
if (!trigger.isValid())
return false;
if (trigger.wheelDirection() != 0 || trigger.modifiers() != event->modifiers()) if (trigger.wheelDirection() != 0 || trigger.modifiers() != event->modifiers())
return false; return false;
if (trigger.button() == Qt::NoButton) if (trigger.button() == Qt::NoButton)
...@@ -215,6 +220,8 @@ bool Palapeli::InteractorManager::testTrigger(const Palapeli::InteractorTrigger& ...@@ -215,6 +220,8 @@ bool Palapeli::InteractorManager::testTrigger(const Palapeli::InteractorTrigger&
bool Palapeli::InteractorManager::testTrigger(const Palapeli::InteractorTrigger& trigger, QKeyEvent* event) bool Palapeli::InteractorManager::testTrigger(const Palapeli::InteractorTrigger& trigger, QKeyEvent* event)
{ {
if (!trigger.isValid())
return false;
//read modifiers //read modifiers
Qt::KeyboardModifiers modifiers = event->modifiers(); Qt::KeyboardModifiers modifiers = event->modifiers();
const Qt::Key key = (Qt::Key) event->key(); const Qt::Key key = (Qt::Key) event->key();
...@@ -225,3 +232,47 @@ bool Palapeli::InteractorManager::testTrigger(const Palapeli::InteractorTrigger& ...@@ -225,3 +232,47 @@ bool Palapeli::InteractorManager::testTrigger(const Palapeli::InteractorTrigger&
&& trigger.button() == Qt::NoButton && trigger.button() == Qt::NoButton
&& trigger.wheelDirection() == 0; && trigger.wheelDirection() == 0;
} }
//BEGIN API to configuration UI
const QList<Palapeli::Interactor*> Palapeli::InteractorManager::interactors() const
{
return m_interactors.values();
}
const QList<Palapeli::AssociatedInteractorTrigger> Palapeli::InteractorManager::triggers() const
{
return m_triggers;
}
//FIXME: changeTrigger() and removeTrigger() break if the triggers in question are active.
int Palapeli::InteractorManager::addTrigger(const Palapeli::AssociatedInteractorTrigger& trigger)
{
const int i = m_triggers.size();
m_triggers << trigger;
emit triggerAdded(i);
return i;
}
bool Palapeli::InteractorManager::changeTrigger(int i, const Palapeli::AssociatedInteractorTrigger& newTrigger)
{
if (i < 0 || i >= m_triggers.size())
return false;
m_triggers[i] = newTrigger;
emit triggerChanged(i);
return true;
}
bool Palapeli::InteractorManager::removeTrigger(int i)
{
if (i < 0 || i >= m_triggers.size())
return false;
m_triggers.removeAt(i);
emit triggerRemoved(i);
return true;
}
//END API to configuration UI
#include "interactormanager.moc"
...@@ -30,8 +30,9 @@ namespace Palapeli ...@@ -30,8 +30,9 @@ namespace Palapeli
class Interactor; class Interactor;
typedef QPair<Palapeli::InteractorTrigger, Palapeli::Interactor*> AssociatedInteractorTrigger; typedef QPair<Palapeli::InteractorTrigger, Palapeli::Interactor*> AssociatedInteractorTrigger;
class InteractorManager class InteractorManager : public QObject
{ {
Q_OBJECT
public: public:
explicit InteractorManager(QGraphicsView* view); explicit InteractorManager(QGraphicsView* view);
...@@ -40,6 +41,19 @@ namespace Palapeli ...@@ -40,6 +41,19 @@ namespace Palapeli
void handleEvent(QKeyEvent* event); void handleEvent(QKeyEvent* event);
void updateScene(); void updateScene();
///\note This list will never change at run-time.
const QList<Palapeli::Interactor*> interactors() const;
const QList<Palapeli::AssociatedInteractorTrigger> triggers() const;
///\return The index of the new trigger.
int addTrigger(const Palapeli::AssociatedInteractorTrigger& trigger);
bool changeTrigger(int index, const Palapeli::AssociatedInteractorTrigger& newTrigger);
///\return whether the trigger was found and removed successfully.
bool removeTrigger(int index);
Q_SIGNALS:
void triggerAdded(int index);
void triggerChanged(int index);
void triggerRemoved(int index);
protected: protected:
bool testTrigger(const Palapeli::InteractorTrigger& trigger, QWheelEvent* event); bool testTrigger(const Palapeli::InteractorTrigger& trigger, QWheelEvent* event);
bool testTrigger(const Palapeli::InteractorTrigger& trigger, QMouseEvent* event); bool testTrigger(const Palapeli::InteractorTrigger& trigger, QMouseEvent* event);
...@@ -48,7 +62,7 @@ namespace Palapeli ...@@ -48,7 +62,7 @@ namespace Palapeli
void handleMouseEvent(const Palapeli::MouseEvent& pEvent, QList<Palapeli::AssociatedInteractorTrigger>& matchingTriggers, QMap<Qt::MouseButton, QEvent::Type>& unhandledButtons); void handleMouseEvent(const Palapeli::MouseEvent& pEvent, QList<Palapeli::AssociatedInteractorTrigger>& matchingTriggers, QMap<Qt::MouseButton, QEvent::Type>& unhandledButtons);
private: private:
QGraphicsView* m_view; QGraphicsView* m_view;
QMap<QByteArray, Palapeli::Interactor*> m_interactors; QMap<QByteArray, Palapeli::Interactor*> m_interactors; //NOTE: The interactor list is always hard-coded, based on what is available. The keys are used for writing the trigger list to the config.
//configuration //configuration
QList<Palapeli::AssociatedInteractorTrigger> m_triggers; QList<Palapeli::AssociatedInteractorTrigger> m_triggers;
//state //state
......
...@@ -44,6 +44,11 @@ Palapeli::View::View() ...@@ -44,6 +44,11 @@ Palapeli::View::View()
connect(m_scene, SIGNAL(victoryAnimationFinished()), this, SLOT(startVictoryAnimation())); connect(m_scene, SIGNAL(victoryAnimationFinished()), this, SLOT(startVictoryAnimation()));
} }
Palapeli::InteractorManager* Palapeli::View::interactorManager() const
{
return m_interactorManager;
}
Palapeli::Scene* Palapeli::View::scene() const Palapeli::Scene* Palapeli::View::scene() const
{ {
return m_scene; return m_scene;
......
...@@ -35,6 +35,7 @@ namespace Palapeli ...@@ -35,6 +35,7 @@ namespace Palapeli
public: public:
View(); View();
Palapeli::InteractorManager* interactorManager() const;
Palapeli::Scene* scene() const; Palapeli::Scene* scene() const;
Palapeli::TextureHelper* textureHelper() const; Palapeli::TextureHelper* textureHelper() const;
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
***************************************************************************/ ***************************************************************************/