From dde5a134a5bb0a568cc89a721e2ac726a635bbd5 Mon Sep 17 00:00:00 2001 From: Faraphel Date: Sat, 9 Jul 2022 22:09:07 +0200 Subject: [PATCH] preparing bmg patch --- .../message/Common.bmg.json | 32 ++++---- .../specific/_PATCH/files/Scene/UI/en.json | 80 ++++++++++--------- .../specific/_PATCH/files/Scene/UI/es.json | 10 ++- .../specific/_PATCH/files/Scene/UI/fr.json | 80 ++++++++++--------- .../specific/_PATCH/files/Scene/UI/ge.json | 80 ++++++++++--------- .../specific/_PATCH/files/Scene/UI/it.json | 80 ++++++++++--------- source/mkw/Patch/PatchOperation.py | 9 ++- source/wt/bmg.py | 31 +++++++ source/wt/img.py | 4 +- 9 files changed, 227 insertions(+), 179 deletions(-) diff --git a/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/CommonLanguageMenu.d/message/Common.bmg.json b/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/CommonLanguageMenu.d/message/Common.bmg.json index f760722..2b97277 100644 --- a/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/CommonLanguageMenu.d/message/Common.bmg.json +++ b/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/CommonLanguageMenu.d/message/Common.bmg.json @@ -2,23 +2,25 @@ "mode": "edit", "operation": { - "bmg-edit": { - "mode": "regex", - "data": { - "CWF de Nintendo": "{{ONLINE_SERVICE}}", - "Wi-Fi Nintendo": "{{ONLINE_SERVICE}}", - "CWF Nintendo": "{{ONLINE_SERVICE}}", - "Nintendo WFC": "{{ONLINE_SERVICE}}", - "Wi-Fi": "{{ONLINE_SERVICE}}", - "インターネット": "{{ONLINE_SERVICE}}", + "bmg-edit": [ + { + "mode": "regex", + "data": { + "CWF de Nintendo": "{{ONLINE_SERVICE}}", + "Wi-Fi Nintendo": "{{ONLINE_SERVICE}}", + "CWF Nintendo": "{{ONLINE_SERVICE}}", + "Nintendo WFC": "{{ONLINE_SERVICE}}", + "Wi-Fi": "{{ONLINE_SERVICE}}", + "インターネット": "{{ONLINE_SERVICE}}", - "Menu principal": "{{MOD_NICKNAME}} {{MOD_VERSION}} {{MOD_CUSTOMIZED}}", - "Menú principal": "{{MOD_NICKNAME}} {{MOD_VERSION}} {{MOD_CUSTOMIZED}}", - "Main Menu": "{{MOD_NICKNAME}} {{MOD_VERSION}} {{MOD_CUSTOMIZED}}", - "トップメニュー": "{{MOD_NICKNAME}} {{MOD_VERSION}} {{MOD_CUSTOMIZED}}", + "Menu principal": "{{MOD_NICKNAME}} {{MOD_VERSION}} {{MOD_CUSTOMIZED}}", + "Menú principal": "{{MOD_NICKNAME}} {{MOD_VERSION}} {{MOD_CUSTOMIZED}}", + "Main Menu": "{{MOD_NICKNAME}} {{MOD_VERSION}} {{MOD_CUSTOMIZED}}", + "トップメニュー": "{{MOD_NICKNAME}} {{MOD_VERSION}} {{MOD_CUSTOMIZED}}", - "Mario Kart Wii": "{{MOD_NICKNAME}} {{MOD_VERSION}} {{MOD_CUSTOMIZED}}" + "Mario Kart Wii": "{{MOD_NICKNAME}} {{MOD_VERSION}} {{MOD_CUSTOMIZED}}" + } } - } + ] } } \ No newline at end of file diff --git a/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/en.json b/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/en.json index f859f15..cdab236 100644 --- a/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/en.json +++ b/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/en.json @@ -1,46 +1,48 @@ { "mode": "edit", "operation": { - "bmg-edit": { - "mode": "id", - "data": { - "0x703e": "\\c{white}Random: All tracks", - "0x703f": "\\c{white}Random: Original tracks", - "0x7040": "\\c{white}Random: Custom Tracks", - "0x7041": "\\c{white}Random: New tracks", + "bmg-edit": [ + { + "mode": "id", + "data": { + "0x703e": "\\c{white}Random: All tracks", + "0x703f": "\\c{white}Random: Original tracks", + "0x7040": "\\c{white}Random: Custom Tracks", + "0x7041": "\\c{white}Random: New tracks", - "M37": "\\c{YOR4}Reset options", - "M38": "\\c{YOR4}Vote : by players", - "M39": "\\c{YOR4}Vote : by host", - "M40": "\\c{YOR4}Blocking : reset", - "M41": "\\c{YOR4}Blocking : disable", - "M42": "\\c{YOR4}Blocking : enable", - "M43": "\\c{YOR4}Vehicle : all", - "M44": "\\c{YOR4}Vehicle : all weight", - "M45": "\\c{YOR4}Vehicle : light only", - "M46": "\\c{YOR4}Vehicle : all except light", - "M47": "\\c{YOR4}Vehicle : medium only", - "M48": "\\c{YOR4}Vehicle : all except medium", - "M49": "\\c{YOR4}Vehicle : heavy only", - "M50": "\\c{YOR4}Vehicle : all except heavy", - "M51": "\\c{YOR4}Vehicle : all type", - "M52": "\\c{YOR4}Vehicle : kart only", - "M53": "\\c{YOR4}Vehicle : bike only", - "M54": "\\c{YOR4}Engine : reset", - "M55": "\\c{YOR4}Engine : 100cc", - "M56": "\\c{YOR4}Engine : 150cc", - "M57": "\\c{YOR4}Engine : 150cc mirror", - "M58": "\\c{YOR4}Game : 1 race", - "M59": "\\c{YOR4}Game : 2 races", - "M60": "\\c{YOR4}Game : 4 races", - "M61": "\\c{YOR4}Game : 8 races", - "M62": "\\c{YOR4}Game : 12 races", - "M63": "\\c{YOR4}Game : 16 races", - "M64": "\\c{YOR4}Game : 24 races", - "M65": "\\c{YOR4}Game : 32 races", - "M66": "\\c{YOR4}Game : 48 races", - "M67": "\\c{YOR4}Game : 64 races" + "M37": "\\c{YOR4}Reset options", + "M38": "\\c{YOR4}Vote : by players", + "M39": "\\c{YOR4}Vote : by host", + "M40": "\\c{YOR4}Blocking : reset", + "M41": "\\c{YOR4}Blocking : disable", + "M42": "\\c{YOR4}Blocking : enable", + "M43": "\\c{YOR4}Vehicle : all", + "M44": "\\c{YOR4}Vehicle : all weight", + "M45": "\\c{YOR4}Vehicle : light only", + "M46": "\\c{YOR4}Vehicle : all except light", + "M47": "\\c{YOR4}Vehicle : medium only", + "M48": "\\c{YOR4}Vehicle : all except medium", + "M49": "\\c{YOR4}Vehicle : heavy only", + "M50": "\\c{YOR4}Vehicle : all except heavy", + "M51": "\\c{YOR4}Vehicle : all type", + "M52": "\\c{YOR4}Vehicle : kart only", + "M53": "\\c{YOR4}Vehicle : bike only", + "M54": "\\c{YOR4}Engine : reset", + "M55": "\\c{YOR4}Engine : 100cc", + "M56": "\\c{YOR4}Engine : 150cc", + "M57": "\\c{YOR4}Engine : 150cc mirror", + "M58": "\\c{YOR4}Game : 1 race", + "M59": "\\c{YOR4}Game : 2 races", + "M60": "\\c{YOR4}Game : 4 races", + "M61": "\\c{YOR4}Game : 8 races", + "M62": "\\c{YOR4}Game : 12 races", + "M63": "\\c{YOR4}Game : 16 races", + "M64": "\\c{YOR4}Game : 24 races", + "M65": "\\c{YOR4}Game : 32 races", + "M66": "\\c{YOR4}Game : 48 races", + "M67": "\\c{YOR4}Game : 64 races" + } } - } + ] } } \ No newline at end of file diff --git a/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/es.json b/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/es.json index 7cc8ba2..384fcbd 100644 --- a/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/es.json +++ b/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/es.json @@ -1,9 +1,10 @@ { "mode": "edit", "operation": { - "bmg-edit": { - "mode": "id", - "data": { + "bmg-edit": [ + { + "mode": "id", + "data": { "0x703e": "\\c{white}Aleatorio: Todas las pistas", "0x703f": "\\c{white}Aleatorio: Pistas originales", "0x7040": "\\c{white}Aleatorio: Custom Tracks", @@ -41,6 +42,7 @@ "M66": "\\c{YOR4}Partido : 48 pistas", "M67": "\\c{YOR4}Partido : 64 pistas" } - } + } + ] } } \ No newline at end of file diff --git a/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/fr.json b/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/fr.json index 34c9374..35f92c9 100644 --- a/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/fr.json +++ b/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/fr.json @@ -1,46 +1,48 @@ { "mode": "edit", "operation": { - "bmg-edit": { - "mode": "id", - "data": { - "0x703e": "\\c{white}Aléatoire: Toutes les pistes", - "0x703f": "\\c{white}Aléatoire: Pistes Originales", - "0x7040": "\\c{white}Aléatoire: Custom Tracks", - "0x7041": "\\c{white}Aléatoire: Nouvelles pistes", + "bmg-edit": [ + { + "mode": "id", + "data": { + "0x703e": "\\c{white}Aléatoire: Toutes les pistes", + "0x703f": "\\c{white}Aléatoire: Pistes Originales", + "0x7040": "\\c{white}Aléatoire: Custom Tracks", + "0x7041": "\\c{white}Aléatoire: Nouvelles pistes", - "M37": "\\c{YOR4}Réinitialiser les options", - "M38": "\\c{YOR4}Vote : par les joueurs", - "M39": "\\c{YOR4}Vote : par l'hôte", - "M40": "\\c{YOR4}Blocage : réinitialiser", - "M41": "\\c{YOR4}Blocage : désactiver", - "M42": "\\c{YOR4}Blocage : activer", - "M43": "\\c{YOR4}Véhicule : tout", - "M44": "\\c{YOR4}Véhicule : tout poids", - "M45": "\\c{YOR4}Véhicule : seulement léger", - "M46": "\\c{YOR4}Véhicule : tout sauf léger", - "M47": "\\c{YOR4}Véhicule : seulement moyen", - "M48": "\\c{YOR4}Véhicule : tout sauf moyen", - "M49": "\\c{YOR4}Véhicule : seulement lourd", - "M50": "\\c{YOR4}Véhicule : tout sauf lourd", - "M51": "\\c{YOR4}Véhicule : tout type", - "M52": "\\c{YOR4}Véhicule : seulement kart", - "M53": "\\c{YOR4}Véhicule : seulement moto", - "M54": "\\c{YOR4}Cylindrée : réinitialiser", - "M55": "\\c{YOR4}Cylindrée : 100cc", - "M56": "\\c{YOR4}Cylindrée : 150cc", - "M57": "\\c{YOR4}Cylindrée : 150cc mirroir", - "M58": "\\c{YOR4}Partie : 1 course", - "M59": "\\c{YOR4}Partie : 2 courses", - "M60": "\\c{YOR4}Partie : 4 courses", - "M61": "\\c{YOR4}Partie : 8 courses", - "M62": "\\c{YOR4}Partie : 12 courses", - "M63": "\\c{YOR4}Partie : 16 courses", - "M64": "\\c{YOR4}Partie : 24 courses", - "M65": "\\c{YOR4}Partie : 32 courses", - "M66": "\\c{YOR4}Partie : 48 courses", - "M67": "\\c{YOR4}Partie : 64 courses" + "M37": "\\c{YOR4}Réinitialiser les options", + "M38": "\\c{YOR4}Vote : par les joueurs", + "M39": "\\c{YOR4}Vote : par l'hôte", + "M40": "\\c{YOR4}Blocage : réinitialiser", + "M41": "\\c{YOR4}Blocage : désactiver", + "M42": "\\c{YOR4}Blocage : activer", + "M43": "\\c{YOR4}Véhicule : tout", + "M44": "\\c{YOR4}Véhicule : tout poids", + "M45": "\\c{YOR4}Véhicule : seulement léger", + "M46": "\\c{YOR4}Véhicule : tout sauf léger", + "M47": "\\c{YOR4}Véhicule : seulement moyen", + "M48": "\\c{YOR4}Véhicule : tout sauf moyen", + "M49": "\\c{YOR4}Véhicule : seulement lourd", + "M50": "\\c{YOR4}Véhicule : tout sauf lourd", + "M51": "\\c{YOR4}Véhicule : tout type", + "M52": "\\c{YOR4}Véhicule : seulement kart", + "M53": "\\c{YOR4}Véhicule : seulement moto", + "M54": "\\c{YOR4}Cylindrée : réinitialiser", + "M55": "\\c{YOR4}Cylindrée : 100cc", + "M56": "\\c{YOR4}Cylindrée : 150cc", + "M57": "\\c{YOR4}Cylindrée : 150cc mirroir", + "M58": "\\c{YOR4}Partie : 1 course", + "M59": "\\c{YOR4}Partie : 2 courses", + "M60": "\\c{YOR4}Partie : 4 courses", + "M61": "\\c{YOR4}Partie : 8 courses", + "M62": "\\c{YOR4}Partie : 12 courses", + "M63": "\\c{YOR4}Partie : 16 courses", + "M64": "\\c{YOR4}Partie : 24 courses", + "M65": "\\c{YOR4}Partie : 32 courses", + "M66": "\\c{YOR4}Partie : 48 courses", + "M67": "\\c{YOR4}Partie : 64 courses" + } } - } + ] } } \ No newline at end of file diff --git a/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/ge.json b/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/ge.json index c61813b..13d456f 100644 --- a/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/ge.json +++ b/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/ge.json @@ -1,46 +1,48 @@ { "mode": "edit", "operation": { - "bmg-edit": { - "mode": "id", - "data": { - "0x703e": "\\c{white}Zufällig: Alle Tracks", - "0x703f": "\\c{white}Zufällig: Original-Tracks", - "0x7040": "\\c{white}Zufällig: Custom Tracks", - "0x7041": "\\c{white}Zufällig: Neue Tracks", + "bmg-edit": [ + { + "mode": "id", + "data": { + "0x703e": "\\c{white}Zufällig: Alle Tracks", + "0x703f": "\\c{white}Zufällig: Original-Tracks", + "0x7040": "\\c{white}Zufällig: Custom Tracks", + "0x7041": "\\c{white}Zufällig: Neue Tracks", - "M37": "\\c{YOR4}Optionen zurücksetzen", - "M38": "\\c{YOR4}Abstimmung : von Spielern", - "M39": "\\c{YOR4}Abstimmung : vom Gastgeber", - "M40": "\\c{YOR4}Blockierung : reset", - "M41": "\\c{YOR4}Blockierung : disable", - "M42": "\\c{YOR4}Blockierung : enable", - "M43": "\\c{YOR4}Fahrzeug : alle", - "M44": "\\c{YOR4}Fahrzeug : alles Gewicht", - "M45": "\\c{YOR4}Fahrzeug : nur leicht", - "M46": "\\c{YOR4}Fahrzeug : alles außer leicht", - "M47": "\\c{YOR4}Fahrzeug : nur Mittel", - "M48": "\\c{YOR4}Fahrzeug : alles außer Mittel", - "M49": "\\c{YOR4}Fahrzeug : nur schwer", - "M50": "\\c{YOR4}Fahrzeug : alles außer schwer", - "M51": "\\c{YOR4}Fahrzeug : alle Arten", - "M52": "\\c{YOR4}Fahrzeug : nur Kart", - "M53": "\\c{YOR4}Fahrzeug : nur Fahrrad", - "M54": "\\c{YOR4}Motor : zurücksetzen", - "M55": "\\c{YOR4}Motor : 100cc", - "M56": "\\c{YOR4}Motor : 150cc", - "M57": "\\c{YOR4}Motor : 150cc Spiegel", - "M58": "\\c{YOR4}Spiel : 1 Track", - "M59": "\\c{YOR4}Spiel : 2 Tracks", - "M60": "\\c{YOR4}Spiel : 4 Tracks", - "M61": "\\c{YOR4}Spiel : 8 Tracks", - "M62": "\\c{YOR4}Spiel : 12 Tracks", - "M63": "\\c{YOR4}Spiel : 16 Tracks", - "M64": "\\c{YOR4}Spiel : 24 Tracks", - "M65": "\\c{YOR4}Spiel : 32 Tracks", - "M66": "\\c{YOR4}Spiel : 48 Tracks", - "M67": "\\c{YOR4}Spiel : 64 Tracks" + "M37": "\\c{YOR4}Optionen zurücksetzen", + "M38": "\\c{YOR4}Abstimmung : von Spielern", + "M39": "\\c{YOR4}Abstimmung : vom Gastgeber", + "M40": "\\c{YOR4}Blockierung : reset", + "M41": "\\c{YOR4}Blockierung : disable", + "M42": "\\c{YOR4}Blockierung : enable", + "M43": "\\c{YOR4}Fahrzeug : alle", + "M44": "\\c{YOR4}Fahrzeug : alles Gewicht", + "M45": "\\c{YOR4}Fahrzeug : nur leicht", + "M46": "\\c{YOR4}Fahrzeug : alles außer leicht", + "M47": "\\c{YOR4}Fahrzeug : nur Mittel", + "M48": "\\c{YOR4}Fahrzeug : alles außer Mittel", + "M49": "\\c{YOR4}Fahrzeug : nur schwer", + "M50": "\\c{YOR4}Fahrzeug : alles außer schwer", + "M51": "\\c{YOR4}Fahrzeug : alle Arten", + "M52": "\\c{YOR4}Fahrzeug : nur Kart", + "M53": "\\c{YOR4}Fahrzeug : nur Fahrrad", + "M54": "\\c{YOR4}Motor : zurücksetzen", + "M55": "\\c{YOR4}Motor : 100cc", + "M56": "\\c{YOR4}Motor : 150cc", + "M57": "\\c{YOR4}Motor : 150cc Spiegel", + "M58": "\\c{YOR4}Spiel : 1 Track", + "M59": "\\c{YOR4}Spiel : 2 Tracks", + "M60": "\\c{YOR4}Spiel : 4 Tracks", + "M61": "\\c{YOR4}Spiel : 8 Tracks", + "M62": "\\c{YOR4}Spiel : 12 Tracks", + "M63": "\\c{YOR4}Spiel : 16 Tracks", + "M64": "\\c{YOR4}Spiel : 24 Tracks", + "M65": "\\c{YOR4}Spiel : 32 Tracks", + "M66": "\\c{YOR4}Spiel : 48 Tracks", + "M67": "\\c{YOR4}Spiel : 64 Tracks" + } } - } + ] } } \ No newline at end of file diff --git a/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/it.json b/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/it.json index f204e9a..4b89b32 100644 --- a/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/it.json +++ b/Pack/MKWFaraphel/specific/_PATCH/files/Scene/UI/it.json @@ -1,46 +1,48 @@ { "mode": "edit", "operation": { - "bmg-edit": { - "mode": "id", - "data": { - "0x703e": "\\c{white}Casuale: Tutte le tracce", - "0x703f": "\\c{white}Casuale: Tracce originali", - "0x7040": "\\c{white}Casuale: Custom Tracks", - "0x7041": "\\c{white}Casuale: Nuovi brani", + "bmg-edit": [ + { + "mode": "id", + "data": { + "0x703e": "\\c{white}Casuale: Tutte le tracce", + "0x703f": "\\c{white}Casuale: Tracce originali", + "0x7040": "\\c{white}Casuale: Custom Tracks", + "0x7041": "\\c{white}Casuale: Nuovi brani", - "M37": "\\c{YOR4}Ripristina opzioni", - "M38": "\\c{YOR4}Votazione : dei giocatori", - "M39": "\\c{YOR4}Votazione : per ospite", - "M40": "\\c{YOR4}Blocco : Ripristina", - "M41": "\\c{YOR4}Blocco : disattivare", - "M42": "\\c{YOR4}Blocco : abilitare", - "M43": "\\c{YOR4}Veicolo : tutto", - "M44": "\\c{YOR4}Veicolo : tutto peso", - "M45": "\\c{YOR4}Veicolo : solo leggero", - "M46": "\\c{YOR4}Veicolo : tutto tranne leggero", - "M47": "\\c{YOR4}Veicolo : solo medio", - "M48": "\\c{YOR4}Veicolo : tutto tranne medio", - "M49": "\\c{YOR4}Veicolo : solo pesante", - "M50": "\\c{YOR4}Veicolo : tutto tranne pesante", - "M51": "\\c{YOR4}Veicolo : tutti i tipi", - "M52": "\\c{YOR4}Veicolo : solo kart", - "M53": "\\c{YOR4}Veicolo : solo bici", - "M54": "\\c{YOR4}Motore : Ripristina", - "M55": "\\c{YOR4}Motore : 100cc", - "M56": "\\c{YOR4}Motore : 150cc", - "M57": "\\c{YOR4}Motore : 150cc specchio", - "M58": "\\c{YOR4}Gioco : 1 pista", - "M59": "\\c{YOR4}Gioco : 2 pistas", - "M60": "\\c{YOR4}Gioco : 4 pistas", - "M61": "\\c{YOR4}Gioco : 8 pistas", - "M62": "\\c{YOR4}Gioco : 12 pistas", - "M63": "\\c{YOR4}Gioco : 16 pistas", - "M64": "\\c{YOR4}Gioco : 24 pistas", - "M65": "\\c{YOR4}Gioco : 32 pistas", - "M66": "\\c{YOR4}Gioco : 48 pistas", - "M67": "\\c{YOR4}Gioco : 64 pistas" + "M37": "\\c{YOR4}Ripristina opzioni", + "M38": "\\c{YOR4}Votazione : dei giocatori", + "M39": "\\c{YOR4}Votazione : per ospite", + "M40": "\\c{YOR4}Blocco : Ripristina", + "M41": "\\c{YOR4}Blocco : disattivare", + "M42": "\\c{YOR4}Blocco : abilitare", + "M43": "\\c{YOR4}Veicolo : tutto", + "M44": "\\c{YOR4}Veicolo : tutto peso", + "M45": "\\c{YOR4}Veicolo : solo leggero", + "M46": "\\c{YOR4}Veicolo : tutto tranne leggero", + "M47": "\\c{YOR4}Veicolo : solo medio", + "M48": "\\c{YOR4}Veicolo : tutto tranne medio", + "M49": "\\c{YOR4}Veicolo : solo pesante", + "M50": "\\c{YOR4}Veicolo : tutto tranne pesante", + "M51": "\\c{YOR4}Veicolo : tutti i tipi", + "M52": "\\c{YOR4}Veicolo : solo kart", + "M53": "\\c{YOR4}Veicolo : solo bici", + "M54": "\\c{YOR4}Motore : Ripristina", + "M55": "\\c{YOR4}Motore : 100cc", + "M56": "\\c{YOR4}Motore : 150cc", + "M57": "\\c{YOR4}Motore : 150cc specchio", + "M58": "\\c{YOR4}Gioco : 1 pista", + "M59": "\\c{YOR4}Gioco : 2 pistas", + "M60": "\\c{YOR4}Gioco : 4 pistas", + "M61": "\\c{YOR4}Gioco : 8 pistas", + "M62": "\\c{YOR4}Gioco : 12 pistas", + "M63": "\\c{YOR4}Gioco : 16 pistas", + "M64": "\\c{YOR4}Gioco : 24 pistas", + "M65": "\\c{YOR4}Gioco : 32 pistas", + "M66": "\\c{YOR4}Gioco : 48 pistas", + "M67": "\\c{YOR4}Gioco : 64 pistas" + } } - } + ] } } \ No newline at end of file diff --git a/source/mkw/Patch/PatchOperation.py b/source/mkw/Patch/PatchOperation.py index b15f98e..3173cf5 100644 --- a/source/mkw/Patch/PatchOperation.py +++ b/source/mkw/Patch/PatchOperation.py @@ -249,8 +249,13 @@ class PatchOperation: type = "bmg-edit" - def __init__(self, *args, **kwargs): - print(args, kwargs) + def __init__(self, layers: list[dict]): + """ + :param layers: all the bmg patch to apply + """ + self.layers = layers def patch(self, patch: "Patch", file_name: str, file_content: IO) -> (str, IO): + print(file_content) + return file_name, file_content diff --git a/source/wt/bmg.py b/source/wt/bmg.py index e69de29..29e912f 100644 --- a/source/wt/bmg.py +++ b/source/wt/bmg.py @@ -0,0 +1,31 @@ +from source.wt import * +from source.wt import _run + +tools_path = tools_szs_dir / ("wimgt.exe" if system == "win64" else "wimgt") + + +@better_wt_error(tools_path) +class BMGPath: + """ + Represent a path to a bmg file (game file containing text data) + """ + __slots__ = ("path",) + + def __init__(self, path: Path | str): + self.path: Path = Path(path) + + @better_wt_error(tools_path) + def _run(self, *args) -> bytes: + """ + Return a command with wbmgt and return the output + :param args: command arguments + :return: the output of the command + """ + return _run(tools_path, *args) + + def get_decoded_data(self): + """ + Return the decoded content of the bmg file + :return: + """ + return self._run("DECODE", self.path, "--DEST", "-") diff --git a/source/wt/img.py b/source/wt/img.py index 05f807d..32e9787 100644 --- a/source/wt/img.py +++ b/source/wt/img.py @@ -7,7 +7,7 @@ tools_path = tools_szs_dir / ("wimgt.exe" if system == "win64" else "wimgt") @better_wt_error(tools_path) class IMGPath: """ - Represent a path to an image + Represent a path to a normal image, that can be converted into game image data """ __slots__ = ("path", ) @@ -17,7 +17,7 @@ class IMGPath: @better_wt_error(tools_path) def _run(self, *args) -> bytes: """ - Return a command with wszst and return the output + Return a command with wimgt and return the output :param args: command arguments :return: the output of the command """