Skip to content

Commit

Permalink
Adding card-rf
Browse files Browse the repository at this point in the history
  • Loading branch information
HobbitDur committed Oct 27, 2024
1 parent 9e569bb commit 30cf653
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
**/__pycache__/**
**/FF8TestFolder/**
**/FF8FolderTest/**
**/MOdDownloaded/**
2 changes: 1 addition & 1 deletion HobbitInstaller-data
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def exception_hook(exctype, value, traceback):
parser.add_argument("-kdm", "--keep_download_mod", help="Keep downloading mod file", action='store_true')

args = parser.parse_args()
faulthandler.enable()
#faulthandler.enable()
sys.excepthook = exception_hook
mod_manager = ModManager(ff8_path=args.path)

Expand Down
7 changes: 5 additions & 2 deletions modmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ModManager:
UPDATE_DATA_NAME = "UpdateData"
SETUP_FILE = os.path.join(FOLDER_SETUP, "setup.json")
VERSION_LIST = ["FF8 PC 2000", "FF8 Steam 2013", "FF8 Remastered"]

LANG_STR_LIST = ["en", "fr", "de", "es", "it"]
def __init__(self, ff8_path='.'):
self.ffnx_manager = FFNxManager()
os.makedirs(self.FOLDER_DOWNLOAD, exist_ok=True)
Expand Down Expand Up @@ -173,7 +173,7 @@ def restore_backup(self):
return False

def install_mod(self, mod: Mod, download_update_func: types.MethodType = None, keep_download_mod=False, download=True, ff8_wrapper=ModWrapper.FFNX,
backup=True):
backup=True, lang_requested=ModLang.EN):
if backup:
print("Backing up the data")
try:
Expand Down Expand Up @@ -268,6 +268,9 @@ def install_mod(self, mod: Mod, download_update_func: types.MethodType = None, k
elif mod.get_type() == ModType.RAGNAROK:
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')
elif mod.name == "Tsunamod-Card-RF":
archive_to_copy = os.path.join(archive, self.LANG_STR_LIST[lang_requested.value])
futur_path = os.path.join(self.ff8_path)
elif mod.name == "FF8Curiosite-FR-ONLY":
archive_to_copy = archive
futur_path = os.path.join(self.ff8_path, 'Data', 'lang-fr')
Expand Down
10 changes: 5 additions & 5 deletions view/hobbitgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ class Installer(QObject):
update_mod_list_completed = pyqtSignal()
restore_backup_completed = pyqtSignal(bool)

@pyqtSlot(ModManager, list, bool, bool, ModWrapper, bool)
@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):
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)
mod_manager.install_mod(mod_name, 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 All @@ -38,7 +38,7 @@ def restore_backup(self, mod_manager):


class WindowInstaller(QWidget):
install_requested = pyqtSignal(ModManager, list, bool, bool, ModWrapper, bool)
install_requested = pyqtSignal(ModManager, list, bool, bool, ModWrapper, bool, ModLang)
update_mod_list_requested = pyqtSignal(ModManager)
restore_backup_requested = pyqtSignal(ModManager)

Expand Down Expand Up @@ -241,7 +241,7 @@ def install_click(self):
mod_to_be_installed = self.mod_widget.get_mod_to_install()
self.progress.setRange(0, len(mod_to_be_installed))
self.progress.setValue(0)
self.install_requested.emit(self.mod_manager, mod_to_be_installed, self.keep_mod_archive.isChecked(), self.download.isChecked(), self.get_current_wrapper(), self.backup.isChecked())
self.install_requested.emit(self.mod_manager, mod_to_be_installed, self.keep_mod_archive.isChecked(), self.download.isChecked(), self.get_current_wrapper(), self.backup.isChecked(), self.LANG_LIST[self.language.currentIndex()])

def update_download(self, advancement:int, max_size:int):
if advancement >= 0 and max_size >= 0:
Expand Down

0 comments on commit 30cf653

Please sign in to comment.