YimMenu / YimMenu

YimMenu, a GTA V menu protecting against a wide ranges of the public crashes and improving the overall experience.
https://yim.gta.menu
GNU General Public License v2.0
1.42k stars 1.19k forks source link

[Request]: Lua Access To YimMenu Settings #3658

Open xesdoog opened 2 weeks ago

xesdoog commented 2 weeks ago

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

gir489returns commented 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.

xesdoog commented 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.

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.