diff options
Diffstat (limited to 'engines')
-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); |