Skip to content

Commit

Permalink
Fixing ragnarok
Browse files Browse the repository at this point in the history
  • Loading branch information
HobbitDur committed Nov 12, 2024
1 parent 2fee939 commit 8c648ec
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion model/mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, name, mod_info):
self.special_status = ""

def __str__(self):
return f"Mod(Name:{self.name}, Info:{self.info}"
return f"Mod(Name:{self.name}, Info:{self.info}, special: {self.special_status})"
def __repr__(self):
return self.__str__()

Expand Down
11 changes: 11 additions & 0 deletions modmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ def restore_backup(self):

def install_mod(self, mod: Mod, download_update_func: types.MethodType = None, keep_download_mod=False, download=True, ff8_wrapper=ModWrapper.FFNX,
backup=True, lang_requested=ModLang.EN):
print("install_mod")
print(mod.special_status)
if backup:
print("Backing up the data")
try:
Expand Down Expand Up @@ -248,6 +250,7 @@ def install_mod(self, mod: Mod, download_update_func: types.MethodType = None, k
os.path.join("HobbitInstaller-data", 'Resources', '7z.exe')))
if '.rar' in dd_file_name or '.7z' in dd_file_name:
archive = "temparchive"
#subprocess.run(['HobbitInstaller-data\\Resources\\7z.exe', 'x', f'-o{archive}', '--', os.path.join(self.FOLDER_DOWNLOAD, dd_file_name)])
patoolib.extract_archive(os.path.join(self.FOLDER_DOWNLOAD, dd_file_name), verbosity=-1, outdir=archive,
program=os.path.join("HobbitInstaller-data", 'Resources', '7z.exe'))
# Unzip locally then copy all files, so we don't have problem erasing files while unziping
Expand All @@ -262,12 +265,20 @@ def install_mod(self, mod: Mod, download_update_func: types.MethodType = None, k

except ValueError:
index_folder = -1
print(mod.get_type())
if mod.get_type() == ModType.RELOADED: # Special handle
archive_to_copy = os.path.join(archive, mod.special_status)
futur_path = os.path.join(self.ff8_path, 'Data', 'lang-fr')
elif mod.get_type() == ModType.RAGNAROK:
print(mod.special_status)
archive_to_copy = os.path.join(archive, list_dir[index_folder], list_dir[index_folder], mod.special_status)
futur_path = os.path.join(self.ff8_path, 'Data')
hext_to_copy = os.path.join(archive, list_dir[index_folder], list_dir[index_folder], "Ragnarok_mod.txt")
futur_path_hext_to_copy = os.path.join(self.ff8_path, 'hext', 'ff8')
shutil.copy(hext_to_copy, os.path.join(futur_path_hext_to_copy, 'en'))
shutil.copy(hext_to_copy, os.path.join(futur_path_hext_to_copy, 'en_nv'))
shutil.copy(hext_to_copy, os.path.join(futur_path_hext_to_copy, 'en_eidos'))
shutil.copy(hext_to_copy, os.path.join(futur_path_hext_to_copy, 'en_eidos_nv'))
elif mod.name == "[Tsunamods] Card-RF":
archive_to_copy = os.path.join(archive , 'Card-RF', self.LANG_STR_LIST[lang_requested.value])
futur_path = os.path.join(self.ff8_path)
Expand Down
4 changes: 2 additions & 2 deletions view/hobbitgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class Installer(QObject):
@pyqtSlot(ModManager, list, bool, bool, ModWrapper, bool, ModLang)
def install(self, mod_manager, mod_to_be_installed, keep_downloaded_mod, download=True,
ff8_version=ModWrapper.FFNX, backup=True, lang=ModLang.EN):
for index, mod_name in enumerate(mod_to_be_installed):
mod_manager.install_mod(mod_name, self.download_progress.emit, keep_downloaded_mod, download, ff8_version, backup, lang)
for index, mod in enumerate(mod_to_be_installed):
mod_manager.install_mod(mod, self.download_progress.emit, keep_downloaded_mod, download, ff8_version, backup, lang)
self.progress.emit(index + 1)
self.completed.emit(len(mod_to_be_installed))

Expand Down
2 changes: 2 additions & 0 deletions view/modwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def __init__(self, mod_manager, mod:Mod):

# FFVIII Reloaded
if mod.get_type() == ModType.RELOADED:
self.select.toggled.connect(self._update_special_status)
self.layout_ff8reloaded = QVBoxLayout()
self.ff8reloaded_classic = QRadioButton(parent=self, text="FFVIII Reloaded classic")
self.ff8reloaded_classic.setChecked(True)
Expand All @@ -63,6 +64,7 @@ def __init__(self, mod_manager, mod:Mod):
self.layout_main.addWidget(self.ff8reloaded_level100)
# Ragnarok
elif mod.get_type() == ModType.RAGNAROK:
self.select.toggled.connect(self._update_special_status)
self.layout_ragnarok = QVBoxLayout()
self.ragnarok_standard = QRadioButton(parent=self, text="Standard Mode files")
self.ragnarok_standard.setChecked(True)
Expand Down

0 comments on commit 8c648ec

Please sign in to comment.