Skip to content

Commit

Permalink
BLADERUNNER: Add Dialogue Menu
Browse files Browse the repository at this point in the history
  • Loading branch information
madmoose committed Aug 22, 2017
1 parent 867b8db commit a4c7992
Show file tree
Hide file tree
Showing 11 changed files with 518 additions and 29 deletions.
29 changes: 24 additions & 5 deletions engines/bladerunner/bladerunner.cpp
Expand Up @@ -30,6 +30,7 @@
#include "bladerunner/chapters.h"
#include "bladerunner/combat.h"
#include "bladerunner/crimes_database.h"
#include "bladerunner/dialogue_menu.h"
#include "bladerunner/font.h"
#include "bladerunner/gameflags.h"
#include "bladerunner/gameinfo.h"
Expand Down Expand Up @@ -280,7 +281,9 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
if (!_textOptions->open("OPTIONS"))
return false;

// TODO: Dialogue Menu (DLGMENU.TRE)
_dialogueMenu = new DialogueMenu(this);
if (!_dialogueMenu->loadText("DLGMENU"))
return false;

_suspectsDatabase = new SuspectsDatabase(this, _gameInfo->getSuspectsDatabaseSize());

Expand Down Expand Up @@ -602,8 +605,12 @@ void BladeRunnerEngine::gameTick() {
if (_scene->didPlayerWalkIn()) {
_sceneScript->PlayerWalkedIn();
}
// TODO: Gun range announcements
bool inDialogueMenu = _dialogueMenu->isVisible();
if (!inDialogueMenu) {
// TODO: actors combat-tick
}

// TODO: Gun range announcements
_zbuffer->clean();

_ambientSounds->tick();
Expand All @@ -621,8 +628,9 @@ void BladeRunnerEngine::gameTick() {

// TODO: Render overlays

//if (!dialogueMenu)
if (!inDialogueMenu) {
actorsUpdate();
}

if (_settings->getNewScene() == -1 || _sceneScript->IsInsideScript() || _aiScripts->IsInsideScript()) {
_sliceRenderer->setView(*_view);
Expand All @@ -645,9 +653,13 @@ void BladeRunnerEngine::gameTick() {
_itemPickup->tick();
_itemPickup->draw();

// TODO: Draw dialogue menu

Common::Point p = getMousePos();

if (_dialogueMenu->isVisible()) {
_dialogueMenu->tick(p.x, p.y);
_dialogueMenu->draw();
}

_mouse->tick(p.x, p.y);
_mouse->draw(_surfaceGame, p.x, p.y);

Expand Down Expand Up @@ -833,6 +845,13 @@ void BladeRunnerEngine::handleMouseAction(int x, int y, bool buttonLeft, bool bu
return;
}

if (_dialogueMenu->waitingForInput()) {
if (buttonLeft && !buttonDown) {
_dialogueMenu->mouseUp();
}
return;
}

Vector3 mousePosition = _mouse->getXYZ(x, y);

int isClickable;
Expand Down
2 changes: 2 additions & 0 deletions engines/bladerunner/bladerunner.h
Expand Up @@ -54,6 +54,7 @@ class AudioSpeech;
class Chapters;
class CrimesDatabase;
class Combat;
class DialogueMenu;
class Font;
class GameFlags;
class GameInfo;
Expand Down Expand Up @@ -92,6 +93,7 @@ class BladeRunnerEngine : public Engine {
Chapters *_chapters;
CrimesDatabase *_crimesDatabase;
Combat *_combat;
DialogueMenu *_dialogueMenu;
GameFlags *_gameFlags;
GameInfo *_gameInfo;
ItemPickup *_itemPickup;
Expand Down

0 comments on commit a4c7992

Please sign in to comment.