forked from mirror/openmw-tes3mp
Update the tooltip when the focusObject is set
This commit is contained in:
parent
0e2e23e9f8
commit
c9f8a220dc
3 changed files with 13 additions and 2 deletions
|
@ -40,6 +40,7 @@ namespace MWGui
|
|||
, mEnabled(true)
|
||||
, mFullHelp(false)
|
||||
, mShowOwned(0)
|
||||
, mFrameDuration(0.f)
|
||||
{
|
||||
getWidget(mDynamicToolTipBox, "DynamicToolTipBox");
|
||||
|
||||
|
@ -67,6 +68,11 @@ namespace MWGui
|
|||
}
|
||||
|
||||
void ToolTips::onFrame(float frameDuration)
|
||||
{
|
||||
mFrameDuration = frameDuration;
|
||||
}
|
||||
|
||||
void ToolTips::update(float frameDuration)
|
||||
{
|
||||
|
||||
while (mDynamicToolTipBox->getChildCount())
|
||||
|
@ -320,6 +326,8 @@ namespace MWGui
|
|||
void ToolTips::setFocusObject(const MWWorld::ConstPtr& focus)
|
||||
{
|
||||
mFocusObject = focus;
|
||||
|
||||
update(mFrameDuration);
|
||||
}
|
||||
|
||||
MyGUI::IntSize ToolTips::getToolTipViaPtr (int count, bool image)
|
||||
|
|
|
@ -50,6 +50,7 @@ namespace MWGui
|
|||
ToolTips();
|
||||
|
||||
void onFrame(float frameDuration);
|
||||
void update(float frameDuration);
|
||||
|
||||
void setEnabled(bool enabled);
|
||||
|
||||
|
@ -126,6 +127,8 @@ namespace MWGui
|
|||
bool mFullHelp;
|
||||
|
||||
int mShowOwned;
|
||||
|
||||
float mFrameDuration;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1756,8 +1756,6 @@ namespace MWWorld
|
|||
// inform the GUI about focused object
|
||||
MWWorld::Ptr object = getFacedObject ();
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setFocusObject(object);
|
||||
|
||||
// retrieve object dimensions so we know where to place the floating label
|
||||
if (!object.isEmpty ())
|
||||
{
|
||||
|
@ -1766,6 +1764,8 @@ namespace MWWorld
|
|||
MWBase::Environment::get().getWindowManager()->setFocusObjectScreenCoords(
|
||||
screenBounds.x(), screenBounds.y(), screenBounds.z(), screenBounds.w());
|
||||
}
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setFocusObject(object);
|
||||
}
|
||||
|
||||
MWWorld::Ptr World::getFacedObject(float maxDistance, bool ignorePlayer)
|
||||
|
|
Loading…
Reference in a new issue