Skip to content

Commit

Permalink
Properly save/load and apply play_sounds option
Browse files Browse the repository at this point in the history
This fixes #182
  • Loading branch information
TeamSpen210 committed Feb 8, 2016
1 parent c3c1a40 commit 8b30e0b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/BEE2.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if __name__ == '__main__':
# Initialise the logger, which ensures sys.stdout & stderr are availible
# This fixes a bug in multiprocessing. We don't want to reopen the logfile
# again though.
utils.init_logging()
LOGGER = utils.init_logging()

# Make multiprocessing work correctly when frozen.
# This must run immediately - in this case, multiprocessing overrides
Expand Down Expand Up @@ -50,7 +50,7 @@ DEFAULT_SETTINGS = {
'General': {
'preserve_BEE2_resource_dir': '0',
'allow_any_folder_as_game': '0',
'mute_sounds': '0',
'play_sounds': '1',
'show_wip_items': '0',
},
'Debug': {
Expand Down
4 changes: 4 additions & 0 deletions src/UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,10 @@ def init_windows():

optionWindow.reset_all_win = reset_panes

# Save and load to properly apply config settings.
optionWindow.load()
optionWindow.save()

TK_ROOT.deiconify() # show it once we've loaded everything
windows['pal'].deiconify()
windows['opt'].deiconify()
Expand Down
5 changes: 3 additions & 2 deletions src/optionWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ def make_checkbox(
if var is None:
var = BooleanVar(
value=default,
name='opt_'+section.casefold()+'_'+item,
name='opt_' + section.casefold() + '_' + item,
)
VARS[section, item] = var
else:
default = var.get()

VARS[section, item] = var

def save_opt():
"""Save the checkbox's values."""
GEN_OPTS[section][item] = utils.bool_as_int(
Expand Down

0 comments on commit 8b30e0b

Please sign in to comment.