mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-03 19:45:32 +00:00
Console code cleaned
This commit is contained in:
parent
f5bf7254a8
commit
dd11ae04ee
1 changed files with 15 additions and 35 deletions
|
@ -81,48 +81,28 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
{
|
{
|
||||||
const MyGUI::IntPoint& mousePos = InputManager::getInstance().getMousePosition();
|
const MyGUI::IntPoint& mousePos = InputManager::getInstance().getMousePosition();
|
||||||
|
|
||||||
if (mWindowManager->getWorldMouseOver() && (mWindowManager->getMode() == GM_Console))
|
if (mWindowManager->getWorldMouseOver() && ((mWindowManager->getMode() == GM_Console)
|
||||||
{
|
|| (mWindowManager->getMode() == GM_Container)
|
||||||
MWWorld::Ptr objectptr = MWBase::Environment::get().getWorld()->getFacedObject();
|
|
||||||
if (!objectptr.isEmpty())
|
|
||||||
{
|
|
||||||
const MWWorld::Class& objectclass = MWWorld::Class::get (mFocusObject);
|
|
||||||
IntSize tooltipSize;
|
|
||||||
if (!objectclass.hasToolTip(mFocusObject))
|
|
||||||
{
|
|
||||||
setCoord(0, 0, 300, 300);
|
|
||||||
mDynamicToolTipBox->setVisible(true);
|
|
||||||
ToolTipInfo info;
|
|
||||||
info.caption=objectptr.getCellRef().mRefID;
|
|
||||||
info.icon="";
|
|
||||||
tooltipSize = createToolTip(info);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
tooltipSize = getToolTipViaPtr(true);
|
|
||||||
IntPoint tooltipPosition = InputManager::getInstance().getMousePosition() + IntPoint(0, 24);
|
|
||||||
|
|
||||||
if ((tooltipPosition.left + tooltipSize.width) > viewSize.width)
|
|
||||||
{
|
|
||||||
tooltipPosition.left = viewSize.width - tooltipSize.width;
|
|
||||||
}
|
|
||||||
if ((tooltipPosition.top + tooltipSize.height) > viewSize.height)
|
|
||||||
{
|
|
||||||
tooltipPosition.top = viewSize.height - tooltipSize.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
setCoord(tooltipPosition.left, tooltipPosition.top, tooltipSize.width, tooltipSize.height);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mWindowManager->getWorldMouseOver() && ((mWindowManager->getMode() == GM_Container)
|
|
||||||
|| (mWindowManager->getMode() == GM_Inventory)))
|
|| (mWindowManager->getMode() == GM_Inventory)))
|
||||||
{
|
{
|
||||||
mFocusObject = MWBase::Environment::get().getWorld()->getFacedObject();
|
mFocusObject = MWBase::Environment::get().getWorld()->getFacedObject();
|
||||||
|
const MWWorld::Class& objectclass = MWWorld::Class::get (mFocusObject);
|
||||||
|
|
||||||
if (mFocusObject.isEmpty ())
|
if (mFocusObject.isEmpty ())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IntSize tooltipSize = getToolTipViaPtr(true);
|
IntSize tooltipSize;
|
||||||
|
if ((!objectclass.hasToolTip(mFocusObject))&&(mWindowManager->getMode() == GM_Console))
|
||||||
|
{
|
||||||
|
setCoord(0, 0, 300, 300);
|
||||||
|
mDynamicToolTipBox->setVisible(true);
|
||||||
|
ToolTipInfo info;
|
||||||
|
info.caption=mFocusObject.getCellRef().mRefID;
|
||||||
|
info.icon="";
|
||||||
|
tooltipSize = createToolTip(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
tooltipSize = getToolTipViaPtr(true);
|
||||||
|
|
||||||
IntPoint tooltipPosition = InputManager::getInstance().getMousePosition() + IntPoint(0, 24);
|
IntPoint tooltipPosition = InputManager::getInstance().getMousePosition() + IntPoint(0, 24);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue