def drawBottles(canvas): currentBottles = [ ] gillywater = bottles.LiquidIngredients(canvas, "gillywater") leechJuice = bottles.LiquidIngredients(canvas, "leech juice") lilyVenom = bottles.LiquidIngredients(canvas, "lily venom") # bottles should only be placed in their original spots if they haven't been moved: if canvas.thingsMoved == False: # this is a problem when sizeChanged calls redraw gillywater.placeBottle(0, "left") leechJuice.placeBottle(0, "right") lilyVenom.placeBottle(1, "left") gillywater.drawBottle() leechJuice.drawBottle() lilyVenom.drawBottle() canvas.gillywater = gillywater canvas.leechJuice = leechJuice canvas.lilyVenom = lilyVenom currentBottles.append(gillywater) currentBottles.append(leechJuice) currentBottles.append(lilyVenom) canvas.currentBottles = currentBottles
def drawBottles(canvas): allIngredients = [] pineSap = bottles.LiquidIngredients(canvas, "pine sap") allIngredients.append(pineSap) roseDew = bottles.LiquidIngredients(canvas, "rose dew") allIngredients.append(roseDew) lilyVenom = bottles.LiquidIngredients(canvas, "lily venom") allIngredients.append(lilyVenom) fluxweedJuice = bottles.LiquidIngredients(canvas, "fluxweed juice") allIngredients.append(fluxweedJuice) pamplemousse = bottles.LiquidIngredients(canvas, "pamplemousse") allIngredients.append(pamplemousse) armadilloBile = bottles.LiquidIngredients(canvas, "armadillo bile") allIngredients.append(armadilloBile) gillywater = bottles.LiquidIngredients(canvas, "gillywater") allIngredients.append(gillywater) leechJuice = bottles.LiquidIngredients(canvas, "leech juice") allIngredients.append(leechJuice) recipe = canvas.recipe recipeIngredients = recipe.ingredients currentBottles = [] otherIngredients = [] for Bottle in allIngredients: if Bottle.ingredientName in recipe.ingredients: currentBottles.append(Bottle) else: otherIngredients.append(Bottle) random.shuffle(otherIngredients) while len(currentBottles) != 6: currentBottles.append(otherIngredients[0]) otherIngredients.pop(0) BottleCount = 0 place = "left" for Bottle in currentBottles: Bottle.placeBottle(BottleCount / 2, place) BottleCount += 1 if place == "left": place = "right" else: place = "left" for Bottle in currentBottles: Bottle.drawBottle() canvas.currentBottles = currentBottles
def drawBottles(canvas): currentBottles = [ ] # these ingredients should be retrieved from the recipes dictionary in the recipe module for the current recipe pineSap = bottles.LiquidIngredients(canvas, "pine sap") roseDew = bottles.LiquidIngredients(canvas, "rose dew") lilyVenom = bottles.LiquidIngredients(canvas, "lily venom") fluxweedJuice = bottles.LiquidIngredients(canvas, "fluxweed juice") pamplemousse = bottles.LiquidIngredients(canvas, "pamplemousse") armadilloBile = bottles.LiquidIngredients(canvas, "armadillo bile") # bottles should only be placed in their original spots if they haven't been moved: if canvas.thingsMoved == False: # this is a problem when sizeChanged calls redraw pineSap.placeBottle(0, "left") roseDew.placeBottle(0, "right") lilyVenom.placeBottle(1, "left") fluxweedJuice.placeBottle(1, "right") pamplemousse.placeBottle(2, "left") armadilloBile.placeBottle(2, "right") pineSap.drawBottle() roseDew.drawBottle() lilyVenom.drawBottle() fluxweedJuice.drawBottle() pamplemousse.drawBottle() armadilloBile.drawBottle() canvas.pineSap = pineSap canvas.roseDew = roseDew canvas.lilyVenom = lilyVenom canvas.fluxweedJuice = fluxweedJuice canvas.pamplemousse= pamplemousse canvas.armadilloBile = armadilloBile currentBottles.append(pineSap) currentBottles.append(roseDew) currentBottles.append(lilyVenom) currentBottles.append(fluxweedJuice) currentBottles.append(pamplemousse) currentBottles.append(armadilloBile) canvas.currentBottles = currentBottles