OpenRCT2 does not allow image updates for `WindowWidgetType::ImgBtn`
Closed this issue · 1 comments
mrmagic2020 commented
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 not WindowWidgetType::ImgBtn
.
Seen here:
OpenRCT2/src/openrct2-ui/scripting/ScWidget.hpp
Lines 502 to 524 in ba9c84f
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 anonClick
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
tofalse
. Now the image updates on each click.
Attachments
No response
Basssiiie commented
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.