From d776a0f822fca5adef5fbbb6b8fa9ae912eb4c70 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 15:14:51 +0000 Subject: [PATCH] Decompile fn_12088 (UIWindow::DrawButtonBar) Batch #16096 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_12088 UIWindow::DrawButtonBar: logic confirmed by peer review Peer-reviewed-by: alisonrag, gordaoprogramas, kyoshi Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Window/WindowBorder.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/UI/Window/WindowBorder.cpp b/Source/UI/Window/WindowBorder.cpp index fbebc83e8..3be15a0d0 100644 --- a/Source/UI/Window/WindowBorder.cpp +++ b/Source/UI/Window/WindowBorder.cpp @@ -121,19 +121,19 @@ int UIWindow::DrawButtonBar(int style, int width, int rows) { } auto* middle = static_cast(ResourceMgr::Instance().Load(Resolve(name))); - if (!middle) { - return 0; - } + if (middle) { + width = width - rightWidth - leftWidth; + const int middleWidth = middle->image.width; + const int count = width / middleWidth + (width % middleWidth != 0); - width = width - rightWidth - leftWidth; - const int middleWidth = middle->image.width; - const int count = width / middleWidth + (width % middleWidth != 0); - - for (int row = 1; row <= rows; ++row) { - for (int column = 0; column < count; ++column) { - this->DrawBitmap(leftWidth + column * middleWidth, this->geometry.height - row * barHeight, middle, false); + for (int row = 1; row <= rows; ++row) { + for (int column = 0; column < count; ++column) { + this->DrawBitmap(leftWidth + column * middleWidth, this->geometry.height - row * barHeight, middle, false); + } } + + return middle->image.height; } - return middle->image.height; + return 0; }