From 32ed83263d5276f61968af77863163506d3b165d Mon Sep 17 00:00:00 2001 From: 1ForeverHD Date: Sat, 13 Feb 2021 18:27:28 +0000 Subject: [PATCH] Added icon:setProperty --- src/Icon/init.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Icon/init.lua b/src/Icon/init.lua index 3d9ec85..ecd437d 100644 --- a/src/Icon/init.lua +++ b/src/Icon/init.lua @@ -74,6 +74,14 @@ icon:setName(string) ``` Associates the given name to the icon which enables it to be retrieved with ``IconController.getIcon(name)``. +---- +#### setProperty +{chainable} +```lua +icon:setProperty(propertyName, value) +``` +An alternative way of doing ``zone[propertyName] = value``. This enables the easy-configuration of icon properties within chained methods. + ---- #### select {chainable} @@ -1360,6 +1368,11 @@ function Icon:setName(string) return self end +function Icon:setProperty(propertyName, value) + self[propertyName] = value + return self +end + function Icon:_playClickSound() local clickSound = self.instances.clickSound if clickSound.SoundId ~= nil and #clickSound.SoundId > 0 and clickSound.Volume > 0 then