mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Merge remote branch 'amos/gui-windows' into newchar
This commit is contained in:
commit
cc86fe54d5
@ -107,6 +107,8 @@ file(GLOB ESM_HEADER ${COMP_DIR}/esm/*.hpp)
|
||||
set(ESM
|
||||
${COMP_DIR}/esm/load_impl.cpp
|
||||
${COMP_DIR}/esm/skill.cpp
|
||||
${COMP_DIR}/esm/attr.cpp
|
||||
${COMP_DIR}/esm/class.cpp
|
||||
)
|
||||
source_group(components\\esm FILES ${ESM_HEADER} ${ESM})
|
||||
|
||||
|
@ -187,7 +187,7 @@ void BirthDialog::updateSpells()
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
static struct{ const std::vector<std::string> &spells; const char *label; } categories[3] = {
|
||||
struct{ const std::vector<std::string> &spells; const char *label; } categories[3] = {
|
||||
{abilities, "sBirthsignmenu1"},
|
||||
{powers, "sPowers"},
|
||||
{spells, "sBirthsignmenu2"}
|
||||
|
@ -12,6 +12,62 @@
|
||||
|
||||
using namespace MWGui;
|
||||
|
||||
/* GenerateClassResultDialog */
|
||||
|
||||
GenerateClassResultDialog::GenerateClassResultDialog(MWWorld::Environment& environment)
|
||||
: Layout("openmw_chargen_generate_class_result_layout.xml")
|
||||
, environment(environment)
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntSize gameWindowSize = environment.mWindowManager->getGui()->getViewSize();
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
mMainWidget->setCoord(coord);
|
||||
|
||||
WindowManager *wm = environment.mWindowManager;
|
||||
setText("ReflectT", wm->getGameSettingString("sMessageQuestionAnswer1", ""));
|
||||
|
||||
getWidget(classImage, "ClassImage");
|
||||
getWidget(className, "ClassName");
|
||||
|
||||
// TODO: These buttons should be managed by a Dialog class
|
||||
MyGUI::ButtonPtr backButton;
|
||||
getWidget(backButton, "BackButton");
|
||||
backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &GenerateClassResultDialog::onBackClicked);
|
||||
|
||||
MyGUI::ButtonPtr okButton;
|
||||
getWidget(okButton, "OKButton");
|
||||
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked);
|
||||
}
|
||||
|
||||
std::string GenerateClassResultDialog::getClassId() const
|
||||
{
|
||||
return className->getCaption();
|
||||
}
|
||||
|
||||
void GenerateClassResultDialog::setClassId(const std::string &classId)
|
||||
{
|
||||
currentClassId = classId;
|
||||
classImage->setImageTexture(std::string("textures\\levelup\\") + currentClassId + ".dds");
|
||||
ESMS::ESMStore &store = environment.mWorld->getStore();
|
||||
className->setCaption(store.classes.find(currentClassId)->name);
|
||||
}
|
||||
|
||||
// widget controls
|
||||
|
||||
void GenerateClassResultDialog::onOkClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
eventDone();
|
||||
}
|
||||
|
||||
void GenerateClassResultDialog::onBackClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
eventBack();
|
||||
}
|
||||
|
||||
/* PickClassDialog */
|
||||
|
||||
PickClassDialog::PickClassDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||
: Layout("openmw_chargen_class_layout.xml")
|
||||
, environment(environment)
|
||||
@ -221,3 +277,713 @@ void PickClassDialog::updateStats()
|
||||
|
||||
classImage->setImageTexture(std::string("textures\\levelup\\") + currentClassId + ".dds");
|
||||
}
|
||||
|
||||
/* InfoBoxDialog */
|
||||
|
||||
void fitToText(MyGUI::StaticTextPtr widget)
|
||||
{
|
||||
MyGUI::IntCoord inner = widget->getTextRegion();
|
||||
MyGUI::IntCoord outer = widget->getCoord();
|
||||
MyGUI::IntSize size = widget->getTextSize();
|
||||
size.width += outer.width - inner.width;
|
||||
size.height += outer.height - inner.height;
|
||||
widget->setSize(size);
|
||||
}
|
||||
|
||||
void layoutVertically(MyGUI::WidgetPtr widget, int margin)
|
||||
{
|
||||
size_t count = widget->getChildCount();
|
||||
int pos = 0;
|
||||
pos += margin;
|
||||
int width = 0;
|
||||
for (unsigned i = 0; i < count; ++i)
|
||||
{
|
||||
MyGUI::WidgetPtr child = widget->getChildAt(i);
|
||||
if (!child->isVisible())
|
||||
continue;
|
||||
|
||||
child->setPosition(child->getLeft(), pos);
|
||||
width = std::max(width, child->getWidth());
|
||||
pos += child->getHeight() + margin;
|
||||
}
|
||||
width += margin*2;
|
||||
widget->setSize(width, pos);
|
||||
}
|
||||
|
||||
InfoBoxDialog::InfoBoxDialog(MWWorld::Environment& environment)
|
||||
: Layout("openmw_infobox_layout.xml")
|
||||
, environment(environment)
|
||||
, currentButton(-1)
|
||||
{
|
||||
getWidget(textBox, "TextBox");
|
||||
getWidget(text, "Text");
|
||||
text->getSubWidgetText()->setWordWrap(true);
|
||||
getWidget(buttonBar, "ButtonBar");
|
||||
|
||||
center();
|
||||
}
|
||||
|
||||
void InfoBoxDialog::setText(const std::string &str)
|
||||
{
|
||||
text->setCaption(str);
|
||||
textBox->setVisible(!str.empty());
|
||||
fitToText(text);
|
||||
}
|
||||
|
||||
std::string InfoBoxDialog::getText() const
|
||||
{
|
||||
return text->getCaption();
|
||||
}
|
||||
|
||||
void InfoBoxDialog::setButtons(ButtonList &buttons)
|
||||
{
|
||||
for (std::vector<MyGUI::ButtonPtr>::iterator it = this->buttons.begin(); it != this->buttons.end(); ++it)
|
||||
{
|
||||
MyGUI::Gui::getInstance().destroyWidget(*it);
|
||||
}
|
||||
this->buttons.clear();
|
||||
currentButton = -1;
|
||||
|
||||
// TODO: The buttons should be generated from a template in the layout file, ie. cloning an existing widget
|
||||
MyGUI::ButtonPtr button;
|
||||
MyGUI::IntCoord coord = MyGUI::IntCoord(0, 0, buttonBar->getWidth(), 10);
|
||||
ButtonList::const_iterator end = buttons.end();
|
||||
for (ButtonList::const_iterator it = buttons.begin(); it != end; ++it)
|
||||
{
|
||||
const std::string &text = *it;
|
||||
button = buttonBar->createWidget<MyGUI::Button>("MW_Button", coord, MyGUI::Align::Top | MyGUI::Align::HCenter, "");
|
||||
button->getSubWidgetText()->setWordWrap(true);
|
||||
button->setCaption(text);
|
||||
fitToText(button);
|
||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &InfoBoxDialog::onButtonClicked);
|
||||
coord.top += button->getHeight();
|
||||
this->buttons.push_back(button);
|
||||
}
|
||||
}
|
||||
|
||||
void InfoBoxDialog::update()
|
||||
{
|
||||
// Fix layout
|
||||
layoutVertically(textBox, 4);
|
||||
layoutVertically(buttonBar, 6);
|
||||
layoutVertically(mMainWidget, 4 + 6);
|
||||
|
||||
center();
|
||||
}
|
||||
|
||||
int InfoBoxDialog::getChosenButton() const
|
||||
{
|
||||
return currentButton;
|
||||
}
|
||||
|
||||
void InfoBoxDialog::onButtonClicked(MyGUI::WidgetPtr _sender)
|
||||
{
|
||||
std::vector<MyGUI::ButtonPtr>::const_iterator end = buttons.end();
|
||||
int i = 0;
|
||||
for (std::vector<MyGUI::ButtonPtr>::const_iterator it = buttons.begin(); it != end; ++it)
|
||||
{
|
||||
if (*it == _sender)
|
||||
{
|
||||
currentButton = i;
|
||||
eventButtonSelected(_sender, i);
|
||||
return;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
void InfoBoxDialog::center()
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntSize gameWindowSize = environment.mWindowManager->getGui()->getViewSize();
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
mMainWidget->setCoord(coord);
|
||||
}
|
||||
|
||||
/* ClassChoiceDialog */
|
||||
|
||||
ClassChoiceDialog::ClassChoiceDialog(MWWorld::Environment& environment)
|
||||
: InfoBoxDialog(environment)
|
||||
{
|
||||
WindowManager *mw = environment.mWindowManager;
|
||||
setText("");
|
||||
ButtonList buttons;
|
||||
buttons.push_back(mw->getGameSettingString("sClassChoiceMenu1", ""));
|
||||
buttons.push_back(mw->getGameSettingString("sClassChoiceMenu2", ""));
|
||||
buttons.push_back(mw->getGameSettingString("sClassChoiceMenu3", ""));
|
||||
buttons.push_back(mw->getGameSettingString("sBack", ""));
|
||||
setButtons(buttons);
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
/* CreateClassDialog */
|
||||
|
||||
CreateClassDialog::CreateClassDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||
: Layout("openmw_chargen_create_class_layout.xml")
|
||||
, environment(environment)
|
||||
, specDialog(nullptr)
|
||||
, attribDialog(nullptr)
|
||||
, skillDialog(nullptr)
|
||||
, descDialog(nullptr)
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
mMainWidget->setCoord(coord);
|
||||
|
||||
WindowManager *wm = environment.mWindowManager;
|
||||
setText("SpecializationT", wm->getGameSettingString("sChooseClassMenu1", "Specialization"));
|
||||
getWidget(specializationName, "SpecializationName");
|
||||
specializationName->setCaption(wm->getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Combat], ""));
|
||||
specializationName->eventMouseButtonClick = MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationClicked);
|
||||
|
||||
setText("FavoriteAttributesT", wm->getGameSettingString("sChooseClassMenu2", "Favorite Attributes:"));
|
||||
getWidget(favoriteAttribute0, "FavoriteAttribute0");
|
||||
getWidget(favoriteAttribute1, "FavoriteAttribute1");
|
||||
favoriteAttribute0->setWindowManager(wm);
|
||||
favoriteAttribute1->setWindowManager(wm);
|
||||
favoriteAttribute0->eventClicked = MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
|
||||
favoriteAttribute1->eventClicked = MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
|
||||
|
||||
setText("MajorSkillT", wm->getGameSettingString("sSkillClassMajor", ""));
|
||||
getWidget(majorSkill0, "MajorSkill0");
|
||||
getWidget(majorSkill1, "MajorSkill1");
|
||||
getWidget(majorSkill2, "MajorSkill2");
|
||||
getWidget(majorSkill3, "MajorSkill3");
|
||||
getWidget(majorSkill4, "MajorSkill4");
|
||||
skills.push_back(majorSkill0);
|
||||
skills.push_back(majorSkill1);
|
||||
skills.push_back(majorSkill2);
|
||||
skills.push_back(majorSkill3);
|
||||
skills.push_back(majorSkill4);
|
||||
|
||||
setText("MinorSkillT", wm->getGameSettingString("sSkillClassMinor", ""));
|
||||
getWidget(minorSkill0, "MinorSkill0");
|
||||
getWidget(minorSkill1, "MinorSkill1");
|
||||
getWidget(minorSkill2, "MinorSkill2");
|
||||
getWidget(minorSkill3, "MinorSkill3");
|
||||
getWidget(minorSkill4, "MinorSkill4");
|
||||
skills.push_back(minorSkill0);
|
||||
skills.push_back(minorSkill1);
|
||||
skills.push_back(minorSkill2);
|
||||
skills.push_back(minorSkill3);
|
||||
skills.push_back(minorSkill4);
|
||||
|
||||
std::vector<Widgets::MWSkillPtr>::const_iterator end = skills.end();
|
||||
for (std::vector<Widgets::MWSkillPtr>::const_iterator it = skills.begin(); it != end; ++it)
|
||||
{
|
||||
(*it)->setWindowManager(wm);
|
||||
(*it)->eventClicked = MyGUI::newDelegate(this, &CreateClassDialog::onSkillClicked);
|
||||
}
|
||||
|
||||
setText("LabelT", wm->getGameSettingString("sName", ""));
|
||||
getWidget(editName, "EditName");
|
||||
|
||||
// Make sure the edit box has focus
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(editName);
|
||||
|
||||
// TODO: These buttons should be managed by a Dialog class
|
||||
MyGUI::ButtonPtr descriptionButton;
|
||||
getWidget(descriptionButton, "DescriptionButton");
|
||||
descriptionButton->eventMouseButtonClick = MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionClicked);
|
||||
|
||||
MyGUI::ButtonPtr backButton;
|
||||
getWidget(backButton, "BackButton");
|
||||
backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &CreateClassDialog::onBackClicked);
|
||||
|
||||
MyGUI::ButtonPtr okButton;
|
||||
getWidget(okButton, "OKButton");
|
||||
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &CreateClassDialog::onOkClicked);
|
||||
|
||||
// Set default skills, attributes
|
||||
|
||||
favoriteAttribute0->setAttributeId(ESM::Attribute::Strength);
|
||||
favoriteAttribute1->setAttributeId(ESM::Attribute::Agility);
|
||||
|
||||
majorSkill0->setSkillId(ESM::Skill::Block);
|
||||
majorSkill1->setSkillId(ESM::Skill::Armorer);
|
||||
majorSkill2->setSkillId(ESM::Skill::MediumArmor);
|
||||
majorSkill3->setSkillId(ESM::Skill::HeavyArmor);
|
||||
majorSkill4->setSkillId(ESM::Skill::BluntWeapon);
|
||||
|
||||
minorSkill0->setSkillId(ESM::Skill::LongBlade);
|
||||
minorSkill1->setSkillId(ESM::Skill::Axe);
|
||||
minorSkill2->setSkillId(ESM::Skill::Spear);
|
||||
minorSkill3->setSkillId(ESM::Skill::Athletics);
|
||||
minorSkill4->setSkillId(ESM::Skill::Enchant);
|
||||
}
|
||||
|
||||
CreateClassDialog::~CreateClassDialog()
|
||||
{
|
||||
delete specDialog;
|
||||
delete attribDialog;
|
||||
delete skillDialog;
|
||||
delete descDialog;
|
||||
}
|
||||
|
||||
std::string CreateClassDialog::getName() const
|
||||
{
|
||||
return editName->getOnlyText();
|
||||
}
|
||||
|
||||
std::string CreateClassDialog::getDescription() const
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
ESM::Class::Specialization CreateClassDialog::getSpecializationId() const
|
||||
{
|
||||
return specializationId;
|
||||
}
|
||||
|
||||
std::vector<int> CreateClassDialog::getFavoriteAttributes() const
|
||||
{
|
||||
std::vector<int> v;
|
||||
v.push_back(favoriteAttribute0->getAttributeId());
|
||||
v.push_back(favoriteAttribute1->getAttributeId());
|
||||
return v;
|
||||
}
|
||||
|
||||
std::vector<ESM::Skill::SkillEnum> CreateClassDialog::getMajorSkills() const
|
||||
{
|
||||
std::vector<ESM::Skill::SkillEnum> v;
|
||||
v.push_back(majorSkill0->getSkillId());
|
||||
v.push_back(majorSkill1->getSkillId());
|
||||
v.push_back(majorSkill2->getSkillId());
|
||||
v.push_back(majorSkill3->getSkillId());
|
||||
v.push_back(majorSkill4->getSkillId());
|
||||
return v;
|
||||
}
|
||||
|
||||
std::vector<ESM::Skill::SkillEnum> CreateClassDialog::getMinorSkills() const
|
||||
{
|
||||
std::vector<ESM::Skill::SkillEnum> v;
|
||||
v.push_back(majorSkill0->getSkillId());
|
||||
v.push_back(majorSkill1->getSkillId());
|
||||
v.push_back(majorSkill2->getSkillId());
|
||||
v.push_back(majorSkill3->getSkillId());
|
||||
v.push_back(majorSkill4->getSkillId());
|
||||
return v;
|
||||
}
|
||||
|
||||
void CreateClassDialog::setNextButtonShow(bool shown)
|
||||
{
|
||||
MyGUI::ButtonPtr descriptionButton;
|
||||
getWidget(descriptionButton, "DescriptionButton");
|
||||
|
||||
MyGUI::ButtonPtr backButton;
|
||||
getWidget(backButton, "BackButton");
|
||||
|
||||
MyGUI::ButtonPtr okButton;
|
||||
getWidget(okButton, "OKButton");
|
||||
|
||||
// TODO: All hardcoded coords for buttons are temporary, will be replaced with a dynamic system.
|
||||
if (shown)
|
||||
{
|
||||
okButton->setCaption("Next");
|
||||
|
||||
// Adjust back button when next is shown
|
||||
descriptionButton->setCoord(MyGUI::IntCoord(207 - 18, 158, 143, 23));
|
||||
backButton->setCoord(MyGUI::IntCoord(356 - 18, 158, 53, 23));
|
||||
okButton->setCoord(MyGUI::IntCoord(417 - 18, 158, 42 + 18, 23));
|
||||
}
|
||||
else
|
||||
{
|
||||
okButton->setCaption("OK");
|
||||
descriptionButton->setCoord(MyGUI::IntCoord(207, 158, 143, 23));
|
||||
backButton->setCoord(MyGUI::IntCoord(356, 158, 53, 23));
|
||||
okButton->setCoord(MyGUI::IntCoord(417, 158, 42, 23));
|
||||
}
|
||||
}
|
||||
|
||||
void CreateClassDialog::open()
|
||||
{
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
// widget controls
|
||||
|
||||
void CreateClassDialog::onDialogCancel()
|
||||
{
|
||||
if (specDialog)
|
||||
specDialog->setVisible(false);
|
||||
if (attribDialog)
|
||||
attribDialog->setVisible(false);
|
||||
if (skillDialog)
|
||||
skillDialog->setVisible(false);
|
||||
if (descDialog)
|
||||
descDialog->setVisible(false);
|
||||
// TODO: Delete dialogs here
|
||||
}
|
||||
|
||||
void CreateClassDialog::onSpecializationClicked(MyGUI::WidgetPtr _sender)
|
||||
{
|
||||
if (specDialog)
|
||||
delete specDialog;
|
||||
specDialog = new SelectSpecializationDialog(environment, environment.mWindowManager->getGui()->getViewSize());
|
||||
specDialog->eventCancel = MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
||||
specDialog->eventItemSelected = MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationSelected);
|
||||
specDialog->setVisible(true);
|
||||
}
|
||||
|
||||
void CreateClassDialog::onSpecializationSelected()
|
||||
{
|
||||
specializationId = specDialog->getSpecializationId();
|
||||
specializationName->setCaption(environment.mWindowManager->getGameSettingString(ESM::Class::gmstSpecializationIds[specializationId], ""));
|
||||
specDialog->setVisible(false);
|
||||
}
|
||||
|
||||
void CreateClassDialog::onAttributeClicked(Widgets::MWAttributePtr _sender)
|
||||
{
|
||||
if (attribDialog)
|
||||
delete attribDialog;
|
||||
attribDialog = new SelectAttributeDialog(environment, environment.mWindowManager->getGui()->getViewSize());
|
||||
attribDialog->setAffectedWidget(_sender);
|
||||
attribDialog->eventCancel = MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
||||
attribDialog->eventItemSelected = MyGUI::newDelegate(this, &CreateClassDialog::onAttributeSelected);
|
||||
attribDialog->setVisible(true);
|
||||
}
|
||||
|
||||
void CreateClassDialog::onAttributeSelected()
|
||||
{
|
||||
ESM::Attribute::AttributeID id = attribDialog->getAttributeId();
|
||||
Widgets::MWAttributePtr attribute = attribDialog->getAffectedWidget();
|
||||
if (attribute == favoriteAttribute0)
|
||||
{
|
||||
if (favoriteAttribute1->getAttributeId() == id)
|
||||
favoriteAttribute1->setAttributeId(favoriteAttribute0->getAttributeId());
|
||||
}
|
||||
else if (attribute == favoriteAttribute1)
|
||||
{
|
||||
if (favoriteAttribute0->getAttributeId() == id)
|
||||
favoriteAttribute0->setAttributeId(favoriteAttribute1->getAttributeId());
|
||||
}
|
||||
attribute->setAttributeId(id);
|
||||
attribDialog->setVisible(false);
|
||||
}
|
||||
|
||||
void CreateClassDialog::onSkillClicked(Widgets::MWSkillPtr _sender)
|
||||
{
|
||||
if (skillDialog)
|
||||
delete skillDialog;
|
||||
skillDialog = new SelectSkillDialog(environment, environment.mWindowManager->getGui()->getViewSize());
|
||||
skillDialog->setAffectedWidget(_sender);
|
||||
skillDialog->eventCancel = MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
||||
skillDialog->eventItemSelected = MyGUI::newDelegate(this, &CreateClassDialog::onSkillSelected);
|
||||
skillDialog->setVisible(true);
|
||||
}
|
||||
|
||||
void CreateClassDialog::onSkillSelected()
|
||||
{
|
||||
ESM::Skill::SkillEnum id = skillDialog->getSkillId();
|
||||
Widgets::MWSkillPtr skill = skillDialog->getAffectedWidget();
|
||||
|
||||
// Avoid duplicate skills by swapping any skill field that matches the selected one
|
||||
std::vector<Widgets::MWSkillPtr>::const_iterator end = skills.end();
|
||||
for (std::vector<Widgets::MWSkillPtr>::const_iterator it = skills.begin(); it != end; ++it)
|
||||
{
|
||||
if (*it == skill)
|
||||
continue;
|
||||
if ((*it)->getSkillId() == id)
|
||||
{
|
||||
(*it)->setSkillId(skill->getSkillId());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
skill->setSkillId(skillDialog->getSkillId());
|
||||
skillDialog->setVisible(false);
|
||||
}
|
||||
|
||||
void CreateClassDialog::onDescriptionClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
if (descDialog)
|
||||
delete descDialog;
|
||||
descDialog = new DescriptionDialog(environment, environment.mWindowManager->getGui()->getViewSize());
|
||||
descDialog->setTextInput(description);
|
||||
descDialog->eventDone = MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionEntered);
|
||||
descDialog->setVisible(true);
|
||||
}
|
||||
|
||||
void CreateClassDialog::onDescriptionEntered()
|
||||
{
|
||||
description = descDialog->getTextInput();
|
||||
descDialog->setVisible(false);
|
||||
}
|
||||
|
||||
void CreateClassDialog::onOkClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
eventDone();
|
||||
}
|
||||
|
||||
void CreateClassDialog::onBackClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
eventBack();
|
||||
}
|
||||
|
||||
/* SelectSpecializationDialog */
|
||||
|
||||
SelectSpecializationDialog::SelectSpecializationDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||
: Layout("openmw_chargen_select_specialization_layout.xml")
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
mMainWidget->setCoord(coord);
|
||||
|
||||
WindowManager *wm = environment.mWindowManager;
|
||||
|
||||
setText("LabelT", wm->getGameSettingString("sSpecializationMenu1", ""));
|
||||
|
||||
getWidget(specialization0, "Specialization0");
|
||||
getWidget(specialization1, "Specialization1");
|
||||
getWidget(specialization2, "Specialization2");
|
||||
specialization0->setCaption(wm->getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Combat], ""));
|
||||
specialization0->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
|
||||
specialization1->setCaption(wm->getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Magic], ""));
|
||||
specialization1->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
|
||||
specialization2->setCaption(wm->getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Stealth], ""));
|
||||
specialization2->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
|
||||
specializationId = ESM::Class::Combat;
|
||||
|
||||
// TODO: These buttons should be managed by a Dialog class
|
||||
MyGUI::ButtonPtr cancelButton;
|
||||
getWidget(cancelButton, "CancelButton");
|
||||
cancelButton->setCaption(wm->getGameSettingString("sCancel", ""));
|
||||
cancelButton->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onCancelClicked);
|
||||
}
|
||||
|
||||
// widget controls
|
||||
|
||||
void SelectSpecializationDialog::onSpecializationClicked(MyGUI::WidgetPtr _sender)
|
||||
{
|
||||
if (_sender == specialization0)
|
||||
specializationId = ESM::Class::Combat;
|
||||
else if (_sender == specialization1)
|
||||
specializationId = ESM::Class::Magic;
|
||||
else if (_sender == specialization2)
|
||||
specializationId = ESM::Class::Stealth;
|
||||
else
|
||||
return;
|
||||
|
||||
eventItemSelected();
|
||||
}
|
||||
|
||||
void SelectSpecializationDialog::onCancelClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
eventCancel();
|
||||
}
|
||||
|
||||
/* SelectAttributeDialog */
|
||||
|
||||
SelectAttributeDialog::SelectAttributeDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||
: Layout("openmw_chargen_select_attribute_layout.xml")
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
mMainWidget->setCoord(coord);
|
||||
|
||||
WindowManager *wm = environment.mWindowManager;
|
||||
|
||||
setText("LabelT", wm->getGameSettingString("sAttributesMenu1", ""));
|
||||
|
||||
getWidget(attribute0, "Attribute0");
|
||||
getWidget(attribute1, "Attribute1");
|
||||
getWidget(attribute2, "Attribute2");
|
||||
getWidget(attribute3, "Attribute3");
|
||||
getWidget(attribute4, "Attribute4");
|
||||
getWidget(attribute5, "Attribute5");
|
||||
getWidget(attribute6, "Attribute6");
|
||||
getWidget(attribute7, "Attribute7");
|
||||
|
||||
Widgets::MWAttributePtr attributes[8] = {
|
||||
attribute0,
|
||||
attribute1,
|
||||
attribute2,
|
||||
attribute3,
|
||||
attribute4,
|
||||
attribute5,
|
||||
attribute6,
|
||||
attribute7
|
||||
};
|
||||
|
||||
for (int i = 0; i < 8; ++i)
|
||||
{
|
||||
attributes[i]->setWindowManager(wm);
|
||||
attributes[i]->setAttributeId(ESM::Attribute::attributeIds[i]);
|
||||
attributes[i]->eventClicked = MyGUI::newDelegate(this, &SelectAttributeDialog::onAttributeClicked);
|
||||
}
|
||||
|
||||
// TODO: These buttons should be managed by a Dialog class
|
||||
MyGUI::ButtonPtr cancelButton;
|
||||
getWidget(cancelButton, "CancelButton");
|
||||
cancelButton->setCaption(wm->getGameSettingString("sCancel", ""));
|
||||
cancelButton->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectAttributeDialog::onCancelClicked);
|
||||
}
|
||||
|
||||
// widget controls
|
||||
|
||||
void SelectAttributeDialog::onAttributeClicked(Widgets::MWAttributePtr _sender)
|
||||
{
|
||||
// TODO: Change MWAttribute to set and get AttributeID enum instead of int
|
||||
attributeId = static_cast<ESM::Attribute::AttributeID>(_sender->getAttributeId());
|
||||
eventItemSelected();
|
||||
}
|
||||
|
||||
void SelectAttributeDialog::onCancelClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
eventCancel();
|
||||
}
|
||||
|
||||
|
||||
/* SelectSkillDialog */
|
||||
|
||||
SelectSkillDialog::SelectSkillDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||
: Layout("openmw_chargen_select_skill_layout.xml")
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
mMainWidget->setCoord(coord);
|
||||
|
||||
WindowManager *wm = environment.mWindowManager;
|
||||
|
||||
setText("LabelT", wm->getGameSettingString("sSkillsMenu1", ""));
|
||||
setText("CombatLabelT", wm->getGameSettingString("sSpecializationCombat", ""));
|
||||
setText("MagicLabelT", wm->getGameSettingString("sSpecializationMagic", ""));
|
||||
setText("StealthLabelT", wm->getGameSettingString("sSpecializationStealth", ""));
|
||||
|
||||
getWidget(combatSkill0, "CombatSkill0");
|
||||
getWidget(combatSkill1, "CombatSkill1");
|
||||
getWidget(combatSkill2, "CombatSkill2");
|
||||
getWidget(combatSkill3, "CombatSkill3");
|
||||
getWidget(combatSkill4, "CombatSkill4");
|
||||
getWidget(combatSkill5, "CombatSkill5");
|
||||
getWidget(combatSkill6, "CombatSkill6");
|
||||
getWidget(combatSkill7, "CombatSkill7");
|
||||
getWidget(combatSkill8, "CombatSkill8");
|
||||
|
||||
getWidget(magicSkill0, "MagicSkill0");
|
||||
getWidget(magicSkill1, "MagicSkill1");
|
||||
getWidget(magicSkill2, "MagicSkill2");
|
||||
getWidget(magicSkill3, "MagicSkill3");
|
||||
getWidget(magicSkill4, "MagicSkill4");
|
||||
getWidget(magicSkill5, "MagicSkill5");
|
||||
getWidget(magicSkill6, "MagicSkill6");
|
||||
getWidget(magicSkill7, "MagicSkill7");
|
||||
getWidget(magicSkill8, "MagicSkill8");
|
||||
|
||||
getWidget(stealthSkill0, "StealthSkill0");
|
||||
getWidget(stealthSkill1, "StealthSkill1");
|
||||
getWidget(stealthSkill2, "StealthSkill2");
|
||||
getWidget(stealthSkill3, "StealthSkill3");
|
||||
getWidget(stealthSkill4, "StealthSkill4");
|
||||
getWidget(stealthSkill5, "StealthSkill5");
|
||||
getWidget(stealthSkill6, "StealthSkill6");
|
||||
getWidget(stealthSkill7, "StealthSkill7");
|
||||
getWidget(stealthSkill8, "StealthSkill8");
|
||||
|
||||
struct {Widgets::MWSkillPtr widget; ESM::Skill::SkillEnum skillId;} skills[3][9] = {
|
||||
{
|
||||
{combatSkill0, ESM::Skill::Block},
|
||||
{combatSkill1, ESM::Skill::Armorer},
|
||||
{combatSkill2, ESM::Skill::MediumArmor},
|
||||
{combatSkill3, ESM::Skill::HeavyArmor},
|
||||
{combatSkill4, ESM::Skill::BluntWeapon},
|
||||
{combatSkill5, ESM::Skill::LongBlade},
|
||||
{combatSkill6, ESM::Skill::Axe},
|
||||
{combatSkill7, ESM::Skill::Spear},
|
||||
{combatSkill8, ESM::Skill::Athletics}
|
||||
},
|
||||
{
|
||||
{magicSkill0, ESM::Skill::Enchant},
|
||||
{magicSkill1, ESM::Skill::Destruction},
|
||||
{magicSkill2, ESM::Skill::Alteration},
|
||||
{magicSkill3, ESM::Skill::Illusion},
|
||||
{magicSkill4, ESM::Skill::Conjuration},
|
||||
{magicSkill5, ESM::Skill::Mysticism},
|
||||
{magicSkill6, ESM::Skill::Restoration},
|
||||
{magicSkill7, ESM::Skill::Alchemy},
|
||||
{magicSkill8, ESM::Skill::Unarmored}
|
||||
},
|
||||
{
|
||||
{stealthSkill0, ESM::Skill::Security},
|
||||
{stealthSkill1, ESM::Skill::Sneak},
|
||||
{stealthSkill2, ESM::Skill::Acrobatics},
|
||||
{stealthSkill3, ESM::Skill::LightArmor},
|
||||
{stealthSkill4, ESM::Skill::ShortBlade},
|
||||
{stealthSkill5 ,ESM::Skill::Marksman},
|
||||
{stealthSkill6 ,ESM::Skill::Mercantile},
|
||||
{stealthSkill7 ,ESM::Skill::Speechcraft},
|
||||
{stealthSkill8 ,ESM::Skill::HandToHand}
|
||||
}
|
||||
};
|
||||
|
||||
for (int spec = 0; spec < 3; ++spec)
|
||||
{
|
||||
for (int i = 0; i < 9; ++i)
|
||||
{
|
||||
skills[spec][i].widget->setWindowManager(wm);
|
||||
skills[spec][i].widget->setSkillId(skills[spec][i].skillId);
|
||||
skills[spec][i].widget->eventClicked = MyGUI::newDelegate(this, &SelectSkillDialog::onSkillClicked);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: These buttons should be managed by a Dialog class
|
||||
MyGUI::ButtonPtr cancelButton;
|
||||
getWidget(cancelButton, "CancelButton");
|
||||
cancelButton->setCaption(wm->getGameSettingString("sCancel", ""));
|
||||
cancelButton->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSkillDialog::onCancelClicked);
|
||||
}
|
||||
|
||||
// widget controls
|
||||
|
||||
void SelectSkillDialog::onSkillClicked(Widgets::MWSkillPtr _sender)
|
||||
{
|
||||
skillId = _sender->getSkillId();
|
||||
eventItemSelected();
|
||||
}
|
||||
|
||||
void SelectSkillDialog::onCancelClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
eventCancel();
|
||||
}
|
||||
|
||||
/* DescriptionDialog */
|
||||
|
||||
DescriptionDialog::DescriptionDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||
: Layout("openmw_chargen_class_description_layout.xml")
|
||||
, environment(environment)
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
mMainWidget->setCoord(coord);
|
||||
|
||||
getWidget(textEdit, "TextEdit");
|
||||
|
||||
// TODO: These buttons should be managed by a Dialog class
|
||||
MyGUI::ButtonPtr okButton;
|
||||
getWidget(okButton, "OKButton");
|
||||
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &DescriptionDialog::onOkClicked);
|
||||
okButton->setCaption(environment.mWindowManager->getGameSettingString("sInputMenu1", ""));
|
||||
|
||||
// Make sure the edit box has focus
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(textEdit);
|
||||
}
|
||||
|
||||
// widget controls
|
||||
|
||||
void DescriptionDialog::onOkClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
eventDone();
|
||||
}
|
||||
|
@ -23,6 +23,92 @@ namespace MWGui
|
||||
{
|
||||
using namespace MyGUI;
|
||||
|
||||
class InfoBoxDialog : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
InfoBoxDialog(MWWorld::Environment& environment);
|
||||
|
||||
typedef std::vector<std::string> ButtonList;
|
||||
|
||||
void setText(const std::string &str);
|
||||
std::string getText() const;
|
||||
void setButtons(ButtonList &buttons);
|
||||
|
||||
void update();
|
||||
int getChosenButton() const;
|
||||
|
||||
// Events
|
||||
typedef delegates::CDelegate2<MyGUI::WidgetPtr, int> EventHandle_WidgetInt;
|
||||
|
||||
/** Event : Button was clicked.\n
|
||||
signature : void method(MyGUI::WidgetPtr widget, int index)\n
|
||||
*/
|
||||
EventHandle_WidgetInt eventButtonSelected;
|
||||
|
||||
protected:
|
||||
void onButtonClicked(MyGUI::WidgetPtr _sender);
|
||||
|
||||
private:
|
||||
void center();
|
||||
|
||||
MWWorld::Environment& environment;
|
||||
|
||||
int currentButton;
|
||||
MyGUI::WidgetPtr textBox;
|
||||
MyGUI::StaticTextPtr text;
|
||||
MyGUI::WidgetPtr buttonBar;
|
||||
std::vector<MyGUI::ButtonPtr> buttons;
|
||||
};
|
||||
|
||||
// Lets the player choose between 3 ways of creating a class
|
||||
class ClassChoiceDialog : public InfoBoxDialog
|
||||
{
|
||||
public:
|
||||
// Corresponds to the buttons that can be clicked
|
||||
enum ClassChoice
|
||||
{
|
||||
Class_Generate = 0,
|
||||
Class_Pick = 1,
|
||||
Class_Create = 2,
|
||||
Class_Back = 3
|
||||
};
|
||||
ClassChoiceDialog(MWWorld::Environment& environment);
|
||||
};
|
||||
|
||||
class GenerateClassResultDialog : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
GenerateClassResultDialog(MWWorld::Environment& environment);
|
||||
|
||||
std::string getClassId() const;
|
||||
void setClassId(const std::string &classId);
|
||||
|
||||
// Events
|
||||
typedef delegates::CDelegate0 EventHandle_Void;
|
||||
|
||||
/** Event : Back button clicked.\n
|
||||
signature : void method()\n
|
||||
*/
|
||||
EventHandle_Void eventBack;
|
||||
|
||||
/** Event : Dialog finished, OK button clicked.\n
|
||||
signature : void method()\n
|
||||
*/
|
||||
EventHandle_Void eventDone;
|
||||
|
||||
protected:
|
||||
void onOkClicked(MyGUI::Widget* _sender);
|
||||
void onBackClicked(MyGUI::Widget* _sender);
|
||||
|
||||
private:
|
||||
MWWorld::Environment& environment;
|
||||
|
||||
MyGUI::StaticImagePtr classImage;
|
||||
MyGUI::StaticTextPtr className;
|
||||
|
||||
std::string currentClassId;
|
||||
};
|
||||
|
||||
class PickClassDialog : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
@ -68,5 +154,194 @@ namespace MWGui
|
||||
|
||||
std::string currentClassId;
|
||||
};
|
||||
|
||||
class SelectSpecializationDialog : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
SelectSpecializationDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize);
|
||||
|
||||
ESM::Class::Specialization getSpecializationId() const { return specializationId; }
|
||||
|
||||
// Events
|
||||
typedef delegates::CDelegate0 EventHandle_Void;
|
||||
|
||||
/** Event : Cancel button clicked.\n
|
||||
signature : void method()\n
|
||||
*/
|
||||
EventHandle_Void eventCancel;
|
||||
|
||||
/** Event : Dialog finished, specialization selected.\n
|
||||
signature : void method()\n
|
||||
*/
|
||||
EventHandle_Void eventItemSelected;
|
||||
|
||||
protected:
|
||||
void onSpecializationClicked(MyGUI::Widget* _sender);
|
||||
void onCancelClicked(MyGUI::Widget* _sender);
|
||||
|
||||
private:
|
||||
MyGUI::WidgetPtr specialization0, specialization1, specialization2;
|
||||
|
||||
ESM::Class::Specialization specializationId;
|
||||
};
|
||||
|
||||
class SelectAttributeDialog : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
SelectAttributeDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize);
|
||||
|
||||
ESM::Attribute::AttributeID getAttributeId() const { return attributeId; }
|
||||
Widgets::MWAttributePtr getAffectedWidget() const { return affectedWidget; }
|
||||
void setAffectedWidget(Widgets::MWAttributePtr widget) { affectedWidget = widget; }
|
||||
|
||||
// Events
|
||||
typedef delegates::CDelegate0 EventHandle_Void;
|
||||
|
||||
/** Event : Cancel button clicked.\n
|
||||
signature : void method()\n
|
||||
*/
|
||||
EventHandle_Void eventCancel;
|
||||
|
||||
/** Event : Dialog finished, attribute selected.\n
|
||||
signature : void method()\n
|
||||
*/
|
||||
EventHandle_Void eventItemSelected;
|
||||
|
||||
protected:
|
||||
void onAttributeClicked(Widgets::MWAttributePtr _sender);
|
||||
void onCancelClicked(MyGUI::Widget* _sender);
|
||||
|
||||
private:
|
||||
Widgets::MWAttributePtr attribute0, attribute1, attribute2, attribute3,
|
||||
attribute4, attribute5, attribute6, attribute7;
|
||||
Widgets::MWAttributePtr affectedWidget;
|
||||
|
||||
ESM::Attribute::AttributeID attributeId;
|
||||
};
|
||||
|
||||
class SelectSkillDialog : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
SelectSkillDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize);
|
||||
|
||||
ESM::Skill::SkillEnum getSkillId() const { return skillId; }
|
||||
Widgets::MWSkillPtr getAffectedWidget() const { return affectedWidget; }
|
||||
void setAffectedWidget(Widgets::MWSkillPtr widget) { affectedWidget = widget; }
|
||||
|
||||
// Events
|
||||
typedef delegates::CDelegate0 EventHandle_Void;
|
||||
|
||||
/** Event : Cancel button clicked.\n
|
||||
signature : void method()\n
|
||||
*/
|
||||
EventHandle_Void eventCancel;
|
||||
|
||||
/** Event : Dialog finished, skill selected.\n
|
||||
signature : void method()\n
|
||||
*/
|
||||
EventHandle_Void eventItemSelected;
|
||||
|
||||
protected:
|
||||
void onSkillClicked(Widgets::MWSkillPtr _sender);
|
||||
void onCancelClicked(MyGUI::Widget* _sender);
|
||||
|
||||
private:
|
||||
Widgets::MWSkillPtr combatSkill0, combatSkill1, combatSkill2, combatSkill3, combatSkill4,
|
||||
combatSkill5, combatSkill6, combatSkill7, combatSkill8;
|
||||
Widgets::MWSkillPtr magicSkill0, magicSkill1, magicSkill2, magicSkill3, magicSkill4,
|
||||
magicSkill5, magicSkill6, magicSkill7, magicSkill8;
|
||||
Widgets::MWSkillPtr stealthSkill0, stealthSkill1, stealthSkill2, stealthSkill3, stealthSkill4,
|
||||
stealthSkill5, stealthSkill6, stealthSkill7, stealthSkill8;
|
||||
Widgets::MWSkillPtr affectedWidget;
|
||||
|
||||
ESM::Skill::SkillEnum skillId;
|
||||
};
|
||||
|
||||
class DescriptionDialog : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
DescriptionDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize);
|
||||
|
||||
std::string getTextInput() const { return textEdit ? textEdit->getOnlyText() : ""; }
|
||||
void setTextInput(const std::string &text) { if (textEdit) textEdit->setOnlyText(text); }
|
||||
|
||||
// Events
|
||||
typedef delegates::CDelegate0 EventHandle_Void;
|
||||
|
||||
/** Event : Dialog finished, OK button clicked.\n
|
||||
signature : void method()\n
|
||||
*/
|
||||
EventHandle_Void eventDone;
|
||||
|
||||
protected:
|
||||
void onOkClicked(MyGUI::Widget* _sender);
|
||||
|
||||
private:
|
||||
MWWorld::Environment& environment;
|
||||
|
||||
MyGUI::EditPtr textEdit;
|
||||
};
|
||||
|
||||
class CreateClassDialog : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
CreateClassDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize);
|
||||
virtual ~CreateClassDialog();
|
||||
|
||||
std::string getName() const;
|
||||
std::string getDescription() const;
|
||||
ESM::Class::Specialization getSpecializationId() const;
|
||||
std::vector<int> getFavoriteAttributes() const;
|
||||
std::vector<ESM::Skill::SkillEnum> getMajorSkills() const;
|
||||
std::vector<ESM::Skill::SkillEnum> getMinorSkills() const;
|
||||
|
||||
void setNextButtonShow(bool shown);
|
||||
void open();
|
||||
|
||||
// Events
|
||||
typedef delegates::CDelegate0 EventHandle_Void;
|
||||
|
||||
/** Event : Back button clicked.\n
|
||||
signature : void method()\n
|
||||
*/
|
||||
EventHandle_Void eventBack;
|
||||
|
||||
/** Event : Dialog finished, OK button clicked.\n
|
||||
signature : void method()\n
|
||||
*/
|
||||
EventHandle_Void eventDone;
|
||||
|
||||
protected:
|
||||
void onOkClicked(MyGUI::Widget* _sender);
|
||||
void onBackClicked(MyGUI::Widget* _sender);
|
||||
|
||||
void onSpecializationClicked(MyGUI::WidgetPtr _sender);
|
||||
void onSpecializationSelected();
|
||||
void onAttributeClicked(Widgets::MWAttributePtr _sender);
|
||||
void onAttributeSelected();
|
||||
void onSkillClicked(Widgets::MWSkillPtr _sender);
|
||||
void onSkillSelected();
|
||||
void onDescriptionClicked(MyGUI::Widget* _sender);
|
||||
void onDescriptionEntered();
|
||||
void onDialogCancel();
|
||||
|
||||
private:
|
||||
MWWorld::Environment& environment;
|
||||
|
||||
MyGUI::EditPtr editName;
|
||||
MyGUI::WidgetPtr specializationName;
|
||||
Widgets::MWAttributePtr favoriteAttribute0, favoriteAttribute1;
|
||||
Widgets::MWSkillPtr majorSkill0, majorSkill1, majorSkill2, majorSkill3, majorSkill4;
|
||||
Widgets::MWSkillPtr minorSkill0, minorSkill1, minorSkill2, minorSkill3, minorSkill4;
|
||||
std::vector<Widgets::MWSkillPtr> skills;
|
||||
std::string description;
|
||||
|
||||
SelectSpecializationDialog *specDialog;
|
||||
SelectAttributeDialog *attribDialog;
|
||||
SelectSkillDialog *skillDialog;
|
||||
DescriptionDialog *descDialog;
|
||||
|
||||
ESM::Class::Specialization specializationId;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
@ -23,6 +23,9 @@ namespace MWGui
|
||||
GM_Race,
|
||||
GM_Birth,
|
||||
GM_Class,
|
||||
GM_ClassGenerate,
|
||||
GM_ClassPick,
|
||||
GM_ClassCreate,
|
||||
GM_Review
|
||||
};
|
||||
|
||||
|
@ -82,6 +82,11 @@ void MWSkill::updateWidgets()
|
||||
}
|
||||
}
|
||||
|
||||
void MWSkill::onClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
eventClicked(this);
|
||||
}
|
||||
|
||||
void MWSkill::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
|
||||
{
|
||||
Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
|
||||
@ -116,6 +121,20 @@ void MWSkill::initialiseWidgetSkin(ResourceSkin* _info)
|
||||
MYGUI_DEBUG_ASSERT( ! skillValueWidget, "widget already assigned");
|
||||
skillValueWidget = (*iter)->castType<StaticText>();
|
||||
}
|
||||
else if (name == "StatNameButton")
|
||||
{
|
||||
MYGUI_DEBUG_ASSERT( ! skillNameWidget, "widget already assigned");
|
||||
MyGUI::ButtonPtr button = (*iter)->castType<Button>();
|
||||
skillNameWidget = button;
|
||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWSkill::onClicked);
|
||||
}
|
||||
else if (name == "StatValueButton")
|
||||
{
|
||||
MYGUI_DEBUG_ASSERT( ! skillValueWidget, "widget already assigned");
|
||||
MyGUI::ButtonPtr button = (*iter)->castType<Button>();
|
||||
skillNameWidget = button;
|
||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWSkill::onClicked);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,6 +164,11 @@ void MWAttribute::setAttributeValue(const AttributeValue& value_)
|
||||
updateWidgets();
|
||||
}
|
||||
|
||||
void MWAttribute::onClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
eventClicked(this);
|
||||
}
|
||||
|
||||
void MWAttribute::updateWidgets()
|
||||
{
|
||||
if (attributeNameWidget && manager)
|
||||
@ -216,6 +240,20 @@ void MWAttribute::initialiseWidgetSkin(ResourceSkin* _info)
|
||||
MYGUI_DEBUG_ASSERT( ! attributeValueWidget, "widget already assigned");
|
||||
attributeValueWidget = (*iter)->castType<StaticText>();
|
||||
}
|
||||
else if (name == "StatNameButton")
|
||||
{
|
||||
MYGUI_DEBUG_ASSERT( ! attributeNameWidget, "widget already assigned");
|
||||
MyGUI::ButtonPtr button = (*iter)->castType<Button>();
|
||||
attributeNameWidget = button;
|
||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWAttribute::onClicked);
|
||||
}
|
||||
else if (name == "StatValue")
|
||||
{
|
||||
MYGUI_DEBUG_ASSERT( ! attributeValueWidget, "widget already assigned");
|
||||
MyGUI::ButtonPtr button = (*iter)->castType<Button>();
|
||||
attributeNameWidget = button;
|
||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWAttribute::onClicked);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,6 +42,14 @@ namespace MWGui
|
||||
ESM::Skill::SkillEnum getSkillId() const { return skillId; }
|
||||
const SkillValue& getSkillValue() const { return value; }
|
||||
|
||||
// Events
|
||||
typedef delegates::CDelegate1<MWSkill*> EventHandle_SkillVoid;
|
||||
|
||||
/** Event : Skill clicked.\n
|
||||
signature : void method(MWSkill* _sender)\n
|
||||
*/
|
||||
EventHandle_SkillVoid eventClicked;
|
||||
|
||||
/*internal:*/
|
||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
||||
|
||||
@ -50,6 +58,8 @@ namespace MWGui
|
||||
|
||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
||||
|
||||
void onClicked(MyGUI::Widget* _sender);
|
||||
|
||||
private:
|
||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
||||
void shutdownWidgetSkin();
|
||||
@ -59,7 +69,7 @@ namespace MWGui
|
||||
WindowManager *manager;
|
||||
ESM::Skill::SkillEnum skillId;
|
||||
SkillValue value;
|
||||
MyGUI::StaticTextPtr skillNameWidget, skillValueWidget;
|
||||
MyGUI::WidgetPtr skillNameWidget, skillValueWidget;
|
||||
};
|
||||
typedef MWSkill* MWSkillPtr;
|
||||
|
||||
@ -79,6 +89,14 @@ namespace MWGui
|
||||
int getAttributeId() const { return id; }
|
||||
const AttributeValue& getAttributeValue() const { return value; }
|
||||
|
||||
// Events
|
||||
typedef delegates::CDelegate1<MWAttribute*> EventHandle_AttributeVoid;
|
||||
|
||||
/** Event : Attribute clicked.\n
|
||||
signature : void method(MWAttribute* _sender)\n
|
||||
*/
|
||||
EventHandle_AttributeVoid eventClicked;
|
||||
|
||||
/*internal:*/
|
||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
||||
|
||||
@ -87,6 +105,8 @@ namespace MWGui
|
||||
|
||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
||||
|
||||
void onClicked(MyGUI::Widget* _sender);
|
||||
|
||||
private:
|
||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
||||
void shutdownWidgetSkin();
|
||||
@ -96,7 +116,7 @@ namespace MWGui
|
||||
WindowManager *manager;
|
||||
int id;
|
||||
AttributeValue value;
|
||||
MyGUI::StaticTextPtr attributeNameWidget, attributeValueWidget;
|
||||
MyGUI::WidgetPtr attributeNameWidget, attributeValueWidget;
|
||||
};
|
||||
typedef MWAttribute* MWAttributePtr;
|
||||
|
||||
|
@ -21,7 +21,11 @@ WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment
|
||||
: environment(environment)
|
||||
, nameDialog(nullptr)
|
||||
, raceDialog(nullptr)
|
||||
, classChoiceDialog(nullptr)
|
||||
, generateClassQuestionDialog(nullptr)
|
||||
, generateClassResultDialog(nullptr)
|
||||
, pickClassDialog(nullptr)
|
||||
, createClassDialog(nullptr)
|
||||
, birthSignDialog(nullptr)
|
||||
, nameChosen(false)
|
||||
, raceChosen(false)
|
||||
@ -67,7 +71,11 @@ WindowManager::~WindowManager()
|
||||
|
||||
delete nameDialog;
|
||||
delete raceDialog;
|
||||
delete classChoiceDialog;
|
||||
delete generateClassQuestionDialog;
|
||||
delete generateClassResultDialog;
|
||||
delete pickClassDialog;
|
||||
delete createClassDialog;
|
||||
delete birthSignDialog;
|
||||
}
|
||||
|
||||
@ -129,6 +137,22 @@ void WindowManager::updateVisible()
|
||||
}
|
||||
|
||||
if (mode == GM_Class)
|
||||
{
|
||||
if (classChoiceDialog)
|
||||
delete classChoiceDialog;
|
||||
classChoiceDialog = new ClassChoiceDialog(environment);
|
||||
classChoiceDialog->eventButtonSelected = MyGUI::newDelegate(this, &WindowManager::onClassChoice);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode == GM_ClassGenerate)
|
||||
{
|
||||
generateClassStep = 0;
|
||||
showClassQuestionDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode == GM_ClassPick)
|
||||
{
|
||||
if (!pickClassDialog)
|
||||
pickClassDialog = new PickClassDialog(environment, gui->getViewSize());
|
||||
@ -139,6 +163,17 @@ void WindowManager::updateVisible()
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode == GM_ClassCreate)
|
||||
{
|
||||
if (createClassDialog)
|
||||
delete createClassDialog;
|
||||
createClassDialog = new CreateClassDialog(environment, gui->getViewSize());
|
||||
createClassDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onCreateClassDialogDone);
|
||||
createClassDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onCreateClassDialogBack);
|
||||
createClassDialog->open();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode == GM_Birth)
|
||||
{
|
||||
if (!birthSignDialog)
|
||||
@ -317,6 +352,135 @@ void WindowManager::onRaceDialogBack()
|
||||
environment.mInputManager->setGuiMode(GM_Name);
|
||||
}
|
||||
|
||||
void WindowManager::onClassChoice(MyGUI::WidgetPtr, int _index)
|
||||
{
|
||||
classChoiceDialog->setVisible(false);
|
||||
// classChoiceDialog = nullptr;
|
||||
|
||||
if (_index == ClassChoiceDialog::Class_Generate)
|
||||
{
|
||||
environment.mInputManager->setGuiMode(GM_ClassGenerate);
|
||||
}
|
||||
else if (_index == ClassChoiceDialog::Class_Pick)
|
||||
{
|
||||
environment.mInputManager->setGuiMode(GM_ClassPick);
|
||||
}
|
||||
else if (_index == ClassChoiceDialog::Class_Create)
|
||||
{
|
||||
environment.mInputManager->setGuiMode(GM_ClassCreate);
|
||||
}
|
||||
else if (_index == ClassChoiceDialog::Class_Back)
|
||||
{
|
||||
environment.mInputManager->setGuiMode(GM_Race);
|
||||
}
|
||||
}
|
||||
|
||||
void WindowManager::showClassQuestionDialog()
|
||||
{
|
||||
struct Step
|
||||
{
|
||||
const char* text;
|
||||
const char* buttons[3];
|
||||
};
|
||||
static boost::array<Step, 2> steps = { {
|
||||
{"On a clear day you chance upon a strange animal, its legs trapped in a hunter's clawsnare. Judging from the bleeding, it will not survive long.",
|
||||
{"Use herbs from your pack to put it to sleep?",
|
||||
"Do not interfere in the natural evolution of events, but rather take the opportunity to learn more about a strange animal that you have never seen before?",
|
||||
"Draw your dagger, mercifully endings its life with a single thrust?"}
|
||||
},
|
||||
{"Your mother sends you to the market with a list of goods to buy. After you finish you find that by mistake a shopkeeper has given you too much money back in exchange for one of the items.",
|
||||
{"Return to the store and give the shopkeeper his hard-earned money, explaining to him the mistake?",
|
||||
"Pocket the extra money, knowing that shopkeepers in general tend to overcharge customers anyway?",
|
||||
"Decide to put the extra money to good use and purchase items that would help your family?"}
|
||||
},
|
||||
} };
|
||||
|
||||
if (generateClassStep == steps.size())
|
||||
{
|
||||
// TODO: Calculate this in mechanics manager
|
||||
generateClass = "acrobat";
|
||||
|
||||
if (generateClassResultDialog)
|
||||
delete generateClassResultDialog;
|
||||
generateClassResultDialog = new GenerateClassResultDialog(environment);
|
||||
generateClassResultDialog->setClassId(generateClass);
|
||||
generateClassResultDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onGenerateClassBack);
|
||||
generateClassResultDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onGenerateClassDone);
|
||||
generateClassResultDialog->setVisible(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (generateClassStep > steps.size())
|
||||
{
|
||||
environment.mInputManager->setGuiMode(GM_Class);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!generateClassQuestionDialog)
|
||||
generateClassQuestionDialog = new InfoBoxDialog(environment);
|
||||
|
||||
InfoBoxDialog::ButtonList buttons;
|
||||
generateClassQuestionDialog->setText(steps[generateClassStep].text);
|
||||
buttons.push_back(steps[generateClassStep].buttons[0]);
|
||||
buttons.push_back(steps[generateClassStep].buttons[1]);
|
||||
buttons.push_back(steps[generateClassStep].buttons[2]);
|
||||
generateClassQuestionDialog->setButtons(buttons);
|
||||
generateClassQuestionDialog->update();
|
||||
generateClassQuestionDialog->eventButtonSelected = MyGUI::newDelegate(this, &WindowManager::onClassQuestionChosen);
|
||||
generateClassQuestionDialog->setVisible(true);
|
||||
}
|
||||
|
||||
void WindowManager::onClassQuestionChosen(MyGUI::Widget* _sender, int _index)
|
||||
{
|
||||
generateClassQuestionDialog->setVisible(false);
|
||||
if (_index < 0 || _index >= 3)
|
||||
{
|
||||
environment.mInputManager->setGuiMode(GM_Class);
|
||||
return;
|
||||
}
|
||||
|
||||
++generateClassStep;
|
||||
showClassQuestionDialog();
|
||||
}
|
||||
|
||||
void WindowManager::onGenerateClassBack()
|
||||
{
|
||||
bool goNext = classChosen; // Go to next dialog if class was previously chosen
|
||||
classChosen = true;
|
||||
|
||||
if (generateClassResultDialog)
|
||||
{
|
||||
generateClassResultDialog->setVisible(false);
|
||||
}
|
||||
environment.mMechanicsManager->setPlayerClass(generateClass);
|
||||
|
||||
updateCharacterGeneration();
|
||||
|
||||
environment.mInputManager->setGuiMode(GM_Class);
|
||||
}
|
||||
|
||||
void WindowManager::onGenerateClassDone()
|
||||
{
|
||||
bool goNext = classChosen; // Go to next dialog if class was previously chosen
|
||||
classChosen = true;
|
||||
|
||||
if (generateClassResultDialog)
|
||||
{
|
||||
generateClassResultDialog->setVisible(false);
|
||||
}
|
||||
environment.mMechanicsManager->setPlayerClass(generateClass);
|
||||
|
||||
updateCharacterGeneration();
|
||||
|
||||
if (reviewNext)
|
||||
environment.mInputManager->setGuiMode(GM_Review);
|
||||
else if (goNext)
|
||||
environment.mInputManager->setGuiMode(GM_Birth);
|
||||
else
|
||||
environment.mInputManager->setGuiMode(GM_Game);
|
||||
}
|
||||
|
||||
|
||||
void WindowManager::onPickClassDialogDone()
|
||||
{
|
||||
pickClassDialog->eventDone = MWGui::PickClassDialog::EventHandle_Void();
|
||||
@ -349,7 +513,64 @@ void WindowManager::onPickClassDialogBack()
|
||||
|
||||
updateCharacterGeneration();
|
||||
|
||||
environment.mInputManager->setGuiMode(GM_Race);
|
||||
environment.mInputManager->setGuiMode(GM_Class);
|
||||
}
|
||||
|
||||
void WindowManager::onCreateClassDialogDone()
|
||||
{
|
||||
createClassDialog->eventDone = MWGui::CreateClassDialog::EventHandle_Void();
|
||||
|
||||
bool goNext = classChosen; // Go to next dialog if class was previously chosen
|
||||
classChosen = true;
|
||||
if (createClassDialog)
|
||||
{
|
||||
createClassDialog->setVisible(false);
|
||||
|
||||
// TODO: The ESM::Class should have methods to set these values to ensure correct data is assigned
|
||||
ESM::Class klass;
|
||||
klass.name = createClassDialog->getName();
|
||||
klass.description = createClassDialog->getDescription();
|
||||
klass.data.specialization = createClassDialog->getSpecializationId();
|
||||
klass.data.isPlayable = 0x1;
|
||||
|
||||
std::vector<int> attributes = createClassDialog->getFavoriteAttributes();
|
||||
assert(attributes.size() == 2);
|
||||
klass.data.attribute[0] = attributes[0];
|
||||
klass.data.attribute[1] = attributes[1];
|
||||
|
||||
std::vector<ESM::Skill::SkillEnum> majorSkills = createClassDialog->getMajorSkills();
|
||||
std::vector<ESM::Skill::SkillEnum> minorSkills = createClassDialog->getMinorSkills();
|
||||
assert(majorSkills.size() >= sizeof(klass.data.skills)/sizeof(klass.data.skills[0]));
|
||||
assert(minorSkills.size() >= sizeof(klass.data.skills)/sizeof(klass.data.skills[0]));
|
||||
for (size_t i = 0; i < sizeof(klass.data.skills)/sizeof(klass.data.skills[0]); ++i)
|
||||
{
|
||||
klass.data.skills[i][1] = majorSkills[i];
|
||||
klass.data.skills[i][0] = minorSkills[i];
|
||||
}
|
||||
environment.mMechanicsManager->setPlayerClass(klass);
|
||||
}
|
||||
|
||||
updateCharacterGeneration();
|
||||
|
||||
if (reviewNext)
|
||||
environment.mInputManager->setGuiMode(GM_Review);
|
||||
else if (goNext)
|
||||
environment.mInputManager->setGuiMode(GM_Birth);
|
||||
else
|
||||
environment.mInputManager->setGuiMode(GM_Game);
|
||||
}
|
||||
|
||||
void WindowManager::onCreateClassDialogBack()
|
||||
{
|
||||
if (pickClassDialog)
|
||||
{
|
||||
pickClassDialog->setVisible(false);
|
||||
environment.mMechanicsManager->setPlayerClass(pickClassDialog->getClassId());
|
||||
}
|
||||
|
||||
updateCharacterGeneration();
|
||||
|
||||
environment.mInputManager->setGuiMode(GM_Class);
|
||||
}
|
||||
|
||||
void WindowManager::onBirthSignDialogDone()
|
||||
|
@ -20,6 +20,7 @@
|
||||
namespace MyGUI
|
||||
{
|
||||
class Gui;
|
||||
class Widget;
|
||||
}
|
||||
|
||||
namespace Compiler
|
||||
@ -42,8 +43,12 @@ namespace MWGui
|
||||
class Console;
|
||||
|
||||
class TextInputDialog;
|
||||
class InfoBoxDialog;
|
||||
class RaceDialog;
|
||||
class ClassChoiceDialog;
|
||||
class GenerateClassResultDialog;
|
||||
class PickClassDialog;
|
||||
class CreateClassDialog;
|
||||
class BirthDialog;
|
||||
|
||||
class WindowManager
|
||||
@ -61,7 +66,11 @@ namespace MWGui
|
||||
// Character creation
|
||||
TextInputDialog *nameDialog;
|
||||
RaceDialog *raceDialog;
|
||||
ClassChoiceDialog *classChoiceDialog;
|
||||
InfoBoxDialog *generateClassQuestionDialog;
|
||||
GenerateClassResultDialog *generateClassResultDialog;
|
||||
PickClassDialog *pickClassDialog;
|
||||
CreateClassDialog *createClassDialog;
|
||||
BirthDialog *birthSignDialog;
|
||||
|
||||
// Which dialogs have been shown, controls back/next/ok buttons
|
||||
@ -72,6 +81,10 @@ namespace MWGui
|
||||
bool reviewNext;
|
||||
///< If true then any click on Next will cause the summary to be shown
|
||||
|
||||
// Keeps track of current step in Generate Class dialogs
|
||||
unsigned generateClassStep;
|
||||
std::string generateClass;
|
||||
|
||||
MyGUI::Gui *gui;
|
||||
|
||||
// Current gui mode
|
||||
@ -189,10 +202,23 @@ namespace MWGui
|
||||
void onRaceDialogDone();
|
||||
void onRaceDialogBack();
|
||||
|
||||
// Character generation: Choose class process
|
||||
void onClassChoice(MyGUI::Widget* _sender, int _index);
|
||||
|
||||
// Character generation: Generate Class
|
||||
void showClassQuestionDialog();
|
||||
void onClassQuestionChosen(MyGUI::Widget* _sender, int _index);
|
||||
void onGenerateClassBack();
|
||||
void onGenerateClassDone();
|
||||
|
||||
// Character generation: Pick Class dialog
|
||||
void onPickClassDialogDone();
|
||||
void onPickClassDialogBack();
|
||||
|
||||
// Character generation: Create Class dialog
|
||||
void onCreateClassDialogDone();
|
||||
void onCreateClassDialogBack();
|
||||
|
||||
// Character generation: Birth sign dialog
|
||||
void onBirthSignDialogDone();
|
||||
void onBirthSignDialogBack();
|
||||
|
36
components/esm/attr.cpp
Normal file
36
components/esm/attr.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
#include "attr.hpp"
|
||||
|
||||
using namespace ESM;
|
||||
|
||||
const Attribute::AttributeID Attribute::attributeIds[Attribute::Length] = {
|
||||
Attribute::Strength,
|
||||
Attribute::Intelligence,
|
||||
Attribute::Willpower,
|
||||
Attribute::Agility,
|
||||
Attribute::Speed,
|
||||
Attribute::Endurance,
|
||||
Attribute::Personality,
|
||||
Attribute::Luck
|
||||
};
|
||||
|
||||
const std::string Attribute::gmstAttributeIds[Attribute::Length] = {
|
||||
"sAttributeStrength",
|
||||
"sAttributeIntelligence",
|
||||
"sAttributeWillpower",
|
||||
"sAttributeAgility",
|
||||
"sAttributeSpeed",
|
||||
"sAttributeEndurance",
|
||||
"sAttributePersonality",
|
||||
"sAttributeLuck"
|
||||
};
|
||||
|
||||
const std::string Attribute::gmstAttributeDescIds[Attribute::Length] = {
|
||||
"sStrDesc",
|
||||
"sIntDesc",
|
||||
"sWilDesc",
|
||||
"sAgiDesc",
|
||||
"sSpdDesc",
|
||||
"sEndDesc",
|
||||
"sPerDesc",
|
||||
"sLucDesc"
|
||||
};
|
42
components/esm/attr.hpp
Normal file
42
components/esm/attr.hpp
Normal file
@ -0,0 +1,42 @@
|
||||
#ifndef _ESM_ATTR_H
|
||||
#define _ESM_ATTR_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace ESM {
|
||||
|
||||
/*
|
||||
* Attribute definitions
|
||||
*/
|
||||
|
||||
struct Attribute
|
||||
{
|
||||
enum AttributeID
|
||||
{
|
||||
Strength = 0,
|
||||
Intelligence = 1,
|
||||
Willpower = 2,
|
||||
Agility = 3,
|
||||
Speed = 4,
|
||||
Endurance = 5,
|
||||
Personality = 6,
|
||||
Luck = 7,
|
||||
Length
|
||||
};
|
||||
|
||||
AttributeID id;
|
||||
std::string name, description;
|
||||
|
||||
static const AttributeID attributeIds[Length];
|
||||
static const std::string gmstAttributeIds[Length];
|
||||
static const std::string gmstAttributeDescIds[Length];
|
||||
|
||||
Attribute(AttributeID id, const std::string &name, const std::string &description)
|
||||
: id(id)
|
||||
, name(name)
|
||||
, description(description)
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif
|
15
components/esm/class.cpp
Normal file
15
components/esm/class.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include "loadclas.hpp"
|
||||
|
||||
using namespace ESM;
|
||||
|
||||
const Class::Specialization Class::specializationIds[3] = {
|
||||
Class::Combat,
|
||||
Class::Magic,
|
||||
Class::Stealth
|
||||
};
|
||||
|
||||
const char *Class::gmstSpecializationIds[3] = {
|
||||
"sSpecializationCombat",
|
||||
"sSpecializationMagic",
|
||||
"sSpecializationStealth"
|
||||
};
|
@ -42,6 +42,9 @@ struct Class
|
||||
Stealth = 2
|
||||
};
|
||||
|
||||
static const Specialization specializationIds[3];
|
||||
static const char *gmstSpecializationIds[3];
|
||||
|
||||
struct CLDTstruct
|
||||
{
|
||||
int attribute[2]; // Attributes that get class bonus
|
||||
|
@ -43,6 +43,9 @@
|
||||
#include "loadstat.hpp"
|
||||
#include "loadweap.hpp"
|
||||
|
||||
// Special records which are not loaded from ESM
|
||||
#include "attr.hpp"
|
||||
|
||||
namespace ESM {
|
||||
|
||||
// Integer versions of all the record names, used for faster lookup
|
||||
|
@ -90,6 +90,12 @@ void ESMStore::load(ESMReader &esm)
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < Attribute::Length; ++i)
|
||||
{
|
||||
Attribute::AttributeID id = Attribute::attributeIds[i];
|
||||
attributes.list.insert(std::make_pair(id, Attribute(id, Attribute::gmstAttributeIds[i], Attribute::gmstAttributeDescIds[i])));
|
||||
}
|
||||
|
||||
/* This information isn't needed on screen. But keep the code around
|
||||
for debugging purposes later.
|
||||
|
||||
|
@ -76,6 +76,9 @@ namespace ESMS
|
||||
IndexListT<Skill> skills;
|
||||
//RecListT<PathGrid> pathgrids;
|
||||
|
||||
// Special entry which is hardcoded and not loaded from an ESM
|
||||
IndexListT<Attribute> attributes;
|
||||
|
||||
// Lookup of all IDs. Makes looking up references faster. Just
|
||||
// maps the id name to the record type.
|
||||
typedef std::map<std::string, int> AllMap;
|
||||
|
7
extern/mygui_3.0.1/CMakeLists.txt
vendored
7
extern/mygui_3.0.1/CMakeLists.txt
vendored
@ -42,8 +42,15 @@ configure_file("${SDIR}/openmw_hud_box.skin.xml" "${DDIR}/openmw_hud_box.skin.xm
|
||||
configure_file("${SDIR}/openmw_hud_energybar.skin.xml" "${DDIR}/openmw_hud_energybar.skin.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_hud_layout.xml" "${DDIR}/openmw_hud_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_text_input_layout.xml" "${DDIR}/openmw_text_input_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_infobox_layout.xml" "${DDIR}/openmw_infobox_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_chargen_race_layout.xml" "${DDIR}/openmw_chargen_race_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_chargen_class_layout.xml" "${DDIR}/openmw_chargen_class_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_chargen_generate_class_result_layout.xml" "${DDIR}/openmw_chargen_generate_class_result_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_chargen_create_class_layout.xml" "${DDIR}/openmw_chargen_create_class_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_chargen_select_specialization_layout.xml" "${DDIR}/openmw_chargen_select_specialization_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_chargen_select_attribute_layout.xml" "${DDIR}/openmw_chargen_select_attribute_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_chargen_select_skill_layout.xml" "${DDIR}/openmw_chargen_select_skill_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_chargen_class_description_layout.xml" "${DDIR}/openmw_chargen_class_description_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_chargen_birth_layout.xml" "${DDIR}/openmw_chargen_birth_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_inventory_window_layout.xml" "${DDIR}/openmw_inventory_window_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_layers.xml" "${DDIR}/openmw_layers.xml" COPYONLY)
|
||||
|
18
extern/mygui_3.0.1/openmw_resources/openmw_chargen_class_description_layout.xml
vendored
Normal file
18
extern/mygui_3.0.1/openmw_resources/openmw_chargen_class_description_layout.xml
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<MyGUI type="Layout">
|
||||
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 249 249" name="_Main">
|
||||
|
||||
<!-- Edit box -->
|
||||
<Widget type="Edit" skin="MW_TextBoxEdit" position="14 14 220 192" name="TextEdit" align="ALIGN_LEFT ALIGN_TOP STRETCH">
|
||||
<Property key="Edit_MultiLine" value="1" />
|
||||
<Property key="Edit_VisibleVScroll" value="1" />
|
||||
<Property key="Edit_WordWrap" value="1" />
|
||||
</Widget>
|
||||
|
||||
<!-- Dialog buttons -->
|
||||
<Widget type="Button" skin="MW_Button" position="177 214 57 24" name="OKButton">
|
||||
<Property key="Widget_Caption" value="Enter"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
</MyGUI>
|
70
extern/mygui_3.0.1/openmw_resources/openmw_chargen_create_class_layout.xml
vendored
Normal file
70
extern/mygui_3.0.1/openmw_resources/openmw_chargen_create_class_layout.xml
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MyGUI type="Layout">
|
||||
<!-- correct size is 474 192, adjust when skin is changed to a dialog -->
|
||||
<Widget type="Window" skin="MW_Window" layer="Windows" position="0 0 482 220" name="_Main">
|
||||
<!-- content, used to adjust offsets while the window skin is used -->
|
||||
<Widget type="Widget" skin="" position="0 0 474 192" align="ALIGN_STRETCH">
|
||||
|
||||
<!-- Class name -->
|
||||
<Widget type="StaticText" skin="ProgressText" position="12 12 48 30" name="LabelT" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_Caption" value="Name"/>
|
||||
<Property key="Widget_AlignText" value="ALIGN_LEFT ALIGN_VCENTRE"/>
|
||||
</Widget>
|
||||
<Widget type="Edit" skin="MW_TextEdit" position="62 12 250 30" name="EditName" align="ALIGN_HSTRETCH ALIGN_TOP"/>
|
||||
|
||||
<Widget type="Widget" skin="" position="12 46 480 110" align="ALIGN_STRETCH">
|
||||
|
||||
<!-- Specialization -->
|
||||
<Widget type="StaticText" skin="HeaderText" position="0 0 156 18" name="SpecializationT" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_Caption" value="Specialization:"/>
|
||||
<Property key="Widget_AlignText" value="ALIGN_LEFT ALIGN_TOP"/>
|
||||
</Widget>
|
||||
<Widget type="StaticText" skin="SandText" position="0 18 156 18" name="SpecializationName" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_AlignText" value="ALIGN_LEFT ALIGN_TOP"/>
|
||||
</Widget>
|
||||
|
||||
<!-- Favorite Attributes -->
|
||||
<Widget type="StaticText" skin="HeaderText" position="0 41 156 18" name="FavoriteAttributesT" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_Caption" value="Favorite Attributes:"/>
|
||||
<Property key="Widget_AlignText" value="ALIGN_LEFT ALIGN_TOP"/>
|
||||
</Widget>
|
||||
<Widget type="MWAttribute" skin="MW_StatNameButton" position="0 59 156 18" name="FavoriteAttribute0" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWAttribute" skin="MW_StatNameButton" position="0 77 156 18" name="FavoriteAttribute1" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
|
||||
<!-- Major Skills -->
|
||||
<Widget type="StaticText" skin="HeaderText" position="156 0 158 18" name="MajorSkillT" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_Caption" value="Major Skills:"/>
|
||||
<Property key="Widget_AlignText" value="ALIGN_LEFT ALIGN_TOP"/>
|
||||
</Widget>
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 18 158 18" name="MajorSkill0" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 36 158 18" name="MajorSkill1" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 54 158 18" name="MajorSkill2" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 72 158 18" name="MajorSkill3" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 90 158 18" name="MajorSkill4" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
|
||||
<!-- Minor Skills -->
|
||||
<Widget type="StaticText" skin="HeaderText" position="314 0 140 18" name="MinorSkillT" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_Caption" value="Minor Skills:"/>
|
||||
<Property key="Widget_AlignText" value="ALIGN_LEFT ALIGN_TOP"/>
|
||||
</Widget>
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 18 140 18" name="MinorSkill0" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 36 140 18" name="MinorSkill1" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 54 140 18" name="MinorSkill2" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 72 140 18" name="MinorSkill3" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 90 140 18" name="MinorSkill4" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
|
||||
</Widget>
|
||||
|
||||
<!-- Dialog buttons -->
|
||||
<Widget type="Button" skin="MW_Button" position="207 158 143 23" name="DescriptionButton">
|
||||
<Property key="Widget_Caption" value="Class Description"/>
|
||||
</Widget>
|
||||
<Widget type="Button" skin="MW_Button" position="356 158 53 23" name="BackButton">
|
||||
<Property key="Widget_Caption" value="Back"/>
|
||||
</Widget>
|
||||
<Widget type="Button" skin="MW_Button" position="417 158 42 23" name="OKButton">
|
||||
<Property key="Widget_Caption" value="OK"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
</Widget>
|
||||
</MyGUI>
|
28
extern/mygui_3.0.1/openmw_resources/openmw_chargen_generate_class_result_layout.xml
vendored
Normal file
28
extern/mygui_3.0.1/openmw_resources/openmw_chargen_generate_class_result_layout.xml
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<MyGUI type="Layout">
|
||||
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 330 217" name="_Main">
|
||||
<!-- Class image -->
|
||||
<Widget type="Widget" skin="MW_Box" position="32 10 265 138" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Widget type="StaticImage" skin="StaticImage" position="2 2 261 134" name="ClassImage" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
</Widget>
|
||||
|
||||
<!-- Class text -->
|
||||
<Widget type="StaticText" skin="SandText" position="32 152 265 18" name="ReflectT" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_Caption" value="Your personality and past reflect a:"/>
|
||||
<Property key="Widget_AlignText" value="ALIGN_TOP ALIGN_HCENTER"/>
|
||||
</Widget>
|
||||
<Widget type="StaticText" skin="SandText" position="32 170 265 18" name="ClassName" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_Caption" value="[Class]"/>
|
||||
<Property key="Widget_AlignText" value="ALIGN_TOP ALIGN_HCENTER"/>
|
||||
</Widget>
|
||||
|
||||
<!-- Dialog buttons -->
|
||||
<Widget type="Button" skin="MW_Button" position="220 184 53 23" name="BackButton">
|
||||
<Property key="Widget_Caption" value="Back"/>
|
||||
</Widget>
|
||||
<Widget type="Button" skin="MW_Button" position="277 184 42 23" name="OKButton">
|
||||
<Property key="Widget_Caption" value="OK"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
</MyGUI>
|
29
extern/mygui_3.0.1/openmw_resources/openmw_chargen_select_attribute_layout.xml
vendored
Normal file
29
extern/mygui_3.0.1/openmw_resources/openmw_chargen_select_attribute_layout.xml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MyGUI type="Layout">
|
||||
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 217 234" name="_Main">
|
||||
<Widget type="Widget" skin="" position="14 14 186 203" align="ALIGN_STRETCH">
|
||||
|
||||
<!-- Label -->
|
||||
<Widget type="StaticText" skin="HeaderText" position="0 0 186 18" name="LabelT" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_Caption" value="Choose a Specialization"/>
|
||||
<Property key="Widget_AlignText" value="ALIGN_LEFT ALIGN_TOP"/>
|
||||
</Widget>
|
||||
|
||||
<!-- Attribute list -->
|
||||
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 28 186 18" name="Attribute0" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 46 186 18" name="Attribute1" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 64 186 18" name="Attribute2" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 82 186 18" name="Attribute3" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 100 186 18" name="Attribute4" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 118 186 18" name="Attribute5" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 136 186 18" name="Attribute6" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 154 186 18" name="Attribute7" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
|
||||
<!-- Dialog buttons -->
|
||||
<Widget type="Button" skin="MW_Button" position="120 180 66 21" name="CancelButton">
|
||||
<Property key="Widget_Caption" value="Cancel"/>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
</Widget>
|
||||
</MyGUI>
|
64
extern/mygui_3.0.1/openmw_resources/openmw_chargen_select_skill_layout.xml
vendored
Normal file
64
extern/mygui_3.0.1/openmw_resources/openmw_chargen_select_skill_layout.xml
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MyGUI type="Layout">
|
||||
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 477 270" name="_Main">
|
||||
<Widget type="Widget" skin="" position="17 14 447 239" align="ALIGN_STRETCH">
|
||||
|
||||
<!-- Label -->
|
||||
<Widget type="StaticText" skin="HeaderText" position="0 0 447 18" name="LabelT" align="ALIGN_HCENTRE ALIGN_TOP">
|
||||
<Property key="Widget_Caption" value="Choose a Skill"/>
|
||||
<Property key="Widget_AlignText" value="ALIGN_HCENTRE ALIGN_TOP"/>
|
||||
</Widget>
|
||||
|
||||
<!-- Combat list -->
|
||||
<Widget type="StaticText" skin="HeaderText" position="0 32 154 18" name="CombatLabelT" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_Caption" value="Combat"/>
|
||||
<Property key="Widget_AlignText" value="ALIGN_LEFT ALIGN_TOP"/>
|
||||
</Widget>
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 50 154 18" name="CombatSkill0" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 68 154 18" name="CombatSkill1" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 86 154 18" name="CombatSkill2" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 104 154 18" name="CombatSkill3" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 122 154 18" name="CombatSkill4" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 140 154 18" name="CombatSkill5" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 158 154 18" name="CombatSkill6" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 176 154 18" name="CombatSkill7" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 194 154 18" name="CombatSkill8" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
|
||||
<!-- Magic list -->
|
||||
<Widget type="StaticText" skin="HeaderText" position="158 32 154 18" name="MagicLabelT" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_Caption" value="Magic"/>
|
||||
<Property key="Widget_AlignText" value="ALIGN_LEFT ALIGN_TOP"/>
|
||||
</Widget>
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 50 154 18" name="MagicSkill0" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 68 154 18" name="MagicSkill1" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 86 154 18" name="MagicSkill2" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 104 154 18" name="MagicSkill3" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 122 154 18" name="MagicSkill4" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 140 154 18" name="MagicSkill5" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 158 154 18" name="MagicSkill6" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 176 154 18" name="MagicSkill7" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 194 154 18" name="MagicSkill8" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
|
||||
<!-- Stealth list -->
|
||||
<Widget type="StaticText" skin="HeaderText" position="316 32 131 18" name="StealthLabelT" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_Caption" value="Stealth"/>
|
||||
<Property key="Widget_AlignText" value="ALIGN_LEFT ALIGN_TOP"/>
|
||||
</Widget>
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 50 131 18" name="StealthSkill0" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 68 131 18" name="StealthSkill1" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 86 131 18" name="StealthSkill2" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 104 131 18" name="StealthSkill3" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 122 131 18" name="StealthSkill4" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 140 131 18" name="StealthSkill5" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 158 131 18" name="StealthSkill6" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 176 131 18" name="StealthSkill7" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 194 131 18" name="StealthSkill8" align="ALIGN_LEFT ALIGN_TOP" />
|
||||
|
||||
<!-- Dialog buttons -->
|
||||
<Widget type="Button" skin="MW_Button" position="381 218 66 21" name="CancelButton">
|
||||
<Property key="Widget_Caption" value="Cancel"/>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
</Widget>
|
||||
</MyGUI>
|
31
extern/mygui_3.0.1/openmw_resources/openmw_chargen_select_specialization_layout.xml
vendored
Normal file
31
extern/mygui_3.0.1/openmw_resources/openmw_chargen_select_specialization_layout.xml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MyGUI type="Layout">
|
||||
<!-- correct size is 247 144, adjust when skin is changed to a dialog -->
|
||||
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 247 144" name="_Main">
|
||||
<Widget type="Widget" skin="" position="14 14 216 113" align="ALIGN_STRETCH">
|
||||
|
||||
<!-- Label -->
|
||||
<Widget type="StaticText" skin="HeaderText" position="0 0 216 18" name="LabelT" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_Caption" value="Choose a Specialization"/>
|
||||
<Property key="Widget_AlignText" value="ALIGN_LEFT ALIGN_TOP"/>
|
||||
</Widget>
|
||||
|
||||
<!-- Specialization list -->
|
||||
<Widget type="StaticText" skin="SandText" position="0 28 216 18" name="Specialization0" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_AlignText" value="ALIGN_TOP ALIGN_HCENTRE"/>
|
||||
</Widget>
|
||||
<Widget type="StaticText" skin="SandText" position="0 46 216 18" name="Specialization1" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_AlignText" value="ALIGN_TOP ALIGN_HCENTRE"/>
|
||||
</Widget>
|
||||
<Widget type="StaticText" skin="SandText" position="0 64 216 18" name="Specialization2" align="ALIGN_LEFT ALIGN_TOP">
|
||||
<Property key="Widget_AlignText" value="ALIGN_TOP ALIGN_HCENTRE"/>
|
||||
</Widget>
|
||||
|
||||
<!-- Dialog buttons -->
|
||||
<Widget type="Button" skin="MW_Button" position="150 90 66 21" name="CancelButton">
|
||||
<Property key="Widget_Caption" value="Cancel"/>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
</Widget>
|
||||
</MyGUI>
|
@ -10,6 +10,16 @@
|
||||
|
||||
<BasisSkin type="EditText" offset = "0 0 10 10" align = "Stretch"/>
|
||||
</Skin>
|
||||
|
||||
<Skin name = "MW_TextBoxEditClient" size = "10 10">
|
||||
<Property key="FontName" value = "MyGUI_CoreFont.18"/>
|
||||
<Property key="FontHeight" value = "18" />
|
||||
<Property key="AlignText" value = "ALIGN_LEFT ALIGN_TOP" />
|
||||
<Property key="Colour" value = "0.6 0.6 0.6" />
|
||||
|
||||
<BasisSkin type="EditText" offset = "0 0 10 10" align = "Stretch"/>
|
||||
</Skin>
|
||||
|
||||
<Skin name = "MW_TextEdit" size = "512 20" texture="mwgui.png">
|
||||
<BasisSkin type="SubSkin" offset = "0 0 512 2" align = "ALIGN_TOP ALIGN_HSTRETCH">
|
||||
<State name="normal" offset = "2 2 512 2"/>
|
||||
@ -26,4 +36,22 @@
|
||||
|
||||
<Child type="Widget" skin="MW_TextEditClient" offset = "2 2 508 18" align = "Stretch" name = "Client"/>
|
||||
</Skin>
|
||||
|
||||
<Skin name = "MW_TextBoxEdit" size = "512 20" texture="mwgui.png">
|
||||
<BasisSkin type="SubSkin" offset = "0 0 512 2" align = "ALIGN_TOP ALIGN_HSTRETCH">
|
||||
<State name="normal" offset = "2 2 512 2"/>
|
||||
</BasisSkin>
|
||||
<BasisSkin type="SubSkin" offset = "0 2 2 16" align = "ALIGN_LEFT ALIGN_VSTRETCH">
|
||||
<State name="normal" offset = "2 4 2 16"/>
|
||||
</BasisSkin>
|
||||
<BasisSkin type="SubSkin" offset = "510 2 2 16" align = "ALIGN_RIGHT ALIGN_VSTRETCH">
|
||||
<State name="normal" offset = "512 4 2 16"/>
|
||||
</BasisSkin>
|
||||
<BasisSkin type="SubSkin" offset = "0 18 512 2" align = "ALIGN_BOTTOM ALIGN_HSTRETCH">
|
||||
<State name="normal" offset = "2 20 512 2"/>
|
||||
</BasisSkin>
|
||||
|
||||
<Child type="Widget" skin="MW_TextBoxEditClient" offset = "2 2 490 18" align = "Stretch" name = "Client"/>
|
||||
<Child type="VScroll" skin="MW_VScroll" offset = "494 3 14 14" align = "Right VStretch" name = "VScroll"/>
|
||||
</Skin>
|
||||
</MyGUI>
|
||||
|
16
extern/mygui_3.0.1/openmw_resources/openmw_infobox_layout.xml
vendored
Normal file
16
extern/mygui_3.0.1/openmw_resources/openmw_infobox_layout.xml
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<MyGUI type="Layout">
|
||||
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 545 265" name="_Main">
|
||||
|
||||
<!-- Edit box -->
|
||||
<Widget type="Widget" skin="MW_Box" position="14 14 516 70" name="TextBox" align="ALIGN_TOP ALIGN_HCENTER">
|
||||
<Widget type="StaticText" skin="SandText" position="4 4 508 62" name="Text" align="ALIGN_TOP ALIGN_HCENTER">
|
||||
<Property key="Edit_WordWrap" value="1" />
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
<!-- Button bar, buttons are created as children -->
|
||||
<Widget type="Widget" skin="" position="72 98 400 150" name="ButtonBar" align="ALIGN_TOP ALIGN_HCENTER" />
|
||||
</Widget>
|
||||
</MyGUI>
|
@ -17,6 +17,14 @@
|
||||
<BasisSkin type="SimpleText" offset = "0 0 16 16" align = "ALIGN_STRETCH"/>
|
||||
</Skin>
|
||||
|
||||
<Skin name = "SandTextC" size = "16 16">
|
||||
<Property key="FontName" value = "MyGUI_CoreFont.18" />
|
||||
<Property key="FontHeight" value = "18" />
|
||||
<Property key="AlignText" value = "TOP HCENTER" />
|
||||
<Property key="Colour" value = "0.75 0.6 0.35" />
|
||||
<BasisSkin type="SimpleText" offset = "0 0 16 16" align = "ALIGN_STRETCH"/>
|
||||
</Skin>
|
||||
|
||||
<Skin name = "SandTextRight" size = "16 16">
|
||||
<Property key="FontName" value = "MyGUI_CoreFont.18" />
|
||||
<Property key="FontHeight" value = "18" />
|
||||
@ -57,11 +65,28 @@
|
||||
<Child type="StaticText" skin="SandText" offset = "0 0 200 18" align = "ALIGN_LEFT ALIGN_HSTRETCH" name = "StatName" />
|
||||
</Skin>
|
||||
|
||||
<Skin name = "MW_StatNameC" size = "200 18">
|
||||
<Child type="StaticTextC" skin="SandText" offset = "0 0 200 18" align = "LEFT HSTRETCH" name = "StatName" />
|
||||
</Skin>
|
||||
|
||||
<Skin name = "MW_StatNameValue" size = "200 18">
|
||||
<Child type="StaticText" skin="SandText" offset = "0 0 160 18" align = "ALIGN_LEFT ALIGN_HSTRETCH" name = "StatName" />
|
||||
<Child type="StaticText" skin="SandTextRight" offset = "160 0 40 18" align = "ALIGN_RIGHT ALIGN_TOP" name = "StatValue" />
|
||||
</Skin>
|
||||
|
||||
<Skin name = "MW_StatNameButtonC" size = "200 18">
|
||||
<Child type="Button" skin="SandTextC" offset = "0 0 200 18" align = "LEFT HSTRETCH" name = "StatNameButton" />
|
||||
</Skin>
|
||||
|
||||
<Skin name = "MW_StatNameButton" size = "200 18">
|
||||
<Child type="Button" skin="SandText" offset = "0 0 200 18" align = "ALIGN_LEFT ALIGN_HSTRETCH" name = "StatNameButton" />
|
||||
</Skin>
|
||||
|
||||
<Skin name = "MW_StatNameValueButton" size = "200 18">
|
||||
<Child type="Button" skin="SandText" offset = "0 0 160 18" align = "ALIGN_LEFT ALIGN_HSTRETCH" name = "StatNameButton" />
|
||||
<Child type="Button" skin="SandTextRight" offset = "160 0 40 18" align = "ALIGN_RIGHT ALIGN_TOP" name = "StatValueButton" />
|
||||
</Skin>
|
||||
|
||||
<Skin name = "MW_EffectImage" size = "200 24">
|
||||
<Child type="StaticImage" skin="StaticImage" offset = "4 4 16 16" align = "ALIGN_LEFT ALIGN_TOP" name = "Image" />
|
||||
<Child type="StaticText" skin="SandText" offset = "24 0 176 20" align = "ALIGN_VCENTRE ALIGN_HSTRETCH" name = "Text" />
|
||||
|
@ -1,13 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<MyGUI type="Skin">
|
||||
<!-- Defines a pure black background -->
|
||||
<!-- Defines a transparent background -->
|
||||
<Skin name = "BlackBG" size = "8 8" texture = "transparent.png">
|
||||
<BasisSkin type="MainSkin" offset = "0 0 8 8">
|
||||
<State name="normal" offset = "0 0 8 8"/>
|
||||
</BasisSkin>
|
||||
</Skin>
|
||||
|
||||
<!-- Defines a pure black background -->
|
||||
<Skin name = "DialogBG" size = "8 8" texture = "black.png">
|
||||
<BasisSkin type="MainSkin" offset = "0 0 8 8">
|
||||
<State name="normal" offset = "0 0 8 8"/>
|
||||
</BasisSkin>
|
||||
</Skin>
|
||||
|
||||
<!-- These define the dialog borders -->
|
||||
<Skin name="DB_B" size="512 4" texture="textures\menu_thick_border_bottom.dds">
|
||||
<BasisSkin type="MainSkin" offset = "0 0 512 4">
|
||||
<State name="normal" offset = "0 0 512 4"/>
|
||||
</BasisSkin>
|
||||
</Skin>
|
||||
|
||||
<Skin name="DB_R" size="4 512" texture="textures\menu_thick_border_right.dds">
|
||||
<BasisSkin type="MainSkin" offset = "0 0 4 512">
|
||||
<State name="normal" offset = "0 0 4 512"/>
|
||||
</BasisSkin>
|
||||
</Skin>
|
||||
|
||||
<Skin name="DB_T" size="512 4" texture="textures\menu_thick_border_top.dds">
|
||||
<BasisSkin type="MainSkin" offset = "0 0 512 4">
|
||||
<State name="normal" offset = "0 0 512 4"/>
|
||||
</BasisSkin>
|
||||
</Skin>
|
||||
|
||||
<Skin name="DB_L" size="4 512" texture="textures\menu_thick_border_left.dds">
|
||||
<BasisSkin type="MainSkin" offset = "0 0 4 512">
|
||||
<State name="normal" offset = "0 0 4 512"/>
|
||||
</BasisSkin>
|
||||
</Skin>
|
||||
|
||||
<!-- Dialog border corners -->
|
||||
<Skin name="DB_BR" size="4 4" texture="textures\menu_thick_border_bottom_right_corner.dds">
|
||||
<BasisSkin type="MainSkin" offset = "0 0 4 4">
|
||||
<State name="normal" offset = "0 0 4 4"/>
|
||||
</BasisSkin>
|
||||
</Skin>
|
||||
<Skin name="DB_BL" size="4 4" texture="textures\menu_thick_border_bottom_left_corner.dds">
|
||||
<Property key="Pointer" value = "dresize2" />
|
||||
<BasisSkin type="MainSkin" offset = "0 0 4 4">
|
||||
<State name="normal" offset = "0 0 4 4"/>
|
||||
</BasisSkin>
|
||||
</Skin>
|
||||
<Skin name="DB_TR" size="4 4" texture="textures\menu_thick_border_top_right_corner.dds">
|
||||
<BasisSkin type="MainSkin" offset = "0 0 4 4">
|
||||
<State name="normal" offset = "0 0 4 4"/>
|
||||
</BasisSkin>
|
||||
</Skin>
|
||||
<Skin name="DB_TL" size="4 4" texture="textures\menu_thick_border_top_left_corner.dds">
|
||||
<BasisSkin type="MainSkin" offset = "0 0 4 4">
|
||||
<State name="normal" offset = "0 0 4 4"/>
|
||||
</BasisSkin>
|
||||
</Skin>
|
||||
|
||||
<!-- These define the window borders -->
|
||||
<Skin name="TB_B" size="512 4" texture="textures\menu_thick_border_bottom.dds">
|
||||
<Property key="Pointer" value = "vresize" />
|
||||
@ -241,4 +296,40 @@
|
||||
<Property key="Scale" value = "1 1 0 0"/>
|
||||
</Child>
|
||||
</Skin>
|
||||
|
||||
<Skin name = "MW_Dialog" size = "256 54">
|
||||
<Property key="FontName" value = "MyGUI_CoreFont.18" />
|
||||
<Property key="FontHeight" value = "18" />
|
||||
<Property key="AlignText" value = "ALIGN_CENTER" />
|
||||
<Property key="Colour" value = "0.8 0.8 0.8" />
|
||||
|
||||
<Child type="Widget" skin="DialogBG" offset = "4 4 248 46" align = "ALIGN_STRETCH" name = "Client"/>
|
||||
|
||||
<!-- Outer borders -->
|
||||
<Child type="Widget" skin="DB_T" offset="4 0 248 4" align="ALIGN_TOP ALIGN_HSTRETCH" name="Border">
|
||||
<Property key="Scale" value = "0 1 0 -1"/>
|
||||
</Child>
|
||||
<Child type="Widget" skin="DB_L" offset="0 4 4 46" align="ALIGN_LEFT ALIGN_VSTRETCH" name="Border">
|
||||
<Property key="Scale" value = "1 0 -1 0"/>
|
||||
</Child>
|
||||
<Child type="Widget" skin="DB_B" offset="4 50 248 4" align="ALIGN_BOTTOM ALIGN_HSTRETCH" name="Border">
|
||||
<Property key="Scale" value = "0 0 0 1"/>
|
||||
</Child>
|
||||
<Child type="Widget" skin="DB_R" offset="252 4 4 46" align="ALIGN_RIGHT ALIGN_VSTRETCH" name="Border">
|
||||
<Property key="Scale" value = "0 0 1 0"/>
|
||||
</Child>
|
||||
|
||||
<Child type="Widget" skin="DB_BR" offset="252 50 4 4" align="ALIGN_RIGHT ALIGN_BOTTOM" name="Border">
|
||||
<Property key="Scale" value = "0 0 1 1"/>
|
||||
</Child>
|
||||
<Child type="Widget" skin="DB_BL" offset="0 50 4 4" align="ALIGN_LEFT ALIGN_BOTTOM" name="Border">
|
||||
<Property key="Scale" value = "1 0 -1 1"/>
|
||||
</Child>
|
||||
<Child type="Widget" skin="DB_TR" offset="252 0 4 4" align="ALIGN_RIGHT ALIGN_TOP" name="Border">
|
||||
<Property key="Scale" value = "0 1 1 -1"/>
|
||||
</Child>
|
||||
<Child type="Widget" skin="DB_TL" offset="0 0 4 4" align="ALIGN_LEFT ALIGN_TOP" name="Border">
|
||||
<Property key="Scale" value = "1 1 -1 -1"/>
|
||||
</Child>
|
||||
</Skin>
|
||||
</MyGUI>
|
||||
|
Loading…
x
Reference in New Issue
Block a user