mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 02:15:34 +00:00
[#7528] Fix MyGUI 3.4.3 issues
This commit is contained in:
parent
b9c986b0b8
commit
43a931d3c4
16 changed files with 36 additions and 34 deletions
|
@ -23,8 +23,8 @@ namespace MWGui
|
|||
MyGUI::xml::ElementEnumerator info = _node->getElementEnumerator();
|
||||
while (info.next("Property"))
|
||||
{
|
||||
const std::string& key = info->findAttribute("key");
|
||||
const std::string& value = info->findAttribute("value");
|
||||
auto key = info->findAttribute("key");
|
||||
auto value = info->findAttribute("value");
|
||||
|
||||
if (key == "Point")
|
||||
mPoint = MyGUI::IntPoint::parse(value);
|
||||
|
|
|
@ -9,15 +9,15 @@ namespace MWGui
|
|||
void resizeSkin(MyGUI::xml::ElementPtr _node)
|
||||
{
|
||||
_node->setAttribute("type", "ResourceSkin");
|
||||
const std::string size = _node->findAttribute("size");
|
||||
auto size = _node->findAttribute("size");
|
||||
if (!size.empty())
|
||||
return;
|
||||
|
||||
const std::string textureName = _node->findAttribute("texture");
|
||||
auto textureName = _node->findAttribute("texture");
|
||||
if (textureName.empty())
|
||||
return;
|
||||
|
||||
MyGUI::ITexture* texture = MyGUI::RenderManager::getInstance().getTexture(textureName);
|
||||
MyGUI::ITexture* texture = MyGUI::RenderManager::getInstance().getTexture(std::string(textureName));
|
||||
if (!texture)
|
||||
return;
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace MWGui
|
|||
if (basis->getName() != "BasisSkin")
|
||||
continue;
|
||||
|
||||
const std::string basisSkinType = basis->findAttribute("type");
|
||||
auto basisSkinType = basis->findAttribute("type");
|
||||
if (Misc::StringUtils::ciEqual(basisSkinType, "SimpleText"))
|
||||
continue;
|
||||
bool isTileRect = Misc::StringUtils::ciEqual(basisSkinType, "TileRect");
|
||||
|
|
|
@ -242,13 +242,13 @@ namespace MWGui
|
|||
|
||||
void SettingsWindow::updateSliderLabel(MyGUI::ScrollBar* scroller, const std::string& value)
|
||||
{
|
||||
std::string labelWidgetName = scroller->getUserString("SettingLabelWidget");
|
||||
auto labelWidgetName = scroller->getUserString("SettingLabelWidget");
|
||||
if (!labelWidgetName.empty())
|
||||
{
|
||||
MyGUI::TextBox* textBox;
|
||||
getWidget(textBox, labelWidgetName);
|
||||
std::string labelCaption = scroller->getUserString("SettingLabelCaption");
|
||||
labelCaption = Misc::StringUtils::format(labelCaption, value);
|
||||
auto labelCaption = scroller->getUserString("SettingLabelCaption");
|
||||
labelCaption = Misc::StringUtils::format(std::string(labelCaption), value);
|
||||
textBox->setCaptionWithReplacing(labelCaption);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -244,7 +244,7 @@ namespace MWGui
|
|||
= store->get<ESM::Skill>().find(MWMechanics::getSpellSchool(spell, player))->mSchool;
|
||||
info.text = "#{sSchool}: " + MyGUI::TextIterator::toTagsString(school->mName).asUTF8();
|
||||
}
|
||||
const std::string& cost = focus->getUserString("SpellCost");
|
||||
auto cost = focus->getUserString("SpellCost");
|
||||
if (!cost.empty() && cost != "0")
|
||||
info.text
|
||||
+= MWGui::ToolTips::getValueString(MWMechanics::calcSpellCost(*spell), "#{sCastCost}");
|
||||
|
|
|
@ -2186,7 +2186,7 @@ namespace MWGui
|
|||
ResourceImageSetPointerFix* imgSetPointer = resource->castType<ResourceImageSetPointerFix>(false);
|
||||
if (!imgSetPointer)
|
||||
continue;
|
||||
std::string tex_name = imgSetPointer->getImageSet()->getIndexInfo(0, 0).texture;
|
||||
auto tex_name = imgSetPointer->getImageSet()->getIndexInfo(0, 0).texture;
|
||||
|
||||
osg::ref_ptr<osg::Image> image = mResourceSystem->getImageManager()->getImage(tex_name);
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace
|
|||
MyGUI::xml::ElementPtr sizeProperty = getProperty(layersIterator.current(), "Size");
|
||||
if (sizeProperty != nullptr)
|
||||
{
|
||||
std::string sizeValue = sizeProperty->findAttribute("value");
|
||||
auto sizeValue = sizeProperty->findAttribute("value");
|
||||
if (!sizeValue.empty())
|
||||
return MyGUI::IntSize::parse(sizeValue);
|
||||
}
|
||||
|
@ -614,7 +614,7 @@ namespace Gui
|
|||
MyGUI::xml::ElementEnumerator resourceNode = _node->getElementEnumerator();
|
||||
while (resourceNode.next("Resource"))
|
||||
{
|
||||
std::string type = resourceNode->findAttribute("type");
|
||||
auto type = resourceNode->findAttribute("type");
|
||||
|
||||
if (Misc::StringUtils::ciEqual(type, "ResourceLayout"))
|
||||
{
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace osgMyGUI
|
|||
throw std::runtime_error("DataManager::getDataListNames is not implemented - VFS is used");
|
||||
}
|
||||
|
||||
const std::string& DataManager::getDataPath(const std::string& name) const
|
||||
std::string DataManager::getDataPath(const std::string& name) const
|
||||
{
|
||||
static std::string result;
|
||||
result.clear();
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace osgMyGUI
|
|||
@param _name Resource name.
|
||||
@return Return full path to specified data.
|
||||
*/
|
||||
const std::string& getDataPath(const std::string& _name) const override;
|
||||
std::string getDataPath(const std::string& _name) const override;
|
||||
|
||||
private:
|
||||
std::filesystem::path mResourcePath;
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace osgMyGUI
|
|||
void flush() override;
|
||||
|
||||
void log(const std::string& _section, MyGUI::LogLevel _level, const struct tm* _time,
|
||||
const std::string& _message, const char* _file, int _line) override;
|
||||
const std::string& _message, const char* _file, int _line);
|
||||
|
||||
private:
|
||||
std::ofstream mStream;
|
||||
|
|
|
@ -123,8 +123,8 @@ namespace osgMyGUI
|
|||
{
|
||||
if (info->getName() == "Property")
|
||||
{
|
||||
const std::string& key = info->findAttribute("key");
|
||||
const std::string& value = info->findAttribute("value");
|
||||
auto key = info->findAttribute("key");
|
||||
auto value = info->findAttribute("value");
|
||||
|
||||
if (key == "Size")
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace Gui
|
|||
notifySizeChange(this);
|
||||
}
|
||||
|
||||
void AutoSizedTextBox::setPropertyOverride(const std::string& _key, const std::string& _value)
|
||||
void AutoSizedTextBox::setPropertyOverride(std::string_view _key, const std::string_view _value)
|
||||
{
|
||||
if (_key == "ExpandDirection")
|
||||
{
|
||||
|
@ -103,7 +103,7 @@ namespace Gui
|
|||
setEditStatic(true);
|
||||
}
|
||||
|
||||
void AutoSizedEditBox::setPropertyOverride(const std::string& _key, const std::string& _value)
|
||||
void AutoSizedEditBox::setPropertyOverride(std::string_view _key, const std::string_view _value)
|
||||
{
|
||||
if (_key == "ExpandDirection")
|
||||
{
|
||||
|
@ -136,7 +136,7 @@ namespace Gui
|
|||
notifySizeChange(this);
|
||||
}
|
||||
|
||||
void AutoSizedButton::setPropertyOverride(const std::string& _key, const std::string& _value)
|
||||
void AutoSizedButton::setPropertyOverride(std::string_view _key, const std::string_view _value)
|
||||
{
|
||||
if (_key == "ExpandDirection")
|
||||
{
|
||||
|
@ -147,6 +147,7 @@ namespace Gui
|
|||
Gui::Button::setPropertyOverride(_key, _value);
|
||||
}
|
||||
}
|
||||
|
||||
Box::Box()
|
||||
: mSpacing(4)
|
||||
, mPadding(0)
|
||||
|
@ -159,7 +160,7 @@ namespace Gui
|
|||
align();
|
||||
}
|
||||
|
||||
bool Box::_setPropertyImpl(const std::string& _key, const std::string& _value)
|
||||
bool Box::_setPropertyImpl(std::string_view _key, const std::string_view _value)
|
||||
{
|
||||
if (_key == "Spacing")
|
||||
mSpacing = MyGUI::utility::parseValue<int>(_value);
|
||||
|
@ -260,7 +261,7 @@ namespace Gui
|
|||
}
|
||||
}
|
||||
|
||||
void HBox::setPropertyOverride(const std::string& _key, const std::string& _value)
|
||||
void HBox::setPropertyOverride(std::string_view _key, const std::string_view _value)
|
||||
{
|
||||
if (!Box::_setPropertyImpl(_key, _value))
|
||||
MyGUI::Widget::setPropertyOverride(_key, _value);
|
||||
|
@ -415,7 +416,7 @@ namespace Gui
|
|||
}
|
||||
}
|
||||
|
||||
void VBox::setPropertyOverride(const std::string& _key, const std::string& _value)
|
||||
void VBox::setPropertyOverride(std::string_view _key, const std::string_view _value)
|
||||
{
|
||||
if (!Box::_setPropertyImpl(_key, _value))
|
||||
MyGUI::Widget::setPropertyOverride(_key, _value);
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace Gui
|
|||
void setCaption(const MyGUI::UString& _value) override;
|
||||
|
||||
protected:
|
||||
void setPropertyOverride(const std::string& _key, const std::string& _value) override;
|
||||
void setPropertyOverride(std::string_view _key, std::string_view _value) override;
|
||||
std::string mFontSize;
|
||||
};
|
||||
|
||||
|
@ -68,7 +68,7 @@ namespace Gui
|
|||
void initialiseOverride() override;
|
||||
|
||||
protected:
|
||||
void setPropertyOverride(const std::string& _key, const std::string& _value) override;
|
||||
void setPropertyOverride(std::string_view _key, const std::string_view _value) override;
|
||||
int getWidth();
|
||||
std::string mFontSize;
|
||||
bool mShrink = false;
|
||||
|
@ -85,7 +85,7 @@ namespace Gui
|
|||
void setCaption(const MyGUI::UString& _value) override;
|
||||
|
||||
protected:
|
||||
void setPropertyOverride(const std::string& _key, const std::string& _value) override;
|
||||
void setPropertyOverride(std::string_view _key, const std::string_view _value) override;
|
||||
std::string mFontSize;
|
||||
};
|
||||
|
||||
|
@ -105,7 +105,7 @@ namespace Gui
|
|||
protected:
|
||||
virtual void align() = 0;
|
||||
|
||||
virtual bool _setPropertyImpl(const std::string& _key, const std::string& _value);
|
||||
virtual bool _setPropertyImpl(std::string_view _key, std::string_view _value);
|
||||
|
||||
int mSpacing; // how much space to put between elements
|
||||
|
||||
|
@ -137,7 +137,7 @@ namespace Gui
|
|||
void align() override;
|
||||
MyGUI::IntSize getRequestedSize() override;
|
||||
|
||||
void setPropertyOverride(const std::string& _key, const std::string& _value) override;
|
||||
void setPropertyOverride(std::string_view _key, std::string_view _value) override;
|
||||
|
||||
void onWidgetCreated(MyGUI::Widget* _widget) override;
|
||||
};
|
||||
|
@ -156,7 +156,7 @@ namespace Gui
|
|||
void align() override;
|
||||
MyGUI::IntSize getRequestedSize() override;
|
||||
|
||||
void setPropertyOverride(const std::string& _key, const std::string& _value) override;
|
||||
void setPropertyOverride(std::string_view _key, std::string_view _value);
|
||||
|
||||
void onWidgetCreated(MyGUI::Widget* _widget) override;
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace Gui
|
|||
updateImage();
|
||||
}
|
||||
|
||||
void ImageButton::setPropertyOverride(const std::string& _key, const std::string& _value)
|
||||
void ImageButton::setPropertyOverride(std::string_view _key, const std::string_view _value)
|
||||
{
|
||||
if (_key == "ImageHighlighted")
|
||||
mImageHighlighted = _value;
|
||||
|
@ -56,6 +56,7 @@ namespace Gui
|
|||
else
|
||||
ImageBox::setPropertyOverride(_key, _value);
|
||||
}
|
||||
|
||||
void ImageButton::onMouseSetFocus(Widget* _old)
|
||||
{
|
||||
mMouseFocus = true;
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Gui
|
|||
static bool sDefaultNeedKeyFocus;
|
||||
|
||||
protected:
|
||||
void setPropertyOverride(const std::string& _key, const std::string& _value) override;
|
||||
void setPropertyOverride(std::string_view _key, std::string_view _value) override;
|
||||
void onMouseLostFocus(MyGUI::Widget* _new) override;
|
||||
void onMouseSetFocus(MyGUI::Widget* _old) override;
|
||||
void onMouseButtonPressed(int _left, int _top, MyGUI::MouseButton _id) override;
|
||||
|
|
|
@ -107,7 +107,7 @@ namespace Gui
|
|||
mScrollView->setViewOffset(MyGUI::IntPoint(0, -viewPosition));
|
||||
}
|
||||
|
||||
void MWList::setPropertyOverride(const std::string& _key, const std::string& _value)
|
||||
void MWList::setPropertyOverride(std::string_view _key, const std::string_view _value)
|
||||
{
|
||||
if (_key == "ListItemSkin")
|
||||
mListItemSkin = _value;
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace Gui
|
|||
|
||||
void scrollToTop();
|
||||
|
||||
void setPropertyOverride(const std::string& _key, const std::string& _value) override;
|
||||
void setPropertyOverride(std::string_view _key, std::string_view _value) override;
|
||||
|
||||
protected:
|
||||
void initialiseOverride() override;
|
||||
|
|
Loading…
Reference in a new issue