MOHAWK: Update the card and stack variables when entering new locations
This commit is contained in:
parent
05bed84a85
commit
9926475937
5 changed files with 12 additions and 4 deletions
|
@ -42,6 +42,7 @@ RivenCard::RivenCard(MohawkEngine_Riven *vm, uint16 id) :
|
||||||
loadCardSoundList(id);
|
loadCardSoundList(id);
|
||||||
loadCardHotspotEnableList(id);
|
loadCardHotspotEnableList(id);
|
||||||
loadCardWaterEffectList(id);
|
loadCardWaterEffectList(id);
|
||||||
|
setCurrentCardVariable();
|
||||||
}
|
}
|
||||||
|
|
||||||
RivenCard::~RivenCard() {
|
RivenCard::~RivenCard() {
|
||||||
|
@ -432,6 +433,10 @@ void RivenCard::runLeaveScripts() {
|
||||||
_vm->_scriptMan->runScript(script, false);
|
_vm->_scriptMan->runScript(script, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RivenCard::setCurrentCardVariable() {
|
||||||
|
_vm->_vars["currentcardid"] = _id;
|
||||||
|
}
|
||||||
|
|
||||||
RivenHotspot::RivenHotspot(MohawkEngine_Riven *vm, Common::ReadStream *stream) :
|
RivenHotspot::RivenHotspot(MohawkEngine_Riven *vm, Common::ReadStream *stream) :
|
||||||
_vm(vm) {
|
_vm(vm) {
|
||||||
loadFromStream(stream);
|
loadFromStream(stream);
|
||||||
|
|
|
@ -124,6 +124,7 @@ private:
|
||||||
void loadCardSoundList(uint16 id);
|
void loadCardSoundList(uint16 id);
|
||||||
void loadCardHotspotEnableList(uint16 id);
|
void loadCardHotspotEnableList(uint16 id);
|
||||||
void loadCardWaterEffectList(uint16 id);
|
void loadCardWaterEffectList(uint16 id);
|
||||||
|
void setCurrentCardVariable();
|
||||||
|
|
||||||
RivenScriptPtr getScript(uint16 scriptType) const;
|
RivenScriptPtr getScript(uint16 scriptType) const;
|
||||||
void defaultLoadScript();
|
void defaultLoadScript();
|
||||||
|
|
|
@ -403,10 +403,6 @@ Common::Error RivenSaveLoad::saveGame(const int slot, const Common::String &desc
|
||||||
|
|
||||||
Common::String filename = buildSaveFilename(slot);
|
Common::String filename = buildSaveFilename(slot);
|
||||||
|
|
||||||
// Convert class variables to variable numbers
|
|
||||||
_vm->_vars["currentstackid"] = _vm->getStack()->getId();
|
|
||||||
_vm->_vars["currentcardid"] = _vm->getCard()->getId();
|
|
||||||
|
|
||||||
Common::OutSaveFile *saveFile = _saveFileMan->openForSaving(filename);
|
Common::OutSaveFile *saveFile = _saveFileMan->openForSaving(filename);
|
||||||
if (!saveFile)
|
if (!saveFile)
|
||||||
return Common::kWritingFailed;
|
return Common::kWritingFailed;
|
||||||
|
|
|
@ -33,6 +33,7 @@ RivenStack::RivenStack(MohawkEngine_Riven *vm, uint16 id) :
|
||||||
_id(id) {
|
_id(id) {
|
||||||
loadResourceNames();
|
loadResourceNames();
|
||||||
loadCardIdMap();
|
loadCardIdMap();
|
||||||
|
setCurrentStackVariable();
|
||||||
}
|
}
|
||||||
|
|
||||||
RivenStack::~RivenStack() {
|
RivenStack::~RivenStack() {
|
||||||
|
@ -116,6 +117,10 @@ uint32 RivenStack::getCurrentCardGlobalId() const {
|
||||||
return _cardIdMap[_vm->getCard()->getId()];
|
return _cardIdMap[_vm->getCard()->getId()];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RivenStack::setCurrentStackVariable() {
|
||||||
|
_vm->_vars["currentstackid"] = _id;
|
||||||
|
}
|
||||||
|
|
||||||
RivenNameList::RivenNameList() {
|
RivenNameList::RivenNameList() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,6 +98,7 @@ public:
|
||||||
private:
|
private:
|
||||||
void loadResourceNames();
|
void loadResourceNames();
|
||||||
void loadCardIdMap();
|
void loadCardIdMap();
|
||||||
|
void setCurrentStackVariable();
|
||||||
|
|
||||||
MohawkEngine_Riven *_vm;
|
MohawkEngine_Riven *_vm;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue