2020-04-08 15:33:07 +00:00
|
|
|
#ifndef MWINPUT_ACTIONMANAGER_H
|
|
|
|
#define MWINPUT_ACTIONMANAGER_H
|
|
|
|
|
|
|
|
#include <osg/ref_ptr>
|
|
|
|
#include <osgViewer/ViewerEventHandlers>
|
|
|
|
|
|
|
|
namespace osgViewer
|
|
|
|
{
|
|
|
|
class Viewer;
|
|
|
|
class ScreenCaptureHandler;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWInput
|
|
|
|
{
|
2020-04-17 11:21:23 +00:00
|
|
|
class BindingsManager;
|
|
|
|
|
2020-04-08 15:33:07 +00:00
|
|
|
class ActionManager
|
|
|
|
{
|
|
|
|
public:
|
2024-06-06 08:23:05 +00:00
|
|
|
ActionManager(BindingsManager* bindingsManager, osg::ref_ptr<osgViewer::Viewer> viewer,
|
|
|
|
osg::ref_ptr<osgViewer::ScreenCaptureHandler> screenCaptureHandler);
|
2020-04-08 15:33:07 +00:00
|
|
|
|
2022-12-05 22:31:23 +00:00
|
|
|
void update(float dt);
|
2020-04-16 12:36:32 +00:00
|
|
|
|
2020-04-08 15:33:07 +00:00
|
|
|
void executeAction(int action);
|
|
|
|
|
|
|
|
bool checkAllowedToUseItems() const;
|
|
|
|
|
|
|
|
void toggleMainMenu();
|
|
|
|
void toggleConsole();
|
|
|
|
void screenshot();
|
|
|
|
void activate();
|
|
|
|
void rest();
|
|
|
|
void quickLoad();
|
|
|
|
void quickSave();
|
|
|
|
|
|
|
|
void quickKey(int index);
|
|
|
|
|
2020-04-16 12:36:32 +00:00
|
|
|
void resetIdleTime();
|
2021-06-26 21:10:24 +00:00
|
|
|
float getIdleTime() const { return mTimeIdle; }
|
2020-04-16 12:36:32 +00:00
|
|
|
|
2022-09-03 14:29:24 +00:00
|
|
|
bool isSneaking() const;
|
2020-04-08 15:33:07 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void handleGuiArrowKey(int action);
|
|
|
|
|
2020-04-17 11:21:23 +00:00
|
|
|
BindingsManager* mBindingsManager;
|
2020-04-08 15:33:07 +00:00
|
|
|
osg::ref_ptr<osgViewer::Viewer> mViewer;
|
|
|
|
osg::ref_ptr<osgViewer::ScreenCaptureHandler> mScreenCaptureHandler;
|
|
|
|
|
2020-04-16 12:36:32 +00:00
|
|
|
float mTimeIdle;
|
2020-04-08 15:33:07 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|