Constants.py (view raw)
1#!/usr/bin/python3
2import os
3from sys import platform
4
5PATCH_VERSION = '1.1.1'
6FINAL_ROM_NAME = f'Mother 1+2 [T+Ita{PATCH_VERSION}].gba'
7
8STATUS_PRESET = "Preset applicato" # Niente punto qui
9STATUS_START = "Patcher pronto all'uso."
10STATUS_MD5 = "MD5 verificato."
11STATUS_COPIED = "File copiati."
12STATUS_ASSEMBLY = "Codice compilato."
13STATUS_INJECTED = "Testo inserito."
14STATUS_PATCHED = "Patch applicate."
15STATUS_CLEANED = "Pulizia effettuata."
16
17VAR_WINDOW_TITLE = "Mother 1+2 Patcher by Earthbound Café"
18VAR_FILEPICKER = "ROM giapponese di Mother 1+2"
19
20WARNING_TITLE = "Attenzione"
21WARNING_EXTRACT = "È necessario estrarre l'archivio."
22WARNING_MD5_MISMATCH = "La ROM selezionata non è compatibile con la nostra patch."
23
24SUCCESS_TITLE = "Finito!"
25SUCCESS_CONTENT = f"La ROM {FINAL_ROM_NAME} è stata creata con successo!"
26
27PRESETS = {
28 "Scelte consigliate": { # default preset
29 'font': 'font_og',
30 'sprites': 'sprites_mix',
31 'places': 'places_us',
32 'nes_palette': 'nes_palette_yes',
33 'skip_m1': 'skip_m1_yes'
34 },
35 "Earthbound Beginnings (US)": {
36 'font': 'font_og',
37 'sprites': 'sprites_us',
38 'places': 'places_us',
39 'nes_palette': 'nes_palette_yes',
40 'skip_m1': 'skip_m1_yes'
41 },
42 "Mother 1 (JP)": {
43 'font': 'font_og',
44 'sprites': 'sprites_jp',
45 'places': 'places_jp',
46 'nes_palette': 'nes_palette_yes',
47 'skip_m1': 'skip_m1_yes'
48 },
49 "Mother 1+2": {
50 'font': 'font_og',
51 'sprites': 'sprites_us',
52 'places': 'places_jp',
53 'nes_palette': 'nes_palette_no',
54 'skip_m1': 'skip_m1_no'
55 }
56}
57
58ALT_FILENAMES = {
59 'font_og':
60 ['m1_gfx_font_og.bin'],
61 'font_new':
62 ['m1_gfx_font_new.bin'],
63 'sprites_mix':
64 ['m1_restoration_gfx_sprites_mix.bin',
65 'm1_restoration_gfx_ending_us.bin',
66 'm1_restoration_gfx_enemies_jp.bin',
67 'm1_restoration_gfx_maptiles_jp.bin'],
68 'sprites_us':
69 ['m1_restoration_gfx_sprites_us.bin',
70 'm1_restoration_gfx_ending_us.bin',
71 'm1_restoration_gfx_enemies_us.bin',
72 'm1_restoration_gfx_maptiles_us.bin'],
73 'sprites_jp':
74 ['m1_restoration_gfx_sprites_jp.bin',
75 'm1_restoration_gfx_ending_jp.bin',
76 'm1_restoration_gfx_enemies_jp.bin',
77 'm1_restoration_gfx_maptiles_jp.bin'],
78 'places_us':
79 ['m1_main_text_us.txt',
80 'm1_gfx_map_us.bin'],
81 'places_jp':
82 ['m1_main_text_jp.txt',
83 'm1_gfx_map_jp.bin'],
84
85 'nes_palette_yes': 'nes_palette.ips',
86 'nes_palette_no': None,
87 'skip_m1_yes': 'skip_m1.ips',
88 'skip_m1_no': None
89}
90
91DEF_FILENAMES = {
92 'font': [
93 'm1_gfx_font.bin'
94 ],
95 'sprites': [
96 'm1_restoration_gfx_sprites.bin',
97 'm1_restoration_gfx_ending.bin',
98 'm1_restoration_gfx_enemies.bin',
99 'm1_restoration_gfx_maptiles.bin'
100 ],
101 'places': [
102 'm1_main_text.txt',
103 'm1_gfx_map.bin'
104 ]
105}
106
107DEF_PRESET = next(iter(PRESETS.items()))
108DEF_PATCHES = DEF_PRESET[1].keys() - DEF_FILENAMES.keys()
109
110PATH_TOOLS = os.path.join('.', 'tools')
111PATH_ALT = os.path.join(PATH_TOOLS, 'alt')
112PATH_ICON = os.path.join(PATH_TOOLS, 'icon.png')
113
114OS_SUFFIX = (
115 '.exe' if platform.startswith('win32') else
116 '_mac' if platform.startswith('darwin')
117 else ''
118)
119
120OS_FILENAMES = {
121 'xkas': os.path.join('.', 'xkas' + OS_SUFFIX),
122 'insert': os.path.join('.', 'insert' + OS_SUFFIX),
123 'introconv': os.path.join('.', 'introconv' + OS_SUFFIX)
124}
125OS_SHELL = True if os.name == 'nt' else False