#28 Need to also save when using hotkeys.

开启中
ayyzee3 年之前创建 · 1 条评论
ayyzee 评论于 3 年之前

When changing a setting in the setting screen, the settings, are retained. But when changing them through hotkeys like [CTRL] + [F], they are not loaded back in the next session.

How do you save from another module?

in engine.py line 202 - 232

#      [CTRL]                             [+]
    if 65507 in game.current["keys"] and 65451 in game.current["keys"]:
        game.settings["pixels"] += 1
        #save_settings(game) <---
        game.current["keys"] = [] # Wiping the press

#      [CTRL]                             [-]
    if 65507 in game.current["keys"] and 65453 in game.current["keys"] and game.settings["pixels"] >1:
        game.settings["pixels"] -= 1
        #save_settings(game) <---
        game.current["keys"] = [] # Wiping the press

Can't use this save_settings(game) from this module.

When changing a setting in the setting screen, the settings, are retained. But when changing them through hotkeys like [CTRL] + [F], they are not loaded back in the next session. How do you save from another module? in `engine.py` line 202 - 232 ```python # [CTRL] [+] if 65507 in game.current["keys"] and 65451 in game.current["keys"]: game.settings["pixels"] += 1 #save_settings(game) <--- game.current["keys"] = [] # Wiping the press # [CTRL] [-] if 65507 in game.current["keys"] and 65453 in game.current["keys"] and game.settings["pixels"] >1: game.settings["pixels"] -= 1 #save_settings(game) <--- game.current["keys"] = [] # Wiping the press ``` Can't use this `save_settings(game)` from this module.

In settings there is a saver function. Look it up. You just need to run it I guess.

In settings there is a saver function. Look it up. You just need to run it I guess.
登录 并参与到对话中。
未选择里程碑
未指派成员
2 名参与者
正在加载...
取消
保存
这个人很懒,什么都没留下。