diff --git a/apps/openmw/mwgui/stats_window.cpp b/apps/openmw/mwgui/stats_window.cpp index 092ceaeb6..33d9f02c8 100644 --- a/apps/openmw/mwgui/stats_window.cpp +++ b/apps/openmw/mwgui/stats_window.cpp @@ -302,13 +302,15 @@ MyGUI::TextBox* StatsWindow::addValueItem(const std::string& text, const std::st skillNameWidget = skillClientWidget->createWidget("SandText", coord1, MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch); skillNameWidget->setCaption(text); - skillNameWidget->setUserString("ToolTipType", "Text"); - skillNameWidget->setUserString("ToolTipText", tooltip); + skillNameWidget->setUserString("ToolTipType", "Layout"); + skillNameWidget->setUserString("ToolTipLayout", "TextToolTip"); + skillNameWidget->setUserString("Caption_Text", tooltip); skillNameWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel); skillValueWidget = skillClientWidget->createWidget("SandTextRight", coord2, MyGUI::Align::Right | MyGUI::Align::Top); - skillValueWidget->setUserString("ToolTipType", "Text"); - skillValueWidget->setUserString("ToolTipText", tooltip); + skillNameWidget->setUserString("ToolTipType", "Layout"); + skillNameWidget->setUserString("ToolTipLayout", "TextToolTip"); + skillNameWidget->setUserString("Caption_Text", tooltip); skillValueWidget->setCaption(value); skillValueWidget->_setWidgetState(state); skillValueWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel); diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 47907ec94..df06bd93e 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -72,29 +72,6 @@ void ToolTips::onFrame(float frameDuration) if (type == "") { return; - } - else if (type == "Text") - { - info.text = text; - tooltipSize = createToolTip(info); - } - else if (type == "CaptionText") - { - std::string caption = focus->getUserString("ToolTipCaption"); - info.caption = caption; - info.text = text; - tooltipSize = createToolTip(info); - } - else if (type == "ImageCaptionText") - { - std::string caption = focus->getUserString("ToolTipCaption"); - std::string image = focus->getUserString("ToolTipImage"); - std::string sizeString = focus->getUserString("ToolTipImageSize"); - - info.text = text; - info.caption = caption; - info.icon = image; - tooltipSize = createToolTip(info); } else if (type == "ItemPtr") { @@ -153,6 +130,8 @@ void ToolTips::onFrame(float frameDuration) tooltip->setCoord(0, 0, tooltipSize.width, tooltipSize.height); } + else + throw std::runtime_error ("unknown tooltip type"); IntPoint tooltipPosition = InputManager::getInstance().getMousePosition() + IntPoint(0, 24); diff --git a/files/mygui/openmw_tooltips.xml b/files/mygui/openmw_tooltips.xml index 1913095a8..414991664 100644 --- a/files/mygui/openmw_tooltips.xml +++ b/files/mygui/openmw_tooltips.xml @@ -8,6 +8,19 @@ + + + + + + + + + + + + +