ScummVM API documentation
spell_view.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_H
23 #define NUVIE_VIEWS_SPELL_VIEW_H
24 
25 #include "ultima/nuvie/views/draggable_view.h"
26 #include "ultima/nuvie/core/obj.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 class SpellView : public DraggableView {
41 
42  U6Bmp *background;
43  bool all_spells_mode;
44 
45 protected:
46  bool event_mode; //this means we are reporting the spell_num back to the event class. Used by the enchant spell.
47 
48  Obj *spell_container;
49  Actor *caster;
50  uint16 caster_reagents[8];
51 
52  uint8 level;
53  uint8 spell_num;
54 
55  sint16 cur_spells[16];
56 
57  uint8 num_spells_per_page;
58 
59 public:
60  SpellView(const Configuration *cfg);
61  ~SpellView() override;
62 
63  virtual bool init(Screen *tmp_screen, void *view_manager, uint16 x, uint16 y, Font *f, Party *p, TileManager *tm, ObjManager *om);
64 
65  void set_spell_caster(Actor *actor, Obj *s_container, bool eventMode);
66  sint16 get_selected_spell() const {
67  if (spell_container) {
68  return spell_container->quality;
69  } else return -1;
70  }
71  void Display(bool full_redraw) override;
72  void PlaceOnScreen(Screen *s, GUI_DragManager *dm, int x, int y) override;
73  void close_look();
74  GUI_status KeyDown(const Common::KeyState &key) override;
75  GUI_status MouseDown(int x, int y, Shared::MouseButton button) override;
76 
77  GUI_status MouseUp(int x, int y, Shared::MouseButton button) override {
78  return GUI_YUM;
79  }
80  GUI_status MouseMotion(int x, int y, uint8 state) override {
81  return GUI_YUM;
82  }
83  GUI_status MouseEnter(uint8 state) override {
84  return GUI_YUM;
85  }
86  GUI_status MouseLeave(uint8 state) override {
87  return GUI_YUM;
88  }
89  GUI_status MouseClick(int x, int y, Shared::MouseButton button) override {
90  return GUI_YUM;
91  }
92  GUI_status MouseDouble(int x, int y, Shared::MouseButton button) override {
93  return GUI_YUM;
94  }
95  GUI_status MouseDelayed(int x, int y, Shared::MouseButton button) override {
96  return GUI_YUM;
97  }
98  GUI_status MouseHeld(int x, int y, Shared::MouseButton button) override {
99  return GUI_YUM;
100  }
101  GUI_status MouseWheel(sint32 x, sint32 y) override;
102 
103 protected:
104 
105  void event_mode_select_spell();
106 
107  void add_command_icons(Screen *tmp_screen, void *view_manager);
108  void hide_buttons();
109  void show_buttons();
110  void update_buttons();
111 
112  void move_left();
113  void move_right();
114  GUI_status move_up();
115  GUI_status move_down();
116 
117  void set_prev_level();
118  void set_next_level();
119 
120  virtual uint8 fill_cur_spell_list();
121  sint8 get_selected_index() const;
122 
123  void display_level_text();
124  void display_spell_list_text();
125  void display_spell_text(Spell *spell, uint16 line_num, uint8 selected_spell);
126  void show_spell_description();
127  GUI_status cancel_spell();
128  uint16 get_available_spell_count(const Spell *s) const;
129 
130  GUI_status callback(uint16 msg, GUI_CallBack *caller, void *data) override;
131 };
132 
133 } // End of namespace Nuvie
134 } // End of namespace Ultima
135 
136 #endif
Definition: actor.h:178
Definition: obj.h:84
Definition: configuration.h:61
Definition: atari-screen.h:60
Definition: tile_manager.h:145
Definition: party.h:92
Definition: magic.h:60
Definition: screen.h:41
Definition: detection.h:27
Definition: u6_bmp.h:32
Definition: draggable_view.h:34
Definition: spell_view.h:40
Definition: obj_manager.h:75
Definition: gui_drag_manager.h:36
Definition: keyboard.h:294
Definition: font.h:42
Definition: gui_callback.h:31