Fix layout problems in generate class result dialog

deque
scrawl 10 years ago
parent 4cc95cf952
commit f5868f7ae1

@ -17,9 +17,6 @@ namespace MWGui
GenerateClassResultDialog::GenerateClassResultDialog() GenerateClassResultDialog::GenerateClassResultDialog()
: WindowModal("openmw_chargen_generate_class_result.layout") : WindowModal("openmw_chargen_generate_class_result.layout")
{ {
// Centre dialog
center();
setText("ReflectT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sMessageQuestionAnswer1", "")); setText("ReflectT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sMessageQuestionAnswer1", ""));
getWidget(mClassImage, "ClassImage"); getWidget(mClassImage, "ClassImage");
@ -34,6 +31,8 @@ namespace MWGui
getWidget(okButton, "OKButton"); getWidget(okButton, "OKButton");
okButton->setCaptionWithReplacing("#{sMessageQuestionAnswer2}"); okButton->setCaptionWithReplacing("#{sMessageQuestionAnswer2}");
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked); okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked);
center();
} }
std::string GenerateClassResultDialog::getClassId() const std::string GenerateClassResultDialog::getClassId() const
@ -46,6 +45,8 @@ namespace MWGui
mCurrentClassId = classId; mCurrentClassId = classId;
mClassImage->setImageTexture(std::string("textures\\levelup\\") + mCurrentClassId + ".dds"); mClassImage->setImageTexture(std::string("textures\\levelup\\") + mCurrentClassId + ".dds");
mClassName->setCaption(MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find(mCurrentClassId)->mName); mClassName->setCaption(MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find(mCurrentClassId)->mName);
center();
} }
// widget controls // widget controls

@ -1,29 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout"> <MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 289 256" name="_Main"> <Widget type="VBox" skin="MW_Dialog" layer="Windows" position="0 0 289 256" name="_Main">
<Property key="AutoResize" value="true"/>
<Property key="Padding" value="12"/>
<Property key="Spacing" value="8"/>
<!-- Class image --> <!-- Class image -->
<Widget type="Widget" skin="MW_Box" position="8 8 265 138" align="Left Top"> <Widget type="Widget" skin="MW_Box" position="8 8 265 138" align="Left Top">
<Widget type="ImageBox" skin="ImageBox" position="2 2 261 134" name="ClassImage" align="Left Top"/> <Widget type="ImageBox" skin="ImageBox" position="2 2 261 134" name="ClassImage" align="Left Top"/>
</Widget> </Widget>
<!-- Class text --> <!-- Class text -->
<Widget type="EditBox" skin="SandText" position="8 152 265 40" name="ReflectT" align="Left Top"> <Widget type="AutoSizedEditBox" skin="SandText" position="8 152 265 40" name="ReflectT" align="Left Top">
<Property key="TextAlign" value="Top HCenter"/> <Property key="TextAlign" value="Top HCenter"/>
<Property key="MultiLine" value="true"/> <Property key="MultiLine" value="true"/>
<Property key="WordWrap" value="true"/> <Property key="WordWrap" value="true"/>
<Property key="Static" value="true"/> <Property key="Static" value="true"/>
</Widget> </Widget>
<Widget type="TextBox" skin="SandText" position="8 183 265 23" name="ClassName" align="Left Top"> <Widget type="AutoSizedTextBox" skin="SandText" position="8 183 265 23" name="ClassName" align="Left Top">
<Property key="Caption" value="[Class]"/> <Property key="Caption" value="[Class]"/>
<Property key="TextAlign" value="Top HCenter"/> <Property key="TextAlign" value="Top HCenter"/>
</Widget> </Widget>
<!-- Dialog buttons --> <!-- Dialog buttons -->
<Widget type="HBox" position="0 216 273 24"> <Widget type="HBox" position="0 216 273 24">
<Widget type="Widget">
<UserString key="HStretch" value="true"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" name="BackButton"> <Widget type="AutoSizedButton" skin="MW_Button" name="BackButton">
<Property key="Caption" value="#{sBack}"/> <Property key="Caption" value="#{sBack}"/>
</Widget> </Widget>

Loading…
Cancel
Save