MrEliptik / godot_twitch_games

Collection of small chat interactive games for Twitch
https://bento.me/mreliptik
MIT License
16 stars 5 forks source link

game settings system #73

Closed Drathal closed 10 months ago

Drathal commented 10 months ago

this closes #56

A simple way to save settings for every game and the games launcher.

I tried to save settings when the windows is moved, resized or closed with events but could not find the right events. So I added a line so save the settings when the esc key is hit.

MrEliptik commented 10 months ago

Shouldn't the config manager be a singleton? I guess it would be easier to access. Also you can use the following to do something before the game quits

func _notification(what: int) -> void:
    if what == NOTIFICATION_WM_CLOSE_REQUEST:
        # Do stuff
        get_tree().quit()
Drathal commented 10 months ago

Ahhhh thanks for the code snippet. I will take a look.

Drathal commented 10 months ago

@MrEliptik i worked on the _notification stuff for a while.

Conclusion

If i had a wish :D I would like to merge that PR as is. And then i create follow up tickets:

Long story short: I would love to iterate over it and not have one big PR.

MrEliptik commented 10 months ago

I'm not sure what you mean by ugly stuff? I just tried getting the NOTIFICATION_WM_CLOSE_REQUEST notification in the main branch and it worked fine?

In the end it's just one line less but I feel like it makes for sense in terms of architecture. Do you agree?

I agree, let's merge that and make other issues to tackle specific problems or improvements. I'll let you create the issues?