diff --git a/Source/UI/ProbabilityTable/UIProbabilityTable.cpp b/Source/UI/ProbabilityTable/UIProbabilityTable.cpp index b0290af7f..1d91176f4 100644 --- a/Source/UI/ProbabilityTable/UIProbabilityTable.cpp +++ b/Source/UI/ProbabilityTable/UIProbabilityTable.cpp @@ -187,8 +187,10 @@ template <> void CUIListBoxEx::OnCreate(int width, int height) { this->scrollBar = new CUIVScrollBar(); this->scrollBar->Show(0); - const std::function onChange = [this](int position) { this->OnScroll(position); }; - this->scrollBar->onChange = onChange; + { + const std::function onChange = [this](int position) { this->OnScroll(position); }; + this->scrollBar->onChange = onChange; + } this->AddChild(this->scrollBar); } diff --git a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp index 1adb03198..e8adbab82 100644 --- a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp +++ b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp @@ -589,16 +589,14 @@ int UIRuneSystem_tagListWnd::SendMsg(UIWindow*, int message, std::intptr_t argum this->m_firstTag = --this->m_firstTag < 0 ? 0 : this->m_firstTag; this->Invalidate(); break; - case ID_NEXT_PAGE: { + case ID_NEXT_PAGE: ++this->m_firstTag; - const int first = this->m_firstTag; - if (CRuneSystemMgr::GetInstance()->GetTagCount() < first + 10) { - this->m_firstTag = first - 1; + if (CRuneSystemMgr::GetInstance()->GetTagCount() < this->m_firstTag + 10) { + --this->m_firstTag; } this->Invalidate(); break; } - } break; case 0xA9: this->Move(0, (argument1 == 0 ? argument2 : 0) + 44); @@ -1135,8 +1133,8 @@ void UIGage_Circle::Paint() { ); const std::string text = FormatOwnedString("%.2f%%", static_cast(static_cast(this->m_value) * 0.001f)); - const int width = this->TextWidth(text.c_str(), text.size(), 0, 12, 0, 0); - this->DrawTextAt(static_cast(static_cast(this->geometry.width - width) * 0.5f), this->m_textY, text.c_str(), 0, + const int space = this->geometry.width - this->TextWidth(text.c_str(), text.size(), 0, 12, 0, 0); + this->DrawTextAt(static_cast(static_cast(space) * 0.5f), this->m_textY, text.c_str(), 0, 0, 12, 0xFFFFFF, 1, 0 ); }