mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 20:43:26 +02:00
Improve tab navigation and scrolling
* Fix with use with over creatures when you are over force use objects * Fix textedit wrapping
This commit is contained in:
@@ -449,15 +449,15 @@ ThingPtr Tile::getTopMultiUseThing()
|
||||
if(isEmpty())
|
||||
return nullptr;
|
||||
|
||||
if(CreaturePtr topCreature = getTopCreature())
|
||||
return topCreature;
|
||||
|
||||
for(uint i = 0; i < m_things.size(); ++i) {
|
||||
ThingPtr thing = m_things[i];
|
||||
if(thing->isForceUse())
|
||||
return thing;
|
||||
}
|
||||
|
||||
if(CreaturePtr topCreature = getTopCreature())
|
||||
return topCreature;
|
||||
|
||||
for(uint i = 0; i < m_things.size(); ++i) {
|
||||
ThingPtr thing = m_things[i];
|
||||
if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop()) {
|
||||
@@ -467,7 +467,6 @@ ThingPtr Tile::getTopMultiUseThing()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(uint i = 0; i < m_things.size(); ++i) {
|
||||
ThingPtr thing = m_things[i];
|
||||
if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnTop())
|
||||
|
@@ -480,7 +480,7 @@ std::string UITextEdit::cut()
|
||||
|
||||
void UITextEdit::wrapText()
|
||||
{
|
||||
setText(m_font->wrapText(m_text, getPaddingRect().width()));
|
||||
setText(m_font->wrapText(m_text, getPaddingRect().width() - m_textOffset.x));
|
||||
}
|
||||
|
||||
void UITextEdit::moveCursorHorizontally(bool right)
|
||||
@@ -552,7 +552,7 @@ std::string UITextEdit::getDisplayedText()
|
||||
text = m_text;
|
||||
|
||||
if(m_textWrap && m_rect.isValid())
|
||||
text = m_font->wrapText(text, getWidth() - m_textOffset.x);
|
||||
text = m_font->wrapText(text, getPaddingRect().width() - m_textOffset.x);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
Reference in New Issue
Block a user