forked from rosebudai/OpenRCT2-Web
Rework WindowDropdownShowImage to take ScreenCoordsXY&
This commit is contained in:
1 parent
36aa64b75b
commit
ed14f44bf0
4 files changed
+10
-10
No files matched your search
@@ -52,8 +52,8 @@ namespace OpenRCT2::Ui::Windows
|
||||
std::span<const Dropdown::Item> items, int32_t width, size_t prefRowsPerColumn = 0);
|
||||
|
||||
void WindowDropdownShowImage(
|
||||
int32_t x, int32_t y, int32_t extray, ColourWithFlags colour, uint8_t flags, int32_t numItems, int32_t itemWidth,
|
||||
int32_t itemHeight, int32_t numColumns);
|
||||
const ScreenCoordsXY& screenPos, int32_t extray, ColourWithFlags colour, uint8_t flags, int32_t numItems,
|
||||
int32_t itemWidth, int32_t itemHeight, int32_t numColumns);
|
||||
|
||||
void WindowDropdownClose();
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ void LandTool::ShowSurfaceStyleDropdown(WindowBase* w, Widget* widget, ObjectEnt
|
||||
uint32_t surfaceCount = itemIndex;
|
||||
|
||||
WindowDropdownShowImage(
|
||||
w->windowPos.x + widget->left, w->windowPos.y + widget->top, widget->height() - 1, w->colours[2], 0, surfaceCount, 47,
|
||||
w->windowPos + ScreenCoordsXY{ widget->left, widget->top }, widget->height() - 1, w->colours[2], 0, surfaceCount, 47,
|
||||
36, DropdownGetAppropriateImageDropdownItemsPerRow(surfaceCount));
|
||||
|
||||
gDropdown.hasTooltips = true;
|
||||
@@ -129,7 +129,7 @@ void LandTool::ShowEdgeStyleDropdown(WindowBase* w, Widget* widget, ObjectEntryI
|
||||
auto itemsPerRow = DropdownGetAppropriateImageDropdownItemsPerRow(edgeCount);
|
||||
|
||||
WindowDropdownShowImage(
|
||||
w->windowPos.x + widget->left, w->windowPos.y + widget->top, widget->height() - 1, w->colours[2], 0, edgeCount, 47, 36,
|
||||
w->windowPos + ScreenCoordsXY{ widget->left, widget->top }, widget->height() - 1, w->colours[2], 0, edgeCount, 47, 36,
|
||||
itemsPerRow);
|
||||
|
||||
gDropdown.hasTooltips = true;
|
||||
|
||||
@@ -443,8 +443,8 @@ namespace OpenRCT2::Ui::Windows
|
||||
* @param numColumns (bl)
|
||||
*/
|
||||
void WindowDropdownShowImage(
|
||||
int32_t x, int32_t y, int32_t extray, ColourWithFlags colour, uint8_t flags, int32_t numItems, int32_t itemWidth,
|
||||
int32_t itemHeight, int32_t numColumns)
|
||||
const ScreenCoordsXY& screenPos, int32_t extray, ColourWithFlags colour, uint8_t flags, int32_t numItems,
|
||||
int32_t itemWidth, int32_t itemHeight, int32_t numColumns)
|
||||
{
|
||||
gInputFlags.unset(InputFlag::dropdownStayOpen, InputFlag::dropdownMouseUp);
|
||||
if (flags & Dropdown::Flag::StayOpen || Config::Get().interface.touchEnhancements)
|
||||
@@ -458,7 +458,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
auto* w = windowMgr->Create<DropdownWindow>(WindowClass::dropdown, { itemWidth, itemHeight }, WindowFlag::stickToFront);
|
||||
if (w != nullptr)
|
||||
{
|
||||
w->setImageItems({ x, y }, extray, colour, numItems, itemWidth, itemHeight, numColumns);
|
||||
w->setImageItems(screenPos, extray, colour, numItems, itemWidth, itemHeight, numColumns);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -616,7 +616,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
// Show dropdown
|
||||
auto squareSize = DropdownWindow::GetDefaultRowHeight();
|
||||
WindowDropdownShowImage(
|
||||
w->windowPos.x + widget->left, w->windowPos.y + widget->top, widget->height(), dropdownColour,
|
||||
w->windowPos + ScreenCoordsXY{ widget->left, widget->top }, widget->height(), dropdownColour,
|
||||
Dropdown::Flag::StayOpen, numColours, squareSize, squareSize,
|
||||
DropdownGetAppropriateImageDropdownItemsPerRow(static_cast<uint32_t>(numColours)));
|
||||
|
||||
|
||||
@@ -820,7 +820,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
auto itemsPerRow = DropdownGetAppropriateImageDropdownItemsPerRow(numPathTypes);
|
||||
WindowDropdownShowImage(
|
||||
windowPos.x + widget->left, windowPos.y + widget->top, widget->height(), colours[1], 0, numPathTypes, 47, 36,
|
||||
windowPos + ScreenCoordsXY{ widget->left, widget->top }, widget->height(), colours[1], 0, numPathTypes, 47, 36,
|
||||
itemsPerRow);
|
||||
|
||||
gDropdown.hasTooltips = true;
|
||||
@@ -856,7 +856,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
auto itemsPerRow = DropdownGetAppropriateImageDropdownItemsPerRow(numRailingsTypes);
|
||||
WindowDropdownShowImage(
|
||||
windowPos.x + widget->left, windowPos.y + widget->top, widget->height(), colours[1], 0, numRailingsTypes, 47,
|
||||
windowPos + ScreenCoordsXY{ widget->left, widget->top }, widget->height(), colours[1], 0, numRailingsTypes, 47,
|
||||
36, itemsPerRow);
|
||||
|
||||
gDropdown.hasTooltips = true;
|
||||
|
||||
Reference in new issue
Block a user