diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 7327a6a4bd83..9ad978df5427 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -9,6 +9,7 @@ - Change: [#7248] Small mini-maps are now centred in the map window. - Fix: [#13294] Map corners are cut off in some directions (original bug). - Fix: [#21974] No reason specified when attempting to place benches, lamps, or bins on path with no unconnected edges (original bug). +- Fix: [#22012] [Plugin] Images on ImgButton widgets cannot be updated. 0.4.11 (2024-05-05) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/scripting/ScWidget.hpp b/src/openrct2-ui/scripting/ScWidget.hpp index 80759bd78141..5ffa194999a2 100644 --- a/src/openrct2-ui/scripting/ScWidget.hpp +++ b/src/openrct2-ui/scripting/ScWidget.hpp @@ -502,7 +502,7 @@ namespace OpenRCT2::Scripting uint32_t image_get() const { auto widget = GetWidget(); - if (widget != nullptr && widget->type == WindowWidgetType::FlatBtn) + if (widget != nullptr && (widget->type == WindowWidgetType::FlatBtn || widget->type == WindowWidgetType::ImgBtn)) { if (GetTargetAPIVersion() <= API_VERSION_63_G2_REORDER) { @@ -516,7 +516,7 @@ namespace OpenRCT2::Scripting void image_set(DukValue value) { auto widget = GetWidget(); - if (widget != nullptr && widget->type == WindowWidgetType::FlatBtn) + if (widget != nullptr && (widget->type == WindowWidgetType::FlatBtn || widget->type == WindowWidgetType::ImgBtn)) { widget->image = ImageId(ImageFromDuk(value)); Invalidate();