mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-22 12:39:59 +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
@ -98,6 +98,7 @@
|
||||
Bug #7604: Goblins Grunt becomes idle once injured
|
||||
Bug #7609: ForceGreeting should not open dialogue for werewolves
|
||||
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 #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
|
||||
|
@ -481,10 +481,13 @@ namespace MWGui
|
||||
MyGUI::IntCoord(padding.left + 8 + 4, totalSize.height + padding.top, 300 - padding.left - 8 - 4,
|
||||
300 - totalSize.height),
|
||||
MyGUI::Align::Default);
|
||||
edit->setEditMultiLine(true);
|
||||
edit->setEditWordWrap(true);
|
||||
edit->setCaption(note);
|
||||
edit->setSize(edit->getWidth(), edit->getTextSize().height);
|
||||
constexpr size_t maxLength = 60;
|
||||
std::string shortenedNote = note.substr(0, std::min(maxLength, note.find('\n')));
|
||||
if (shortenedNote.size() < note.size())
|
||||
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);
|
||||
totalSize.height += std::max(edit->getHeight(), icon->getHeight());
|
||||
totalSize.width = std::max(totalSize.width, edit->getWidth() + 8 + 4);
|
||||
|
Loading…
x
Reference in New Issue
Block a user