22 #ifndef SCUMM_MACGUI_MACGUI_INDY3_H 23 #define SCUMM_MACGUI_MACGUI_INDY3_H 25 #include "common/events.h" 26 #include "common/rect.h" 27 #include "common/str.h" 29 #include "graphics/surface.h" 31 #include "scumm/macgui/macgui_colors.h" 35 #define INDY3_INVENTORY_SLOT_SIZE 6 41 enum ScrollDirection {
50 int getNumColors()
const override {
return 16; }
56 void setupCursor(
int &width,
int &height,
int &hotspotX,
int &hotspotY,
int &animate)
override;
60 void initTextAreaForActor(
Actor *a, byte color)
override;
61 void printCharToTextArea(
int chr,
int x,
int y,
int color)
override;
73 bool isVerbGuiActive()
const override;
75 void reset()
override;
76 void resetAfterLoad()
override;
77 void update(
int delta)
override;
81 bool getFontParams(FontId fontId,
int &
id,
int &size,
int &slant)
const override;
83 void updateMenus()
override;
86 void runAboutDialog()
override;
87 bool runOpenDialog(
int &saveSlotToHandle)
override;
88 bool runSaveDialog(
int &saveSlotToHandle,
Common::String &saveName)
override;
89 bool runOptionsDialog()
override;
90 bool runIqPointsDialog();
96 bool _visible =
false;
98 bool _leftButtonIsPressed =
false;
104 bool updateVerbs(
int delta);
105 void updateMouseHeldTimer(
int delta);
110 int getInventoryScrollOffset()
const;
111 void setInventoryScrollOffset(
int n)
const;
122 Widget(
int x,
int y,
int width,
int height);
125 void setEnabled(
bool enabled) {
126 if (enabled != _enabled)
133 void setTimer(
int t) { _timer = t; }
134 void clearTimer() { _timer = 0; }
135 bool hasTimer()
const {
return _timer > 0; }
137 virtual void setRedraw(
bool redraw) { _redraw = redraw; }
139 virtual void reset();
143 virtual void updateTimer(
int delta);
144 virtual void timeOut() {}
147 virtual void undraw();
149 byte translateChar(byte c)
const;
153 void drawBitmap(
Common::Rect r,
const uint16 *bitmap, byte color)
const;
155 void drawShadowFrame(
Common::Rect r, byte shadowColor, byte fillColor);
160 class VerbWidget :
public Widget {
167 VerbWidget(
int x,
int y,
int width,
int height) : Widget(x, y, width, height) {}
169 void setVerbid(
int n) { _verbid = n; }
170 bool hasVerb()
const {
return _verbslot != -1; }
171 void threaten() { _kill =
true; }
172 bool isDying()
const {
return _kill; }
174 void reset()
override;
176 virtual void updateVerb(
int verbslot);
178 void draw()
override;
179 void undraw()
override;
182 class Button :
public VerbWidget {
187 Button(
int x,
int y,
int width,
int height);
191 void reset()
override;
192 void timeOut()
override;
193 void updateVerb(
int verbslot)
override;
195 void draw()
override;
198 class Inventory :
public VerbWidget {
200 class ScrollBar :
public Widget {
206 ScrollBar(
int x,
int y,
int width,
int height);
208 void setInventoryParameters(
int invCount,
int invOffset);
209 void scroll(ScrollDirection dir);
210 int getHandlePosition();
212 void reset()
override;
216 void draw()
override;
219 class ScrollButton :
public Widget {
221 ScrollDirection _direction;
223 ScrollButton(
int x,
int y,
int width,
int height, ScrollDirection direction);
227 void timeOut()
override;
229 void draw()
override;
232 class Slot :
public Widget {
239 Slot(
int slot,
int x,
int y,
int width,
int height);
241 void clearName() { _name.
clear(); }
242 bool hasName()
const {
return !_name.empty(); }
245 void setObject(
int n);
246 int getObject()
const {
return _obj; }
248 void reset()
override;
251 void timeOut()
override;
253 void draw()
override;
256 Slot *_slots[INDY3_INVENTORY_SLOT_SIZE];
257 ScrollBar *_scrollBar;
258 ScrollButton *_scrollButtons[2];
260 static const uint16 _upArrow[16];
261 static const uint16 _downArrow[16];
264 Inventory(
int x,
int y,
int width,
int height);
267 void setRedraw(
bool redraw)
override;
269 void reset()
override;
273 void updateTimer(
int delta)
override;
274 void updateVerb(
int verbslot)
override;
276 void draw()
override;
282 bool isVerbGuiAllowed()
const;
290 void copyDirtyRectsToScreen();
Definition: macgui_impl.h:52
int16 h
Definition: surface.h:76
Definition: macgui_indy3.h:39
Definition: macgui_impl.h:657
Definition: macgui_impl.h:251
int16 w
Definition: surface.h:71
void fillRect(Common::Rect r, uint32 color)