mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 13:19: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 = skillClientWidget->createWidget<MyGUI::TextBox>("SandText", coord1, MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch);
|
||||||
skillNameWidget->setCaption(text);
|
skillNameWidget->setCaption(text);
|
||||||
skillNameWidget->setUserString("ToolTipType", "Text");
|
skillNameWidget->setUserString("ToolTipType", "Layout");
|
||||||
skillNameWidget->setUserString("ToolTipText", tooltip);
|
skillNameWidget->setUserString("ToolTipLayout", "TextToolTip");
|
||||||
|
skillNameWidget->setUserString("Caption_Text", tooltip);
|
||||||
skillNameWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
skillNameWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||||
|
|
||||||
skillValueWidget = skillClientWidget->createWidget<MyGUI::TextBox>("SandTextRight", coord2, MyGUI::Align::Right | MyGUI::Align::Top);
|
skillValueWidget = skillClientWidget->createWidget<MyGUI::TextBox>("SandTextRight", coord2, MyGUI::Align::Right | MyGUI::Align::Top);
|
||||||
skillValueWidget->setUserString("ToolTipType", "Text");
|
skillNameWidget->setUserString("ToolTipType", "Layout");
|
||||||
skillValueWidget->setUserString("ToolTipText", tooltip);
|
skillNameWidget->setUserString("ToolTipLayout", "TextToolTip");
|
||||||
|
skillNameWidget->setUserString("Caption_Text", tooltip);
|
||||||
skillValueWidget->setCaption(value);
|
skillValueWidget->setCaption(value);
|
||||||
skillValueWidget->_setWidgetState(state);
|
skillValueWidget->_setWidgetState(state);
|
||||||
skillValueWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
skillValueWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||||
|
|
|
@ -72,29 +72,6 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
if (type == "")
|
if (type == "")
|
||||||
{
|
{
|
||||||
return;
|
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")
|
else if (type == "ItemPtr")
|
||||||
{
|
{
|
||||||
|
@ -153,6 +130,8 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
|
|
||||||
tooltip->setCoord(0, 0, tooltipSize.width, tooltipSize.height);
|
tooltip->setCoord(0, 0, tooltipSize.width, tooltipSize.height);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
throw std::runtime_error ("unknown tooltip type");
|
||||||
|
|
||||||
IntPoint tooltipPosition = InputManager::getInstance().getMousePosition() + IntPoint(0, 24);
|
IntPoint tooltipPosition = InputManager::getInstance().getMousePosition() + IntPoint(0, 24);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,19 @@
|
||||||
<Property key="Visible" value="false"/>
|
<Property key="Visible" value="false"/>
|
||||||
</Widget>
|
</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 -->
|
<!-- Attribute tooltip -->
|
||||||
<Widget type="Widget" skin="HUD_Box" position="0 0 300 300" align="Stretch" name="AttributeToolTip">
|
<Widget type="Widget" skin="HUD_Box" position="0 0 300 300" align="Stretch" name="AttributeToolTip">
|
||||||
<Property key="Visible" value="false"/>
|
<Property key="Visible" value="false"/>
|
||||||
|
|
Loading…
Reference in a new issue