mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-21 01:08:25 +00:00
ZVISION: Implement enabled/disabled support in Controls
This commit is contained in:
parent
03d3646f84
commit
7d1dca9ad1
@ -183,6 +183,10 @@ void LeverControl::parseLevFile(const Common::String &fileName) {
|
||||
}
|
||||
|
||||
void LeverControl::onMouseDown(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) {
|
||||
if (!_enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_frameInfo[_currentFrame].hotspot.contains(backgroundImageSpacePos)) {
|
||||
_mouseIsCaptured = true;
|
||||
_lastMousePos = backgroundImageSpacePos;
|
||||
@ -190,6 +194,10 @@ void LeverControl::onMouseDown(const Common::Point &screenSpacePos, const Common
|
||||
}
|
||||
|
||||
void LeverControl::onMouseUp(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) {
|
||||
if (!_enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
_mouseIsCaptured = false;
|
||||
_engine->getScriptManager()->setStateValue(_key, _currentFrame);
|
||||
|
||||
@ -201,6 +209,10 @@ void LeverControl::onMouseUp(const Common::Point &screenSpacePos, const Common::
|
||||
}
|
||||
|
||||
bool LeverControl::onMouseMove(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) {
|
||||
if (!_enabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cursorWasChanged = false;
|
||||
|
||||
if (_mouseIsCaptured) {
|
||||
@ -228,6 +240,10 @@ bool LeverControl::onMouseMove(const Common::Point &screenSpacePos, const Common
|
||||
}
|
||||
|
||||
bool LeverControl::process(uint32 deltaTimeInMillis) {
|
||||
if (!_enabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Implement reversal over time
|
||||
|
||||
return false;
|
||||
|
@ -71,12 +71,20 @@ PushToggleControl::~PushToggleControl() {
|
||||
}
|
||||
|
||||
void PushToggleControl::onMouseUp(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) {
|
||||
if (!_enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_hotspot.contains(backgroundImageSpacePos)) {
|
||||
_engine->getScriptManager()->setStateValue(_key, 1);
|
||||
}
|
||||
}
|
||||
|
||||
bool PushToggleControl::onMouseMove(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) {
|
||||
if (!_enabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_hotspot.contains(backgroundImageSpacePos)) {
|
||||
_engine->getCursorManager()->changeCursor(_hoverCursor);
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user