1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-18 19:33:33 +08:00

Fix: Modified settings are still retained and written to file in the next update (#737)

This commit is contained in:
LmeSzinc
2021-11-12 22:19:25 +08:00
parent f7035922fc
commit f8d6848d84
2 changed files with 4 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ class CampaignRun(UI):
'please check for update, or make map files yourself using dev_tools/map_extractor.py') 'please check for update, or make map files yourself using dev_tools/map_extractor.py')
raise RequestHumanTakeover raise RequestHumanTakeover
config = copy.copy(self.config).merge(self.module.Config()) config = copy.deepcopy(self.config).merge(self.module.Config())
device = self.device device = self.device
self.campaign = self.module.Campaign(config=config, device=device) self.campaign = self.module.Campaign(config=config, device=device)

View File

@@ -97,7 +97,7 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig):
# Bind arguments # Bind arguments
visited = set() visited = set()
self.bound = {} self.bound.clear()
for func in func_set: for func in func_set:
func_data = self.data.get(func, {}) func_data = self.data.get(func, {})
for group, group_data in func_data.items(): for group, group_data in func_data.items():
@@ -193,7 +193,8 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig):
deep_set(self.data, keys=path, value=value) deep_set(self.data, keys=path, value=value)
logger.info(f'Save config {filepath_config(self.config_name)}, {dict_to_kv(self.modified)}') logger.info(f'Save config {filepath_config(self.config_name)}, {dict_to_kv(self.modified)}')
self.modified = {} # Don't use self.modified = {}, that will create a new object.
self.modified.clear()
write_file(filepath_config(self.config_name), data=self.data) write_file(filepath_config(self.config_name), data=self.data)
def update(self): def update(self):