rodecomp/Source/UI/Lists/UIListBoxEx.h
ragnarok-clanker d1b138f289 Confirm 2 functions in Source/UI/Lists/UIComboBoxEx.cpp, Source/UI/Lists/UIListBoxEx.cpp, ...
Batch #11868 by StrawberrysherbetIX: 2 byte-identical, 0 confirmed by peer review.

- fn_11435 UIComboBoxEx::Slot31: byte-identical (already on main)
- fn_11464 UIComboBoxEx::Slot27: byte-identical (already on main)

Merged automatically: every function is byte-identical to the original.
2026-11-05 05:14:04 +00:00

69 lines
2 KiB
C++

#ifndef RAGNAROK_SOURCE_UI_LISTS_UILISTBOXEX_H
#define RAGNAROK_SOURCE_UI_LISTS_UILISTBOXEX_H
#include "UI/Window/UIWindow.h"
#include <map>
#include <string>
class UIScrollBar;
struct ExtendedListLine {
/* 0000 */ std::string text;
/* 0018 */ std::uint32_t color = 0;
};
class UIListBoxEx : public UIWindow {
public:
UIListBoxEx();
~UIListBoxEx() override;
void Resize(int width, int height) override;
void Slot15(int width, int height) override;
void Paint() override;
void Slot25(int x, int y) override;
void Slot26(int x, int y) override;
void Slot35(int value) override;
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
virtual void Configure(int x, int y, int width, int height, unsigned char transparent);
virtual void AddLine(const char* text, std::uint32_t color);
virtual void Clear();
virtual void Refresh();
int FindLine(const std::string& text);
/* 007C */ int backgroundRed;
/* 0080 */ int backgroundGreen;
/* 0084 */ int backgroundBlue;
/* 0088 */ std::map<int, ExtendedListLine> lines;
/* 0090 */ int selected;
/* 0094 */ int topLine;
/* 0098 */ int horizontalOffset;
/* 009C */ int contentWidth;
/* 00A0 */ int verticalOverflow;
/* 00A4 */ int bottomMargin;
/* 00A8 */ UIScrollBar* verticalBar;
/* 00AC */ UIScrollBar* horizontalBar;
/* 00B0 */ int transparent;
/* 00B4 */ int lineHeight;
/* 00B8 */ int unknown_00B8;
/* 00BC */ std::uint32_t selectionColor;
protected:
int LineAt(int x, int y) const;
};
// INLINED
inline int UIListBoxEx::LineAt(int x, int y) const {
if (x < 0 || y < 0 || x >= this->geometry.width || y >= this->geometry.height) {
return -1;
}
const int index = (this->topLine + y / this->lineHeight);
return index >= 0 && static_cast<unsigned>(index) < this->lines.size() ? index : -1;
}
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(ExtendedListLine) == 28);
static_assert(sizeof(UIListBoxEx) == 0xC0);
#endif
#endif