#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명
로딩중...
취소
저장
아직 콘텐츠가 없습니다.