preparing bmg patch

This commit is contained in:
Faraphel 2022-07-09 22:09:07 +02:00
parent 093319eece
commit dde5a134a5
9 changed files with 227 additions and 179 deletions

View file

@ -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}}"
}
}
}
]
}
}

View file

@ -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"
}
}
}
]
}
}

View file

@ -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"
}
}
}
]
}
}

View file

@ -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"
}
}
}
]
}
}

View file

@ -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"
}
}
}
]
}
}

View file

@ -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"
}
}
}
]
}
}

View file

@ -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

View file

@ -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", "-")

View file

@ -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
"""