Decompile 2 functions in Source/UI/Buttons/UITextButton.cpp
Batch #10673 by dori: 0 byte-identical, 2 confirmed by peer review. - fn_11514 UIListBoxID::Refresh: logic confirmed by peer review - fn_11471 UITextButton::Slot27: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, kyoshi, cremane Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
069f1c90a1
commit
75ca7eb42f
1 changed files with 21 additions and 9 deletions
|
|
@ -131,8 +131,9 @@ void UITextButton::Slot27(int x, int y) {
|
|||
return;
|
||||
}
|
||||
|
||||
const bool captured = g_windowMgr.Capture() == this;
|
||||
const bool inside = x >= 0 && x < this->geometry.width && y >= 0 && y < this->geometry.height;
|
||||
const unsigned state = inside ? (g_windowMgr.Capture() == this ? 2 : 1) : 0;
|
||||
const unsigned state = inside ? (captured ? 2 : 1) : 0;
|
||||
this->m_color = inside ? this->m_hoverColor : this->m_normalColor;
|
||||
|
||||
if (this->geometry.unknown_0030 != state) {
|
||||
|
|
@ -1352,19 +1353,30 @@ void UIComboBoxID::Resize(int width, int height) {
|
|||
void UIListBoxID::Refresh() {
|
||||
const int visible = this->geometry.height / this->lineHeight;
|
||||
const int count = static_cast<int>(this->lines.size());
|
||||
const int overflow = std::max((count - visible), 0);
|
||||
int overflow = count - visible;
|
||||
|
||||
this->verticalOverflow = overflow != 0;
|
||||
this->verticalBar->maximum = overflow != 0 ? (this->bottomMargin + overflow) : 0;
|
||||
this->verticalBar->total = count;
|
||||
this->verticalBar->visible = visible;
|
||||
this->verticalBar->Invalidate();
|
||||
|
||||
if (this->verticalBar->position > this->verticalBar->maximum) {
|
||||
this->verticalBar->position = this->verticalBar->maximum;
|
||||
if (overflow < 0) {
|
||||
overflow = 0;
|
||||
}
|
||||
|
||||
this->verticalBar->Invalidate();
|
||||
this->verticalOverflow = overflow != 0;
|
||||
auto* bar = this->verticalBar;
|
||||
|
||||
if (overflow == 0) {
|
||||
bar->maximum = 0;
|
||||
} else {
|
||||
bar->maximum = this->bottomMargin + overflow;
|
||||
}
|
||||
|
||||
bar->total = count;
|
||||
bar->visible = visible;
|
||||
bar->Invalidate();
|
||||
|
||||
if (bar->position > bar->maximum) {
|
||||
bar->position = bar->maximum;
|
||||
}
|
||||
|
||||
bar->Invalidate();
|
||||
}
|
||||
|
||||
// OFFSET: 0x00895D80
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue