some cleanup

actorid
scrawl 13 years ago
parent 1c7110fbf5
commit 6518eb7794

@ -302,13 +302,15 @@ MyGUI::TextBox* StatsWindow::addValueItem(const std::string& text, const std::st
skillNameWidget = skillClientWidget->createWidget<MyGUI::TextBox>("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<MyGUI::TextBox>("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);

@ -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);

@ -8,6 +8,19 @@
<Property key="Visible" value="false"/>
</Widget>
<!-- Text tooltip -->
<Widget type="Widget" skin="HUD_Box" position="0 0 300 300" align="Stretch" name="TextToolTip">
<Property key="Visible" value="false"/>
<Widget type="EditBox" skin="SandText" position="8 8 284 284" align="Left Top Stretch" name="Text">
<Property key="MultiLine" value="true"/>
<Property key="WordWrap" value="true"/>
<Property key="TextAlign" value="Left Top"/>
<UserString key="AutoResizeHorizontal" value="true"/>
<UserString key="AutoResizeVertical" value="true"/>
</Widget>
</Widget>
<!-- Attribute tooltip -->
<Widget type="Widget" skin="HUD_Box" position="0 0 300 300" align="Stretch" name="AttributeToolTip">
<Property key="Visible" value="false"/>

Loading…
Cancel
Save