Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w1zard1 committed Mar 21, 2024
1 parent afc2955 commit 84c8681
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
13 changes: 6 additions & 7 deletions Tools/HolocronToolset/src/toolset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"toolsetDownloadLink": "https://deadlystream.com/files/file/1982-holocron-toolset",
"toolsetBetaDownloadLink": "https://mega.nz/folder/cGJDAKaa#WzsWF8LgUkM8U2FDEoeeRA",
"toolsetLatestNotes": "Fixed major bug that was causing most editors to load data incorrectly.",
"toolsetLatestBetaNotes": "<br> - Tons of performance optimizations<br> - Fix filtering by name in the Texture tab<br> - Fix editors not starting on top<br> - Use new strategy for IO<br> - Use pillow to load large TGA images.<br> - Fix reload/refresh buttons<br> - Prompt before creating a .mod when using module designer.<br> - Fix bug when compiling scripts inside RIMs, when rims saving setting is disabled.<br> - Optimize installation loading and show progress bar for the entire process.<br> - Fix issue with installations not being cached when swapping to a different installation in the combobox.<br> - Fix issue with windows not having separate taskbar entries.<br> - Add an option to disable/enable loading Override textures into the module designer (workaround for large textures taking ages to load).<br> - Add additional resources into the Core tab.<br><br>Thank you to the users who've reported the bugs in the last few versions.",
"toolsetLatestBetaNotes": "Various bugfixes, update when you are able :)",
"kits": {
"Black Vulkar Base": {"version": 1, "id": "blackvulkar"},
"Endar Spire": {"version": 1, "id": "endarspire"},
Expand Down Expand Up @@ -57,13 +57,12 @@ def getRemoteToolsetUpdateInfo(*, useBetaChannel: bool = False, silent: bool = F
# Use regex to extract the JSON part between the markers
json_data_match = re.search(r"<---JSON_START--->\#(.*?)\#<---JSON_END--->", decoded_content_str, flags=re.DOTALL)

if json_data_match:
json_str = json_data_match.group(1)
remoteInfo = json.loads(json_str)
if not isinstance(remoteInfo, dict):
raise TypeError(f"Expected remoteInfo to be a dict, instead got type {remoteInfo.__class__.__name__}") # noqa: TRY301
else:
if not json_data_match:
raise ValueError(f"JSON data not found or markers are incorrect: {json_data_match}") # noqa: TRY301
json_str = json_data_match.group(1)
remoteInfo = json.loads(json_str)
if not isinstance(remoteInfo, dict):
raise TypeError(f"Expected remoteInfo to be a dict, instead got type {remoteInfo.__class__.__name__}") # noqa: TRY301
except Exception as e: # noqa: BLE001
errMsg = str(universal_simplify_exception(e))
result = silent or QMessageBox.question(
Expand Down
5 changes: 3 additions & 2 deletions Tools/HolocronToolset/src/toolset/data/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def getter(this: Settings) -> Any:
return this.settings.value(name, l_default, l_default.__class__)

def setter(this: Settings, value: Any):
#serialized_value = jsonpickle.encode(value, warn=True)
this.settings.setValue(name, jsonpickle.encode(convert_value(value)))
converted_value = convert_value(value)
serialized_value = jsonpickle.encode(converted_value, warn=True)
this.settings.setValue(name, serialized_value)

return property(getter, setter)
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def setupValues(self):

def save(self):
self.settings.alsoCheckReleaseVersion = self.ui.alsoCheckReleaseVersion.isChecked()
self.settings.useBetaChannel = not self.ui.useBetaChannel.isChecked()
self.settings.useBetaChannel = self.ui.useBetaChannel.isChecked()
self.settings.disableRIMSaving = not self.ui.saveRimCheck.isChecked()
self.settings.joinRIMsTogether = self.ui.mergeRimCheck.isChecked()
self.settings.moduleSortOption = self.ui.moduleSortOptionComboBox.currentIndex()
Expand Down
11 changes: 4 additions & 7 deletions Tools/HolocronToolset/src/toolset/gui/windows/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,13 +941,10 @@ def _check_toolset_update(self, *, silent: bool):

toolsetLatestReleaseVersion = remoteInfo["toolsetLatestVersion"]
toolsetLatestBetaVersion = remoteInfo["toolsetLatestBetaVersion"]
releaseNewerThanBeta = remoteVersionNewer(toolsetLatestReleaseVersion, toolsetLatestBetaVersion)
if (
self.settings.alsoCheckReleaseVersion
and (
not self.settings.useBetaChannel
or releaseNewerThanBeta is True
)
releaseNewerThanBeta = not remoteVersionNewer(toolsetLatestReleaseVersion, toolsetLatestBetaVersion)
if self.settings.alsoCheckReleaseVersion and (
not self.settings.useBetaChannel
or releaseNewerThanBeta
):
releaseVersionChecked = True
greatestAvailableVersion = remoteInfo["toolsetLatestVersion"]
Expand Down

0 comments on commit 84c8681

Please sign in to comment.