From 9353ae170719a39ee91ebc79ee9c6360255e5378 Mon Sep 17 00:00:00 2001 From: LmeSzinc Date: Wed, 3 Jun 2020 04:36:05 +0800 Subject: [PATCH] Optimize: Disable commission_time_limit by default - Faster ui click --- config/template.ini | 2 +- module/base/timer.py | 2 +- module/config/argparser.py | 2 +- module/config/argparser_en.py | 2 +- module/config/config.py | 5 ++++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/config/template.ini b/config/template.ini index 902af17c0..0d17427cd 100644 --- a/config/template.ini +++ b/config/template.ini @@ -65,7 +65,7 @@ enable_coin_reward = yes enable_mission_reward = yes enable_commission_reward = yes enable_tactical_reward = yes -commission_time_limit = 23:30 +commission_time_limit = 0 duration_shorter_than_2 = 11 duration_longer_than_6 = -11 expire_shorter_than_2 = 11 diff --git a/module/base/timer.py b/module/base/timer.py index ce3b6e2aa..d0a8a4da9 100644 --- a/module/base/timer.py +++ b/module/base/timer.py @@ -91,7 +91,7 @@ class Timer: self.limit = limit self.count = count self._current = 0 - self._reach_count = 0 + self._reach_count = count def start(self): if not self.started(): diff --git a/module/config/argparser.py b/module/config/argparser.py index 433dd3d09..ac85524f0 100644 --- a/module/config/argparser.py +++ b/module/config/argparser.py @@ -229,7 +229,7 @@ def main(ini_name=''): reward_commission = reward_parser.add_argument_group('委托设置', '') reward_commission.add_argument('--启用委托收获', default=default('--启用委托收获'), choices=['是', '否']) - reward_commission.add_argument('--委托时间限制', default=default('--委托时间限制'), help='忽略完成时间超过限制的委托, 格式: 23:30') + reward_commission.add_argument('--委托时间限制', default=default('--委托时间限制'), help='忽略完成时间超过限制的委托, 格式: 23:30, 不需要就填0') priority1 = reward_commission.add_argument_group('委托耗时优先级', '') priority1.add_argument('--委托耗时小于2h', default=default('--委托耗时小于2h'), help='') diff --git a/module/config/argparser_en.py b/module/config/argparser_en.py index bbaa56b13..ad53be009 100644 --- a/module/config/argparser_en.py +++ b/module/config/argparser_en.py @@ -227,7 +227,7 @@ def main(ini_name=''): reward_commission = reward_parser.add_argument_group('Commission settings', '') reward_commission.add_argument('--enable_commission_reward', default=default('--enable_commission_reward'), choices=['yes', 'no']) - reward_commission.add_argument('--commission_time_limit', default=default('--commission_time_limit'), help='Ignore orders whose completion time exceeds the limit, Format: 23:30') + reward_commission.add_argument('--commission_time_limit', default=default('--commission_time_limit'), help='Ignore orders whose completion time exceeds the limit, Format: 23:30. Fill in 0 if it is not needed') priority1 = reward_commission.add_argument_group('Commission priority by time duration', '') priority1.add_argument('--duration_shorter_than_2', default=default('--duration_shorter_than_2'), help='') diff --git a/module/config/config.py b/module/config/config.py index 1a4745407..e4efe1db3 100644 --- a/module/config/config.py +++ b/module/config/config.py @@ -462,7 +462,10 @@ class AzurLaneConfig: self.REWARD_INTERVAL = int(option['reward_interval']) for attr in ['enable_reward', 'enable_oil_reward', 'enable_coin_reward', 'enable_mission_reward', 'enable_commission_reward', 'enable_tactical_reward']: self.__setattr__(attr.upper(), to_bool(option[attr])) - self.COMMISSION_TIME_LIMIT = future_time(option['commission_time_limit']) + if not option['commission_time_limit'].isdigit(): + self.COMMISSION_TIME_LIMIT = future_time(option['commission_time_limit']) + else: + self.COMMISSION_TIME_LIMIT = 0 for attr in self.COMMISSION_PRIORITY.keys(): self.COMMISSION_PRIORITY[attr] = int(option[attr]) self.TACTICAL_NIGHT_RANGE = future_time_range(option['tactical_night_range'])