2010-09-14 22:13:26 +02:00
|
|
|
#ifndef MWGUI_RACE_H
|
|
|
|
#define MWGUI_RACE_H
|
2010-09-12 14:06:10 +02:00
|
|
|
|
2012-09-15 00:57:29 +02:00
|
|
|
#include "../mwrender/characterpreview.hpp"
|
|
|
|
|
2013-04-10 00:32:05 -04:00
|
|
|
#include "windowbase.hpp"
|
2010-09-12 14:06:10 +02:00
|
|
|
|
|
|
|
|
2011-02-21 20:36:35 +01:00
|
|
|
namespace MWGui
|
2010-09-14 14:16:26 +02:00
|
|
|
{
|
2011-02-21 20:36:35 +01:00
|
|
|
class WindowManager;
|
2010-09-14 14:16:26 +02:00
|
|
|
}
|
|
|
|
|
2010-09-12 14:06:10 +02:00
|
|
|
/*
|
2010-09-14 22:15:35 +02:00
|
|
|
This file contains the dialog for choosing a race.
|
2012-07-03 11:34:20 +02:00
|
|
|
Layout is defined by resources/mygui/openmw_chargen_race.layout.
|
2010-09-12 14:06:10 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
2013-02-25 06:57:32 +01:00
|
|
|
class RaceDialog : public WindowModal
|
2010-09-14 21:55:41 +02:00
|
|
|
{
|
|
|
|
public:
|
2013-04-10 14:46:21 -04:00
|
|
|
RaceDialog();
|
2010-09-14 21:27:40 +02:00
|
|
|
|
|
|
|
enum Gender
|
|
|
|
{
|
|
|
|
GM_Male,
|
|
|
|
GM_Female
|
|
|
|
};
|
|
|
|
|
2012-11-10 11:41:12 +04:00
|
|
|
const ESM::NPC &getResult() const { return mPreview->getPrototype(); }
|
2012-07-13 03:51:58 -07:00
|
|
|
const std::string &getRaceId() const { return mCurrentRaceId; }
|
|
|
|
Gender getGender() const { return mGenderIndex == 0 ? GM_Male : GM_Female; }
|
2010-09-14 21:27:40 +02:00
|
|
|
// getFace()
|
|
|
|
// getHair()
|
2010-09-14 14:16:26 +02:00
|
|
|
|
2010-09-15 13:04:57 +02:00
|
|
|
void setRaceId(const std::string &raceId);
|
2012-07-13 03:51:58 -07:00
|
|
|
void setGender(Gender gender) { mGenderIndex = gender == GM_Male ? 0 : 1; }
|
2010-09-14 21:27:40 +02:00
|
|
|
// setFace()
|
|
|
|
// setHair()
|
2010-09-12 14:06:10 +02:00
|
|
|
|
2010-09-15 19:37:06 +02:00
|
|
|
void setNextButtonShow(bool shown);
|
2012-08-27 21:29:04 +02:00
|
|
|
virtual void open();
|
2012-09-24 00:42:05 +02:00
|
|
|
virtual void close();
|
2010-09-15 19:37:06 +02:00
|
|
|
|
2010-09-14 19:33:40 +02:00
|
|
|
// Events
|
2012-09-10 09:10:50 +02:00
|
|
|
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
2010-09-14 19:33:40 +02:00
|
|
|
|
|
|
|
/** Event : Back button clicked.\n
|
2010-09-14 21:55:41 +02:00
|
|
|
signature : void method()\n
|
|
|
|
*/
|
|
|
|
EventHandle_Void eventBack;
|
2010-09-14 19:33:40 +02:00
|
|
|
|
|
|
|
protected:
|
2012-03-22 15:23:23 +01:00
|
|
|
void onHeadRotate(MyGUI::ScrollBar* _sender, size_t _position);
|
2010-09-12 14:06:10 +02:00
|
|
|
|
2010-09-14 21:55:41 +02:00
|
|
|
void onSelectPreviousGender(MyGUI::Widget* _sender);
|
|
|
|
void onSelectNextGender(MyGUI::Widget* _sender);
|
2010-09-12 14:06:10 +02:00
|
|
|
|
2010-09-14 21:55:41 +02:00
|
|
|
void onSelectPreviousFace(MyGUI::Widget* _sender);
|
|
|
|
void onSelectNextFace(MyGUI::Widget* _sender);
|
2010-09-12 14:06:10 +02:00
|
|
|
|
2010-09-14 21:55:41 +02:00
|
|
|
void onSelectPreviousHair(MyGUI::Widget* _sender);
|
|
|
|
void onSelectNextHair(MyGUI::Widget* _sender);
|
2010-09-12 14:06:10 +02:00
|
|
|
|
2012-03-22 15:28:06 +01:00
|
|
|
void onSelectRace(MyGUI::ListBox* _sender, size_t _index);
|
2010-09-12 14:06:10 +02:00
|
|
|
|
2010-09-14 19:33:40 +02:00
|
|
|
void onOkClicked(MyGUI::Widget* _sender);
|
|
|
|
void onBackClicked(MyGUI::Widget* _sender);
|
|
|
|
|
2010-09-14 21:55:41 +02:00
|
|
|
private:
|
|
|
|
void updateRaces();
|
|
|
|
void updateSkills();
|
|
|
|
void updateSpellPowers();
|
2012-11-10 19:57:50 +04:00
|
|
|
void updatePreview();
|
2012-11-10 21:30:16 +04:00
|
|
|
void recountParts();
|
2010-09-12 14:06:10 +02:00
|
|
|
|
2013-04-18 00:19:34 +02:00
|
|
|
void getBodyParts (int part, std::vector<std::string>& out);
|
|
|
|
|
|
|
|
std::vector<std::string> mAvailableHeads;
|
|
|
|
std::vector<std::string> mAvailableHairs;
|
2013-03-30 20:04:05 +01:00
|
|
|
|
2012-09-13 19:03:31 +02:00
|
|
|
MyGUI::ImageBox* mPreviewImage;
|
2012-07-13 03:51:58 -07:00
|
|
|
MyGUI::ListBox* mRaceList;
|
|
|
|
MyGUI::ScrollBar* mHeadRotate;
|
2010-09-12 14:06:10 +02:00
|
|
|
|
2013-03-03 13:11:02 +01:00
|
|
|
MyGUI::Widget* mSkillList;
|
|
|
|
std::vector<MyGUI::Widget*> mSkillItems;
|
2010-09-12 14:06:10 +02:00
|
|
|
|
2013-03-03 13:11:02 +01:00
|
|
|
MyGUI::Widget* mSpellPowerList;
|
|
|
|
std::vector<MyGUI::Widget*> mSpellPowerItems;
|
2010-09-12 14:06:10 +02:00
|
|
|
|
2012-07-13 03:51:58 -07:00
|
|
|
int mGenderIndex, mFaceIndex, mHairIndex;
|
2010-09-14 14:16:26 +02:00
|
|
|
|
2012-07-13 03:51:58 -07:00
|
|
|
std::string mCurrentRaceId;
|
2012-09-13 19:03:31 +02:00
|
|
|
|
|
|
|
float mCurrentAngle;
|
2012-09-15 00:57:29 +02:00
|
|
|
|
2012-09-24 00:42:05 +02:00
|
|
|
MWRender::RaceSelectionPreview* mPreview;
|
2010-09-14 21:55:41 +02:00
|
|
|
};
|
2010-09-12 14:06:10 +02:00
|
|
|
}
|
|
|
|
#endif
|