diff options
-rw-r--r-- | engines/zvision/scripting/script_manager.cpp | 26 | ||||
-rw-r--r-- | engines/zvision/scripting/script_manager.h | 3 |
2 files changed, 29 insertions, 0 deletions
diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index 4dd51816a0..6a9398d356 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -486,6 +486,10 @@ void ScriptManager::onKeyUp(Common::KeyState keyState) { } } +void ScriptManager::changeLocation(const Location &_newLocation) { + changeLocation(_newLocation.world, _newLocation.room, _newLocation.node, _newLocation.view, _newLocation.offset); +} + void ScriptManager::changeLocation(char _world, char _room, char _node, char _view, uint32 offset) { _nextLocation.world = _world; _nextLocation.room = _room; @@ -731,6 +735,28 @@ Location ScriptManager::getCurrentLocation() const { return location; } +Location ScriptManager::getLastLocation() { + Location location; + location.world = getStateValue(StateKey_LastWorld); + location.room = getStateValue(StateKey_LastRoom); + location.node = getStateValue(StateKey_LastNode); + location.view = getStateValue(StateKey_LastView); + location.offset = getStateValue(StateKey_LastViewPos); + + return location; +} + +Location ScriptManager::getLastMenuLocation() { + Location location; + location.world = getStateValue(StateKey_Menu_LastWorld); + location.room = getStateValue(StateKey_Menu_LastRoom); + location.node = getStateValue(StateKey_Menu_LastNode); + location.view = getStateValue(StateKey_Menu_LastView); + location.offset = getStateValue(StateKey_Menu_LastViewPos); + + return location; +} + void ScriptManager::addEvent(Common::Event event) { _controlEvents.push_back(event); } diff --git a/engines/zvision/scripting/script_manager.h b/engines/zvision/scripting/script_manager.h index 6cc957874b..4d82f36aea 100644 --- a/engines/zvision/scripting/script_manager.h +++ b/engines/zvision/scripting/script_manager.h @@ -237,11 +237,14 @@ public: /** Mark next location */ void changeLocation(char world, char room, char node, char view, uint32 offset); + void changeLocation(const Location &_newLocation); void serialize(Common::WriteStream *stream); void deserialize(Common::SeekableReadStream *stream); Location getCurrentLocation() const; + Location getLastLocation(); + Location getLastMenuLocation(); private: void referenceTableAddPuzzle(uint32 key, puzzle_ref ref); |