mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 11:18:26 +02:00
(DONT WORK) trying to make Common file generate from game's files
This commit is contained in:
parent
e0ffdc01ac
commit
c3f910694b
15 changed files with 37 additions and 14363 deletions
1066
file/Common_E.txt
1066
file/Common_E.txt
File diff suppressed because it is too large
Load diff
1066
file/Common_F.txt
1066
file/Common_F.txt
File diff suppressed because it is too large
Load diff
1066
file/Common_G.txt
1066
file/Common_G.txt
File diff suppressed because it is too large
Load diff
1065
file/Common_I.txt
1065
file/Common_I.txt
File diff suppressed because it is too large
Load diff
1805
file/Common_RE.txt
1805
file/Common_RE.txt
File diff suppressed because it is too large
Load diff
1805
file/Common_RF.txt
1805
file/Common_RF.txt
File diff suppressed because it is too large
Load diff
1805
file/Common_RG.txt
1805
file/Common_RG.txt
File diff suppressed because it is too large
Load diff
1804
file/Common_RI.txt
1804
file/Common_RI.txt
File diff suppressed because it is too large
Load diff
1805
file/Common_RS.txt
1805
file/Common_RS.txt
File diff suppressed because it is too large
Load diff
1066
file/Common_S.txt
1066
file/Common_S.txt
File diff suppressed because it is too large
Load diff
1
main.pyw
1
main.pyw
|
@ -19,6 +19,7 @@ class ClassApp():
|
||||||
from source.StateButton import StateButton
|
from source.StateButton import StateButton
|
||||||
from source.create_lecode_config import create_lecode_config
|
from source.create_lecode_config import create_lecode_config
|
||||||
from source.patch_file import patch_file
|
from source.patch_file import patch_file
|
||||||
|
from source.patch_bmg import patch_bmg
|
||||||
from source.install_mod import install_mod
|
from source.install_mod import install_mod
|
||||||
from source.restart import restart
|
from source.restart import restart
|
||||||
|
|
||||||
|
|
19
source/patch_bmg.py
Normal file
19
source/patch_bmg.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
import subprocess
|
||||||
|
import shutil
|
||||||
|
from .definition import *
|
||||||
|
|
||||||
|
|
||||||
|
def patch_bmg(self, bmgfileszs):
|
||||||
|
subprocess.call(["./tools/szs/wszst", "EXTRACT", bmgfileszs, "-d", bmgfileszs + ".d", "--overwrite"]
|
||||||
|
, creationflags=CREATE_NO_WINDOW)
|
||||||
|
|
||||||
|
bmgfile = "./file/" + get_nodir(bmgfileszs) + ".bmg"
|
||||||
|
print(bmgfile)
|
||||||
|
filecopy(bmgfileszs + ".d/message/Common.bmg", bmgfile)
|
||||||
|
shutil.rmtree(bmgfileszs + ".d")
|
||||||
|
|
||||||
|
bmgtext = subprocess.check_output(["tools/szs/wctct", "--le-code", "--long", "BMG", "./file/CTFILE.txt",
|
||||||
|
"--patch-bmg", "REPLACE="+bmgfile], creationflags=CREATE_NO_WINDOW)
|
||||||
|
with open(bmgfile+".txt", "w", encoding="utf-8") as f: f.write(bmgtext.decode())
|
||||||
|
subprocess.call(["./tools/szs/wbmgt", "ENCODE", bmgfile+".txt", "--overwrite"])
|
||||||
|
#os.remove(bmgfile+".txt")
|
|
@ -1,6 +1,7 @@
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
import subprocess
|
import subprocess
|
||||||
import json
|
import json
|
||||||
|
import glob
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from .definition import *
|
from .definition import *
|
||||||
|
@ -14,7 +15,7 @@ def patch_file(self):
|
||||||
total_track = 0
|
total_track = 0
|
||||||
with open("./convert_file.json") as f:
|
with open("./convert_file.json") as f:
|
||||||
fc = json.load(f)
|
fc = json.load(f)
|
||||||
max_step = len(fc["img"]) + len(fc["bmg"]) + total_track + 1
|
max_step = len(fc["img"]) + total_track + 1 # + len(fc["bmg"])
|
||||||
self.Progress(show=True, indeter=False, statut=self.translate("Conversion des fichiers"), max=max_step, step=0)
|
self.Progress(show=True, indeter=False, statut=self.translate("Conversion des fichiers"), max=max_step, step=0)
|
||||||
|
|
||||||
for i, file in enumerate(fc["img"]):
|
for i, file in enumerate(fc["img"]):
|
||||||
|
@ -23,11 +24,15 @@ def patch_file(self):
|
||||||
subprocess.call(["./tools/szs/wimgt", "ENCODE", "./file/" + file, "-x", fc["img"][file]]
|
subprocess.call(["./tools/szs/wimgt", "ENCODE", "./file/" + file, "-x", fc["img"][file]]
|
||||||
, creationflags=CREATE_NO_WINDOW)
|
, creationflags=CREATE_NO_WINDOW)
|
||||||
|
|
||||||
for i, file in enumerate(fc["bmg"]):
|
for file in glob.glob(self.path_mkwf+"/files/Scene/UI/MenuSingle_?.szs"):
|
||||||
self.Progress(statut=self.translate("Conversion des textes")+f"\n({i + 1}/{len(fc['bmg'])}) {file}", add=1)
|
self.patch_bmg(file)
|
||||||
if not (os.path.exists("./file/" + get_filename(file) + ".bmg")):
|
|
||||||
subprocess.call(["./tools/szs/wbmgt", "ENCODE", "./file/" + file]
|
# for i, file in enumerate(fc["bmg"]):
|
||||||
, creationflags=CREATE_NO_WINDOW)
|
# self.Progress(statut=self.translate("Conversion des textes")+f"\n({i + 1}/{len(fc['bmg'])}) {file}", add=1)
|
||||||
|
# if not (os.path.exists("./file/" + get_filename(file) + ".bmg")):
|
||||||
|
# subprocess.call(["./tools/szs/wbmgt", "ENCODE", "./file/" + file]
|
||||||
|
# , creationflags=CREATE_NO_WINDOW)
|
||||||
|
|
||||||
|
|
||||||
if not (os.path.exists("./file/auto-add/")):
|
if not (os.path.exists("./file/auto-add/")):
|
||||||
subprocess.call(["./tools/szs/wszst", "AUTOADD", self.path_mkwf + "/files/Race/Course/", "--DEST",
|
subprocess.call(["./tools/szs/wszst", "AUTOADD", self.path_mkwf + "/files/Race/Course/", "--DEST",
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
def translate(self, text):
|
def translate(self, text, lang = None):
|
||||||
|
if lang == None: lang = self.language
|
||||||
|
|
||||||
with open("./translation.json", encoding="utf-8") as f:
|
with open("./translation.json", encoding="utf-8") as f:
|
||||||
translation = json.load(f)
|
translation = json.load(f)
|
||||||
if self.language in translation:
|
if lang in translation:
|
||||||
_lang_trad = translation[self.language]
|
_lang_trad = translation[lang]
|
||||||
if text in _lang_trad: return _lang_trad[text]
|
if text in _lang_trad: return _lang_trad[text]
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"en": {"MKWFaraphel Installateur": "MKWFaraphel Installer", "Jeu Wii": "Wii game", "Jeu original": "Original game", "Erreur": "Error", "Le chemin de fichier est invalide": "The file path in invalid", "Attention": "Warning", "Ce dossier sera \u00e9cras\u00e9 si vous installer le mod !\n\u00cates-vous s\u00fbr de vouloir l'utiliser ?": "This directory will be overwritten if you install the mod !\nAre you sure you want to use it ?", "Extraction du jeu...": "Extracting the game...", "Le type de fichier n'est pas reconnu": "This file type is not supported", "Cette ROM est d\u00e9j\u00e0 modd\u00e9, il est d\u00e9conseill\u00e9 de l'utiliser pour installer le mod": "This game is already modded, it is not recommended to use it to install the mod", "Extraire le fichier": "Extract file", "Preparer les fichiers": "Prepare files", "Action": "Action", "Installer le mod": "Install mod", "Dossier": "Directory", "Langage : ": "Language : ", "Mise \u00e0 jour disponible !": "Update available !", "Une mise \u00e0 jour est disponible, souhaitez-vous l'installer ?": "An update is available, do you want to install it ?", "T\u00e9l\u00e9chargement de Updater en cours...": "Downloading the Updater...", "fin du t\u00e9l\u00e9chargement, d\u00e9but de l'extraction...": "end of the download, extracting...", "fin de l'extraction": "finished extracting", "lancement de l'application...": "starting application...", "Modification de": "Modifying", "Recompilation de": "Recompilating", "Conversion en": "Converting to", "Changement de l'ID du jeu": "editing game's ID", "Fin": "End", "L'installation est termin\u00e9 !": "The mod has been installed !", "Conversion des fichiers": "Converting files", "Conversion des images": "Converting images", "Conversion des textes": "Converting texts", "Conversion des courses": "Converting races", "Configuration de LE-CODE": "Configurating LE-CODE"}, "selected": "en"}
|
{"en": {"MKWFaraphel Installateur": "MKWFaraphel Installer", "Jeu Wii": "Wii game", "Jeu original": "Original game", "Erreur": "Error", "Le chemin de fichier est invalide": "The file path in invalid", "Attention": "Warning", "Ce dossier sera \u00e9cras\u00e9 si vous installer le mod !\n\u00cates-vous s\u00fbr de vouloir l'utiliser ?": "This directory will be overwritten if you install the mod !\nAre you sure you want to use it ?", "Extraction du jeu...": "Extracting the game...", "Le type de fichier n'est pas reconnu": "This file type is not supported", "Cette ROM est d\u00e9j\u00e0 modd\u00e9, il est d\u00e9conseill\u00e9 de l'utiliser pour installer le mod": "This game is already modded, it is not recommended to use it to install the mod", "Extraire le fichier": "Extract file", "Preparer les fichiers": "Prepare files", "Action": "Action", "Installer le mod": "Install mod", "Dossier": "Directory", "Langage : ": "Language : ", "Mise \u00e0 jour disponible !": "Update available !", "Une mise \u00e0 jour est disponible, souhaitez-vous l'installer ?": "An update is available, do you want to install it ?", "T\u00e9l\u00e9chargement de Updater en cours...": "Downloading the Updater...", "fin du t\u00e9l\u00e9chargement, d\u00e9but de l'extraction...": "end of the download, extracting...", "fin de l'extraction": "finished extracting", "lancement de l'application...": "starting application...", "Modification de": "Modifying", "Recompilation de": "Recompilating", "Conversion en": "Converting to", "Changement de l'ID du jeu": "editing game's ID", "Fin": "End", "L'installation est termin\u00e9 !": "The mod has been installed !", "Conversion des fichiers": "Converting files", "Conversion des images": "Converting images", "Conversion des textes": "Converting texts", "Conversion des courses": "Converting races", "Configuration de LE-CODE": "Configurating LE-CODE"}, "selected": "fr"}
|
Loading…
Reference in a new issue