mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 04:24:54 +02:00
Provide the option to suppress lua call in setText
This commit is contained in:
@@ -492,7 +492,7 @@ public:
|
||||
void resizeToText() { setSize(getTextSize()); }
|
||||
void clearText() { setText(""); }
|
||||
|
||||
void setText(std::string text);
|
||||
void setText(std::string text, bool fireLuaCall = true);
|
||||
void setTextAlign(Fw::AlignmentFlag align) { m_textAlign = align; updateText(); }
|
||||
void setTextOffset(const Point& offset) { m_textOffset = offset; updateText(); }
|
||||
void setTextWrap(bool textWrap) { m_textWrap = textWrap; updateText(); }
|
||||
|
@@ -112,7 +112,7 @@ void UIWidget::onFontChange(const std::string& font)
|
||||
callLuaField("onFontChange", font);
|
||||
}
|
||||
|
||||
void UIWidget::setText(std::string text)
|
||||
void UIWidget::setText(std::string text, bool fireLuaCall)
|
||||
{
|
||||
if(m_textOnlyUpperCase)
|
||||
stdext::toupper(text);
|
||||
@@ -125,7 +125,10 @@ void UIWidget::setText(std::string text)
|
||||
updateText();
|
||||
|
||||
text = m_text;
|
||||
onTextChange(text, oldText);
|
||||
|
||||
if(fireLuaCall) {
|
||||
onTextChange(text, oldText);
|
||||
}
|
||||
}
|
||||
|
||||
void UIWidget::setFont(const std::string& fontName)
|
||||
|
Reference in New Issue
Block a user