Open xesdoog opened 2 weeks ago
@xiaoxiao921 Do you have any ideas on how this could be implemented? I don't. The ticket wants access to the JSON file which is functionally useless, not only would it get overwritten within half a second with the main thread runs to serialize the settings to disk, but any change made to the file wouldn't be hoovered back up.
@xiaoxiao921 Do you have any ideas on how this could be implemented? I don't. The ticket wants access to the JSON file which is functionally useless, not only would it get overwritten within half a second with the main thread runs to serialize the settings to disk, but any change made to the file wouldn't be hoovered back up.
You're right. If I remember correctly, when I tried it in Python it worked fine when the menu was unloaded but gave me trouble when I attempted to change stuff in realtime, that's why I discarded the whole idea. Maybe we could have read-only privileges? Just to check the state of options then use command calls to enable/disable them.
Problem
When writing scripts, we often run into conflicts with options in the menu.
Solution
Give the Lua API access to the
settings.json
file.Reason
Having access to the settings file gives us the ability to check if a user has a conflicting option enabled and then act accordingly by either disabling it for them or notifying them about it. We can also write some preset themes for YimMenu. I did this in a personal Python project and it was nice but having it in Lua like a small theme editor script would be great although this is not the main reason for this request.
Additional context
No response