mirror of
https://github.com/edubart/otclient.git
synced 2025-12-26 09:47:11 +01:00
Buttons for client options
This commit is contained in:
@@ -374,6 +374,7 @@ public:
|
||||
Size getIconSize() { return m_iconRect.size(); }
|
||||
Rect getIconRect() { return m_iconRect; }
|
||||
Rect getIconClip() { return m_iconClipRect; }
|
||||
Fw::AlignmentFlag getIconAlign() { return m_iconAlign; }
|
||||
Color getBorderTopColor() { return m_borderColor.top; }
|
||||
Color getBorderRightColor() { return m_borderColor.right; }
|
||||
Color getBorderBottomColor() { return m_borderColor.bottom; }
|
||||
|
||||
@@ -401,7 +401,10 @@ void UIWidget::drawIcon(const Rect& screenCoords)
|
||||
|
||||
void UIWidget::setIcon(const std::string& iconFile)
|
||||
{
|
||||
m_icon = g_textures.getTexture(iconFile);
|
||||
if(iconFile.empty())
|
||||
m_icon = nullptr;
|
||||
else
|
||||
m_icon = g_textures.getTexture(iconFile);
|
||||
if(m_icon && !m_iconClipRect.isValid())
|
||||
m_iconClipRect = Rect(0, 0, m_icon->getSize());
|
||||
}
|
||||
@@ -176,7 +176,10 @@ void UIWidget::drawImage(const Rect& screenCoords)
|
||||
|
||||
void UIWidget::setImageSource(const std::string& source)
|
||||
{
|
||||
m_imageTexture = g_textures.getTexture(source);
|
||||
if(source.empty())
|
||||
m_imageTexture = nullptr;
|
||||
else
|
||||
m_imageTexture = g_textures.getTexture(source);
|
||||
m_imageMustRecache = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user