Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

bug: CollectionSettings do not trigger a value listener #2200

Open
5HT2 opened this issue Apr 19, 2021 · 3 comments
Open

bug: CollectionSettings do not trigger a value listener #2200

5HT2 opened this issue Apr 19, 2021 · 3 comments
Milestone

Comments

@5HT2
Copy link
Member

5HT2 commented Apr 19, 2021

Code example:

        visibleList.listeners.add {
            MessageSendHelper.sendRawChatMessage(visibleList.value.toString())
            mc.renderGlobal.loadRenderers()
        }     

This code is never triggered when calling visibleList.add(), or something similar.

You also cannot do visibleList.value = someNewList due to value being a val.

@5HT2 5HT2 added this to the 2.05.01 milestone Apr 19, 2021
@5HT2
Copy link
Member Author

5HT2 commented Apr 19, 2021

Here (

) is the gremlin responsible. It assumes you're always setting the value by doing setting.value = something, which clearly isn't the case for a Collection

@5HT2
Copy link
Member Author

5HT2 commented Apr 19, 2021

Theoretically the valueListeners should also work for this as well, when this is fixed

@5HT2
Copy link
Member Author

5HT2 commented Apr 19, 2021

A temporary workaround has been added to CollectionSetting by #2186, I don't know of a better way of doing it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant