More map maker WIP
This commit is contained in:
parent
dc8d314713
commit
42aab1e801
@ -14,27 +14,46 @@ from redbot.core.bot import Red
|
|||||||
from redbot.core.data_manager import bundled_data_path, cog_data_path
|
from redbot.core.data_manager import bundled_data_path, cog_data_path
|
||||||
|
|
||||||
|
|
||||||
# class StrList(commands.Converter):
|
class MapMaker(commands.Cog):
|
||||||
# async def convert(self, ctx, argument):
|
""""""
|
||||||
# x = argument.split()
|
def __init__(self, bot: Red):
|
||||||
#
|
super().__init__()
|
||||||
# out_ints = set()
|
self.bot = bot
|
||||||
# for a in x:
|
|
||||||
# if "-" in a:
|
self.config = Config.get_conf(
|
||||||
# splitted = a.split("-", 1)
|
self, identifier=77971127797107101114, force_registration=True
|
||||||
# first = int(splitted[0])
|
)
|
||||||
# last = int(splitted[1])
|
|
||||||
# add_range = {b for b in range(first, last+1)}
|
default_guild = {}
|
||||||
#
|
default_global = {}
|
||||||
# else:
|
self.config.register_guild(**default_guild)
|
||||||
# out_ints.add(int(a))
|
self.config.register_global(**default_global)
|
||||||
|
|
||||||
|
|
||||||
|
@commands.group()
|
||||||
|
async def mapmaker(self, ctx: commands.context):
|
||||||
|
"""
|
||||||
|
Base command for managing current maps or creating new ones
|
||||||
|
"""
|
||||||
|
if ctx.invoked_subcommand is None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
@mapmaker.command(name="upload")
|
||||||
|
async def _mapmaker_upload(self, ctx: commands.Context, map_path=""):
|
||||||
|
"""Load a map image to be modified. Upload one with this command or provide a path"""
|
||||||
|
message: discord.Message = ctx.message
|
||||||
|
if not message.attachments and not map_path:
|
||||||
|
await ctx.maybe_send_embed("Either upload an image with this command or provide a path to the image")
|
||||||
|
return
|
||||||
|
|
||||||
|
@mapmaker.command(name="load")
|
||||||
|
async def _mapmaker_load(self, ctx: commands.Context, map_name=""):
|
||||||
|
"""Load an existing map to be modified."""
|
||||||
|
|
||||||
|
|
||||||
class Conquest(commands.Cog):
|
class Conquest(commands.Cog):
|
||||||
"""
|
"""
|
||||||
Cog Description
|
Cog for
|
||||||
|
|
||||||
Less important information about the cog
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
default_zoom_json = {"enabled": False, "x": -1, "y": -1, "zoom": 1.0}
|
default_zoom_json = {"enabled": False, "x": -1, "y": -1, "zoom": 1.0}
|
||||||
@ -79,22 +98,6 @@ class Conquest(commands.Cog):
|
|||||||
self.ext = self.map_data["extension"]
|
self.ext = self.map_data["extension"]
|
||||||
self.ext_format = "JPEG" if self.ext.upper() == "JPG" else self.ext.upper()
|
self.ext_format = "JPEG" if self.ext.upper() == "JPG" else self.ext.upper()
|
||||||
|
|
||||||
@commands.group()
|
|
||||||
async def mapmaker(self, ctx: commands.context):
|
|
||||||
"""
|
|
||||||
Base command for managing current maps or creating new ones
|
|
||||||
"""
|
|
||||||
if ctx.invoked_subcommand is None:
|
|
||||||
pass
|
|
||||||
|
|
||||||
@mapmaker.command(name="load")
|
|
||||||
async def _mapmaker_load(self, ctx: commands.Context, map_path=""):
|
|
||||||
"""Load a map image to be modified. Upload one with this command or provide a path"""
|
|
||||||
message: discord.Message = ctx.message
|
|
||||||
if not message.attachments and not map_path:
|
|
||||||
await ctx.maybe_send_embed("Either upload an image with this command or provide a path to the image")
|
|
||||||
return
|
|
||||||
|
|
||||||
@commands.group()
|
@commands.group()
|
||||||
async def conquest(self, ctx: commands.Context):
|
async def conquest(self, ctx: commands.Context):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user