mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 15:09:43 +00:00
Merge branch 'mapnotes' into 'master'
Shorten global map marker notes like vanilla (bug #7619) Closes #7619 See merge request OpenMW/openmw!3719
This commit is contained in:
commit
689efa6d69
2 changed files with 8 additions and 4 deletions
|
@ -98,6 +98,7 @@
|
||||||
Bug #7604: Goblins Grunt becomes idle once injured
|
Bug #7604: Goblins Grunt becomes idle once injured
|
||||||
Bug #7609: ForceGreeting should not open dialogue for werewolves
|
Bug #7609: ForceGreeting should not open dialogue for werewolves
|
||||||
Bug #7611: Beast races' idle animations slide after turning or jumping in place
|
Bug #7611: Beast races' idle animations slide after turning or jumping in place
|
||||||
|
Bug #7619: Long map notes may get cut off
|
||||||
Bug #7630: Charm can be cast on creatures
|
Bug #7630: Charm can be cast on creatures
|
||||||
Bug #7631: Cannot trade with/talk to Creeper or Mudcrab Merchant when they're fleeing
|
Bug #7631: Cannot trade with/talk to Creeper or Mudcrab Merchant when they're fleeing
|
||||||
Bug #7636: Animations bug out when switching between 1st and 3rd person, while playing a scripted animation
|
Bug #7636: Animations bug out when switching between 1st and 3rd person, while playing a scripted animation
|
||||||
|
|
|
@ -481,10 +481,13 @@ namespace MWGui
|
||||||
MyGUI::IntCoord(padding.left + 8 + 4, totalSize.height + padding.top, 300 - padding.left - 8 - 4,
|
MyGUI::IntCoord(padding.left + 8 + 4, totalSize.height + padding.top, 300 - padding.left - 8 - 4,
|
||||||
300 - totalSize.height),
|
300 - totalSize.height),
|
||||||
MyGUI::Align::Default);
|
MyGUI::Align::Default);
|
||||||
edit->setEditMultiLine(true);
|
constexpr size_t maxLength = 60;
|
||||||
edit->setEditWordWrap(true);
|
std::string shortenedNote = note.substr(0, std::min(maxLength, note.find('\n')));
|
||||||
edit->setCaption(note);
|
if (shortenedNote.size() < note.size())
|
||||||
edit->setSize(edit->getWidth(), edit->getTextSize().height);
|
shortenedNote += " ...";
|
||||||
|
edit->setCaption(shortenedNote);
|
||||||
|
MyGUI::IntSize noteTextSize = edit->getTextSize();
|
||||||
|
edit->setSize(std::max(edit->getWidth(), noteTextSize.width), noteTextSize.height);
|
||||||
icon->setPosition(icon->getLeft(), (edit->getTop() + edit->getBottom()) / 2 - icon->getHeight() / 2);
|
icon->setPosition(icon->getLeft(), (edit->getTop() + edit->getBottom()) / 2 - icon->getHeight() / 2);
|
||||||
totalSize.height += std::max(edit->getHeight(), icon->getHeight());
|
totalSize.height += std::max(edit->getHeight(), icon->getHeight());
|
||||||
totalSize.width = std::max(totalSize.width, edit->getWidth() + 8 + 4);
|
totalSize.width = std::max(totalSize.width, edit->getWidth() + 8 + 4);
|
||||||
|
|
Loading…
Reference in a new issue