mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 19:28:25 +02:00
authors are now stored as a list in ct_config.json
This commit is contained in:
parent
b7f87d6a31
commit
edb1c78658
3 changed files with 14400 additions and 13812 deletions
974
ct_config.json
974
ct_config.json
File diff suppressed because it is too large
Load diff
|
@ -55,7 +55,7 @@ class Gui:
|
|||
self.root.resizable(False, False)
|
||||
self.root.iconbitmap(bitmap="./icon.ico")
|
||||
|
||||
if not(self.boolvar_dont_check_for_update.get()): self.check_update()
|
||||
if not self.boolvar_dont_check_for_update.get(): self.check_update()
|
||||
|
||||
self.menu_bar = Menu(self.root)
|
||||
self.root.config(menu=self.menu_bar)
|
||||
|
@ -275,7 +275,8 @@ class Gui:
|
|||
f"For game version : {self.game.ctconfig.version}\n"
|
||||
f"./file/ directory : {os.listdir('./file/')}\n"
|
||||
f"GAME/files/ information : {self.game.path, self.game.region}\n"
|
||||
f"{error}\n")
|
||||
f"{error}\n"
|
||||
)
|
||||
messagebox.showerror(self.translate("Error"), self.translate("An error occured", " :", "\n", error, "\n\n"))
|
||||
|
||||
def progress(self, show: bool = None, indeter: bool = None, step: int = None,
|
||||
|
@ -321,10 +322,8 @@ class Gui:
|
|||
self.button_select_path
|
||||
]
|
||||
for widget in button:
|
||||
if enable:
|
||||
widget.config(state=NORMAL)
|
||||
else:
|
||||
widget.config(state=DISABLED)
|
||||
if enable: widget.config(state=NORMAL)
|
||||
else: widget.config(state=DISABLED)
|
||||
|
||||
def translate(self, *texts, gamelang: str = None) -> str:
|
||||
"""
|
||||
|
@ -334,19 +333,15 @@ class Gui:
|
|||
:return: translated text
|
||||
"""
|
||||
lang = gamelang_to_lang.get(gamelang, self.stringvar_language.get())
|
||||
if lang not in translation_dict: return "".join(texts) # if no translation language is found
|
||||
|
||||
if lang in translation_dict:
|
||||
_lang_trad = translation_dict[lang]
|
||||
translated_text = ""
|
||||
for text in texts:
|
||||
if text in _lang_trad:
|
||||
translated_text += _lang_trad[text]
|
||||
else:
|
||||
translated_text += text
|
||||
if text in _lang_trad: translated_text += _lang_trad[text]
|
||||
else: translated_text += text
|
||||
return translated_text
|
||||
|
||||
return "".join(texts) # if no translation language is found
|
||||
|
||||
def is_using_official_config(self) -> bool:
|
||||
"""
|
||||
:return: True if the parameter is the official one, False if it is customized
|
||||
|
|
|
@ -24,7 +24,8 @@ def check_file_sha1(file: str, excepted_sha1: str) -> int:
|
|||
|
||||
class Track:
|
||||
def __init__(self, name: str = "_", prefix: str = None, suffix: str = None,
|
||||
author="Nintendo", special="T11", music="T11", new=True, sha1: str = None, since_version: str = None,
|
||||
author: str = "Nintendo", special: str = "T11", music: str = "T11",
|
||||
new=True, sha1: str = None, since_version: str = None,
|
||||
score: int = 0, warning: int = 0, note: str = "", track_wu8_dir: str = "./file/Track-WU8/",
|
||||
track_szs_dir: str = "./file/Track/", track_version: str = None, tags: list = [], *args, **kwargs):
|
||||
"""
|
||||
|
@ -34,7 +35,7 @@ class Track:
|
|||
:param file_szs: path to its szs file
|
||||
:param prefix: track prefix (often original console or game)
|
||||
:param suffix: track suffix (often for variation like Boost or Night)
|
||||
:param author: track creator
|
||||
:param author: track creator(s)
|
||||
:param special: track special slot
|
||||
:param music: track music slot
|
||||
:param new: is the track original or from an older game
|
||||
|
@ -117,6 +118,12 @@ class Track:
|
|||
raise CantDownloadTrack(track=self, http_error=dl.status_code)
|
||||
raise CantDownloadTrack(track=self, http_error="Failed to download track") # if failed more than 3 times
|
||||
|
||||
def get_author_str(self) -> str:
|
||||
"""
|
||||
:return: the list of authors with ", " separating them
|
||||
"""
|
||||
return ", ".join(self.author) if type(self.author) == str else self.author
|
||||
|
||||
def get_ctfile(self, race=False, *args, **kwargs) -> str:
|
||||
"""
|
||||
get ctfile text to create CTFILE.txt and RCTFILE.txt
|
||||
|
@ -136,7 +143,7 @@ class Track:
|
|||
else:
|
||||
ctfile_text += (
|
||||
f'"-"; ' # track path, not used in Race_*.szs, save a bit of space
|
||||
f'"{self.get_track_formatted_name(*args, **kwargs)}\\n{self.author}"; ' # only in race show author's name
|
||||
f'"{self.get_track_formatted_name(*args, **kwargs)}\\n{self.get_author_str()}"; ' # only in race show author's name
|
||||
f'"-"\n' # sha1, useless for now.
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue