From e2024c6edd6352554df8c8a8a00f4754649af2be Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 3 Jan 2023 09:00:58 -0300 Subject: [PATCH] [lua] Add "properties" property to all objects with user data --- src/app/script/cel_class.cpp | 3 ++- src/app/script/layer_class.cpp | 3 ++- src/app/script/slice_class.cpp | 3 ++- src/app/script/sprite_class.cpp | 4 ++-- src/app/script/tag_class.cpp | 3 ++- src/app/script/tileset_class.cpp | 3 ++- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/app/script/cel_class.cpp b/src/app/script/cel_class.cpp index 2215b6b5e..4e944828b 100644 --- a/src/app/script/cel_class.cpp +++ b/src/app/script/cel_class.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2018-2022 Igara Studio S.A. +// Copyright (C) 2018-2023 Igara Studio S.A. // Copyright (C) 2018 David Capello // // This program is distributed under the terms of @@ -160,6 +160,7 @@ const Property Cel_properties[] = { { "opacity", Cel_get_opacity, Cel_set_opacity }, { "color", UserData_get_color, UserData_set_color }, { "data", UserData_get_text, UserData_set_text }, + { "properties", UserData_get_properties, UserData_set_properties }, { nullptr, nullptr, nullptr } }; diff --git a/src/app/script/layer_class.cpp b/src/app/script/layer_class.cpp index b2c8b3eb6..9978e845b 100644 --- a/src/app/script/layer_class.cpp +++ b/src/app/script/layer_class.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2018-2022 Igara Studio S.A. +// Copyright (C) 2018-2023 Igara Studio S.A. // Copyright (C) 2018 David Capello // // This program is distributed under the terms of @@ -406,6 +406,7 @@ const Property Layer_properties[] = { { "cels", Layer_get_cels, nullptr }, { "color", UserData_get_color, UserData_set_color }, { "data", UserData_get_text, UserData_set_text }, + { "properties", UserData_get_properties, UserData_set_properties }, { "tileset", Layer_get_tileset, nullptr }, { nullptr, nullptr, nullptr } }; diff --git a/src/app/script/slice_class.cpp b/src/app/script/slice_class.cpp index 5aba49404..29aa88b46 100644 --- a/src/app/script/slice_class.cpp +++ b/src/app/script/slice_class.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2018-2022 Igara Studio S.A. +// Copyright (C) 2018-2023 Igara Studio S.A. // Copyright (C) 2018 David Capello // // This program is distributed under the terms of @@ -145,6 +145,7 @@ const Property Slice_properties[] = { { "pivot", Slice_get_pivot, Slice_set_pivot }, { "color", UserData_get_color, UserData_set_color }, { "data", UserData_get_text, UserData_set_text }, + { "properties", UserData_get_properties, UserData_set_properties }, { nullptr, nullptr, nullptr } }; diff --git a/src/app/script/sprite_class.cpp b/src/app/script/sprite_class.cpp index 7965babe7..69f236e84 100644 --- a/src/app/script/sprite_class.cpp +++ b/src/app/script/sprite_class.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2018-2022 Igara Studio S.A. +// Copyright (C) 2018-2023 Igara Studio S.A. // Copyright (C) 2015-2018 David Capello // // This program is distributed under the terms of @@ -882,7 +882,7 @@ const Property Sprite_properties[] = { { "gridBounds", Sprite_get_gridBounds, Sprite_set_gridBounds }, { "color", UserData_get_color, UserData_set_color }, { "data", UserData_get_text, UserData_set_text }, - { "properties", UserData_get_properties, nullptr }, + { "properties", UserData_get_properties, UserData_set_properties }, { "pixelRatio", Sprite_get_pixelRatio, Sprite_set_pixelRatio }, { "events", Sprite_get_events, nullptr }, { nullptr, nullptr, nullptr } diff --git a/src/app/script/tag_class.cpp b/src/app/script/tag_class.cpp index feed4ef40..d30768c96 100644 --- a/src/app/script/tag_class.cpp +++ b/src/app/script/tag_class.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2018-2022 Igara Studio S.A. +// Copyright (C) 2018-2023 Igara Studio S.A. // Copyright (C) 2018 David Capello // // This program is distributed under the terms of @@ -162,6 +162,7 @@ const Property Tag_properties[] = { { "repeats", Tag_get_repeats, Tag_set_repeats }, // Cannot be "repeat" because it's a Lua keyword { "color", UserData_get_color, UserData_set_color }, { "data", UserData_get_text, UserData_set_text }, + { "properties", UserData_get_properties, UserData_set_properties }, { nullptr, nullptr, nullptr } }; diff --git a/src/app/script/tileset_class.cpp b/src/app/script/tileset_class.cpp index 5a5b3b362..a5a93278e 100644 --- a/src/app/script/tileset_class.cpp +++ b/src/app/script/tileset_class.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2019-2022 Igara Studio S.A. +// Copyright (C) 2019-2023 Igara Studio S.A. // // This program is distributed under the terms of // the End-User License Agreement for Aseprite. @@ -100,6 +100,7 @@ const Property Tileset_properties[] = { { "baseIndex", Tileset_get_baseIndex, Tileset_set_baseIndex }, { "color", UserData_get_color, UserData_set_color }, { "data", UserData_get_text, UserData_set_text }, + { "properties", UserData_get_properties, UserData_set_properties }, { nullptr, nullptr, nullptr } };