Skip to content

Commit

Permalink
MOHAWK: Reenable the Riven demo specific features
Browse files Browse the repository at this point in the history
  • Loading branch information
bgK authored and sev- committed Jul 3, 2017
1 parent 8c6cd98 commit 7801d64
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 21 deletions.
3 changes: 2 additions & 1 deletion engines/mohawk/POTFILES
@@ -1,6 +1,7 @@
engines/mohawk/detection.cpp
engines/mohawk/dialogs.cpp
engines/mohawk/mohawk.cpp
engines/mohawk/myst.cpp
engines/mohawk/riven.cpp
engines/mohawk/riven_stack.cpp
engines/mohawk/riven_stacks/aspit.cpp
engines/mohawk/mohawk.cpp
11 changes: 10 additions & 1 deletion engines/mohawk/riven_inventory.cpp
Expand Up @@ -33,7 +33,8 @@ namespace Mohawk {
RivenInventory::RivenInventory(MohawkEngine_Riven *vm) :
_vm(vm),
_inventoryDrawn(false),
_forceVisible(false) {
_forceVisible(false),
_forceHidden(false) {

_atrusJournalRect1 = Common::Rect(295, 402, 313, 426);
_atrusJournalRect2 = Common::Rect(259, 402, 278, 426);
Expand Down Expand Up @@ -176,6 +177,10 @@ bool RivenInventory::isVisible() const {
return true;
}

if (_forceHidden) {
return false;
}

if (_vm->getFeatures() & GF_DEMO) {
// The inventory is always visible in the demo
return true;
Expand Down Expand Up @@ -209,4 +214,8 @@ void RivenInventory::forceVisible(bool visible) {
_forceVisible = visible;
}

void RivenInventory::forceHidden(bool hidden) {
_forceHidden = hidden;
}

} // End of namespace Mohawk
4 changes: 4 additions & 0 deletions engines/mohawk/riven_inventory.h
Expand Up @@ -51,6 +51,9 @@ class RivenInventory {
/** Force the inventory to be visible even in situations where it usually is not */
void forceVisible(bool visible);

/** Force the inventory to be hidden even in situations where it usually is not */
void forceHidden(bool hidden);

private:
bool isVisible() const;
void draw();
Expand All @@ -60,6 +63,7 @@ class RivenInventory {

bool _inventoryDrawn;
bool _forceVisible;
bool _forceHidden;

// Rects for the inventory object positions
Common::Rect _atrusJournalRect1;
Expand Down
5 changes: 3 additions & 2 deletions engines/mohawk/riven_stack.cpp
Expand Up @@ -30,6 +30,7 @@
#include "mohawk/resource.h"

#include "common/events.h"
#include "common/translation.h"

#include "gui/message.h"

Expand Down Expand Up @@ -177,8 +178,8 @@ uint16 RivenStack::getComboDigit(uint32 correctCombo, uint32 digit) {
}

void RivenStack::runDemoBoundaryDialog() {
GUI::MessageDialog dialog("Exploration beyond this point available only within the full version of\n"
"the game.");
GUI::MessageDialog dialog(_("Exploration beyond this point available only within the full version of\n"
"the game."));
dialog.runModal();
}

Expand Down
33 changes: 16 additions & 17 deletions engines/mohawk/riven_stacks/aspit.cpp
Expand Up @@ -39,27 +39,27 @@ namespace RivenStacks {
ASpit::ASpit(MohawkEngine_Riven *vm) :
RivenStack(vm, kStackAspit) {

REGISTER_COMMAND(ASpit, xastartupbtnhide); // Inaccurate but sufficient
REGISTER_COMMAND(ASpit, xasetupcomplete); // Inaccurate but sufficient
REGISTER_COMMAND(ASpit, xaatrusopenbook); // Done
REGISTER_COMMAND(ASpit, xaatrusbookback); // Done
REGISTER_COMMAND(ASpit, xaatrusbookprevpage); // Done
REGISTER_COMMAND(ASpit, xaatrusbooknextpage); // Done
REGISTER_COMMAND(ASpit, xastartupbtnhide);
REGISTER_COMMAND(ASpit, xasetupcomplete);
REGISTER_COMMAND(ASpit, xaatrusopenbook);
REGISTER_COMMAND(ASpit, xaatrusbookback);
REGISTER_COMMAND(ASpit, xaatrusbookprevpage);
REGISTER_COMMAND(ASpit, xaatrusbooknextpage);
REGISTER_COMMAND(ASpit, xacathopenbook);
REGISTER_COMMAND(ASpit, xacathbookback);
REGISTER_COMMAND(ASpit, xacathbookprevpage);
REGISTER_COMMAND(ASpit, xacathbooknextpage);
REGISTER_COMMAND(ASpit, xtrapbookback);
REGISTER_COMMAND(ASpit, xatrapbookclose);
REGISTER_COMMAND(ASpit, xatrapbookopen);
REGISTER_COMMAND(ASpit, xarestoregame); // Done
// REGISTER_COMMAND(ASpit, xadisablemenureturn);
// REGISTER_COMMAND(ASpit, xaenablemenureturn);
// REGISTER_COMMAND(ASpit, xalaunchbrowser);
// REGISTER_COMMAND(ASpit, xadisablemenuintro);
// REGISTER_COMMAND(ASpit, xaenablemenuintro);
// REGISTER_COMMAND(ASpit, xademoquit);
// REGISTER_COMMAND(ASpit, xaexittomain);
REGISTER_COMMAND(ASpit, xarestoregame);
REGISTER_COMMAND(ASpit, xadisablemenureturn);
REGISTER_COMMAND(ASpit, xaenablemenureturn);
REGISTER_COMMAND(ASpit, xalaunchbrowser);
REGISTER_COMMAND(ASpit, xadisablemenuintro);
REGISTER_COMMAND(ASpit, xaenablemenuintro);
REGISTER_COMMAND(ASpit, xademoquit);
REGISTER_COMMAND(ASpit, xaexittomain);
}

void ASpit::xastartupbtnhide(uint16 argc, uint16 *argv) {
Expand Down Expand Up @@ -332,8 +332,7 @@ void ASpit::xadisablemenuintro(uint16 argc, uint16 *argv) {
// playing the intro. Ctrl+p will play the intro movies instead.
// The original also had this shortcut.

// Hide the "exit" button here
//_vm->_inventory->forceVisible(false);
_vm->_inventory->forceHidden(true);
}

void ASpit::xaenablemenuintro(uint16 argc, uint16 *argv) {
Expand All @@ -342,7 +341,7 @@ void ASpit::xaenablemenuintro(uint16 argc, uint16 *argv) {
// The original also had this shortcut.

// Show the "exit" button here
//_vm->_inventory->forceVisible(true);
_vm->_inventory->forceHidden(false);
}

void ASpit::xademoquit(uint16 argc, uint16 *argv) {
Expand Down

0 comments on commit 7801d64

Please sign in to comment.