2021-01-06 08:28:28 +08: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
|
2023-07-02 15:24:40 +08:00
|
|
|
from module.ui.page import page_guild, page_main
|
2021-01-20 22:21:55 +08:00
|
|
|
|
2021-01-17 04:36:44 +08:00
|
|
|
|
2021-01-06 08:28:28 +08:00
|
|
|
class RewardGuild(GuildLobby, GuildLogistics, GuildOperations):
|
2021-09-21 00:56:33 +08:00
|
|
|
def run(self):
|
2021-01-06 05:14:35 +08: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-06 05:14:35 +08:00
|
|
|
"""
|
2021-09-25 23:29:10 +08:00
|
|
|
if not self.config.GuildLogistics_Enable and not self.config.GuildOperation_Enable:
|
2021-09-21 00:56:33 +08:00
|
|
|
self.config.Scheduler_Enable = False
|
|
|
|
self.config.task_stop()
|
2021-01-06 05:14:35 +08: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-25 23:29:10 +08:00
|
|
|
if self.config.GuildLogistics_Enable:
|
2021-09-21 00:56:33 +08:00
|
|
|
success &= self.guild_logistics()
|
2021-01-20 22:21:55 +08:00
|
|
|
|
2021-01-19 00:20:08 +08:00
|
|
|
# Operation
|
2021-09-25 23:29:10 +08:00
|
|
|
if self.config.GuildOperation_Enable:
|
2021-09-21 00:56:33 +08:00
|
|
|
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)
|