You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (widget != nullptr && widget->type == WindowWidgetType::FlatBtn)
{
if (GetTargetAPIVersion() <= API_VERSION_63_G2_REORDER)
{
returnLegacyIconIndex(widget->image.GetIndex());
}
return widget->image.GetIndex();
}
return0;
}
voidimage_set(DukValue value)
{
auto widget = GetWidget();
if (widget != nullptr && widget->type == WindowWidgetType::FlatBtn)
{
widget->image = ImageId(ImageFromDuk(value));
Invalidate();
}
}
Steps to reproduce
Using Basssiiie's FlexUI, create a button widget with properties border = true, image=compute(<store-containing-sprite-id>, value => return value), and an onClick callback function that changes the sprite ID on each click.
Load the plugin and click the button. The image does not update.
Close and reopen the window. Now the image is updated.
Change border to false. Now the image updates on each click.
Attachments
No response
The text was updated successfully, but these errors were encountered:
To add to this. It's not necessary to use FlexUI to reproduce the bug. You can also make a vanilla button widget with border: true, and then attempt to update it with findWidget("my-button").image = 5000;. 🙂 Furthermore, getting the image id will also always return 0 for buttons with a border.
Operating System
macOS 14.4.1 (23E224)
OpenRCT2 build
OpenRCT2, v0.4.11 (893392d on develop, DEBUG)
Base game
RollerCoaster Tycoon Classic
Area(s) with this issue?
This bug is a graphical glitch or error
Describe the issue
OpenRCT2 only allows button image updates for
WindowWidgetType::FlatBtn
but notWindowWidgetType::ImgBtn
.Seen here:
OpenRCT2/src/openrct2-ui/scripting/ScWidget.hpp
Lines 502 to 524 in ba9c84f
Steps to reproduce
border = true
,image=compute(<store-containing-sprite-id>, value => return value)
, and anonClick
callback function that changes the sprite ID on each click.border
tofalse
. Now the image updates on each click.Attachments
No response
The text was updated successfully, but these errors were encountered: