diff options
author | Marisa-Chan | 2014-08-04 16:32:48 +0700 |
---|---|---|
committer | Marisa-Chan | 2014-08-04 16:32:48 +0700 |
commit | d7d058cd60aae2c898f285b183416d1393c4a7ad (patch) | |
tree | f4c0865ba33d8759eb6b846062d3b25b13847c76 /engines/zvision/scripting | |
parent | fb62b9477b5a9d887eb3484d82a7ef67efb6bfa5 (diff) | |
download | scummvm-rg350-d7d058cd60aae2c898f285b183416d1393c4a7ad.tar.gz scummvm-rg350-d7d058cd60aae2c898f285b183416d1393c4a7ad.tar.bz2 scummvm-rg350-d7d058cd60aae2c898f285b183416d1393c4a7ad.zip |
ZVISION: New scriptManager location methods
Diffstat (limited to 'engines/zvision/scripting')
-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); |