mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 19:28:25 +02:00
preparing bmg patch
This commit is contained in:
parent
093319eece
commit
dde5a134a5
9 changed files with 227 additions and 179 deletions
|
@ -2,7 +2,8 @@
|
|||
"mode": "edit",
|
||||
|
||||
"operation": {
|
||||
"bmg-edit": {
|
||||
"bmg-edit": [
|
||||
{
|
||||
"mode": "regex",
|
||||
"data": {
|
||||
"CWF de Nintendo": "{{ONLINE_SERVICE}}",
|
||||
|
@ -20,5 +21,6 @@
|
|||
"Mario Kart Wii": "{{MOD_NICKNAME}} {{MOD_VERSION}} {{MOD_CUSTOMIZED}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"mode": "edit",
|
||||
"operation": {
|
||||
"bmg-edit": {
|
||||
"bmg-edit": [
|
||||
{
|
||||
"mode": "id",
|
||||
"data": {
|
||||
"0x703e": "\\c{white}Random: All tracks",
|
||||
|
@ -42,5 +43,6 @@
|
|||
"M67": "\\c{YOR4}Game : 64 races"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"mode": "edit",
|
||||
"operation": {
|
||||
"bmg-edit": {
|
||||
"bmg-edit": [
|
||||
{
|
||||
"mode": "id",
|
||||
"data": {
|
||||
"0x703e": "\\c{white}Aleatorio: Todas las pistas",
|
||||
|
@ -42,5 +43,6 @@
|
|||
"M67": "\\c{YOR4}Partido : 64 pistas"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"mode": "edit",
|
||||
"operation": {
|
||||
"bmg-edit": {
|
||||
"bmg-edit": [
|
||||
{
|
||||
"mode": "id",
|
||||
"data": {
|
||||
"0x703e": "\\c{white}Aléatoire: Toutes les pistes",
|
||||
|
@ -42,5 +43,6 @@
|
|||
"M67": "\\c{YOR4}Partie : 64 courses"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"mode": "edit",
|
||||
"operation": {
|
||||
"bmg-edit": {
|
||||
"bmg-edit": [
|
||||
{
|
||||
"mode": "id",
|
||||
"data": {
|
||||
"0x703e": "\\c{white}Zufällig: Alle Tracks",
|
||||
|
@ -42,5 +43,6 @@
|
|||
"M67": "\\c{YOR4}Spiel : 64 Tracks"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"mode": "edit",
|
||||
"operation": {
|
||||
"bmg-edit": {
|
||||
"bmg-edit": [
|
||||
{
|
||||
"mode": "id",
|
||||
"data": {
|
||||
"0x703e": "\\c{white}Casuale: Tutte le tracce",
|
||||
|
@ -42,5 +43,6 @@
|
|||
"M67": "\\c{YOR4}Gioco : 64 pistas"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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", "-")
|
|
@ -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
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue