From c402d3e047a9cc80327698c3dc81f62251e09ec4 Mon Sep 17 00:00:00 2001 From: LmeSzinc Date: Fri, 29 May 2020 17:08:43 +0800 Subject: [PATCH] Fix: Folder create when --enable_drop_screenshot disabled --- module/campaign/run.py | 10 ++++------ module/config/config.py | 9 ++++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/module/campaign/run.py b/module/campaign/run.py index 5da149ef0..d997f6ab4 100644 --- a/module/campaign/run.py +++ b/module/campaign/run.py @@ -61,12 +61,10 @@ class CampaignRun(CampaignUI, Reward, LoginHandler): return True def campaign_name_set(self, name): - # self.config.CAMPAIGN_NAME = name - # folder = self.config.SCREEN_SHOT_SAVE_FOLDER_BASE + '/' + name - # if not os.path.exists(folder): - # os.mkdir(folder) - # self.config.SCREEN_SHOT_SAVE_FOLDER = folder - + if not self.campaign.config.ENABLE_SAVE_GET_ITEMS \ + or not len(self.campaign.config.SCREEN_SHOT_SAVE_FOLDER_BASE.strip()): + return False + # Create folder to save drop screenshot folder = self.campaign.config.SCREEN_SHOT_SAVE_FOLDER_BASE + '/' + name if not os.path.exists(folder): os.mkdir(folder) diff --git a/module/config/config.py b/module/config/config.py index 96df186ff..5d7e74a34 100644 --- a/module/config/config.py +++ b/module/config/config.py @@ -340,11 +340,14 @@ class AzurLaneConfig: C124_AMMO_PICK_UP = 3 def create_folder(self): - self.SCREEN_SHOT_SAVE_FOLDER = self.SCREEN_SHOT_SAVE_FOLDER_BASE + '/' + self.CAMPAIGN_NAME - for folder in [self.SCREEN_SHOT_SAVE_FOLDER_BASE, self.ASSETS_FOLDER, self.SCREEN_SHOT_SAVE_FOLDER, - self.PERSPECTIVE_ERROR_LOG_FOLDER, self.ERROR_LOG_FOLDER]: + for folder in [self.ASSETS_FOLDER, self.PERSPECTIVE_ERROR_LOG_FOLDER, self.ERROR_LOG_FOLDER]: if folder and not os.path.exists(folder): os.mkdir(folder) + self.SCREEN_SHOT_SAVE_FOLDER = self.SCREEN_SHOT_SAVE_FOLDER_BASE + '/' + self.CAMPAIGN_NAME + if self.ENABLE_SAVE_GET_ITEMS and len(self.SCREEN_SHOT_SAVE_FOLDER_BASE.strip()): + for folder in [self.SCREEN_SHOT_SAVE_FOLDER_BASE, self.SCREEN_SHOT_SAVE_FOLDER]: + if folder and not os.path.exists(folder): + os.mkdir(folder) def merge(self, other): """