|
|
|
@ -410,10 +410,13 @@ namespace MWGui
|
|
|
|
|
const std::string& image = info.icon;
|
|
|
|
|
int imageSize = (!image.empty()) ? info.imageSize : 0;
|
|
|
|
|
std::string text = info.text;
|
|
|
|
|
std::string_view extra = info.extra;
|
|
|
|
|
|
|
|
|
|
// remove the first newline (easier this way)
|
|
|
|
|
if (text.size() > 0 && text[0] == '\n')
|
|
|
|
|
if (!text.empty() && text[0] == '\n')
|
|
|
|
|
text.erase(0, 1);
|
|
|
|
|
if (!extra.empty() && extra[0] == '\n')
|
|
|
|
|
extra = extra.substr(1);
|
|
|
|
|
|
|
|
|
|
const ESM::Enchantment* enchant = nullptr;
|
|
|
|
|
const MWWorld::ESMStore& store = *MWBase::Environment::get().getESMStore();
|
|
|
|
@ -572,6 +575,24 @@ namespace MWGui
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!extra.empty())
|
|
|
|
|
{
|
|
|
|
|
Gui::EditBox* extraWidget = mDynamicToolTipBox->createWidget<Gui::EditBox>("SandText",
|
|
|
|
|
MyGUI::IntCoord(padding.left, totalSize.height + 12, 300 - padding.left, 300 - totalSize.height),
|
|
|
|
|
MyGUI::Align::Stretch, "ToolTipExtraText");
|
|
|
|
|
|
|
|
|
|
extraWidget->setEditStatic(true);
|
|
|
|
|
extraWidget->setEditMultiLine(true);
|
|
|
|
|
extraWidget->setEditWordWrap(info.wordWrap);
|
|
|
|
|
extraWidget->setCaptionWithReplacing(extra);
|
|
|
|
|
extraWidget->setTextAlign(MyGUI::Align::HCenter | MyGUI::Align::Top);
|
|
|
|
|
extraWidget->setNeedKeyFocus(false);
|
|
|
|
|
|
|
|
|
|
MyGUI::IntSize extraTextSize = extraWidget->getTextSize();
|
|
|
|
|
totalSize.height += extraTextSize.height + 4;
|
|
|
|
|
totalSize.width = std::max(totalSize.width, extraTextSize.width);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
captionWidget->setCoord((totalSize.width - captionSize.width) / 2 + imageSize,
|
|
|
|
|
(captionHeight - captionSize.height) / 2, captionSize.width - imageSize, captionSize.height);
|
|
|
|
|
|
|
|
|
|