forked from mirror/openmw-tes3mp
Tooltips: level, race, class, specialization layout fixes
This commit is contained in:
parent
9f1527b7da
commit
6331cc6ab9
3 changed files with 48 additions and 19 deletions
|
@ -709,20 +709,28 @@ namespace MWGui
|
|||
|
||||
void ToolTips::createSpecializationToolTip(MyGUI::Widget* widget, const std::string& name, int specId)
|
||||
{
|
||||
widget->setUserString("Caption_CenteredCaption", name);
|
||||
widget->setUserString("Caption_Caption", name);
|
||||
std::string specText;
|
||||
// get all skills of this specialisation
|
||||
const MWWorld::Store<ESM::Skill> &skills =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Skill>();
|
||||
|
||||
bool isFirst = true;
|
||||
MWWorld::Store<ESM::Skill>::iterator it = skills.begin();
|
||||
for (; it != skills.end(); ++it)
|
||||
{
|
||||
if (it->second.mData.mSpecialization == specId)
|
||||
specText += std::string("\n#{") + ESM::Skill::sSkillNameIds[it->first] + "}";
|
||||
{
|
||||
if (isFirst)
|
||||
isFirst = false;
|
||||
else
|
||||
specText += "\n";
|
||||
|
||||
specText += std::string("#{") + ESM::Skill::sSkillNameIds[it->first] + "}";
|
||||
}
|
||||
}
|
||||
widget->setUserString("Caption_CenteredCaptionText", specText);
|
||||
widget->setUserString("ToolTipLayout", "TextWithCenteredCaptionToolTip");
|
||||
widget->setUserString("Caption_ColumnText", specText);
|
||||
widget->setUserString("ToolTipLayout", "SpecializationToolTip");
|
||||
widget->setUserString("ToolTipType", "Layout");
|
||||
}
|
||||
|
||||
|
@ -795,7 +803,7 @@ namespace MWGui
|
|||
widget->setUserString("Caption_CenteredCaption", playerRace->mName);
|
||||
widget->setUserString("Caption_CenteredCaptionText", playerRace->mDescription);
|
||||
widget->setUserString("ToolTipType", "Layout");
|
||||
widget->setUserString("ToolTipLayout", "TextWithCenteredCaptionToolTip");
|
||||
widget->setUserString("ToolTipLayout", "RaceToolTip");
|
||||
}
|
||||
|
||||
void ToolTips::createClassToolTip(MyGUI::Widget* widget, const ESM::Class& playerClass)
|
||||
|
|
|
@ -87,12 +87,12 @@
|
|||
<Widget type="AutoSizedTextBox" skin="NormalText" position="0 0 95 18" name="Race_str" align="Left Top">
|
||||
<Property key="Caption" value="#{sRace}"/>
|
||||
<UserString key="ToolTipType" value="Layout"/>
|
||||
<UserString key="ToolTipLayout" value="TextWithCenteredCaptionToolTip"/>
|
||||
<UserString key="ToolTipLayout" value="RaceToolTip"/>
|
||||
</Widget>
|
||||
<Widget type="TextBox" skin="SandTextRight" position="104 0 200 18" name="RaceText" align="Left Top">
|
||||
<Property key="TextAlign" value="Right Top"/>
|
||||
<UserString key="ToolTipType" value="Layout"/>
|
||||
<UserString key="ToolTipLayout" value="TextWithCenteredCaptionToolTip"/>
|
||||
<UserString key="ToolTipLayout" value="RaceToolTip"/>
|
||||
<UserString key="HStretch" value="true"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
|
|
@ -29,16 +29,33 @@
|
|||
</Widget>
|
||||
</Widget>
|
||||
|
||||
<!-- Text with centered caption tooltip -->
|
||||
<Widget type="VBox" skin="HUD_Box_NoTransp" position="0 0 300 56" align="Stretch" name="TextWithCenteredCaptionToolTip">
|
||||
<!-- Race tooltip -->
|
||||
<Widget type="VBox" skin="HUD_Box_NoTransp" position="0 0 0 56" align="Stretch" name="RaceToolTip">
|
||||
<Property key="AutoResize" value="true"/>
|
||||
<Property key="Padding" value="8"/>
|
||||
<Property key="Padding" value="12"/>
|
||||
<Property key="Spacing" value="8"/>
|
||||
|
||||
<Widget type="AutoSizedTextBox" skin="NormalText" position="8 8 284 18" align="Left Top" name="CenteredCaption">
|
||||
<Property key="TextAlign" value="Center"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="AutoSizedEditBox" skin="SandText" position="8 30 330 18" align="Left Top" name="CenteredCaptionText">
|
||||
<Widget type="AutoSizedEditBox" skin="SandText" position="8 30 430 18" align="Left Top" name="CenteredCaptionText">
|
||||
<Property key="MultiLine" value="true"/>
|
||||
<Property key="WordWrap" value="true"/>
|
||||
<Property key="TextAlign" value="Left Top"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
<!-- Specialization tooltip -->
|
||||
<Widget type="VBox" skin="HUD_Box_NoTransp" position="0 0 0 56" align="Stretch" name="SpecializationToolTip">
|
||||
<Property key="AutoResize" value="true"/>
|
||||
<Property key="Padding" value="12"/>
|
||||
|
||||
<Widget type="AutoSizedTextBox" skin="NormalText" position="8 8 140 18" align="Left Top" name="Caption">
|
||||
<Property key="TextAlign" value="Center"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="AutoSizedEditBox" skin="SandText" position="0 30 140 18" align="Left Top" name="ColumnText">
|
||||
<Property key="MultiLine" value="true"/>
|
||||
<Property key="WordWrap" value="true"/>
|
||||
<Property key="TextAlign" value="Left Top"/>
|
||||
|
@ -46,15 +63,16 @@
|
|||
</Widget>
|
||||
|
||||
<!-- Class tooltip -->
|
||||
<Widget type="VBox" skin="HUD_Box_NoTransp" position="0 0 300 78" align="Stretch" name="ClassToolTip">
|
||||
<Widget type="VBox" skin="HUD_Box_NoTransp" position="0 0 0 78" align="Stretch" name="ClassToolTip">
|
||||
<Property key="AutoResize" value="true"/>
|
||||
<Property key="Padding" value="8"/>
|
||||
<Property key="Padding" value="12"/>
|
||||
<Property key="Spacing" value="8"/>
|
||||
|
||||
<Widget type="AutoSizedTextBox" skin="NormalText" position="8 8 284 18" align="Left Top" name="ClassName">
|
||||
<Property key="TextAlign" value="Center"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="AutoSizedEditBox" skin="SandText" position="8 30 320 18" align="Left Top" name="ClassDescription">
|
||||
<Widget type="AutoSizedEditBox" skin="SandText" position="8 30 430 18" align="Left Top" name="ClassDescription">
|
||||
<Property key="MultiLine" value="true"/>
|
||||
<Property key="WordWrap" value="true"/>
|
||||
<Property key="TextAlign" value="Left Top"/>
|
||||
|
@ -204,15 +222,18 @@
|
|||
</Widget>
|
||||
|
||||
<!-- Level tooltip -->
|
||||
<Widget type="Widget" skin="HUD_Box_NoTransp" position="0 0 300 58" align="Left Top" name="LevelToolTip">
|
||||
<Widget type="TextBox" skin="NormalText" position="8 8 284 18" align="Left Top HStretch">
|
||||
<Widget type="VBox" skin="HUD_Box_NoTransp" position="0 0 300 58" align="HStretch" name="LevelToolTip">
|
||||
<Property key="AutoResize" value="true"/>
|
||||
<Property key="Padding" value="12"/>
|
||||
|
||||
<Widget type="AutoSizedTextBox" skin="NormalText" position="8 8 284 18" align="Left Top">
|
||||
<Property key="Caption" value="#{sLevelProgress}"/>
|
||||
<Property key="TextAlign" value="Center"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="ProgressBar" skin="MW_Progress_Red" position="50 30 200 20" align="HCenter Bottom" name="LevelProgress">
|
||||
<Widget type="TextBox" skin="ProgressText" position="0 0 200 16" align="Stretch" name="LevelProgressText">
|
||||
<Property key="TextAlign" value="Center"/>
|
||||
<Widget type="ProgressBar" skin="MW_Progress_Red" position="50 30 180 20" align="HCenter Bottom" name="LevelProgress">
|
||||
<Widget type="TextBox" skin="ProgressText" position="0 0 180 20" align="HCenter" name="LevelProgressText">
|
||||
<Property key="TextAlign" value="HCenter Top"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
|
Loading…
Reference in a new issue