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:
@@ -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)
|
||||
------------------------------------------------------------------------
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user