mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-31 07:36:41 +00:00
Fix Show Owned option affecting tooltips that are not objects (Fixes #3036)
This commit is contained in:
parent
2ffcc2a2b4
commit
984c455027
2 changed files with 11 additions and 10 deletions
|
@ -87,9 +87,9 @@ namespace MWGui
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool gameMode = MWBase::Environment::get().getWindowManager()->isGuiMode();
|
bool guiMode = MWBase::Environment::get().getWindowManager()->isGuiMode();
|
||||||
|
|
||||||
if (gameMode)
|
if (guiMode)
|
||||||
{
|
{
|
||||||
const MyGUI::IntPoint& mousePos = MyGUI::InputManager::getInstance().getMousePosition();
|
const MyGUI::IntPoint& mousePos = MyGUI::InputManager::getInstance().getMousePosition();
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ namespace MWGui
|
||||||
if (info.caption.empty())
|
if (info.caption.empty())
|
||||||
info.caption=mFocusObject.getCellRef().getRefId();
|
info.caption=mFocusObject.getCellRef().getRefId();
|
||||||
info.icon="";
|
info.icon="";
|
||||||
tooltipSize = createToolTip(info);
|
tooltipSize = createToolTip(info, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
tooltipSize = getToolTipViaPtr(true);
|
tooltipSize = getToolTipViaPtr(true);
|
||||||
|
@ -178,7 +178,7 @@ namespace MWGui
|
||||||
ToolTipInfo info;
|
ToolTipInfo info;
|
||||||
info.text = data.caption;
|
info.text = data.caption;
|
||||||
info.notes = data.notes;
|
info.notes = data.notes;
|
||||||
tooltipSize = createToolTip(info);
|
tooltipSize = createToolTip(info, false);
|
||||||
}
|
}
|
||||||
else if (type == "ItemPtr")
|
else if (type == "ItemPtr")
|
||||||
{
|
{
|
||||||
|
@ -197,7 +197,7 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
else if (type == "ToolTipInfo")
|
else if (type == "ToolTipInfo")
|
||||||
{
|
{
|
||||||
tooltipSize = createToolTip(*focus->getUserData<MWGui::ToolTipInfo>());
|
tooltipSize = createToolTip(*focus->getUserData<MWGui::ToolTipInfo>(), false);
|
||||||
}
|
}
|
||||||
else if (type == "AvatarItemSelection")
|
else if (type == "AvatarItemSelection")
|
||||||
{
|
{
|
||||||
|
@ -240,7 +240,7 @@ namespace MWGui
|
||||||
info.text = "#{sSchool}: " + sSchoolNames[school];
|
info.text = "#{sSchool}: " + sSchoolNames[school];
|
||||||
}
|
}
|
||||||
info.effects = effects;
|
info.effects = effects;
|
||||||
tooltipSize = createToolTip(info);
|
tooltipSize = createToolTip(info, false);
|
||||||
}
|
}
|
||||||
else if (type == "Layout")
|
else if (type == "Layout")
|
||||||
{
|
{
|
||||||
|
@ -345,7 +345,7 @@ namespace MWGui
|
||||||
ToolTipInfo info = object.getToolTipInfo(mFocusObject);
|
ToolTipInfo info = object.getToolTipInfo(mFocusObject);
|
||||||
if (!image)
|
if (!image)
|
||||||
info.icon = "";
|
info.icon = "";
|
||||||
tooltipSize = createToolTip(info);
|
tooltipSize = createToolTip(info, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return tooltipSize;
|
return tooltipSize;
|
||||||
|
@ -370,13 +370,13 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MyGUI::IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
MyGUI::IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info, bool isFocusObject)
|
||||||
{
|
{
|
||||||
mDynamicToolTipBox->setVisible(true);
|
mDynamicToolTipBox->setVisible(true);
|
||||||
|
|
||||||
if(mShowOwned == 1 || mShowOwned == 3)
|
if(mShowOwned == 1 || mShowOwned == 3)
|
||||||
{
|
{
|
||||||
if(checkOwned())
|
if(isFocusObject && checkOwned())
|
||||||
{
|
{
|
||||||
mDynamicToolTipBox->changeWidgetSkin("HUD_Box_NoTransp_Owned");
|
mDynamicToolTipBox->changeWidgetSkin("HUD_Box_NoTransp_Owned");
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,8 +98,9 @@ namespace MWGui
|
||||||
MyGUI::IntSize getToolTipViaPtr (bool image=true);
|
MyGUI::IntSize getToolTipViaPtr (bool image=true);
|
||||||
///< @return requested tooltip size
|
///< @return requested tooltip size
|
||||||
|
|
||||||
MyGUI::IntSize createToolTip(const ToolTipInfo& info);
|
MyGUI::IntSize createToolTip(const ToolTipInfo& info, bool isFocusObject);
|
||||||
///< @return requested tooltip size
|
///< @return requested tooltip size
|
||||||
|
/// @param isFocusObject Is the object this tooltips originates from mFocusObject?
|
||||||
|
|
||||||
float mFocusToolTipX;
|
float mFocusToolTipX;
|
||||||
float mFocusToolTipY;
|
float mFocusToolTipY;
|
||||||
|
|
Loading…
Reference in a new issue