summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Kotov <alexdobrohotov@yandex.ru>2024-02-24 19:51:08 +0300
committerAlexei Kotov <alexdobrohotov@yandex.ru>2024-02-24 23:05:27 +0300
commit65aa222efa3d4a4cf49c8cdfb42e119d89b5220b (patch)
treec25cbbcf8ad081044281cd8aebab2e0710486030
parent595e42ae43944bed3fd2ee91d35345cc0f40f923 (diff)
Move full help text after everything else (#7623)
-rw-r--r--CHANGELOG.md1
-rw-r--r--apps/openmw/mwclass/activator.cpp6
-rw-r--r--apps/openmw/mwclass/apparatus.cpp4
-rw-r--r--apps/openmw/mwclass/armor.cpp4
-rw-r--r--apps/openmw/mwclass/book.cpp4
-rw-r--r--apps/openmw/mwclass/clothing.cpp4
-rw-r--r--apps/openmw/mwclass/container.cpp6
-rw-r--r--apps/openmw/mwclass/creature.cpp4
-rw-r--r--apps/openmw/mwclass/door.cpp4
-rw-r--r--apps/openmw/mwclass/ingredient.cpp4
-rw-r--r--apps/openmw/mwclass/light.cpp4
-rw-r--r--apps/openmw/mwclass/lockpick.cpp4
-rw-r--r--apps/openmw/mwclass/misc.cpp4
-rw-r--r--apps/openmw/mwclass/npc.cpp2
-rw-r--r--apps/openmw/mwclass/potion.cpp4
-rw-r--r--apps/openmw/mwclass/probe.cpp4
-rw-r--r--apps/openmw/mwclass/repair.cpp4
-rw-r--r--apps/openmw/mwclass/weapon.cpp4
-rw-r--r--apps/openmw/mwgui/tooltips.cpp23
-rw-r--r--apps/openmw/mwgui/tooltips.hpp1
20 files changed, 57 insertions, 38 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ea44cab4b1..69d0f6c3c6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -115,6 +115,7 @@
Bug #7611: Beast races' idle animations slide after turning or jumping in place
Bug #7617: The death prompt asks the player if they wanted to load the character's last created save
Bug #7619: Long map notes may get cut off
+ Bug #7623: Incorrect placement of the script info in the engraved ring of healing tooltip
Bug #7630: Charm can be cast on creatures
Bug #7631: Cannot trade with/talk to Creeper or Mudcrab Merchant when they're fleeing
Bug #7633: Groundcover should ignore non-geometry Drawables
diff --git a/apps/openmw/mwclass/activator.cpp b/apps/openmw/mwclass/activator.cpp
index 678c4e054b..e0ee315bc1 100644
--- a/apps/openmw/mwclass/activator.cpp
+++ b/apps/openmw/mwclass/activator.cpp
@@ -104,13 +104,11 @@ namespace MWClass
std::string_view name = getName(ptr);
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name)) + MWGui::ToolTips::getCountString(count);
- std::string text;
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
- info.text = std::move(text);
return info;
}
diff --git a/apps/openmw/mwclass/apparatus.cpp b/apps/openmw/mwclass/apparatus.cpp
index 1bf6f9c845..bf5e4dc2f1 100644
--- a/apps/openmw/mwclass/apparatus.cpp
+++ b/apps/openmw/mwclass/apparatus.cpp
@@ -102,8 +102,8 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
info.text = std::move(text);
diff --git a/apps/openmw/mwclass/armor.cpp b/apps/openmw/mwclass/armor.cpp
index ffa5b36a4d..3853f53fc4 100644
--- a/apps/openmw/mwclass/armor.cpp
+++ b/apps/openmw/mwclass/armor.cpp
@@ -257,8 +257,8 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
info.enchant = ref->mBase->mEnchant;
diff --git a/apps/openmw/mwclass/book.cpp b/apps/openmw/mwclass/book.cpp
index 2c375547d0..95453e7a58 100644
--- a/apps/openmw/mwclass/book.cpp
+++ b/apps/openmw/mwclass/book.cpp
@@ -121,8 +121,8 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
info.enchant = ref->mBase->mEnchant;
diff --git a/apps/openmw/mwclass/clothing.cpp b/apps/openmw/mwclass/clothing.cpp
index 17519405de..cdf51ef663 100644
--- a/apps/openmw/mwclass/clothing.cpp
+++ b/apps/openmw/mwclass/clothing.cpp
@@ -164,8 +164,8 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
info.enchant = ref->mBase->mEnchant;
diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp
index e2023ef8c3..75b8543b0a 100644
--- a/apps/openmw/mwclass/container.cpp
+++ b/apps/openmw/mwclass/container.cpp
@@ -265,10 +265,10 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
if (ptr.getCellRef().getRefId() == "stolen_goods")
- text += "\nYou can not use evidence chests";
+ info.extra += "\nYou cannot use evidence chests";
}
info.text = std::move(text);
diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp
index 2de58c6127..0024755f91 100644
--- a/apps/openmw/mwclass/creature.cpp
+++ b/apps/openmw/mwclass/creature.cpp
@@ -591,10 +591,8 @@ namespace MWClass
std::string_view name = getName(ptr);
info.caption = MyGUI::TextIterator::toTagsString(MyGUI::UString(name));
- std::string text;
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
- info.text = std::move(text);
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
return info;
}
diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp
index 015c454915..7509fbf71f 100644
--- a/apps/openmw/mwclass/door.cpp
+++ b/apps/openmw/mwclass/door.cpp
@@ -290,8 +290,8 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
info.text = std::move(text);
diff --git a/apps/openmw/mwclass/ingredient.cpp b/apps/openmw/mwclass/ingredient.cpp
index 9af9a5703b..e18d6ad5f3 100644
--- a/apps/openmw/mwclass/ingredient.cpp
+++ b/apps/openmw/mwclass/ingredient.cpp
@@ -117,8 +117,8 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
diff --git a/apps/openmw/mwclass/light.cpp b/apps/openmw/mwclass/light.cpp
index dc37b8d154..06b1901864 100644
--- a/apps/openmw/mwclass/light.cpp
+++ b/apps/openmw/mwclass/light.cpp
@@ -173,8 +173,8 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
info.text = std::move(text);
diff --git a/apps/openmw/mwclass/lockpick.cpp b/apps/openmw/mwclass/lockpick.cpp
index 42b5634b64..dc3b73da63 100644
--- a/apps/openmw/mwclass/lockpick.cpp
+++ b/apps/openmw/mwclass/lockpick.cpp
@@ -118,8 +118,8 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
info.text = std::move(text);
diff --git a/apps/openmw/mwclass/misc.cpp b/apps/openmw/mwclass/misc.cpp
index 0470a89a16..dcd91c51af 100644
--- a/apps/openmw/mwclass/misc.cpp
+++ b/apps/openmw/mwclass/misc.cpp
@@ -163,8 +163,8 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
info.text = std::move(text);
diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp
index b7540ebe04..43962f44b5 100644
--- a/apps/openmw/mwclass/npc.cpp
+++ b/apps/openmw/mwclass/npc.cpp
@@ -1118,7 +1118,7 @@ namespace MWClass
}
if (fullHelp)
- info.text = MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra = MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
return info;
}
diff --git a/apps/openmw/mwclass/potion.cpp b/apps/openmw/mwclass/potion.cpp
index e5da876d06..42c122cb48 100644
--- a/apps/openmw/mwclass/potion.cpp
+++ b/apps/openmw/mwclass/potion.cpp
@@ -114,8 +114,8 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
info.text = std::move(text);
diff --git a/apps/openmw/mwclass/probe.cpp b/apps/openmw/mwclass/probe.cpp
index 4f5e7be5cb..beab45945c 100644
--- a/apps/openmw/mwclass/probe.cpp
+++ b/apps/openmw/mwclass/probe.cpp
@@ -117,8 +117,8 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
info.text = std::move(text);
diff --git a/apps/openmw/mwclass/repair.cpp b/apps/openmw/mwclass/repair.cpp
index 3000ea4087..279352263e 100644
--- a/apps/openmw/mwclass/repair.cpp
+++ b/apps/openmw/mwclass/repair.cpp
@@ -119,8 +119,8 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
info.text = std::move(text);
diff --git a/apps/openmw/mwclass/weapon.cpp b/apps/openmw/mwclass/weapon.cpp
index b5a3415717..5f1f7f2772 100644
--- a/apps/openmw/mwclass/weapon.cpp
+++ b/apps/openmw/mwclass/weapon.cpp
@@ -239,8 +239,8 @@ namespace MWClass
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
{
- text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
- text += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
+ info.extra += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
+ info.extra += MWGui::ToolTips::getMiscString(ref->mBase->mScript.getRefIdString(), "Script");
}
info.text = std::move(text);
diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp
index 0a0343831d..938d4176f2 100644
--- a/apps/openmw/mwgui/tooltips.cpp
+++ b/apps/openmw/mwgui/tooltips.cpp
@@ -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 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.erase(0, 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);
diff --git a/apps/openmw/mwgui/tooltips.hpp b/apps/openmw/mwgui/tooltips.hpp
index 69f6856840..132698475f 100644
--- a/apps/openmw/mwgui/tooltips.hpp
+++ b/apps/openmw/mwgui/tooltips.hpp
@@ -29,6 +29,7 @@ namespace MWGui
std::string caption;
std::string text;
+ std::string extra;
std::string icon;
int imageSize;