Decompile 7 functions in Source/UI/Window/UIRoulletteWnd.cpp, Source/UI/Window/UIRoulletteWnd.h, ...
Batch #4394 by Yommy: 0 byte-identical, 7 confirmed by peer review. - fn_10085 UIRoulletteWnd::ItemAt: logic confirmed by peer review - fn_10090 UIRoulletteWnd::Slot19: logic confirmed by peer review - fn_10091 UIRoulletteWnd::Slot32: logic confirmed by peer review - fn_10092 UIRoulletteWnd::SendMsg: logic confirmed by peer review - fn_10093 UIRoulletteWnd::UpdateButtons: logic confirmed by peer review - fn_10961 UIStaticText::SetColor: logic confirmed by peer review - fn_10965 UIStaticText::SetTextFitted: logic confirmed by peer review Peer-reviewed-by: eAthena, KWDev, Qwenkler3.8 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
f562ce4bee
commit
631cc6aabc
6 changed files with 315 additions and 9 deletions
|
|
@ -24,6 +24,57 @@ void UIStaticText::SetText(const char* value, int outlineValue) {
|
|||
this->Invalidate();
|
||||
}
|
||||
|
||||
// OFFSET: 0x008685B0
|
||||
// FUNCTION: fn_10961
|
||||
void UIStaticText::SetColor(int redValue, int greenValue, int blueValue) {
|
||||
this->red = redValue;
|
||||
this->green = greenValue;
|
||||
this->blue = blueValue;
|
||||
this->Invalidate();
|
||||
}
|
||||
|
||||
// OFFSET: 0x00868880
|
||||
// FUNCTION: fn_10965
|
||||
void UIStaticText::SetTextFitted(const char* value) {
|
||||
this->tooltip = value;
|
||||
this->tooltipEnabled = 0;
|
||||
|
||||
if (this->geometry.surface == nullptr) {
|
||||
this->text = value;
|
||||
this->Invalidate();
|
||||
return;
|
||||
}
|
||||
|
||||
int width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, value, 0, this->fontFamily, this->fontHeight, this->bold, 0);
|
||||
this->TextWidth(this->m_controls->fonts, this->m_controls->locale, "...", 0, this->fontFamily, this->fontHeight, this->bold, 0);
|
||||
|
||||
if (this->geometry.width >= width) {
|
||||
this->text = value;
|
||||
this->Invalidate();
|
||||
return;
|
||||
}
|
||||
|
||||
this->tooltipEnabled = 1;
|
||||
this->text = value;
|
||||
std::string truncated = value;
|
||||
while (this->geometry.width < width) {
|
||||
if (truncated.size() <= 1) {
|
||||
this->text = truncated + "...";
|
||||
break;
|
||||
}
|
||||
|
||||
if (truncated.size() >= 2) {
|
||||
const std::size_t size = truncated.size();
|
||||
truncated.resize(truncated[size - 2] < 0 && truncated[size - 1] < 0 ? size - 2 : size - 1);
|
||||
}
|
||||
|
||||
this->text = truncated + "...";
|
||||
width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->bold, 0);
|
||||
}
|
||||
|
||||
this->Invalidate();
|
||||
}
|
||||
|
||||
// OFFSET: 0x0085DE70
|
||||
// FUNCTION: fn_10820
|
||||
void UIStaticText::Paint() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue