mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 09:06:43 +00:00
Allow widgets with layout-type tooltip to change user data of widgets from tooltip layout
This commit is contained in:
parent
a9f7a30d90
commit
236eec3d89
1 changed files with 13 additions and 2 deletions
|
@ -238,12 +238,23 @@ namespace MWGui
|
||||||
size_t underscorePos = it->first.find("_");
|
size_t underscorePos = it->first.find("_");
|
||||||
if (underscorePos == std::string::npos)
|
if (underscorePos == std::string::npos)
|
||||||
continue;
|
continue;
|
||||||
std::string propertyKey = it->first.substr(0, underscorePos);
|
std::string key = it->first.substr(0, underscorePos);
|
||||||
std::string widgetName = it->first.substr(underscorePos+1, it->first.size()-(underscorePos+1));
|
std::string widgetName = it->first.substr(underscorePos+1, it->first.size()-(underscorePos+1));
|
||||||
|
|
||||||
|
std::string type = "Property";
|
||||||
|
size_t caretPos = key.find("^");
|
||||||
|
if (caretPos != std::string::npos)
|
||||||
|
{
|
||||||
|
type = key.substr(0, caretPos);
|
||||||
|
key.erase(key.begin(), key.begin() + caretPos + 1);
|
||||||
|
}
|
||||||
|
|
||||||
MyGUI::Widget* w;
|
MyGUI::Widget* w;
|
||||||
getWidget(w, widgetName);
|
getWidget(w, widgetName);
|
||||||
w->setProperty(propertyKey, it->second);
|
if (type == "Property")
|
||||||
|
w->setProperty(key, it->second);
|
||||||
|
else if (type == "UserData")
|
||||||
|
w->setUserString(key, it->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
tooltipSize = tooltip->getSize();
|
tooltipSize = tooltip->getSize();
|
||||||
|
|
Loading…
Reference in a new issue