2021-01-05 19:28:28 -05:00
|
|
|
from module.guild.lobby import GuildLobby
|
2021-09-21 00:56:33 +08:00
|
|
|
from module.guild.logistics import GuildLogistics
|
|
|
|
|
from module.guild.operations import GuildOperations
|
|
|
|
|
from module.ui.ui import page_guild, page_main
|
2021-01-20 22:21:55 +08:00
|
|
|
|
2021-01-16 15:36:44 -05:00
|
|
|
|
2021-01-05 19:28:28 -05:00
|
|
|
class RewardGuild(GuildLobby, GuildLogistics, GuildOperations):
|
2021-09-21 00:56:33 +08:00
|
|
|
def run(self):
|
2021-01-05 16:14:35 -05:00
|
|
|
"""
|
|
|
|
|
ALAS handler function for guild reward loop
|
|
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
bool: If executed
|
2021-01-19 00:20:08 +08:00
|
|
|
|
|
|
|
|
Pages:
|
2021-01-20 22:21:55 +08:00
|
|
|
in: page_main
|
|
|
|
|
out: page_main
|
2021-01-05 16:14:35 -05:00
|
|
|
"""
|
2021-09-21 00:56:33 +08:00
|
|
|
if not self.config.Logistics_Enable and not self.config.Operation_Enable:
|
|
|
|
|
self.config.Scheduler_Enable = False
|
|
|
|
|
self.config.task_stop()
|
2021-01-05 16:14:35 -05:00
|
|
|
|
2021-01-19 00:20:08 +08:00
|
|
|
self.ui_ensure(page_guild)
|
2021-09-21 00:56:33 +08:00
|
|
|
success = True
|
2021-01-20 22:21:55 +08:00
|
|
|
|
2021-01-19 00:20:08 +08:00
|
|
|
# Lobby
|
|
|
|
|
self.guild_lobby()
|
2021-01-20 22:21:55 +08:00
|
|
|
|
2021-01-19 00:20:08 +08:00
|
|
|
# Logistics
|
2021-09-21 00:56:33 +08:00
|
|
|
if self.config.Logistics_Enable:
|
|
|
|
|
success &= self.guild_logistics()
|
2021-01-20 22:21:55 +08:00
|
|
|
|
2021-01-19 00:20:08 +08:00
|
|
|
# Operation
|
2021-09-21 00:56:33 +08:00
|
|
|
if self.config.Operation_Enable:
|
|
|
|
|
success &= self.guild_operations()
|
|
|
|
|
|
|
|
|
|
self.ui_goto(page_main)
|
2021-01-19 00:20:08 +08:00
|
|
|
|
2021-09-21 00:56:33 +08:00
|
|
|
# Scheduler
|
|
|
|
|
if success:
|
|
|
|
|
self.config.task_delay(server_update=True)
|
|
|
|
|
else:
|
|
|
|
|
self.config.task_delay(success=False, server_update=True)
|