Fix: Folder create when --enable_drop_screenshot disabled

This commit is contained in:
LmeSzinc 2020-05-29 17:08:43 +08:00
parent 3702b1c6da
commit c402d3e047
2 changed files with 10 additions and 9 deletions

View File

@ -61,12 +61,10 @@ class CampaignRun(CampaignUI, Reward, LoginHandler):
return True return True
def campaign_name_set(self, name): def campaign_name_set(self, name):
# self.config.CAMPAIGN_NAME = name if not self.campaign.config.ENABLE_SAVE_GET_ITEMS \
# folder = self.config.SCREEN_SHOT_SAVE_FOLDER_BASE + '/' + name or not len(self.campaign.config.SCREEN_SHOT_SAVE_FOLDER_BASE.strip()):
# if not os.path.exists(folder): return False
# os.mkdir(folder) # Create folder to save drop screenshot
# self.config.SCREEN_SHOT_SAVE_FOLDER = folder
folder = self.campaign.config.SCREEN_SHOT_SAVE_FOLDER_BASE + '/' + name folder = self.campaign.config.SCREEN_SHOT_SAVE_FOLDER_BASE + '/' + name
if not os.path.exists(folder): if not os.path.exists(folder):
os.mkdir(folder) os.mkdir(folder)

View File

@ -340,11 +340,14 @@ class AzurLaneConfig:
C124_AMMO_PICK_UP = 3 C124_AMMO_PICK_UP = 3
def create_folder(self): def create_folder(self):
self.SCREEN_SHOT_SAVE_FOLDER = self.SCREEN_SHOT_SAVE_FOLDER_BASE + '/' + self.CAMPAIGN_NAME for folder in [self.ASSETS_FOLDER, self.PERSPECTIVE_ERROR_LOG_FOLDER, self.ERROR_LOG_FOLDER]:
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]:
if folder and not os.path.exists(folder): if folder and not os.path.exists(folder):
os.mkdir(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): def merge(self, other):
""" """