Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change all language files #315

Merged
merged 1 commit into from
Apr 6, 2024
Merged

Change all language files #315

merged 1 commit into from
Apr 6, 2024

Conversation

Miepee
Copy link
Contributor

@Miepee Miepee commented Apr 6, 2024

No description provided.

@dyceron
Copy link
Collaborator

dyceron commented Apr 6, 2024

I think this is probably fine? I'd like @ThanatosGit opinion first. I was mainly unsure about changing mse_english.txt since that's where the credits are stored, but maybe it's fine.

@ThanatosGit
Copy link
Collaborator

Changing it is fine, even though I think it's unecessary. Don't know which region / country uses mse_english. Could be english speaking without being in europe or in america. But afaik australia doesn't use it, guess they use eu_english because they have PAL there anyways?

Whatever, shouldn't do any harm and afaik credits are always pulled from mse_english, so it's not neeed to touch credits.py

def patch_credits(editor: PatcherEditor, spoiler_log: dict[str, str]):
english_files = [
"system/localization/mse_english.txt",
]
rando_credits, amount_title, amount_subtitle, amount_credit = _create_randomizer_credits(spoiler_log)
for file in english_files:
text = editor.get_file(file, Txt)
ordered_credits = list(text.strings.items())
# suffix needs to be sorted per "type"
for index, credit_tuple in enumerate(ordered_credits):
title = re.findall(r'CREDIT_TITLE(\d+)', credit_tuple[0])
if len(title) > 0:
new_suffix = int(title[0]) + amount_title
ordered_credits[index] = (f"CREDIT_TITLE{new_suffix}", credit_tuple[1])
continue
title = re.findall(r'CREDIT_SUBTITLE(\d+)', credit_tuple[0])
if len(title) > 0:
new_suffix = int(title[0]) + amount_subtitle
ordered_credits[index] = (f"CREDIT_SUBTITLE{new_suffix}", credit_tuple[1])
continue
title = re.findall(r'CREDIT_(\d+)', credit_tuple[0])
if len(title) > 0:
new_suffix = int(title[0]) + amount_credit
ordered_credits[index] = (f"CREDIT_{new_suffix}", credit_tuple[1])
text.strings = dict(rando_credits + ordered_credits)

@ThanatosGit ThanatosGit merged commit f16dee6 into main Apr 6, 2024
5 checks passed
@ThanatosGit ThanatosGit deleted the Miepee-patch-2 branch May 10, 2024 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants