all repos — m12-patcher @ b9ba83b93f227a992b3d7027bfe8fb602e85561c

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
 27PATH_TOOLS = os.path.join('.', 'tools')
 28PATH_ALT = os.path.join(PATH_TOOLS, 'alt')
 29
 30PRESETS = {
 31    "Scelte consigliate": { # default preset
 32        'font': 'font_og',
 33        'sprites': 'sprites_mix',
 34        'places': 'places_us',
 35        'nes_palette': 'nes_palette_yes',
 36        'skip_m1': 'skip_m1_yes'
 37        },
 38    "Earthbound Beginnings (US)": {
 39        'font': 'font_og',
 40        'sprites': 'sprites_us',
 41        'places': 'places_us',
 42        'nes_palette': 'nes_palette_yes',
 43        'skip_m1': 'skip_m1_yes'
 44        },
 45    "Mother 1 (JP)": {
 46        'font': 'font_og',
 47        'sprites': 'sprites_jp',
 48        'places': 'places_jp',
 49        'nes_palette': 'nes_palette_yes',
 50        'skip_m1': 'skip_m1_yes'
 51        },
 52    "Mother 1+2": {
 53        'font': 'font_og',
 54        'sprites': 'sprites_us',
 55        'places': 'places_jp',
 56        'nes_palette': 'nes_palette_no',
 57        'skip_m1': 'skip_m1_no'
 58        }
 59}
 60
 61ALT_FILENAMES = {
 62    'font_og':
 63        ['m1_gfx_font_og.bin'],
 64    'font_new':
 65        ['m1_gfx_font_new.bin'],
 66    'sprites_mix':
 67        ['m1_restoration_gfx_sprites_mix.bin',
 68        'm1_restoration_gfx_ending_us.bin',
 69        'm1_restoration_gfx_enemies_jp.bin',
 70        'm1_restoration_gfx_maptiles_jp.bin'],
 71    'sprites_us':
 72        ['m1_restoration_gfx_sprites_us.bin',
 73        'm1_restoration_gfx_ending_us.bin',
 74        'm1_restoration_gfx_enemies_us.bin',
 75        'm1_restoration_gfx_maptiles_us.bin'],
 76    'sprites_jp':
 77        ['m1_restoration_gfx_sprites_jp.bin',
 78        'm1_restoration_gfx_ending_jp.bin',
 79        'm1_restoration_gfx_enemies_jp.bin',
 80        'm1_restoration_gfx_maptiles_jp.bin'],
 81    'places_us':
 82        ['m1_main_text_us.txt',
 83        'm1_gfx_map_us.bin'],
 84    'places_jp':
 85        ['m1_main_text_jp.txt',
 86        'm1_gfx_map_jp.bin'],
 87
 88    'nes_palette_yes': 'nes_palette.ips',
 89    'nes_palette_no': None,
 90    'skip_m1_yes': 'skip_m1.ips',
 91    'skip_m1_no': None
 92}
 93
 94DEF_FILENAMES = {
 95    'font': [
 96        'm1_gfx_font.bin'
 97    ],
 98    'sprites': [
 99        'm1_restoration_gfx_sprites.bin',
100        'm1_restoration_gfx_ending.bin',
101        'm1_restoration_gfx_enemies.bin',
102        'm1_restoration_gfx_maptiles.bin'
103    ],
104    'places': [
105        'm1_main_text.txt',
106        'm1_gfx_map.bin'
107    ]
108}
109
110DEF_PRESET = next(iter(PRESETS.items()))
111DEF_PATCHES = DEF_PRESET[1].keys() - DEF_FILENAMES.keys()
112
113OS_SUFFIX = (
114    '.exe' if platform.startswith('win32') else
115    '_mac' if platform.startswith('darwin')
116    else ''
117)
118
119OS_FILENAMES = {
120    'xkas': os.path.join('.', 'xkas' + OS_SUFFIX),
121    'insert': os.path.join('.', 'insert' + OS_SUFFIX),
122    'introconv': os.path.join('.', 'introconv' + OS_SUFFIX)
123}
124
125OS_SHELL = True if os.name == 'nt' else False