✨ Fully converted to slash commands
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
import math
|
||||
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
from funcs import logThis
|
||||
|
||||
class drawConnectFour():
|
||||
def __init__(self,bot):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
# Draws the whole thing
|
||||
def drawImage(self, channel):
|
||||
logThis("Drawing connect four board")
|
||||
self.bot.log("Drawing connect four board", level = 10)
|
||||
game = self.bot.database["connect 4 games"].find_one({"_id":channel})
|
||||
|
||||
board = game["board"]
|
||||
@@ -34,7 +33,7 @@ class drawConnectFour():
|
||||
white = (255,255,255,160)
|
||||
winBarColor = (250,250,250,255)
|
||||
|
||||
fnt = ImageFont.truetype('resources/futura-bold.ttf', exampleCircles)
|
||||
fnt = ImageFont.truetype('resources/fonts/futura-bold.ttf', exampleCircles)
|
||||
|
||||
boardSize = [w-(2*(border+gridBorder)),h-(2*(border+gridBorder))]
|
||||
placeGridSize = [math.floor(boardSize[0]/7),math.floor(boardSize[1]/6)]
|
||||
@@ -44,12 +43,12 @@ class drawConnectFour():
|
||||
if game["players"][0] == "Gwendolyn":
|
||||
player1 = "Gwendolyn"
|
||||
else:
|
||||
player1 = self.bot.funcs.getName(game["players"][0])
|
||||
player1 = self.bot.databaseFuncs.getName(game["players"][0])
|
||||
|
||||
if game["players"][1] == "Gwendolyn":
|
||||
player2 = "Gwendolyn"
|
||||
else:
|
||||
player2 = self.bot.funcs.getName(game["players"][1])
|
||||
player2 = self.bot.databaseFuncs.getName(game["players"][1])
|
||||
|
||||
|
||||
background = Image.new("RGB", (w,h+bottomBorder),backgroundColor)
|
||||
|
||||
Reference in New Issue
Block a user