WIP conquest
This commit is contained in:
parent
7626bb6a76
commit
4cd033bf12
@ -67,7 +67,7 @@ class Conquest(commands.Cog):
|
|||||||
return
|
return
|
||||||
|
|
||||||
def _path_if_custom(self, custom_custom: bool = None) -> pathlib.Path:
|
def _path_if_custom(self, custom_custom: bool = None) -> pathlib.Path:
|
||||||
check_value = custom_custom if custom_custom is not None else self.is_custom
|
check_value = custom_custom # if custom_custom is not None else self.is_custom
|
||||||
if check_value:
|
if check_value:
|
||||||
return self.custom_map_path
|
return self.custom_map_path
|
||||||
return self.asset_path
|
return self.asset_path
|
||||||
@ -81,7 +81,6 @@ class Conquest(commands.Cog):
|
|||||||
game_name = await self.config.guild(guild).current_game()
|
game_name = await self.config.guild(guild).current_game()
|
||||||
if game_name is not None:
|
if game_name is not None:
|
||||||
await self.load_guild_data(guild, game_name)
|
await self.load_guild_data(guild, game_name)
|
||||||
self.is_custom = await self.config.is_custom()
|
|
||||||
|
|
||||||
if self.current_map:
|
if self.current_map:
|
||||||
await self.current_map_load()
|
await self.current_map_load()
|
||||||
@ -90,8 +89,10 @@ class Conquest(commands.Cog):
|
|||||||
game_name = await self.config.guild(guild).current_game()
|
game_name = await self.config.guild(guild).current_game()
|
||||||
if game_name is not None:
|
if game_name is not None:
|
||||||
map_data = self.config.games.get_raw(game_name)
|
map_data = self.config.games.get_raw(game_name)
|
||||||
|
map_name = map_data["map_name"]
|
||||||
|
map_path = self._path_if_custom(map_data["is_custom"]) / map_name
|
||||||
|
|
||||||
self.current_maps[guild.id] = ConquestGame()
|
self.current_maps[guild.id] = ConquestGame(map_path, map_name, self.current_map_folder / map_name)
|
||||||
|
|
||||||
async def current_map_load(self):
|
async def current_map_load(self):
|
||||||
map_path = self._path_if_custom()
|
map_path = self._path_if_custom()
|
||||||
|
@ -261,8 +261,8 @@ class ConquestMap:
|
|||||||
|
|
||||||
|
|
||||||
class ConquestGame(ConquestMap):
|
class ConquestGame(ConquestMap):
|
||||||
def __init__(self, path: pathlib.Path, game_name: str, custom_map_path: pathlib.Path):
|
def __init__(self, map_path: pathlib.Path, game_name: str, custom_map_path: pathlib.Path):
|
||||||
super().__init__(path)
|
super().__init__(map_path)
|
||||||
self.game_name = game_name
|
self.game_name = game_name
|
||||||
self.custom_map_path = custom_map_path
|
self.custom_map_path = custom_map_path
|
||||||
self.game_path = custom_map_path / game_name
|
self.game_path = custom_map_path / game_name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user