Skip to content

Commit

Permalink
Merge branch 'develop-SWtest2' into develop-Mix4BEtest
Browse files Browse the repository at this point in the history
  • Loading branch information
CrimRecya committed Jan 10, 2025
2 parents 21dcb29 + d1712bb commit 509fad8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Ext/Sidebar/SWSidebar/SWSidebarClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,18 @@ void SWSidebarClass::SortButtons()
const int maximum = Phobos::UI::SuperWeaponSidebar_Max;
const int cameoHarfInterval = (Phobos::UI::SuperWeaponSidebar_CameoHeight - cameoHeight) / 2;
int location_Y = (DSurface::ViewBounds().Height - std::min(buttonCount, maximum) * Phobos::UI::SuperWeaponSidebar_CameoHeight) / 2;
Point2D location = { Phobos::UI::SuperWeaponSidebar_LeftOffset, location_Y };
location_Y -= cameoHarfInterval;
Point2D location = { Phobos::UI::SuperWeaponSidebar_LeftOffset, location_Y + cameoHarfInterval };
int rowIdx = 0, columnIdx = 0;

for (const auto button : vec_Buttons)
{
const auto column = columns[columnIdx];

if (rowIdx == 0)
column->SetPosition(location.X - Phobos::UI::SuperWeaponSidebar_LeftOffset, location.Y - (SideExt::ExtMap.Find(SideClass::Array->Items[ScenarioClass::Instance->PlayerSideIndex])->SuperWeaponSidebar_TopPCX.GetSurface() ? 20 : 0));
{
const auto pTopPCX = SideExt::ExtMap.Find(SideClass::Array->Items[ScenarioClass::Instance->PlayerSideIndex])->SuperWeaponSidebar_TopPCX.GetSurface();
column->SetPosition(location.X - Phobos::UI::SuperWeaponSidebar_LeftOffset, location_Y - (pTopPCX ? pTopPCX->GetHeight() : 0));
}

column->Buttons.emplace_back(button);
button->SetColumn(columnIdx);
Expand Down

0 comments on commit 509fad8

Please sign in to comment.