From 25c22bd9bcd2b3c5a6f446ec56d0379130d6e5c9 Mon Sep 17 00:00:00 2001 From: LudovicGuerra Date: Thu, 22 Aug 2024 23:42:36 +0200 Subject: [PATCH] Adding json maanagement --- ModSetup/setup.json | 16 ++++++++++++++++ hobbitgui.py | 8 ++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ModSetup/setup.json b/ModSetup/setup.json index 375e174..8b0ff9f 100644 --- a/ModSetup/setup.json +++ b/ModSetup/setup.json @@ -10,6 +10,7 @@ "modder_name": "Hobbitdur", "mod_info": "HobbitInstaller", "mod_type": "Setup", + "default_selected": "false", "ffnx_param": {}, "lang": [ "en", @@ -29,6 +30,7 @@ "modder_name": "Hobbitdur", "mod_info": "To reset gameplay mod", "mod_type": "Gameplay", + "default_selected": "false", "ffnx_param": {}, "lang": [ "fr" @@ -46,6 +48,7 @@ "modder_name": "Hobbitdur", "mod_info": "To reset gameplay mod", "mod_type": "Gameplay", + "default_selected": "false", "ffnx_param": {}, "lang": [ "en" @@ -63,6 +66,7 @@ "modder_name": "Hobbitdur", "mod_info": "To reset gameplay mod", "mod_type": "Gameplay", + "default_selected": "false", "ffnx_param": {}, "lang": [ "de" @@ -80,6 +84,7 @@ "modder_name": "TrueOdin, myst6re, Cosmos, vertex2995", "mod_info": "Low level tools to interface with the game", "mod_type": "Wrapper", + "default_selected": "true", "ffnx_param": {}, "lang": [ "en", @@ -99,6 +104,7 @@ "modder_name": "TrueOdin", "mod_info": "To avoid having many click on launcher, just directly launch the game", "mod_type": "EaseOfLife", + "default_selected": "true", "ffnx_param": {}, "lang": [ "en", @@ -118,6 +124,7 @@ "modder_name": "myst6re", "mod_info": "Better music", "mod_type": "Music", + "default_selected": "false", "ffnx_param": { "use_external_music": "true", "external_music_path": "\"psf\"", @@ -142,6 +149,7 @@ "modder_name": "None", "mod_info": "None", "mod_type": "Music", + "default_selected": "false", "ffnx_param": { "use_external_music": "true", "external_music_path": "\"music\"", @@ -166,6 +174,7 @@ "modder_name": "MikeDoesAudio", "mod_info": "Original SoundTrack ReFined by a professional mixer", "mod_type": "Music", + "default_selected": "true", "ffnx_param": { "use_external_music": "true", "external_music_path": "\"music\"", @@ -184,6 +193,7 @@ "link": "https://nas-ludo.fr/drive/d/s/ydCVP829Bye9WUz2ncI4dQInltWN6IFz/webapi/entry.cgi/SYNO.SynologyDrive.Files/FFNxBattlefields.rar?api=SYNO.SynologyDrive.Files&method=download&version=2&files=%5B%22id%3A820784500098245147%22%5D&force_download=true&json_error=true&download_type=%22download%22&c2_offload=%22allow%22&_dc=1724337524125&sharing_token=%22tDH.P.phuQzM7_to9OQonrewdb5GPyQ2fZaTG8k5dLGc8S9.LMCVycV_o75iixvU74WQMzGC50YDBZ8J3pohCAJVxboUT4npnzFhUYcS67_sgyGM.c0K5MZSef1fXYvJb6FbUt08_nPNRFx2PDWCYDuix8wH4CArMWwcqGsrS1tAowjxXLu8wabyppWmQ7ZohhDke2e5OPHWDA5EE05rDtinoWWgBtazho96LRDjrNslLN_S2FrweiS4%22&SynoToken=bXXAHAd1hrf7w", "git_tag": "none", "mod_type": "Graphical", + "default_selected": "false", "rank": "80", "compatibility": [ "ffnx" @@ -209,6 +219,7 @@ "modder_name": "MCINDUS & Digixu", "mod_info": "Improve monster quality", "mod_type": "Graphical", + "default_selected": "false", "ffnx_param": {}, "lang": [ "en", @@ -228,6 +239,7 @@ "modder_name": "MCINDUS & Digixu", "mod_info": "Improve triple triad", "mod_type": "Graphical", + "default_selected": "false", "ffnx_param": {}, "lang": [ "en", @@ -247,6 +259,7 @@ "modder_name": "callisto", "mod_info": "Hard mod", "mod_type": "Gameplay", + "default_selected": "false", "ffnx_param": {}, "lang": [ "en" @@ -264,6 +277,7 @@ "modder_name": "Hobbitdur", "mod_info": "Hard mod that balance the game. WIP do not install if not a tester", "mod_type": "Gameplay", + "default_selected": "false", "ffnx_param": {}, "lang": [ "fr" @@ -281,6 +295,7 @@ "modder_name": "Antoine211 ", "mod_info": "Mod that keep all that is in the game but change everything to rediscover the game !", "mod_type": "Gameplay", + "default_selected": "false", "ffnx_param": {}, "lang": [ "fr" @@ -298,6 +313,7 @@ "modder_name": "mexico ", "mod_info": "Hard mod", "mod_type": "Gameplay", + "default_selected": "false", "ffnx_param": {}, "lang": [ "fr" diff --git a/hobbitgui.py b/hobbitgui.py index 04587af..bc4f3da 100644 --- a/hobbitgui.py +++ b/hobbitgui.py @@ -35,7 +35,6 @@ class WindowInstaller(QWidget): FF8_RELOAD_NAME = "FFVIII-Reloaded-FR-ONLY" RAGNAROK_NAME = "Ragnarok-EN-ONLY" LIST_SPECIAL_MOD = [FF8_RELOAD_NAME, RAGNAROK_NAME] - MOD_CHECK_DEFAULT = ['FFNx', 'FF78Launcher', 'Tsunamods-OST-RF'] VERSION_LIST = ["FF8 Steam 2013", "FF8 Remastered"] LANG_LIST = ["en", "fr", "de"] MOD_TYPE_LIST = ["All", "Wrapper", "Graphical", "Music", "Gameplay", "EaseOfLife"] @@ -108,6 +107,8 @@ def __setup_main(self): # Button Update link data self.update_data_button = QPushButton(parent=self, text="Updating mod list") self.update_data_button.clicked.connect(self.update_data_click) + self.update_data_button.setToolTip("Update mod list, version available and link") + self.update_data_over = QMessageBox(parent=self) self.update_data_over.setWindowTitle("Updating data over!") self.update_data_over.setText("Updating data over!") @@ -195,14 +196,13 @@ def __reset_mod_loaded(self): if self.language.currentText() in mod_info["lang"]: if (self.ff8_version.currentText() == self.VERSION_LIST[0] and "ffnx" in mod_info[ "compatibility"]) \ - or (self.ff8_version.currentText() == self.VERSION_LIST[1] and "demaster" in mod_info[ - "compatibility"]): + or (self.ff8_version.currentText() == self.VERSION_LIST[1] and "demaster" in mod_info["compatibility"]): if self.mod_type.currentText() == "All" or ( self.mod_type.currentText() == mod_info["mod_type"]): self.mod_checkbox[mod_name] = QCheckBox(parent=self, text=mod_name) self.mod_checkbox[mod_name].setToolTip( "Author: {}\nDescription: {}".format(mod_info["modder_name"], mod_info["mod_info"])) - if mod_name in self.MOD_CHECK_DEFAULT: + if mod_info["default_selected"] == "true": self.mod_checkbox[mod_name].setChecked(True) if mod_name == self.FF8_RELOAD_NAME: self.mod_checkbox[mod_name].toggled.connect(self.activate_ff8reload)