1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 00:04:43 +01:00

Fix #22007: Cannot update image of ImgButton from plugins

This commit is contained in:
Harry Hopkinson
2024-05-11 12:32:14 +01:00
committed by GitHub
parent b0a3888d4d
commit bda383c236
2 changed files with 3 additions and 2 deletions

View File

@@ -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)
------------------------------------------------------------------------

View File

@@ -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();