mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-13 18:09:39 +00:00
added the item tooltips
This commit is contained in:
parent
ed6ff0a94a
commit
7723044df0
3 changed files with 12 additions and 5 deletions
|
@ -80,7 +80,7 @@ void ContainerBase::onContainerClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
ItemWidget* item = static_cast<ItemWidget*>(mDragAndDrop->mDraggedWidget);
|
ItemWidget* item = static_cast<ItemWidget*>(mDragAndDrop->mDraggedWidget);
|
||||||
std::cout << item->mPos << (*mDragAndDrop->mStore.begin()).getTypeName();
|
std::cout << item->mPos << (*mDragAndDrop->mStore.begin()).getTypeName();
|
||||||
if(item->mPtr.getContainerStore() == 0) std::cout << "nocontainer!";
|
if((*item->getUserData<MWWorld::Ptr>()).getContainerStore() == 0) std::cout << "nocontainer!";
|
||||||
MWWorld::ContainerStore& containerStore = MWWorld::Class::get(mContainer).getContainerStore(mContainer);
|
MWWorld::ContainerStore& containerStore = MWWorld::Class::get(mContainer).getContainerStore(mContainer);
|
||||||
containerStore.add(*mDragAndDrop->mStore.begin());
|
containerStore.add(*mDragAndDrop->mStore.begin());
|
||||||
mDragAndDrop->mStore.clear();
|
mDragAndDrop->mStore.clear();
|
||||||
|
@ -135,8 +135,9 @@ void ContainerBase::drawItems()
|
||||||
ItemWidget* image = mContainerWidget->createWidget<ItemWidget>("ImageBox", MyGUI::IntCoord(x, y, 32, 32), MyGUI::Align::Default);
|
ItemWidget* image = mContainerWidget->createWidget<ItemWidget>("ImageBox", MyGUI::IntCoord(x, y, 32, 32), MyGUI::Align::Default);
|
||||||
MyGUI::TextBox* text = image->createWidget<MyGUI::TextBox>("SandBrightText", MyGUI::IntCoord(x, y, 18, 18), MyGUI::Align::Default, std::string("Label"));
|
MyGUI::TextBox* text = image->createWidget<MyGUI::TextBox>("SandBrightText", MyGUI::IntCoord(x, y, 18, 18), MyGUI::Align::Default, std::string("Label"));
|
||||||
image->eventMouseButtonClick += MyGUI::newDelegate(this,&ContainerBase::onSelectedItem);
|
image->eventMouseButtonClick += MyGUI::newDelegate(this,&ContainerBase::onSelectedItem);
|
||||||
|
image->setUserString("ToolTipType", "ItemPtr");
|
||||||
|
image->setUserData(*iter);
|
||||||
image->mPos = index;
|
image->mPos = index;
|
||||||
image->mPtr = *iter;
|
|
||||||
x += 36;
|
x += 36;
|
||||||
if(count % 20 == 0)
|
if(count % 20 == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,9 +10,8 @@ namespace MWGui
|
||||||
MYGUI_RTTI_DERIVED( ItemWidget )
|
MYGUI_RTTI_DERIVED( ItemWidget )
|
||||||
public:
|
public:
|
||||||
|
|
||||||
MWWorld::Ptr mPtr;
|
|
||||||
int mPos;
|
int mPos;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -61,12 +61,14 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
else if (type == "Text")
|
else if (type == "Text")
|
||||||
{
|
{
|
||||||
info.text = text;
|
info.text = text;
|
||||||
|
tooltipSize = createToolTip(info);
|
||||||
}
|
}
|
||||||
else if (type == "CaptionText")
|
else if (type == "CaptionText")
|
||||||
{
|
{
|
||||||
std::string caption = focus->getUserString("ToolTipCaption");
|
std::string caption = focus->getUserString("ToolTipCaption");
|
||||||
info.caption = caption;
|
info.caption = caption;
|
||||||
info.text = text;
|
info.text = text;
|
||||||
|
tooltipSize = createToolTip(info);
|
||||||
}
|
}
|
||||||
else if (type == "ImageCaptionText")
|
else if (type == "ImageCaptionText")
|
||||||
{
|
{
|
||||||
|
@ -77,8 +79,13 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
info.text = text;
|
info.text = text;
|
||||||
info.caption = caption;
|
info.caption = caption;
|
||||||
info.icon = image;
|
info.icon = image;
|
||||||
|
tooltipSize = createToolTip(info);
|
||||||
|
}
|
||||||
|
else if (type == "ItemPtr")
|
||||||
|
{
|
||||||
|
mFocusObject = *focus->getUserData<MWWorld::Ptr>();
|
||||||
|
tooltipSize = getToolTipViaPtr();
|
||||||
}
|
}
|
||||||
tooltipSize = createToolTip(info);
|
|
||||||
|
|
||||||
IntPoint tooltipPosition = InputManager::getInstance().getMousePosition() + IntPoint(0, 24);
|
IntPoint tooltipPosition = InputManager::getInstance().getMousePosition() + IntPoint(0, 24);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue