ScummVM API documentation
weasel_gump.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 ULTIMA8_GUMPS_REMORSEMENUGUMP_H
23#define ULTIMA8_GUMPS_REMORSEMENUGUMP_H
24
25#include "ultima/ultima8/gumps/modal_gump.h"
26#include "ultima/ultima8/misc/classtype.h"
27
28namespace Ultima {
29namespace Ultima8 {
30
31class WeaselDat;
32
36class WeaselGump : public ModalGump {
37public:
38 ENABLE_RUNTIME_CLASSTYPE()
39
40 enum WeaselGumpState {
41 kWeaselStart,
42 kWeaselConfirmPurchaseMovie,
43 kWeaselConfirmPurchaseText,
44 kWeaselCancelledPurchaseMovie,
45 kWeaselCancelledPurchaseText,
46 kWeaselCompletedPurchase,
47 kWeaselInsufficientFunds,
48 kWeaselBrowsing,
49 kWeaselClosing,
50 kWeaselCheckBuyMoreMovie,
51 kWeaselCheckBuyMoreText,
52 kWeaselShowIntro
53 };
54
55 WeaselGump(uint16 level);
56 ~WeaselGump() override;
57
58 // Init the gump, call after construction
59 void InitGump(Gump *newparent, bool take_focus = true) override;
60 void Close(bool no_del = false) override;
61
62 void run() override;
63
64 // Paint the Gump
65 void PaintThis(RenderSurface *, int32 lerp_factor, bool scaled) override;
66
67 bool OnKeyDown(int key, int mod) override;
68 bool OnTextInput(int unicode) override;
69 void ChildNotify(Gump *child, uint32 message) override;
70
71 static uint32 I_showWeaselGump(const uint8 *args, unsigned int /*argsize*/);
72
73private:
74
75 void onButtonClick(int entry);
76
77 void prevItem();
78 void nextItem();
79 void buyItem();
80 void updateForAmmoMode();
81 void checkClose();
82 void completePurchase();
83 void abortPurchase();
84 void checkBuyMore();
85 void confirmPurchase();
86 void setYesNoQuestion(const Common::String &msg);
87 void browsingMode(bool browsing);
88 int purchasedCount(uint16 shape) const;
89
90 void updateItemDisplay();
91 Gump *playMovie(const Common::String &filename);
92
94 Gump *_ui;
95
97 Gump *_movie;
98
100 uint16 _level;
101
103 WeaselGumpState _state;
104
105 const WeaselDat *_weaselDat;
106
108 int32 _credits;
109
111 Common::Array<uint16> _purchases;
112
114 int _curItem;
115
117 bool _ammoMode;
118
120 int32 _curItemCost;
121
123 uint16 _curItemShape;
124
134 static bool _playedIntroMovie;
135};
136
137} // End of namespace Ultima8
138} // End of namespace Ultima
139
140#endif
Definition: str.h:59
Definition: gump.h:46
Definition: modal_gump.h:34
Definition: render_surface.h:37
Definition: weasel_dat.h:34
Definition: weasel_gump.h:36
void Close(bool no_del=false) override
void PaintThis(RenderSurface *, int32 lerp_factor, bool scaled) override
Overloadable method to Paint just this Gump (RenderSurface is relative to this)
void ChildNotify(Gump *child, uint32 message) override
void InitGump(Gump *newparent, bool take_focus=true) override
void run() override
Run the gump.