mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 12:49:40 +00:00
some cleanup
This commit is contained in:
parent
1c7110fbf5
commit
6518eb7794
3 changed files with 21 additions and 27 deletions
|
@ -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);
|
||||
|
|
|
@ -73,29 +73,6 @@ void ToolTips::onFrame(float frameDuration)
|
|||
{
|
||||
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")
|
||||
{
|
||||
mFocusObject = *focus->getUserData<MWWorld::Ptr>();
|
||||
|
@ -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…
Reference in a new issue