diff --git a/Source/UI/Lists/UIScrollBar.cpp b/Source/UI/Lists/UIScrollBar.cpp index 601aa9cd..551f8eff 100644 --- a/Source/UI/Lists/UIScrollBar.cpp +++ b/Source/UI/Lists/UIScrollBar.cpp @@ -321,8 +321,43 @@ void UIScrollBar::Configure(int x, int y, unsigned char vertical, int length) { } // OFFSET: 0x00880800 +// FUNCTION: fn_11279 +int UIListBoxEx::FindLine(const std::string& text) { + const std::string key = text; + auto it = this->lines.begin(); + for (; it != this->lines.end(); ++it) { + if (key == it->second.text) { + break; + } + } + return it == this->lines.end() ? -1 : it->first; +} // OFFSET: 0x00880920 +// FUNCTION: fn_11280 +int UIImgMenu::ItemAt(int x, int y) { + const int width = this->geometry.width - 3; + if (x < 1 || x >= width || y < 1) { + return -1; + } + const int height = this->geometry.height - 3; + if (y >= height) { + return -1; + } + + int size; + int offset; + if (this->horizontal != 0) { + size = width / this->count; + this->itemWidth = size; + offset = x; + } else { + size = height / this->count; + this->itemHeight = size; + offset = y; + } + return std::min(offset / size, this->count - 1); +} // OFFSET: 0x00880B20 // FUNCTION: fn_11283 @@ -331,5 +366,27 @@ int UITabControl::TabCount() { } // OFFSET: 0x00880B40 +// FUNCTION: fn_11284 +int UITabControl::TabAt(int x, int y) { + int offset = x; + if (this->layout == 0 || this->layout == 2) { + offset = y; + } + const int count = this->TabCount(); + for (int index = 0; index < count; ++index) { + offset -= this->widths[index]; + if (offset < 0) { + return index; + } + } + return -1; +} // OFFSET: 0x00880BB0 +// FUNCTION: fn_11285 +const char* UIChatHisBox::HistoryText(unsigned int index) { + if (index < this->history.size() && !this->history[index].empty()) { + return this->history[index].c_str(); + } + return nullptr; +}