ScummVM API documentation
kia_section_crimes.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BLADERUNNER_KIA_SECTION_CRIME_H
23 #define BLADERUNNER_KIA_SECTION_CRIME_H
24 
25 #include "bladerunner/ui/kia_section_base.h"
26 
27 #include "common/array.h"
28 
29 namespace BladeRunner {
30 
31 class ActorClues;
32 class BladeRunnerEngine;
33 class Shapes;
34 class UIContainer;
35 class UIImagePicker;
36 class UIScrollBox;
37 
39  // _vm->_gameInfo->getClueCount()
40  static const int kClueCount = 288;
41 
42  struct AcquiredClue {
43  int clueId;
44  int actorId;
45  };
46 
47  bool _isOpen;
48 
49  UIContainer *_uiContainer;
50  UIImagePicker *_buttons;
51  UIScrollBox *_cluesScrollBox;
52 
53  ActorClues *_clues;
54 
55  int _acquiredClueCount;
56  AcquiredClue _acquiredClues[kClueCount];
57 
58  int _crimeSelected;
59 
60  int _crimesFoundCount;
61  Common::Array<bool> _crimesFound;
62 
63  int _suspectsFoundCount;
64  Common::Array<bool> _suspectsFound;
65  Common::Array<bool> _suspectsWithIdentity;
66 
67  int _mouseX;
68  int _mouseY;
69 
70  int _suspectPhotoShapeId;
71  int _suspectPhotoNotUsed;
72  Shapes *_suspectPhotoShapes;
73 
74 public:
75  int _suspectSelected;
76 
77 public:
79  ~KIASectionCrimes() override;
80 
81  void reset();
82 
83  void open() override;
84  void close() override;
85 
86  void draw(Graphics::Surface &surface) override;
87 
88  void handleMouseMove(int mouseX, int mouseY) override;
89  void handleMouseDown(bool mainButton) override;
90  void handleMouseUp(bool mainButton) override;
91  void handleMouseScroll(int direction) override;
92 
93  void saveToLog();
94  void loadFromLog();
95 
96  void selectCrime(int crimeId);
97 
98 private:
99  static void scrollBoxCallback(void *callbackData, void *source, int lineData, int mouseButton);
100  static void mouseUpCallback(int buttonId, void *callbackData);
101 
102  void onButtonPressed(int buttonId) override;
103 
104  void populateAcquiredClues();
105  void populateCrimes();
106  void populateSuspects();
107  void populateVisibleClues();
108  void updateSuspectPhoto();
109 
110  void nextCrime();
111  void prevCrime();
112 
113  void nextSuspect();
114  void prevSuspect();
115 };
116 
117 } // End of namespace BladeRunner
118 
119 #endif
Definition: actor_clues.h:33
Definition: surface.h:67
Definition: actor.h:31
Definition: ui_container.h:33
Definition: kia_section_base.h:40
Definition: kia_section_crimes.h:38
Definition: ui_image_picker.h:40
Definition: bladerunner.h:113
Definition: ui_scroll_box.h:36
Definition: shape.h:61