ActionManager held the osgViewer viewer and ScreenCaptureHandler only to trigger a capture on the screenshot key. The engine now passes a std::function that does the capture, so ActionManager has no OSG left and InputManager no longer needs ScreenCaptureHandler; the viewer still goes through to SDLUtil::InputWrapper.
46 lines
926 B
C++
46 lines
926 B
C++
#ifndef MWINPUT_ACTIONMANAGER_H
|
|
#define MWINPUT_ACTIONMANAGER_H
|
|
|
|
#include <functional>
|
|
|
|
namespace MWInput
|
|
{
|
|
class BindingsManager;
|
|
|
|
class ActionManager
|
|
{
|
|
public:
|
|
ActionManager(BindingsManager* bindingsManager, std::function<void()> takeScreenshot);
|
|
|
|
void update(float dt);
|
|
|
|
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);
|
|
|
|
void resetIdleTime();
|
|
float getIdleTime() const { return mTimeIdle; }
|
|
|
|
bool isSneaking() const;
|
|
|
|
private:
|
|
void handleGuiArrowKey(int action);
|
|
|
|
BindingsManager* mBindingsManager;
|
|
std::function<void()> mTakeScreenshot;
|
|
|
|
float mTimeIdle;
|
|
};
|
|
}
|
|
#endif
|