aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.github/scripts/prepare_JREs.sh2
-rw-r--r--CMakeLists.txt7
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackIndex.cpp39
-rw-r--r--launcher/ui/pages/global/APIPage.ui5
4 files changed, 25 insertions, 28 deletions
diff --git a/.github/scripts/prepare_JREs.sh b/.github/scripts/prepare_JREs.sh
index b85e9c2f..ee713f81 100755
--- a/.github/scripts/prepare_JREs.sh
+++ b/.github/scripts/prepare_JREs.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-URL_JDK8="https://api.adoptium.net/v3/binary/latest/8/ga/linux/x64/jre/hotspot/normal/eclipse"
+URL_JDK8="https://api.adoptium.net/v3/binary/version/jdk8u312-b07/linux/x64/jre/hotspot/normal/eclipse"
URL_JDK17="https://api.adoptium.net/v3/binary/latest/17/ga/linux/x64/jre/hotspot/normal/eclipse"
mkdir -p JREs
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7cd0cf86..7537703c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -152,6 +152,10 @@ add_subdirectory(program_info)
# Install the build results according to platform
set(Launcher_PORTABLE 1 CACHE BOOL "The type of installation (Portable or System)")
+if (Launcher_PORTABLE)
+ # launcher/Application.cpp will use this value
+ set(Launcher_APP_BINARY_DEFS "-DLAUNCHER_PORTABLE")
+endif()
if(UNIX AND APPLE)
set(BINARY_DEST_DIR "${Launcher_Name}.app/Contents/MacOS")
@@ -191,9 +195,6 @@ elseif(UNIX)
set(BUNDLE_DEST_DIR ".")
set(JARS_DEST_DIR "bin/jars")
- # launcher/Application.cpp will use this value
- set(Launcher_APP_BINARY_DEFS "-DLAUNCHER_PORTABLE")
-
# Install basic runner script
configure_file(launcher/Launcher.in "${CMAKE_CURRENT_BINARY_DIR}/LauncherScript" @ONLY)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/LauncherScript" DESTINATION ${BUNDLE_DEST_DIR} RENAME ${Launcher_Name})
diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
index 9017eb67..9581ca04 100644
--- a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
+++ b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
@@ -51,31 +51,32 @@ void Modrinth::loadIndexedPackVersions(Modrinth::IndexedPack & pack, QJsonArray
auto files = Json::requireArray(obj, "files");
int i = 0;
- while (files.count() > 1 && i < files.count()){
- //try to resolve the correct file
+
+ // Find correct file (needed in cases where one version may have multiple files)
+ // Will default to the last one if there's no primary (though I think Modrinth requires that
+ // at least one file is primary, idk)
+ while (i < files.count()){
auto parent = files[i].toObject();
auto fileName = Json::requireString(parent, "filename");
- //avoid grabbing "dev" files
- if(fileName.contains("javadocs",Qt::CaseInsensitive) || fileName.contains("sources",Qt::CaseInsensitive)){
+
+ // Grab the correct mod loader
+ if(hasFabric){
+ if(fileName.contains("forge",Qt::CaseInsensitive)){
+ i++;
+ continue;
+ }
+ } else if(fileName.contains("fabric", Qt::CaseInsensitive)){
i++;
continue;
}
- //grab the correct mod loader
- if(fileName.contains("forge",Qt::CaseInsensitive) || fileName.contains("fabric",Qt::CaseInsensitive) ){
- if(hasFabric){
- if(fileName.contains("forge",Qt::CaseInsensitive)){
- i++;
- continue;
- }
- }else{
- if(fileName.contains("fabric",Qt::CaseInsensitive)){
- i++;
- continue;
- }
- }
- }
- break;
+
+ // Grab the primary file, if available
+ if(Json::requireBoolean(parent, "primary"))
+ break;
+
+ i++;
}
+
auto parent = files[i].toObject();
if(parent.contains("url")) {
file.downloadUrl = Json::requireString(parent, "url");
diff --git a/launcher/ui/pages/global/APIPage.ui b/launcher/ui/pages/global/APIPage.ui
index 28c53b79..1bc41e5a 100644
--- a/launcher/ui/pages/global/APIPage.ui
+++ b/launcher/ui/pages/global/APIPage.ui
@@ -74,11 +74,6 @@
<string>https://0x0.st</string>
</property>
</item>
- <item>
- <property name="text">
- <string>https://paste.polymc.org</string>
- </property>
- </item>
</widget>
</item>
<item>