ScummVM API documentation
view_char_gen.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 ULTIMA_ULTIMA1_GFX_VIEW_CHAR_GEN_H
23#define ULTIMA_ULTIMA1_GFX_VIEW_CHAR_GEN_H
24
25#include "ultima/shared/gfx/visual_container.h"
26#include "ultima/shared/gfx/text_input.h"
27#include "ultima/shared/core/party.h"
28#include "graphics/managed_surface.h"
29
30namespace Ultima {
31namespace Ultima1 {
32namespace U1Gfx {
33
34#define ATTRIBUTE_COUNT 6
35
36using Shared::CKeypressMsg;
37using Shared::CShowMsg;
38using Shared::CHideMsg;
39using Shared::CTextInputMsg;
40
45 DECLARE_MESSAGE_MAP;
46 bool KeypressMsg(CKeypressMsg *msg);
47 bool ShowMsg(CShowMsg *msg);
48 bool HideMsg(CHideMsg *msg);
49 bool TextInputMsg(CTextInputMsg *msg);
50private:
51 enum Flag {
52 FLAG_FRAME = 1, FLAG_POINTS = 2, FLAG_ATTRIBUTES = 4, FLAG_ATTR_POINTERS = 8, FLAG_HELP = 16,
53 FLAG_RACE = 32, FLAG_SEX = 64, FLAG_CLASS = 128, FLAG_NAME = 256, FLAG_SAVE = 512,
54 FLAG_INITIAL = FLAG_FRAME | FLAG_POINTS | FLAG_ATTRIBUTES | FLAG_ATTR_POINTERS | FLAG_HELP
55 };
56 uint _flags;
57 Shared::Character *_character;
58 int _pointsRemaining;
59 int _selectedAttribute;
60 uint *_attributes[ATTRIBUTE_COUNT];
61 Shared::Gfx::TextInput *_textInput;
62private:
66 void setMode(uint flags);
67
71 void drawFrame(Shared::Gfx::VisualSurface &s);
72
76 void drawPointsRemaining(Shared::Gfx::VisualSurface &s);
77
81 void drawAttributes(Shared::Gfx::VisualSurface &s);
82
86 void drawAttributePointers(Shared::Gfx::VisualSurface &s);
87
91 void drawHelp(Shared::Gfx::VisualSurface &s);
92
96 void drawRace(Shared::Gfx::VisualSurface &s);
97
101 void drawSex(Shared::Gfx::VisualSurface &s);
102
106 void drawClass(Shared::Gfx::VisualSurface &s);
107
111 void drawName(Shared::Gfx::VisualSurface &s);
112
116 void drawSave(Shared::Gfx::VisualSurface &s);
117
121 void setRace(int raceNum);
122
126 void setSex(int sexNum);
127
131 void setClass(int classNum);
132
136 bool save();
137public:
138 CLASSDEF;
139
144
149
153 void draw() override;
154};
155
156} // End of namespace U1Gfx
157} // End of namespace Shared
158} // End of namespace Ultima
159
160#endif
Definition: messages.h:230
Definition: messages.h:265
Definition: messages.h:280
Definition: messages.h:285
Definition: character.h:141
Definition: text_input.h:34
Definition: visual_item.h:39
Definition: visual_surface.h:39
Definition: tree_item.h:50
ViewCharacterGeneration(Shared::TreeItem *parent=nullptr)