95 uint8 point[3] = { 0, 100, 50 };
97 uint lawfulnessButton = 0;
98 uint goodnessButton = 0;
99 for (
uint a = 0; a < 3; ++a) {
101 lawfulnessButton = 3 * a;
106 _buttons->setActive(lawfulnessButton + goodnessButton);
114 if (widget.
getTag() ==
"OkButton") {
120 if (widget.
getTag() ==
"CancelButton") {
125 if (widget.
getTag() ==
"RecommendButton") {
130 _buttons->setActive(dynamic_cast<WidgetButton *>(&widget));
136 uint8 recommendedAlign[] = {2, 1, 5, 8, 1, 5, 4, 1, 8, 2, 5};
148 uint alignRestrict = row.
getInt(
"AlignRestrict");
149 bool invertRestrict = row.
getInt(
"InvertRestrict") != 0;
152 uint axisRestrict[5] = { 0x01, 0x02, 0x04, 0x08, 0x10 };
153 uint good[] = { 1, 4, 7 };
154 uint evil[] = { 0, 3, 6 };
155 uint lawful[] = { 3, 4, 5 };
156 uint chaos[] = { 0, 1, 2 };
158 std::vector<uint> goodAxis(good, good +
sizeof(good) /
sizeof(
uint));
159 std::vector<uint> evilAxis(evil, evil +
sizeof(evil) /
sizeof(
uint));
160 std::vector<uint> lawfulAxis(lawful, lawful +
sizeof(lawful) /
sizeof(
uint));
161 std::vector<uint> chaosAxis(chaos, chaos +
sizeof(chaos) /
sizeof(
uint));
162 std::vector<uint> neutralAxis;
164 neutralAxis.push_back(8);
166 uint alignRstrctType = row.
getInt(
"AlignRstrctType");
168 if (alignRstrctType == 0x1) {
169 neutralAxis.push_back(6);
170 neutralAxis.push_back(7);
171 }
else if (alignRstrctType == 0x2) {
172 neutralAxis.push_back(2);
173 neutralAxis.push_back(5);
174 }
else if (alignRstrctType == 0x3) {
175 neutralAxis.push_back(6);
176 neutralAxis.push_back(7);
177 neutralAxis.push_back(2);
178 neutralAxis.push_back(5);
181 std::vector<std::vector<uint> > axis;
182 axis.push_back(neutralAxis);
183 axis.push_back(lawfulAxis);
184 axis.push_back(chaosAxis);
185 axis.push_back(goodAxis);
186 axis.push_back(evilAxis);
188 const std::vector<WidgetButton *> bList =
_buttons->getButtonsList();
190 for (std::vector<WidgetButton *>::const_iterator it = bList.begin(); it != bList.end(); ++it)
191 (*it)->setDisabled(invertRestrict);
193 for (
uint it = 0; it < 5; ++it) {
194 if (axisRestrict[it] & alignRestrict) {
195 for (std::vector<uint>::iterator ax = axis[it].begin(); ax != axis[it].end(); ++ax)
196 bList[*ax]->setDisabled(!invertRestrict);
202 size_t button =
_buttons->getChoice();
204 uint8 point[3] = { 0, 100, 50 };
205 size_t rest = button % 3;
Class to hold the two-dimensional array of a 2DA file.
Common::ScopedPtr< ButtonsGroup > _buttons
#define TalkMan
Shortcut for accessing the talk manager.
uint32 _returnCode
The GUI's return code.
CharAlignment(CharGenChoices &choices, ::Engines::Console *console=0)
bool getAlign(uint8 &goodness, uint8 &lawfulness) const
void setAlign(uint8 goodness, uint8 lawfulness)
The alignment chooser in CharGen.
WidgetButton * getButton(const Common::UString &tag, bool vital=false)
virtual void show()
Show the GUI.
CharGenChoices * _choices
Handling BioWare's 2DAs (two-dimensional array).
void load(const Common::UString &resref)
#define TwoDAReg
Shortcut for accessing the 2da registry.
int32 getInt(size_t column) const
Return the contents of a cell as an int.
void callbackActive(Widget &widget)
Callback that's triggered when a widget was activated.
WidgetEditBox * getEditBox(const Common::UString &tag, bool vital=false)
const TwoDARow & getRow(size_t row) const
Get a row.
The global talk manager for Aurora strings.
virtual void hide()
Hide the GUI.