Merge remote-tracking branch 'miroslavr/master'

deque
Marc Zinnschlag 11 years ago
commit 47619d957a

@ -403,9 +403,24 @@ namespace MWGui
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_SkillDescription", skill->mDescription);
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_SkillAttribute", "#{sGoverningAttribute}: #{" + attr->mName + "}");
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("ImageTexture_SkillImage", icon);
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_SkillProgressText", boost::lexical_cast<std::string>(progressPercent)+"/100");
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Range_SkillProgress", "100");
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("RangePosition_SkillProgress", boost::lexical_cast<std::string>(progressPercent));
if (base < 100)
{
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Visible_SkillMaxed", "false");
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("UserData^Hidden_SkillMaxed", "true");
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Visible_SkillProgressVBox", "true");
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("UserData^Hidden_SkillProgressVBox", "false");
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_SkillProgressText", boost::lexical_cast<std::string>(progressPercent)+"/100");
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Range_SkillProgress", "100");
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("RangePosition_SkillProgress", boost::lexical_cast<std::string>(progressPercent));
} else {
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Visible_SkillMaxed", "true");
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("UserData^Hidden_SkillMaxed", "false");
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Visible_SkillProgressVBox", "false");
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("UserData^Hidden_SkillProgressVBox", "true");
}
}
mSkillWidgetMap[skillId] = widget;

@ -238,12 +238,23 @@ namespace MWGui
size_t underscorePos = it->first.find("_");
if (underscorePos == std::string::npos)
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 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;
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();

@ -670,7 +670,7 @@ namespace MWGui
align();
}
void Box::_setPropertyImpl(const std::string& _key, const std::string& _value)
bool Box::_setPropertyImpl(const std::string& _key, const std::string& _value)
{
if (_key == "Spacing")
mSpacing = MyGUI::utility::parseValue<int>(_value);
@ -678,6 +678,10 @@ namespace MWGui
mPadding = MyGUI::utility::parseValue<int>(_value);
else if (_key == "AutoResize")
mAutoResize = MyGUI::utility::parseValue<bool>(_value);
else
return false;
return true;
}
void HBox::align ()
@ -756,7 +760,8 @@ namespace MWGui
void HBox::setPropertyOverride(const std::string& _key, const std::string& _value)
{
Box::_setPropertyImpl (_key, _value);
if (!Box::_setPropertyImpl (_key, _value))
MyGUI::Widget::setPropertyOverride(_key, _value);
}
void HBox::setSize (const MyGUI::IntSize& _value)
@ -892,7 +897,8 @@ namespace MWGui
void VBox::setPropertyOverride(const std::string& _key, const std::string& _value)
{
Box::_setPropertyImpl (_key, _value);
if (!Box::_setPropertyImpl (_key, _value))
MyGUI::Widget::setPropertyOverride(_key, _value);
}
void VBox::setSize (const MyGUI::IntSize& _value)

@ -367,7 +367,7 @@ namespace MWGui
protected:
virtual void align() = 0;
virtual void _setPropertyImpl(const std::string& _key, const std::string& _value);
virtual bool _setPropertyImpl(const std::string& _key, const std::string& _value);
int mSpacing; // how much space to put between elements

@ -134,15 +134,21 @@
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="AutoSizedTextBox" skin="NormalText" position="8 48 284 18" align="Left Bottom">
<Property key="Caption" value="#{sSkillProgress}"/>
<Widget type="AutoSizedTextBox" skin="SandText" position="8 48 284 18" align="Left Bottom" name="SkillMaxed">
<Property key="Caption" value="#{sSkillMaxReached}"/>
<Property key="TextAlign" value="Center"/>
</Widget>
<Widget type="ProgressBar" skin="MW_Progress_Red" position="50 70 200 20" align="HCenter Bottom" name="SkillProgress">
<Widget type="TextBox" skin="ProgressText" position="0 0 200 20" align="Stretch" name="SkillProgressText">
<Widget type="VBox" name="SkillProgressVBox">
<Widget type="AutoSizedTextBox" skin="NormalText" position="8 48 284 18" align="Left Bottom">
<Property key="Caption" value="#{sSkillProgress}"/>
<Property key="TextAlign" value="Center"/>
</Widget>
<Widget type="ProgressBar" skin="MW_Progress_Red" position="50 70 200 20" align="HCenter Bottom" name="SkillProgress">
<Widget type="TextBox" skin="ProgressText" position="0 0 200 20" align="Stretch" name="SkillProgressText">
<Property key="TextAlign" value="Center"/>
</Widget>
</Widget>
</Widget>
</Widget>

Loading…
Cancel
Save