diff options
author | Eugene Sandulenko | 2018-03-26 00:09:01 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-03-26 00:54:17 +0200 |
commit | cdad8a2e6bcb2a729fc93f3c0e7f2d8787f79e2f (patch) | |
tree | c75dbe1a22e5e2a4667aeca19988781e27810795 /engines/bladerunner | |
parent | 4d0bbf027e62a5700d239fa530e175d3ff5d4cc4 (diff) | |
download | scummvm-rg350-cdad8a2e6bcb2a729fc93f3c0e7f2d8787f79e2f.tar.gz scummvm-rg350-cdad8a2e6bcb2a729fc93f3c0e7f2d8787f79e2f.tar.bz2 scummvm-rg350-cdad8a2e6bcb2a729fc93f3c0e7f2d8787f79e2f.zip |
BLADERUNNER: Fully plug the Scores into the engine
Diffstat (limited to 'engines/bladerunner')
-rw-r--r-- | engines/bladerunner/bladerunner.cpp | 9 | ||||
-rw-r--r-- | engines/bladerunner/script/script.cpp | 14 | ||||
-rw-r--r-- | engines/bladerunner/ui/scores.cpp | 20 | ||||
-rw-r--r-- | engines/bladerunner/ui/scores.h | 8 |
4 files changed, 43 insertions, 8 deletions
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index 5121fa86c6..a8e7df5e93 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -1095,6 +1095,15 @@ void BladeRunnerEngine::handleMouseAction(int x, int y, bool mainButton, bool bu return; } + if (_scores->isOpen()) { + if (buttonDown) { + _scores->handleMouseDown(x, y); + } else { + _scores->handleMouseUp(x, y); + } + return; + } + if (_dialogueMenu->waitingForInput()) { if (mainButton && !buttonDown) { _dialogueMenu->mouseUp(); diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index 6d981fe3e3..3c68717116 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -53,6 +53,7 @@ #include "bladerunner/ui/elevator.h" #include "bladerunner/ui/esper.h" #include "bladerunner/ui/kia.h" +#include "bladerunner/ui/scores.h" #include "bladerunner/ui/spinner.h" #include "bladerunner/ui/vk.h" #include "bladerunner/vector.h" @@ -1211,18 +1212,15 @@ int ScriptBase::Elevator_Activate(int elevatorId) { } void ScriptBase::View_Score_Board() { - //TODO - warning("View_Score_Board()"); + _vm->_scores->open(); } -int ScriptBase::Query_Score(int a0) { - warning("Query_Score(%d)", a0); - - return 0; +int ScriptBase::Query_Score(int index) { + return _vm->_scores->query(index); } -void ScriptBase::Set_Score(int a0, int a1) { - warning("Set_Score(%d, %d)", a0, a1); +void ScriptBase::Set_Score(int index, int value) { + _vm->_scores->set(index, value); } void ScriptBase::Give_McCoy_Ammo(int ammoType, int ammo) { diff --git a/engines/bladerunner/ui/scores.cpp b/engines/bladerunner/ui/scores.cpp index 5f15809c9a..067c90a15a 100644 --- a/engines/bladerunner/ui/scores.cpp +++ b/engines/bladerunner/ui/scores.cpp @@ -36,10 +36,30 @@ Scores::Scores(BladeRunnerEngine *vm) { Scores::~Scores() { } +void Scores::open() { +} + bool Scores::isOpen() const { return _isOpen; } +void Scores::set(int index, int value) { + if (value > _scores[index]) { + _scores[index] = value; + } + + _lastScoreId = index; + _lastScoreValue = value; +} + +int Scores::handleMouseUp(int x, int y) { + return false; +} + +int Scores::handleMouseDown(int x, int y) { + return false; +} + void Scores::tick() { } diff --git a/engines/bladerunner/ui/scores.h b/engines/bladerunner/ui/scores.h index a739614e76..3ae12defd7 100644 --- a/engines/bladerunner/ui/scores.h +++ b/engines/bladerunner/ui/scores.h @@ -49,7 +49,15 @@ public: Scores(BladeRunnerEngine *vm); ~Scores(); + void open(); bool isOpen() const; + + int query(int index) { return _scores[index]; } + void set(int index, int value); + + int handleMouseUp(int x, int y); + int handleMouseDown(int x, int y); + void tick(); void reset(); void save(SaveFileWriteStream &f); |