ScummVM API documentation
spell_view_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 NUVIE_VIEWS_SPELL_VIEW_GUMP_H
23 #define NUVIE_VIEWS_SPELL_VIEW_GUMP_H
24 
25 #include "ultima/nuvie/views/spell_view.h"
26 #include "ultima/nuvie/files/nuvie_bmp_file.h"
27 
28 namespace Ultima {
29 namespace Nuvie {
30 
31 class Configuration;
32 class TileManager;
33 class ObjManager;
34 class Screen;
35 class Actor;
36 class Font;
37 class U6Bmp;
38 class Spell;
39 
40 static const int SPELLVIEWGUMP_WIDTH = 162;
41 
42 class SpellViewGump : public SpellView {
43 
44  GUI_Button *gump_button;
45  sint16 selected_spell;
46  GUI_Font *font;
47  NuvieBmpFile bmp;
48 public:
49  SpellViewGump(const Configuration *cfg);
50  ~SpellViewGump() override;
51 
52  bool init(Screen *tmp_screen, void *view_manager, uint16 x, uint16 y, Font *f, Party *p, TileManager *tm, ObjManager *om) override;
53 
54  void Display(bool full_redraw) override;
55 
56  GUI_status MouseDown(int x, int y, Shared::MouseButton button) override;
57  GUI_status MouseUp(int x, int y, Shared::MouseButton button) override;
58  GUI_status MouseMotion(int x, int y, uint8 state) override {
59  return DraggableView::MouseMotion(x, y, state);
60  }
61  GUI_status MouseWheel(sint32 x, sint32 y) override;
62  void MoveRelative(int dx, int dy) override {
63  return DraggableView::MoveRelative(dx, dy);
64  }
65 
66 
67  GUI_status callback(uint16 msg, GUI_CallBack *caller, void *data) override;
68 protected:
69 
70  sint16 getSpell(int x, int y) const;
71 
72  uint8 fill_cur_spell_list() override;
73  void loadCircleString(const Common::Path &datadir);
74  void loadCircleSuffix(const Common::Path &datadir, const Std::string &image);
75  void printSpellQty(uint8 spell_num, uint16 x, uint16 y);
76 
77  void close_spellbook();
78 };
79 
80 } // End of namespace Nuvie
81 } // End of namespace Ultima
82 
83 #endif
Definition: configuration.h:61
Definition: gui_font.h:36
Definition: gui_button.h:70
Definition: path.h:52
Definition: atari-screen.h:60
Definition: tile_manager.h:145
Definition: party.h:92
Definition: screen.h:41
Definition: detection.h:27
Definition: spell_view_gump.h:42
Definition: string.h:30
Definition: spell_view.h:40
Definition: obj_manager.h:75
Definition: nuvie_bmp_file.h:33
Definition: font.h:42
Definition: gui_callback.h:31