diff --git a/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/de.json b/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/de.json index b0bbdb6..11d27b4 100644 --- a/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/de.json +++ b/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/de.json @@ -2,6 +2,7 @@ "operation": { "img-generate": { "layers": [ + {"type": "color", "color": [0, 0, 0]}, {"type": "image", "image_path": "files/Boot/Strap/bootscreen-base.png"}, {"type": "text", "x": 0.01, "y": 0.00, "text": "Mario Kart Wii - Faraphel", "font_size": 0.04, "color": [100, 100, 100], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"}, {"type": "text", "x": 0.10, "y": 0.06, "text": "Elke track heeft een score tussen 1 en 5 sterren", "font_size": 0.045, "color": [255, 180, 0], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"}, diff --git a/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/en.json b/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/en.json index 62d504a..6f633e7 100644 --- a/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/en.json +++ b/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/en.json @@ -2,6 +2,7 @@ "operation": { "img-generate": { "layers": [ + {"type": "color", "color": [0, 0, 0]}, {"type": "image", "image_path": "files/Boot/Strap/bootscreen-base.png"}, {"type": "text", "x": 0.01, "y": 0.00, "text": "Mario Kart Wii - Faraphel", "font_size": 0.04, "color": [100, 100, 100], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"}, {"type": "text", "x": 0.10, "y": 0.06, "text": "Every track has a score between 1 and 5 stars", "font_size": 0.045, "color": [255, 180, 0], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"}, diff --git a/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/es.json b/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/es.json index 12bc115..7311db4 100644 --- a/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/es.json +++ b/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/es.json @@ -2,6 +2,7 @@ "operation": { "img-generate": { "layers": [ + {"type": "color", "color": [0, 0, 0]}, {"type": "image", "image_path": "files/Boot/Strap/bootscreen-base.png"}, {"type": "text", "x": 0.01, "y": 0.00, "text": "Mario Kart Wii - Faraphel", "font_size": 0.04, "color": [100, 100, 100], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"}, {"type": "text", "x": 0.10, "y": 0.06, "text": "Cada pista tiene una puntuación entre 1 y 5 estrellas", "font_size": 0.045, "color": [255, 180, 0], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"}, diff --git a/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/fr.json b/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/fr.json index ec81a65..aaee405 100644 --- a/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/fr.json +++ b/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/fr.json @@ -2,6 +2,7 @@ "operation": { "img-generate": { "layers": [ + {"type": "color", "color": [0, 0, 0]}, {"type": "image", "image_path": "files/Boot/Strap/bootscreen-base.png"}, {"type": "text", "x": 0.01, "y": 0.00, "text": "Mario Kart Wii - Faraphel", "font_size": 0.04, "color": [100, 100, 100], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"}, {"type": "text", "x": 0.10, "y": 0.06, "text": "Chaque course possède une note allant de 1 à 5 étoiles", "font_size": 0.045, "color": [255, 180, 0], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"}, diff --git a/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/ge.json b/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/ge.json index e3bb11a..ba6af18 100644 --- a/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/ge.json +++ b/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/ge.json @@ -2,6 +2,7 @@ "operation": { "img-generate": { "layers": [ + {"type": "color", "color": [0, 0, 0]}, {"type": "image", "image_path": "files/Boot/Strap/bootscreen-base.png"}, {"type": "text", "x": 0.01, "y": 0.00, "text": "Mario Kart Wii - Faraphel", "font_size": 0.04, "color": [100, 100, 100], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"}, {"type": "text", "x": 0.10, "y": 0.06, "text": "Jeder track hat eine Punktzahl zwischen 1 und 5 sternen", "font_size": 0.045, "color": [255, 180, 0], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"}, diff --git a/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/it.json b/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/it.json index 2ed0ad3..42201e8 100644 --- a/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/it.json +++ b/Pack/MKWFaraphel/specific/_PATCH/files/Boot/Strap/it.json @@ -2,6 +2,7 @@ "operation": { "img-generate": { "layers": [ + {"type": "color", "color": [0, 0, 0]}, {"type": "image", "image_path": "files/Boot/Strap/bootscreen-base.png"}, {"type": "text", "x": 0.01, "y": 0.00, "text": "Mario Kart Wii - Faraphel", "font_size": 0.04, "color": [100, 100, 100], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"}, {"type": "text", "x": 0.10, "y": 0.06, "text": "Ogni traccia ha un punteggio compreso tra 1 e 5 stelle", "font_size": 0.045, "color": [255, 180, 0], "font_path": "files/Boot/Strap/CenturyGothicBold.ttf"}, diff --git a/source/mkw/Patch/PatchOperation.py b/source/mkw/Patch/PatchOperation.py index 84654ee..7db6708 100644 --- a/source/mkw/Patch/PatchOperation.py +++ b/source/mkw/Patch/PatchOperation.py @@ -118,12 +118,11 @@ class PatchOperation: type = "color" def __init__(self, color: tuple[int] = (0,), x1: int | float = 0, y1: int | float = 0, - x2: int | float = 1, - y2: int | float = 1): - self.x1: int = x1 - self.y1: int = y1 - self.x2: int = x2 - self.y2: int = y2 + x2: int | float = 1.0, y2: int | float = 1.0): + self.x1: int | float = x1 + self.y1: int | float = y1 + self.x2: int | float = x2 + self.y2: int | float = y2 self.color: tuple[int] = tuple(color) def patch_image(self, patch: "Patch", image: Image.Image): @@ -138,12 +137,12 @@ class PatchOperation: """ type = "image" - def __init__(self, image_path: str, x1: int | float = 0, y1: int | float = 0, x2: int | float = 1, - y2: int | float = 1): - self.x1: int = x1 - self.y1: int = y1 - self.x2: int = x2 - self.y2: int = y2 + def __init__(self, image_path: str, x1: int | float = 0, y1: int | float = 0, + x2: int | float = 1.0, y2: int | float = 1.0): + self.x1: int | float = x1 + self.y1: int | float = y1 + self.x2: int | float = x2 + self.y2: int | float = y2 self.image_path: str = image_path def patch_image(self, patch: "Patch", image: Image.Image) -> Image.Image: @@ -152,7 +151,13 @@ class PatchOperation: if not layer_image_path.is_relative_to(patch.path): raise PathOutsidePatch(layer_image_path, patch.path) - layer_image = Image.open(layer_image_path).resize(self.get_bbox_size(image)).convert("RGBA") + layer_image = Image.open( + layer_image_path.resolve() + ).resize( + self.get_bbox_size(image) + ).convert( + "RGBA" + ) image.paste( layer_image,