Skip to content

Commit

Permalink
settings overwrite functionality implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
karastoyanov committed Jul 26, 2023
1 parent 482531a commit dd5585d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions gui/settings_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def __init__(self):
save_settings_button.setText("Save Settings")
save_settings_button.setFont(QFont(fonts[0], 18))
save_settings_button.setFixedSize(300, 50)
save_settings_button.clicked.connect(lambda: save_settings())

back_button = QPushButton()
back_button.setText("Back to Main Menu")
Expand All @@ -149,8 +150,8 @@ def __init__(self):
self.show()

def save_settings():
pass

settings_handler.overwrite_game_settings(**{"fps":fps_menu.currentText(), "music":music_vol_slider.value(), "effects": effects_vol_slider.value()})
settings_handler.overwrite_user_settings(**{"username":user_name_textbox.text()})


app = QApplication(sys.argv)
Expand Down
4 changes: 2 additions & 2 deletions settings/game_settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"fps": "60",
"music": "40",
"effects": "30"
"music": 41,
"effects": 19
}
2 changes: 1 addition & 1 deletion settings/user_settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"username": "John Doe",
"username": "pesho",
"gold": "0",
"rank": "airman",
"levels_completed": "0",
Expand Down

0 comments on commit dd5585d

Please sign in to comment.