Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend setData function #11

Open
zaytri opened this issue Dec 6, 2023 · 0 comments
Open

Extend setData function #11

zaytri opened this issue Dec 6, 2023 · 0 comments
Assignees
Labels
core slime2 core updates
Milestone

Comments

@zaytri
Copy link
Owner

zaytri commented Dec 6, 2023

Currently the slime2.widget.setData() function is just meant to be used by the saved widget data file, and so it can only set the values for all the widget settings data.

However, I and another developer have already been testing out ways of loading themes by changing some of those setting values. While they can be manipulated directly, it's not recommended to do that, but it somehow works even though it takes a bit of time to load the new value.

setData() can currently be used if getData() is used, manipulating a copy of that data, and inserting that into setData(). It works, but also gets tricky trying to deep copy data. But it does make the data changes instant, which is the goal.

By exposing how individual values are updated, or even an entire group of values, widget developers don't need to worry about deep copying the data, as that will be handled by the slime2 core itself (like it already does).

The new setData() will have 3 different versions, similar to getData()

  • setData(values) (the current version)
  • setData(groupId, values)
  • setData(groupId, valueId, value)
@zaytri zaytri added the enhancement New feature or request label Dec 6, 2023
@zaytri zaytri self-assigned this Dec 6, 2023
@zaytri zaytri added this to the v1.2 milestone Dec 14, 2023
@zaytri zaytri added core slime2 core updates and removed enhancement New feature or request labels Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core slime2 core updates
Projects
None yet
Development

No branches or pull requests

1 participant