Training menu fixes (#8584)

Rework the layout
Use "OK" instead of "Cancel" for the OK button
Add gp to the price
Use entry spacing consistent with other service menus
This commit is contained in:
Alexei Kotov 2025-07-06 21:57:47 +03:00
parent b160cee0b7
commit 4c4d6078d8
2 changed files with 10 additions and 10 deletions

View File

@ -29,7 +29,7 @@ namespace MWGui
: WindowBase("openmw_trainingwindow.layout")
{
getWidget(mTrainingOptions, "TrainingOptions");
getWidget(mCancelButton, "CancelButton");
getWidget(mCancelButton, "OkButton");
getWidget(mPlayerGold, "PlayerGold");
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TrainingWindow::onCancelButtonClicked);
@ -115,14 +115,14 @@ namespace MWGui
MyGUI::Button* button = mTrainingOptions->createWidget<MyGUI::Button>(price <= playerGold
? "SandTextButton"
: "SandTextButtonDisabled", // can't use setEnabled since that removes tooltip
MyGUI::IntCoord(5, 5 + i * lineHeight, mTrainingOptions->getWidth() - 10, lineHeight),
MyGUI::IntCoord(4, 3 + i * lineHeight, mTrainingOptions->getWidth() - 10, lineHeight),
MyGUI::Align::Default);
button->setUserData(skills[i].first);
button->eventMouseButtonClick += MyGUI::newDelegate(this, &TrainingWindow::onTrainingSelected);
button->setCaptionWithReplacing(
MyGUI::TextIterator::toTagsString(skill->mName) + " - " + MyGUI::utility::toString(price));
MyGUI::TextIterator::toTagsString(skill->mName) + " - " + MyGUI::utility::toString(price) + "#{sgp}");
button->setSize(button->getTextSize().width + 12, button->getSize().height);

View File

@ -1,28 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 319 200" align="Center" name="_Main">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 320 200" align="Center" name="_Main">
<Widget type="TextBox" skin="NormalText" position="0 5 319 24" name="Select" align="Right Top">
<Widget type="TextBox" skin="NormalText" position="6 3 300 24" name="Select" align="Right Top">
<Property key="TextAlign" value="Center"/>
<Property key="Caption" value="#{sServiceTrainingTitle}"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="5 30 319 24" name="Travel" align="Right Top">
<Widget type="TextBox" skin="SandText" position="6 22 300 24" name="Travel" align="Right Top">
<Property key="TextAlign" value="Left"/>
<Property key="Caption" value="#{sTrainingServiceTitle}"/>
</Widget>
<Widget type="Widget" skin="MW_Box" position="6 54 299 100" align="Left Top" name="TrainingOptions">
<Widget type="Widget" skin="MW_Box" position="6 42 300 115" align="Left Top" name="TrainingOptions">
</Widget>
<Widget type="TextBox" skin="SandText" position="8 161 200 24" name="PlayerGold" align="Right Top">
<Widget type="TextBox" skin="SandText" position="6 161 200 24" name="PlayerGold" align="Right Top">
<Property key="TextAlign" value="Left"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" position="244 161 60 24" name="CancelButton" align="Right Top">
<Widget type="AutoSizedButton" skin="MW_Button" position="246 161 60 24" name="OkButton" align="Right Top">
<Property key="ExpandDirection" value="Left"/>
<Property key="Caption" value="#{Interface:Cancel}"/>
<Property key="Caption" value="#{Interface:OK}"/>
</Widget>
</Widget>