Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into catpacks
This commit is contained in:
commit
f046bd7d50
32
.github/workflows/backport.yml
vendored
Normal file
32
.github/workflows/backport.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
name: Backport
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [closed, labeled]
|
||||||
|
|
||||||
|
# WARNING:
|
||||||
|
# When extending this action, be aware that $GITHUB_TOKEN allows write access to
|
||||||
|
# the GitHub repository. This means that it should not evaluate user input in a
|
||||||
|
# way that allows code injection.
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
backport:
|
||||||
|
permissions:
|
||||||
|
contents: write # for korthout/backport-action to create branch
|
||||||
|
pull-requests: write # for korthout/backport-action to create PR to backport
|
||||||
|
name: Backport Pull Request
|
||||||
|
if: github.repository_owner == 'PrismLauncher' && github.event.pull_request.merged == true && (github.event_name != 'labeled' || startsWith('backport', github.event.label.name))
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Create backport PRs
|
||||||
|
uses: korthout/backport-action@v1.3.1
|
||||||
|
with:
|
||||||
|
# Config README: https://github.com/korthout/backport-action#backport-action
|
||||||
|
pull_description: |-
|
||||||
|
Bot-based backport to `${target_branch}`, triggered by a label in #${pull_number}.
|
||||||
|
|
10
.github/workflows/build.yml
vendored
10
.github/workflows/build.yml
vendored
@ -264,23 +264,23 @@ jobs:
|
|||||||
- name: Configure CMake (macOS)
|
- name: Configure CMake (macOS)
|
||||||
if: runner.os == 'macOS' && matrix.qt_ver == 6
|
if: runner.os == 'macOS' && matrix.qt_ver == 6
|
||||||
run: |
|
run: |
|
||||||
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -G Ninja
|
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=official -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -G Ninja
|
||||||
|
|
||||||
- name: Configure CMake (macOS-Legacy)
|
- name: Configure CMake (macOS-Legacy)
|
||||||
if: runner.os == 'macOS' && matrix.qt_ver == 5
|
if: runner.os == 'macOS' && matrix.qt_ver == 5
|
||||||
run: |
|
run: |
|
||||||
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DMACOSX_SPARKLE_UPDATE_PUBLIC_KEY="" -DMACOSX_SPARKLE_UPDATE_FEED_URL="" -G Ninja
|
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=official -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DMACOSX_SPARKLE_UPDATE_PUBLIC_KEY="" -DMACOSX_SPARKLE_UPDATE_FEED_URL="" -G Ninja
|
||||||
|
|
||||||
- name: Configure CMake (Windows MinGW-w64)
|
- name: Configure CMake (Windows MinGW-w64)
|
||||||
if: runner.os == 'Windows' && matrix.msystem != ''
|
if: runner.os == 'Windows' && matrix.msystem != ''
|
||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
run: |
|
run: |
|
||||||
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=6 -DCMAKE_OBJDUMP=/mingw64/bin/objdump.exe -G Ninja
|
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=official -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=6 -DCMAKE_OBJDUMP=/mingw64/bin/objdump.exe -G Ninja
|
||||||
|
|
||||||
- name: Configure CMake (Windows MSVC)
|
- name: Configure CMake (Windows MSVC)
|
||||||
if: runner.os == 'Windows' && matrix.msystem == ''
|
if: runner.os == 'Windows' && matrix.msystem == ''
|
||||||
run: |
|
run: |
|
||||||
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" -A${{ matrix.architecture}} -DLauncher_FORCE_BUNDLED_LIBS=ON
|
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=official -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" -A${{ matrix.architecture}} -DLauncher_FORCE_BUNDLED_LIBS=ON
|
||||||
# https://github.com/ccache/ccache/wiki/MS-Visual-Studio (I coudn't figure out the compiler prefix)
|
# https://github.com/ccache/ccache/wiki/MS-Visual-Studio (I coudn't figure out the compiler prefix)
|
||||||
if ("${{ env.CCACHE_VAR }}")
|
if ("${{ env.CCACHE_VAR }}")
|
||||||
{
|
{
|
||||||
@ -295,7 +295,7 @@ jobs:
|
|||||||
- name: Configure CMake (Linux)
|
- name: Configure CMake (Linux)
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
run: |
|
run: |
|
||||||
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=Linux -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -G Ninja
|
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=official -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -G Ninja
|
||||||
|
|
||||||
##
|
##
|
||||||
# BUILD
|
# BUILD
|
||||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -19,3 +19,6 @@
|
|||||||
[submodule "libraries/cmark"]
|
[submodule "libraries/cmark"]
|
||||||
path = libraries/cmark
|
path = libraries/cmark
|
||||||
url = https://github.com/commonmark/cmark.git
|
url = https://github.com/commonmark/cmark.git
|
||||||
|
[submodule "flatpak/shared-modules"]
|
||||||
|
path = flatpak/shared-modules
|
||||||
|
url = https://github.com/flathub/shared-modules.git
|
||||||
|
@ -178,7 +178,7 @@ set(Launcher_VERSION_NAME4 "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.
|
|||||||
set(Launcher_VERSION_NAME4_COMMA "${Launcher_VERSION_MAJOR},${Launcher_VERSION_MINOR},0,0")
|
set(Launcher_VERSION_NAME4_COMMA "${Launcher_VERSION_MAJOR},${Launcher_VERSION_MINOR},0,0")
|
||||||
|
|
||||||
# Build platform.
|
# Build platform.
|
||||||
set(Launcher_BUILD_PLATFORM "" CACHE STRING "A short string identifying the platform that this build was built for. Only used to display in the about dialog.")
|
set(Launcher_BUILD_PLATFORM "unknown" CACHE STRING "A short string identifying the platform that this build was built for. Only used to display in the about dialog.")
|
||||||
|
|
||||||
# Channel list URL
|
# Channel list URL
|
||||||
set(Launcher_UPDATER_BASE "" CACHE STRING "Base URL for the updater.")
|
set(Launcher_UPDATER_BASE "" CACHE STRING "Base URL for the updater.")
|
||||||
|
@ -61,3 +61,10 @@ As a bonus, you can also [cryptographically sign your commits][gh-signing-commit
|
|||||||
|
|
||||||
[gh-signing-commits]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
|
[gh-signing-commits]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
|
||||||
[gh-vigilant-mode]: https://docs.github.com/en/authentication/managing-commit-signature-verification/displaying-verification-statuses-for-all-of-your-commits
|
[gh-vigilant-mode]: https://docs.github.com/en/authentication/managing-commit-signature-verification/displaying-verification-statuses-for-all-of-your-commits
|
||||||
|
|
||||||
|
|
||||||
|
## Backporting to Release Branches
|
||||||
|
|
||||||
|
We use [automated backports](https://github.com/PrismLauncher/PrismLauncher/blob/develop/.github/workflows/backport.yml) to merge specific contributions from develop into `release` branches.
|
||||||
|
|
||||||
|
This is done when pull requests are merged and have labels such as `backport release-7.x` - which should be added along with the milestone for the release.
|
||||||
|
@ -65,7 +65,7 @@ Config::Config()
|
|||||||
MAC_SPARKLE_PUB_KEY = "@MACOSX_SPARKLE_UPDATE_PUBLIC_KEY@";
|
MAC_SPARKLE_PUB_KEY = "@MACOSX_SPARKLE_UPDATE_PUBLIC_KEY@";
|
||||||
MAC_SPARKLE_APPCAST_URL = "@MACOSX_SPARKLE_UPDATE_FEED_URL@";
|
MAC_SPARKLE_APPCAST_URL = "@MACOSX_SPARKLE_UPDATE_FEED_URL@";
|
||||||
|
|
||||||
if (BUILD_PLATFORM == "macOS" && !MAC_SPARKLE_PUB_KEY.isEmpty() && !MAC_SPARKLE_APPCAST_URL.isEmpty())
|
if (!MAC_SPARKLE_PUB_KEY.isEmpty() && !MAC_SPARKLE_APPCAST_URL.isEmpty())
|
||||||
{
|
{
|
||||||
UPDATER_ENABLED = true;
|
UPDATER_ENABLED = true;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ class Config {
|
|||||||
|
|
||||||
bool UPDATER_ENABLED = false;
|
bool UPDATER_ENABLED = false;
|
||||||
|
|
||||||
/// A short string identifying this build's platform. For example, "lin64" or "win32".
|
/// A short string identifying this build's platform or distribution.
|
||||||
QString BUILD_PLATFORM;
|
QString BUILD_PLATFORM;
|
||||||
|
|
||||||
/// A string containing the build timestamp
|
/// A string containing the build timestamp
|
||||||
|
18
flake.lock
generated
18
flake.lock
generated
@ -21,11 +21,11 @@
|
|||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1688254665,
|
"lastModified": 1688466019,
|
||||||
"narHash": "sha256-8FHEgBrr7gYNiS/NzCxIO3m4hvtLRW9YY1nYo1ivm3o=",
|
"narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "267149c58a14d15f7f81b4d737308421de9d7152",
|
"rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -91,11 +91,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1688221086,
|
"lastModified": 1689413807,
|
||||||
"narHash": "sha256-cdW6qUL71cNWhHCpMPOJjlw0wzSRP0pVlRn2vqX/VVg=",
|
"narHash": "sha256-exuzOvOhGAEKWQKwDuZAL4N8a1I837hH5eocaTcIbLc=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "cd99c2b3c9f160cd004318e0697f90bbd5960825",
|
"rev": "46ed466081b9cad1125b11f11a2af5cc40b942c7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -138,11 +138,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1688386108,
|
"lastModified": 1689328505,
|
||||||
"narHash": "sha256-Vffto9QaVonzYAcPlAzd0soqWYpPpKk60dfNLSIXcFA=",
|
"narHash": "sha256-9B3+OeUn1a/CvzE3GW6nWNwS5J7PDHTyHGlpL3wV5oA=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "42587d3414d1747999a5f71e92a83cf6547b62da",
|
"rev": "5e28316db471d1ac234beb70031b635437421dd6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
22
flatpak/libdecor.json
Normal file
22
flatpak/libdecor.json
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"name": "libdecor",
|
||||||
|
"buildsystem": "meson",
|
||||||
|
"config-opts": [
|
||||||
|
"-Ddemo=false"
|
||||||
|
],
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://gitlab.freedesktop.org/libdecor/libdecor.git",
|
||||||
|
"commit": "73260393a97291c887e1074ab7f318e031be0ac6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "patch",
|
||||||
|
"path": "patches/weird_libdecor.patch"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"cleanup": [
|
||||||
|
"/include",
|
||||||
|
"/lib/pkgconfig"
|
||||||
|
]
|
||||||
|
}
|
@ -5,13 +5,6 @@ sdk: org.kde.Sdk
|
|||||||
sdk-extensions:
|
sdk-extensions:
|
||||||
- org.freedesktop.Sdk.Extension.openjdk17
|
- org.freedesktop.Sdk.Extension.openjdk17
|
||||||
- org.freedesktop.Sdk.Extension.openjdk8
|
- org.freedesktop.Sdk.Extension.openjdk8
|
||||||
add-extensions:
|
|
||||||
com.valvesoftware.Steam.Utility.gamescope:
|
|
||||||
version: stable
|
|
||||||
add-ld-path: lib
|
|
||||||
no-autodownload: true
|
|
||||||
autodelete: false
|
|
||||||
directory: utils/gamescope
|
|
||||||
|
|
||||||
command: prismlauncher
|
command: prismlauncher
|
||||||
finish-args:
|
finish-args:
|
||||||
@ -26,12 +19,22 @@ finish-args:
|
|||||||
# Mod drag&drop
|
# Mod drag&drop
|
||||||
- --filesystem=xdg-download:ro
|
- --filesystem=xdg-download:ro
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
- /lib/libGLU*
|
||||||
|
|
||||||
modules:
|
modules:
|
||||||
|
# Might be needed by some Controller mods (see https://github.com/isXander/Controlify/issues/31)
|
||||||
|
- shared-modules/libusb/libusb.json
|
||||||
|
|
||||||
|
# Needed for proper Wayland support
|
||||||
|
- libdecor.json
|
||||||
|
|
||||||
- name: prismlauncher
|
- name: prismlauncher
|
||||||
buildsystem: cmake-ninja
|
buildsystem: cmake-ninja
|
||||||
|
builddir: true
|
||||||
config-opts:
|
config-opts:
|
||||||
- -DLauncher_BUILD_PLATFORM=flatpak
|
- -DLauncher_BUILD_PLATFORM=flatpak
|
||||||
- -DCMAKE_BUILD_TYPE=Debug
|
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||||
- -DLauncher_QT_VERSION_MAJOR=5
|
- -DLauncher_QT_VERSION_MAJOR=5
|
||||||
build-options:
|
build-options:
|
||||||
env:
|
env:
|
||||||
@ -40,7 +43,7 @@ modules:
|
|||||||
sources:
|
sources:
|
||||||
- type: dir
|
- type: dir
|
||||||
path: ../
|
path: ../
|
||||||
builddir: true
|
|
||||||
- name: openjdk
|
- name: openjdk
|
||||||
buildsystem: simple
|
buildsystem: simple
|
||||||
build-commands:
|
build-commands:
|
||||||
@ -49,14 +52,45 @@ modules:
|
|||||||
- mv /app/jre /app/jdk/17
|
- mv /app/jre /app/jdk/17
|
||||||
- /usr/lib/sdk/openjdk8/install.sh
|
- /usr/lib/sdk/openjdk8/install.sh
|
||||||
- mv /app/jre /app/jdk/8
|
- mv /app/jre /app/jdk/8
|
||||||
cleanup: [/jre]
|
cleanup:
|
||||||
|
- /jre
|
||||||
|
|
||||||
|
- name: glfw
|
||||||
|
buildsystem: cmake-ninja
|
||||||
|
config-opts:
|
||||||
|
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||||
|
- -DBUILD_SHARED_LIBS:BOOL=ON
|
||||||
|
- -DGLFW_USE_WAYLAND=ON
|
||||||
|
sources:
|
||||||
|
- type: git
|
||||||
|
url: https://github.com/glfw/glfw.git
|
||||||
|
commit: 3fa2360720eeba1964df3c0ecf4b5df8648a8e52
|
||||||
|
- type: patch
|
||||||
|
path: patches/0003-Don-t-crash-on-calls-to-focus-or-icon.patch
|
||||||
|
- type: patch
|
||||||
|
path: patches/0005-Add-warning-about-being-an-unofficial-patch.patch
|
||||||
|
- type: patch
|
||||||
|
path: patches/0007-Platform-Prefer-Wayland-over-X11.patch
|
||||||
|
cleanup:
|
||||||
|
- /include
|
||||||
|
- /lib/cmake
|
||||||
|
- /lib/pkgconfig
|
||||||
|
|
||||||
- name: xrandr
|
- name: xrandr
|
||||||
buildsystem: autotools
|
buildsystem: autotools
|
||||||
sources:
|
sources:
|
||||||
- type: archive
|
- type: archive
|
||||||
url: https://xorg.freedesktop.org/archive/individual/app/xrandr-1.5.1.tar.xz
|
url: https://xorg.freedesktop.org/archive/individual/app/xrandr-1.5.2.tar.xz
|
||||||
sha256: 7bc76daf9d72f8aff885efad04ce06b90488a1a169d118dea8a2b661832e8762
|
sha256: c8bee4790d9058bacc4b6246456c58021db58a87ddda1a9d0139bf5f18f1f240
|
||||||
cleanup: [/share/man, /bin/xkeystone]
|
x-checker-data:
|
||||||
|
type: anitya
|
||||||
|
project-id: 14957
|
||||||
|
stable-only: true
|
||||||
|
url-template: https://xorg.freedesktop.org/archive/individual/app/xrandr-$version.tar.xz
|
||||||
|
cleanup:
|
||||||
|
- /share/man
|
||||||
|
- /bin/xkeystone
|
||||||
|
|
||||||
- name: gamemode
|
- name: gamemode
|
||||||
buildsystem: meson
|
buildsystem: meson
|
||||||
config-opts:
|
config-opts:
|
||||||
@ -67,19 +101,56 @@ modules:
|
|||||||
# post-install is running inside the build dir, we need it from the source though
|
# post-install is running inside the build dir, we need it from the source though
|
||||||
- install -Dm755 ../data/gamemoderun -t /app/bin
|
- install -Dm755 ../data/gamemoderun -t /app/bin
|
||||||
sources:
|
sources:
|
||||||
- type: git
|
- type: archive
|
||||||
url: https://github.com/FeralInteractive/gamemode
|
archive-type: tar-gzip
|
||||||
tag: "1.7"
|
url: https://api.github.com/repos/FeralInteractive/gamemode/tarball/1.7
|
||||||
commit: 4dc99dff76218718763a6b07fc1900fa6d1dafd9
|
sha256: 57ce73ba605d1cf12f8d13725006a895182308d93eba0f69f285648449641803
|
||||||
|
x-checker-data:
|
||||||
|
type: json
|
||||||
|
url: https://api.github.com/repos/FeralInteractive/gamemode/releases/latest
|
||||||
|
version-query: .tag_name
|
||||||
|
url-query: .tarball_url
|
||||||
|
timestamp-query: .published_at
|
||||||
|
cleanup:
|
||||||
|
- /include
|
||||||
|
- /lib/pkgconfig
|
||||||
|
- /lib/libgamemodeauto.a
|
||||||
|
|
||||||
|
- name: glxinfo
|
||||||
|
buildsystem: meson
|
||||||
|
config-opts:
|
||||||
|
- --bindir=/app/mesa-demos
|
||||||
|
- -Degl=disabled
|
||||||
|
- -Dglut=disabled
|
||||||
|
- -Dosmesa=disabled
|
||||||
|
- -Dvulkan=disabled
|
||||||
|
- -Dwayland=disabled
|
||||||
|
post-install:
|
||||||
|
- mv -v /app/mesa-demos/glxinfo /app/bin
|
||||||
|
sources:
|
||||||
|
- type: archive
|
||||||
|
url: https://archive.mesa3d.org/demos/mesa-demos-9.0.0.tar.xz
|
||||||
|
sha256: 3046a3d26a7b051af7ebdd257a5f23bfeb160cad6ed952329cdff1e9f1ed496b
|
||||||
|
x-checker-data:
|
||||||
|
type: anitya
|
||||||
|
project-id: 16781
|
||||||
|
stable-only: true
|
||||||
|
url-template: https://archive.mesa3d.org/demos/mesa-demos-$version.tar.xz
|
||||||
|
cleanup:
|
||||||
|
- /include
|
||||||
|
- /mesa-demos
|
||||||
|
- /share
|
||||||
|
modules:
|
||||||
|
- shared-modules/glu/glu-9.json
|
||||||
|
|
||||||
- name: enhance
|
- name: enhance
|
||||||
buildsystem: simple
|
buildsystem: simple
|
||||||
build-commands:
|
build-commands:
|
||||||
- mkdir -p /app/utils/gamescope
|
|
||||||
- install -Dm755 prime-run /app/bin/prime-run
|
- install -Dm755 prime-run /app/bin/prime-run
|
||||||
- mv /app/bin/prismlauncher /app/bin/prismrun
|
- mv /app/bin/prismlauncher /app/bin/prismrun
|
||||||
- install -Dm755 prismlauncher /app/bin/prismlauncher
|
- install -Dm755 prismlauncher /app/bin/prismlauncher
|
||||||
sources:
|
sources:
|
||||||
- type: file
|
- type: file
|
||||||
path: ../flatpak/prime-run
|
path: prime-run
|
||||||
- type: file
|
- type: file
|
||||||
path: ../flatpak/prismlauncher
|
path: prismlauncher
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
diff --git a/src/wl_window.c b/src/wl_window.c
|
||||||
|
index 52d3b9eb..4ac4eb5d 100644
|
||||||
|
--- a/src/wl_window.c
|
||||||
|
+++ b/src/wl_window.c
|
||||||
|
@@ -2117,8 +2117,7 @@ void _glfwSetWindowTitleWayland(_GLFWwindow* window, const char* title)
|
||||||
|
void _glfwSetWindowIconWayland(_GLFWwindow* window,
|
||||||
|
int count, const GLFWimage* images)
|
||||||
|
{
|
||||||
|
- _glfwInputError(GLFW_FEATURE_UNAVAILABLE,
|
||||||
|
- "Wayland: The platform does not support setting the window icon");
|
||||||
|
+ fprintf(stderr, "!!! Ignoring Error: Wayland: The platform does not support setting the window icon\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void _glfwGetWindowPosWayland(_GLFWwindow* window, int* xpos, int* ypos)
|
||||||
|
@@ -2361,8 +2360,7 @@ void _glfwRequestWindowAttentionWayland(_GLFWwindow* window)
|
||||||
|
|
||||||
|
void _glfwFocusWindowWayland(_GLFWwindow* window)
|
||||||
|
{
|
||||||
|
- _glfwInputError(GLFW_FEATURE_UNAVAILABLE,
|
||||||
|
- "Wayland: The platform does not support setting the input focus");
|
||||||
|
+ fprintf(stderr, "!!! Ignoring Error: Wayland: The platform does not support setting the input focus\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void _glfwSetWindowMonitorWayland(_GLFWwindow* window,
|
@ -0,0 +1,17 @@
|
|||||||
|
diff --git a/src/init.c b/src/init.c
|
||||||
|
index 06dbb3f2..a7c6da86 100644
|
||||||
|
--- a/src/init.c
|
||||||
|
+++ b/src/init.c
|
||||||
|
@@ -449,6 +449,12 @@ GLFWAPI int glfwInit(void)
|
||||||
|
_glfw.initialized = GLFW_TRUE;
|
||||||
|
|
||||||
|
glfwDefaultWindowHints();
|
||||||
|
+
|
||||||
|
+ fprintf(stderr, "!!! Patched GLFW from https://github.com/Admicos/minecraft-wayland\n"
|
||||||
|
+ "!!! If any issues with the window, or some issues with rendering, occur, "
|
||||||
|
+ "first try with the built-in GLFW, and if that solves the issue, report there first.\n"
|
||||||
|
+ "!!! Use outside Minecraft is untested, and things might break.\n");
|
||||||
|
+
|
||||||
|
return GLFW_TRUE;
|
||||||
|
}
|
||||||
|
|
20
flatpak/patches/0007-Platform-Prefer-Wayland-over-X11.patch
Normal file
20
flatpak/patches/0007-Platform-Prefer-Wayland-over-X11.patch
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
diff --git a/src/platform.c b/src/platform.c
|
||||||
|
index c5966ae7..3e7442f9 100644
|
||||||
|
--- a/src/platform.c
|
||||||
|
+++ b/src/platform.c
|
||||||
|
@@ -49,12 +49,12 @@ static const struct
|
||||||
|
#if defined(_GLFW_COCOA)
|
||||||
|
{ GLFW_PLATFORM_COCOA, _glfwConnectCocoa },
|
||||||
|
#endif
|
||||||
|
-#if defined(_GLFW_X11)
|
||||||
|
- { GLFW_PLATFORM_X11, _glfwConnectX11 },
|
||||||
|
-#endif
|
||||||
|
#if defined(_GLFW_WAYLAND)
|
||||||
|
{ GLFW_PLATFORM_WAYLAND, _glfwConnectWayland },
|
||||||
|
#endif
|
||||||
|
+#if defined(_GLFW_X11)
|
||||||
|
+ { GLFW_PLATFORM_X11, _glfwConnectX11 },
|
||||||
|
+#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
GLFWbool _glfwSelectPlatform(int desiredID, _GLFWplatform* platform)
|
40
flatpak/patches/weird_libdecor.patch
Normal file
40
flatpak/patches/weird_libdecor.patch
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
diff --git a/src/libdecor.c b/src/libdecor.c
|
||||||
|
index a9c1106..1aa38b3 100644
|
||||||
|
--- a/src/libdecor.c
|
||||||
|
+++ b/src/libdecor.c
|
||||||
|
@@ -1391,22 +1391,32 @@ calculate_priority(const struct libdecor_plugin_description *plugin_description)
|
||||||
|
static bool
|
||||||
|
check_symbol_conflicts(const struct libdecor_plugin_description *plugin_description)
|
||||||
|
{
|
||||||
|
+ bool ret = true;
|
||||||
|
char * const *symbol;
|
||||||
|
+ void* main_prog = dlopen(NULL, RTLD_LAZY);
|
||||||
|
+ if (!main_prog) {
|
||||||
|
+ fprintf(stderr, "Plugin \"%s\" couldn't check conflicting symbols: \"%s\".\n",
|
||||||
|
+ plugin_description->description, dlerror());
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
|
||||||
|
symbol = plugin_description->conflicting_symbols;
|
||||||
|
while (*symbol) {
|
||||||
|
dlerror();
|
||||||
|
- dlsym (RTLD_DEFAULT, *symbol);
|
||||||
|
+ dlsym (main_prog, *symbol);
|
||||||
|
if (!dlerror()) {
|
||||||
|
fprintf(stderr, "Plugin \"%s\" uses conflicting symbol \"%s\".\n",
|
||||||
|
plugin_description->description, *symbol);
|
||||||
|
- return false;
|
||||||
|
+ ret = false;
|
||||||
|
+ break;
|
||||||
|
}
|
||||||
|
|
||||||
|
symbol++;
|
||||||
|
}
|
||||||
|
|
||||||
|
- return true;
|
||||||
|
+ dlclose(main_prog);
|
||||||
|
+ return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct plugin_loader *
|
@ -5,7 +5,7 @@ for i in {0..9}; do
|
|||||||
test -S "$XDG_RUNTIME_DIR"/discord-ipc-"$i" || ln -sf {app/com.discordapp.Discord,"$XDG_RUNTIME_DIR"}/discord-ipc-"$i";
|
test -S "$XDG_RUNTIME_DIR"/discord-ipc-"$i" || ln -sf {app/com.discordapp.Discord,"$XDG_RUNTIME_DIR"}/discord-ipc-"$i";
|
||||||
done
|
done
|
||||||
|
|
||||||
export PATH="${PATH}${PATH:+:}/app/utils/gamescope/bin:/usr/lib/extensions/vulkan/MangoHud/bin"
|
export PATH="${PATH}${PATH:+:}/usr/lib/extensions/vulkan/gamescope/bin:/usr/lib/extensions/vulkan/MangoHud/bin"
|
||||||
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}/usr/lib/extensions/vulkan/MangoHud/\$LIB/"
|
export VK_LAYER_PATH="/usr/lib/extensions/vulkan/share/vulkan/implicit_layer.d/"
|
||||||
|
|
||||||
exec /app/bin/prismrun "$@"
|
exec /app/bin/prismrun "$@"
|
||||||
|
1
flatpak/shared-modules
Submodule
1
flatpak/shared-modules
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 45094ca570be383d06df729b6972830ec63bd3df
|
@ -6,9 +6,10 @@
|
|||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
||||||
* Copyright (C) 2022 Lenny McLennington <lenny@sneed.church>
|
* Copyright (C) 2022 Lenny McLennington <lenny@sneed.church>
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
* Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me>
|
* Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me>
|
||||||
* Copyright (C) 2023 Rachel Powers <508861+Ryex@users.noreply.github.com>
|
* Copyright (C) 2023 Rachel Powers <508861+Ryex@users.noreply.github.com>
|
||||||
|
* Copyright (C) 2023 seth <getchoo at tuta dot io>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -475,6 +476,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
|
|
||||||
qDebug() << BuildConfig.LAUNCHER_DISPLAYNAME << ", (c) 2013-2021 " << BuildConfig.LAUNCHER_COPYRIGHT;
|
qDebug() << BuildConfig.LAUNCHER_DISPLAYNAME << ", (c) 2013-2021 " << BuildConfig.LAUNCHER_COPYRIGHT;
|
||||||
qDebug() << "Version : " << BuildConfig.printableVersionString();
|
qDebug() << "Version : " << BuildConfig.printableVersionString();
|
||||||
|
qDebug() << "Platform : " << BuildConfig.BUILD_PLATFORM;
|
||||||
qDebug() << "Git commit : " << BuildConfig.GIT_COMMIT;
|
qDebug() << "Git commit : " << BuildConfig.GIT_COMMIT;
|
||||||
qDebug() << "Git refspec : " << BuildConfig.GIT_REFSPEC;
|
qDebug() << "Git refspec : " << BuildConfig.GIT_REFSPEC;
|
||||||
if (adjustedBy.size())
|
if (adjustedBy.size())
|
||||||
@ -609,6 +611,9 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
m_settings->registerSetting("IgnoreJavaCompatibility", false);
|
m_settings->registerSetting("IgnoreJavaCompatibility", false);
|
||||||
m_settings->registerSetting("IgnoreJavaWizard", false);
|
m_settings->registerSetting("IgnoreJavaWizard", false);
|
||||||
|
|
||||||
|
// Mod loader settings
|
||||||
|
m_settings->registerSetting("DisableQuiltBeacon", false);
|
||||||
|
|
||||||
// Native library workarounds
|
// Native library workarounds
|
||||||
m_settings->registerSetting("UseNativeOpenAL", false);
|
m_settings->registerSetting("UseNativeOpenAL", false);
|
||||||
m_settings->registerSetting("UseNativeGLFW", false);
|
m_settings->registerSetting("UseNativeGLFW", false);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
* Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me>
|
* Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -15,15 +15,14 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <QString>
|
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
|
#include <QString>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* An abstract base class for versions.
|
* An abstract base class for versions.
|
||||||
*/
|
*/
|
||||||
class BaseVersion
|
class BaseVersion {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
using Ptr = std::shared_ptr<BaseVersion>;
|
using Ptr = std::shared_ptr<BaseVersion>;
|
||||||
virtual ~BaseVersion() {}
|
virtual ~BaseVersion() {}
|
||||||
@ -45,14 +44,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual QString typeString() const = 0;
|
virtual QString typeString() const = 0;
|
||||||
|
|
||||||
virtual bool operator<(BaseVersion &a)
|
virtual bool operator<(BaseVersion& a) { return name() < a.name(); };
|
||||||
{
|
virtual bool operator>(BaseVersion& a) { return name() > a.name(); };
|
||||||
return name() < a.name();
|
|
||||||
};
|
|
||||||
virtual bool operator>(BaseVersion &a)
|
|
||||||
{
|
|
||||||
return name() > a.name();
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(BaseVersion::Ptr)
|
Q_DECLARE_METATYPE(BaseVersion::Ptr)
|
||||||
|
@ -390,7 +390,10 @@ void LaunchController::launchInstance()
|
|||||||
m_launcher->prependStep(makeShared<TextPrint>(m_launcher.get(), "Launched instance in " + online_mode + " mode\n", MessageLevel::Launcher));
|
m_launcher->prependStep(makeShared<TextPrint>(m_launcher.get(), "Launched instance in " + online_mode + " mode\n", MessageLevel::Launcher));
|
||||||
|
|
||||||
// Prepend Version
|
// Prepend Version
|
||||||
m_launcher->prependStep(makeShared<TextPrint>(m_launcher.get(), BuildConfig.LAUNCHER_DISPLAYNAME + " version: " + BuildConfig.printableVersionString() + "\n\n", MessageLevel::Launcher));
|
{
|
||||||
|
auto versionString = QString("%1 version: %2 (%3)").arg(BuildConfig.LAUNCHER_DISPLAYNAME, BuildConfig.printableVersionString(), BuildConfig.BUILD_PLATFORM);
|
||||||
|
m_launcher->prependStep(makeShared<TextPrint>(m_launcher.get(), versionString + "\n\n", MessageLevel::Launcher));
|
||||||
|
}
|
||||||
m_launcher->start();
|
m_launcher->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* PolyMC - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
||||||
|
* Copyright (c) 2023 Trial97 <alexandru.tripon97@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -33,56 +34,50 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "MMCZip.h"
|
||||||
#include <quazip/quazip.h>
|
#include <quazip/quazip.h>
|
||||||
#include <quazip/quazipdir.h>
|
#include <quazip/quazipdir.h>
|
||||||
#include <quazip/quazipfile.h>
|
#include <quazip/quazipfile.h>
|
||||||
#include "MMCZip.h"
|
|
||||||
#include "FileSystem.h"
|
#include "FileSystem.h"
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QtConcurrentRun>
|
||||||
|
|
||||||
|
namespace MMCZip {
|
||||||
// ours
|
// ours
|
||||||
bool MMCZip::mergeZipFiles(QuaZip *into, QFileInfo from, QSet<QString> &contained, const FilterFunction filter)
|
bool mergeZipFiles(QuaZip* into, QFileInfo from, QSet<QString>& contained, const FilterFunction filter)
|
||||||
{
|
{
|
||||||
QuaZip modZip(from.filePath());
|
QuaZip modZip(from.filePath());
|
||||||
modZip.open(QuaZip::mdUnzip);
|
modZip.open(QuaZip::mdUnzip);
|
||||||
|
|
||||||
QuaZipFile fileInsideMod(&modZip);
|
QuaZipFile fileInsideMod(&modZip);
|
||||||
QuaZipFile zipOutFile(into);
|
QuaZipFile zipOutFile(into);
|
||||||
for (bool more = modZip.goToFirstFile(); more; more = modZip.goToNextFile())
|
for (bool more = modZip.goToFirstFile(); more; more = modZip.goToNextFile()) {
|
||||||
{
|
|
||||||
QString filename = modZip.getCurrentFileName();
|
QString filename = modZip.getCurrentFileName();
|
||||||
if (filter && !filter(filename))
|
if (filter && !filter(filename)) {
|
||||||
{
|
qDebug() << "Skipping file " << filename << " from " << from.fileName() << " - filtered";
|
||||||
qDebug() << "Skipping file " << filename << " from "
|
|
||||||
<< from.fileName() << " - filtered";
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (contained.contains(filename))
|
if (contained.contains(filename)) {
|
||||||
{
|
qDebug() << "Skipping already contained file " << filename << " from " << from.fileName();
|
||||||
qDebug() << "Skipping already contained file " << filename << " from "
|
|
||||||
<< from.fileName();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
contained.insert(filename);
|
contained.insert(filename);
|
||||||
|
|
||||||
if (!fileInsideMod.open(QIODevice::ReadOnly))
|
if (!fileInsideMod.open(QIODevice::ReadOnly)) {
|
||||||
{
|
|
||||||
qCritical() << "Failed to open " << filename << " from " << from.fileName();
|
qCritical() << "Failed to open " << filename << " from " << from.fileName();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QuaZipNewInfo info_out(fileInsideMod.getActualFileName());
|
QuaZipNewInfo info_out(fileInsideMod.getActualFileName());
|
||||||
|
|
||||||
if (!zipOutFile.open(QIODevice::WriteOnly, info_out))
|
if (!zipOutFile.open(QIODevice::WriteOnly, info_out)) {
|
||||||
{
|
|
||||||
qCritical() << "Failed to open " << filename << " in the jar";
|
qCritical() << "Failed to open " << filename << " in the jar";
|
||||||
fileInsideMod.close();
|
fileInsideMod.close();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!JlCompress::copyData(fileInsideMod, zipOutFile))
|
if (!JlCompress::copyData(fileInsideMod, zipOutFile)) {
|
||||||
{
|
|
||||||
zipOutFile.close();
|
zipOutFile.close();
|
||||||
fileInsideMod.close();
|
fileInsideMod.close();
|
||||||
qCritical() << "Failed to copy data of " << filename << " into the jar";
|
qCritical() << "Failed to copy data of " << filename << " into the jar";
|
||||||
@ -94,10 +89,11 @@ bool MMCZip::mergeZipFiles(QuaZip *into, QFileInfo from, QSet<QString> &containe
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MMCZip::compressDirFiles(QuaZip *zip, QString dir, QFileInfoList files, bool followSymlinks)
|
bool compressDirFiles(QuaZip* zip, QString dir, QFileInfoList files, bool followSymlinks)
|
||||||
{
|
{
|
||||||
QDir directory(dir);
|
QDir directory(dir);
|
||||||
if (!directory.exists()) return false;
|
if (!directory.exists())
|
||||||
|
return false;
|
||||||
|
|
||||||
for (auto e : files) {
|
for (auto e : files) {
|
||||||
auto filePath = directory.relativeFilePath(e.absoluteFilePath());
|
auto filePath = directory.relativeFilePath(e.absoluteFilePath());
|
||||||
@ -109,13 +105,14 @@ bool MMCZip::compressDirFiles(QuaZip *zip, QString dir, QFileInfoList files, boo
|
|||||||
srcPath = e.canonicalFilePath();
|
srcPath = e.canonicalFilePath();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !JlCompress::compressFile(zip, srcPath, filePath)) return false;
|
if (!JlCompress::compressFile(zip, srcPath, filePath))
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MMCZip::compressDirFiles(QString fileCompressed, QString dir, QFileInfoList files, bool followSymlinks)
|
bool compressDirFiles(QString fileCompressed, QString dir, QFileInfoList files, bool followSymlinks)
|
||||||
{
|
{
|
||||||
QuaZip zip(fileCompressed);
|
QuaZip zip(fileCompressed);
|
||||||
QDir().mkpath(QFileInfo(fileCompressed).absolutePath());
|
QDir().mkpath(QFileInfo(fileCompressed).absolutePath());
|
||||||
@ -136,11 +133,10 @@ bool MMCZip::compressDirFiles(QString fileCompressed, QString dir, QFileInfoList
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ours
|
// ours
|
||||||
bool MMCZip::createModdedJar(QString sourceJarPath, QString targetJarPath, const QList<Mod*>& mods)
|
bool createModdedJar(QString sourceJarPath, QString targetJarPath, const QList<Mod*>& mods)
|
||||||
{
|
{
|
||||||
QuaZip zipOut(targetJarPath);
|
QuaZip zipOut(targetJarPath);
|
||||||
if (!zipOut.open(QuaZip::mdCreate))
|
if (!zipOut.open(QuaZip::mdCreate)) {
|
||||||
{
|
|
||||||
QFile::remove(targetJarPath);
|
QFile::remove(targetJarPath);
|
||||||
qCritical() << "Failed to open the minecraft.jar for modding";
|
qCritical() << "Failed to open the minecraft.jar for modding";
|
||||||
return false;
|
return false;
|
||||||
@ -151,37 +147,29 @@ bool MMCZip::createModdedJar(QString sourceJarPath, QString targetJarPath, const
|
|||||||
|
|
||||||
// Modify the jar
|
// Modify the jar
|
||||||
// This needs to be done in reverse-order to ensure we respect the loading order of components
|
// This needs to be done in reverse-order to ensure we respect the loading order of components
|
||||||
for (auto i = mods.crbegin(); i != mods.crend(); i++)
|
for (auto i = mods.crbegin(); i != mods.crend(); i++) {
|
||||||
{
|
|
||||||
const auto* mod = *i;
|
const auto* mod = *i;
|
||||||
// do not merge disabled mods.
|
// do not merge disabled mods.
|
||||||
if (!mod->enabled())
|
if (!mod->enabled())
|
||||||
continue;
|
continue;
|
||||||
if (mod->type() == ResourceType::ZIPFILE)
|
if (mod->type() == ResourceType::ZIPFILE) {
|
||||||
{
|
if (!mergeZipFiles(&zipOut, mod->fileinfo(), addedFiles)) {
|
||||||
if (!mergeZipFiles(&zipOut, mod->fileinfo(), addedFiles))
|
|
||||||
{
|
|
||||||
zipOut.close();
|
zipOut.close();
|
||||||
QFile::remove(targetJarPath);
|
QFile::remove(targetJarPath);
|
||||||
qCritical() << "Failed to add" << mod->fileinfo().fileName() << "to the jar.";
|
qCritical() << "Failed to add" << mod->fileinfo().fileName() << "to the jar.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
} else if (mod->type() == ResourceType::SINGLEFILE) {
|
||||||
else if (mod->type() == ResourceType::SINGLEFILE)
|
|
||||||
{
|
|
||||||
// FIXME: buggy - does not work with addedFiles
|
// FIXME: buggy - does not work with addedFiles
|
||||||
auto filename = mod->fileinfo();
|
auto filename = mod->fileinfo();
|
||||||
if (!JlCompress::compressFile(&zipOut, filename.absoluteFilePath(), filename.fileName()))
|
if (!JlCompress::compressFile(&zipOut, filename.absoluteFilePath(), filename.fileName())) {
|
||||||
{
|
|
||||||
zipOut.close();
|
zipOut.close();
|
||||||
QFile::remove(targetJarPath);
|
QFile::remove(targetJarPath);
|
||||||
qCritical() << "Failed to add" << mod->fileinfo().fileName() << "to the jar.";
|
qCritical() << "Failed to add" << mod->fileinfo().fileName() << "to the jar.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
addedFiles.insert(filename.fileName());
|
addedFiles.insert(filename.fileName());
|
||||||
}
|
} else if (mod->type() == ResourceType::FOLDER) {
|
||||||
else if (mod->type() == ResourceType::FOLDER)
|
|
||||||
{
|
|
||||||
// untested, but seems to be unused / not possible to reach
|
// untested, but seems to be unused / not possible to reach
|
||||||
// FIXME: buggy - does not work with addedFiles
|
// FIXME: buggy - does not work with addedFiles
|
||||||
auto filename = mod->fileinfo();
|
auto filename = mod->fileinfo();
|
||||||
@ -190,25 +178,21 @@ bool MMCZip::createModdedJar(QString sourceJarPath, QString targetJarPath, const
|
|||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
QString parent_dir = dir.absolutePath();
|
QString parent_dir = dir.absolutePath();
|
||||||
auto files = QFileInfoList();
|
auto files = QFileInfoList();
|
||||||
MMCZip::collectFileListRecursively(what_to_zip, nullptr, &files, nullptr);
|
collectFileListRecursively(what_to_zip, nullptr, &files, nullptr);
|
||||||
|
|
||||||
for (auto e : files) {
|
for (auto e : files) {
|
||||||
if (addedFiles.contains(e.filePath()))
|
if (addedFiles.contains(e.filePath()))
|
||||||
files.removeAll(e);
|
files.removeAll(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!MMCZip::compressDirFiles(&zipOut, parent_dir, files))
|
if (!compressDirFiles(&zipOut, parent_dir, files)) {
|
||||||
{
|
|
||||||
zipOut.close();
|
zipOut.close();
|
||||||
QFile::remove(targetJarPath);
|
QFile::remove(targetJarPath);
|
||||||
qCritical() << "Failed to add" << mod->fileinfo().fileName() << "to the jar.";
|
qCritical() << "Failed to add" << mod->fileinfo().fileName() << "to the jar.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
qDebug() << "Adding folder " << filename.fileName() << " from "
|
qDebug() << "Adding folder " << filename.fileName() << " from " << filename.absoluteFilePath();
|
||||||
<< filename.absoluteFilePath();
|
} else {
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Make sure we do not continue launching when something is missing or undefined...
|
// Make sure we do not continue launching when something is missing or undefined...
|
||||||
zipOut.close();
|
zipOut.close();
|
||||||
QFile::remove(targetJarPath);
|
QFile::remove(targetJarPath);
|
||||||
@ -217,8 +201,7 @@ bool MMCZip::createModdedJar(QString sourceJarPath, QString targetJarPath, const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mergeZipFiles(&zipOut, QFileInfo(sourceJarPath), addedFiles, [](const QString key){return !key.contains("META-INF");}))
|
if (!mergeZipFiles(&zipOut, QFileInfo(sourceJarPath), addedFiles, [](const QString key) { return !key.contains("META-INF"); })) {
|
||||||
{
|
|
||||||
zipOut.close();
|
zipOut.close();
|
||||||
QFile::remove(targetJarPath);
|
QFile::remove(targetJarPath);
|
||||||
qCritical() << "Failed to insert minecraft.jar contents.";
|
qCritical() << "Failed to insert minecraft.jar contents.";
|
||||||
@ -227,8 +210,7 @@ bool MMCZip::createModdedJar(QString sourceJarPath, QString targetJarPath, const
|
|||||||
|
|
||||||
// Recompress the jar
|
// Recompress the jar
|
||||||
zipOut.close();
|
zipOut.close();
|
||||||
if (zipOut.getZipError() != 0)
|
if (zipOut.getZipError() != 0) {
|
||||||
{
|
|
||||||
QFile::remove(targetJarPath);
|
QFile::remove(targetJarPath);
|
||||||
qCritical() << "Failed to finalize minecraft.jar!";
|
qCritical() << "Failed to finalize minecraft.jar!";
|
||||||
return false;
|
return false;
|
||||||
@ -237,7 +219,7 @@ bool MMCZip::createModdedJar(QString sourceJarPath, QString targetJarPath, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ours
|
// ours
|
||||||
QString MMCZip::findFolderOfFileInZip(QuaZip* zip, const QString& what, const QStringList& ignore_paths, const QString& root)
|
QString findFolderOfFileInZip(QuaZip* zip, const QString& what, const QStringList& ignore_paths, const QString& root)
|
||||||
{
|
{
|
||||||
QuaZipDir rootDir(zip, root);
|
QuaZipDir rootDir(zip, root);
|
||||||
for (auto&& fileName : rootDir.entryList(QDir::Files)) {
|
for (auto&& fileName : rootDir.entryList(QDir::Files)) {
|
||||||
@ -261,27 +243,23 @@ QString MMCZip::findFolderOfFileInZip(QuaZip* zip, const QString& what, const QS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ours
|
// ours
|
||||||
bool MMCZip::findFilesInZip(QuaZip * zip, const QString & what, QStringList & result, const QString &root)
|
bool findFilesInZip(QuaZip* zip, const QString& what, QStringList& result, const QString& root)
|
||||||
{
|
{
|
||||||
QuaZipDir rootDir(zip, root);
|
QuaZipDir rootDir(zip, root);
|
||||||
for(auto fileName: rootDir.entryList(QDir::Files))
|
for (auto fileName : rootDir.entryList(QDir::Files)) {
|
||||||
{
|
if (fileName == what) {
|
||||||
if(fileName == what)
|
|
||||||
{
|
|
||||||
result.append(root);
|
result.append(root);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(auto fileName: rootDir.entryList(QDir::Dirs))
|
for (auto fileName : rootDir.entryList(QDir::Dirs)) {
|
||||||
{
|
|
||||||
findFilesInZip(zip, what, result, root + fileName);
|
findFilesInZip(zip, what, result, root + fileName);
|
||||||
}
|
}
|
||||||
return !result.isEmpty();
|
return !result.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ours
|
// ours
|
||||||
std::optional<QStringList> MMCZip::extractSubDir(QuaZip *zip, const QString & subdir, const QString &target)
|
std::optional<QStringList> extractSubDir(QuaZip* zip, const QString& subdir, const QString& target)
|
||||||
{
|
{
|
||||||
auto target_top_dir = QUrl::fromLocalFile(target);
|
auto target_top_dir = QUrl::fromLocalFile(target);
|
||||||
|
|
||||||
@ -292,13 +270,10 @@ std::optional<QStringList> MMCZip::extractSubDir(QuaZip *zip, const QString & su
|
|||||||
if (numEntries < 0) {
|
if (numEntries < 0) {
|
||||||
qWarning() << "Failed to enumerate files in archive";
|
qWarning() << "Failed to enumerate files in archive";
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
} else if (numEntries == 0) {
|
||||||
else if(numEntries == 0) {
|
|
||||||
qDebug() << "Extracting empty archives seems odd...";
|
qDebug() << "Extracting empty archives seems odd...";
|
||||||
return extracted;
|
return extracted;
|
||||||
}
|
} else if (!zip->goToFirstFile()) {
|
||||||
else if (!zip->goToFirstFile())
|
|
||||||
{
|
|
||||||
qWarning() << "Failed to seek to first file in zip";
|
qWarning() << "Failed to seek to first file in zip";
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
@ -334,7 +309,8 @@ std::optional<QStringList> MMCZip::extractSubDir(QuaZip *zip, const QString & su
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!target_top_dir.isParentOf(QUrl::fromLocalFile(target_file_path))) {
|
if (!target_top_dir.isParentOf(QUrl::fromLocalFile(target_file_path))) {
|
||||||
qWarning() << "Extracting" << relative_file_name << "was cancelled, because it was effectively outside of the target path" << target;
|
qWarning() << "Extracting" << relative_file_name << "was cancelled, because it was effectively outside of the target path"
|
||||||
|
<< target;
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,7 +321,8 @@ std::optional<QStringList> MMCZip::extractSubDir(QuaZip *zip, const QString & su
|
|||||||
}
|
}
|
||||||
|
|
||||||
extracted.append(target_file_path);
|
extracted.append(target_file_path);
|
||||||
QFile::setPermissions(target_file_path, QFileDevice::Permission::ReadUser | QFileDevice::Permission::WriteUser | QFileDevice::Permission::ExeUser);
|
QFile::setPermissions(target_file_path,
|
||||||
|
QFileDevice::Permission::ReadUser | QFileDevice::Permission::WriteUser | QFileDevice::Permission::ExeUser);
|
||||||
|
|
||||||
qDebug() << "Extracted file" << relative_file_name << "to" << target_file_path;
|
qDebug() << "Extracted file" << relative_file_name << "to" << target_file_path;
|
||||||
} while (zip->goToNextFile());
|
} while (zip->goToNextFile());
|
||||||
@ -354,51 +331,50 @@ std::optional<QStringList> MMCZip::extractSubDir(QuaZip *zip, const QString & su
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ours
|
// ours
|
||||||
bool MMCZip::extractRelFile(QuaZip *zip, const QString &file, const QString &target)
|
bool extractRelFile(QuaZip* zip, const QString& file, const QString& target)
|
||||||
{
|
{
|
||||||
return JlCompress::extractFile(zip, file, target);
|
return JlCompress::extractFile(zip, file, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ours
|
// ours
|
||||||
std::optional<QStringList> MMCZip::extractDir(QString fileCompressed, QString dir)
|
std::optional<QStringList> extractDir(QString fileCompressed, QString dir)
|
||||||
{
|
{
|
||||||
QuaZip zip(fileCompressed);
|
QuaZip zip(fileCompressed);
|
||||||
if (!zip.open(QuaZip::mdUnzip))
|
if (!zip.open(QuaZip::mdUnzip)) {
|
||||||
{
|
|
||||||
// check if this is a minimum size empty zip file...
|
// check if this is a minimum size empty zip file...
|
||||||
QFileInfo fileInfo(fileCompressed);
|
QFileInfo fileInfo(fileCompressed);
|
||||||
if (fileInfo.size() == 22) {
|
if (fileInfo.size() == 22) {
|
||||||
return QStringList();
|
return QStringList();
|
||||||
}
|
}
|
||||||
qWarning() << "Could not open archive for unzipping:" << fileCompressed << "Error:" << zip.getZipError();;
|
qWarning() << "Could not open archive for unzipping:" << fileCompressed << "Error:" << zip.getZipError();
|
||||||
|
;
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
return MMCZip::extractSubDir(&zip, "", dir);
|
return extractSubDir(&zip, "", dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ours
|
// ours
|
||||||
std::optional<QStringList> MMCZip::extractDir(QString fileCompressed, QString subdir, QString dir)
|
std::optional<QStringList> extractDir(QString fileCompressed, QString subdir, QString dir)
|
||||||
{
|
{
|
||||||
QuaZip zip(fileCompressed);
|
QuaZip zip(fileCompressed);
|
||||||
if (!zip.open(QuaZip::mdUnzip))
|
if (!zip.open(QuaZip::mdUnzip)) {
|
||||||
{
|
|
||||||
// check if this is a minimum size empty zip file...
|
// check if this is a minimum size empty zip file...
|
||||||
QFileInfo fileInfo(fileCompressed);
|
QFileInfo fileInfo(fileCompressed);
|
||||||
if (fileInfo.size() == 22) {
|
if (fileInfo.size() == 22) {
|
||||||
return QStringList();
|
return QStringList();
|
||||||
}
|
}
|
||||||
qWarning() << "Could not open archive for unzipping:" << fileCompressed << "Error:" << zip.getZipError();;
|
qWarning() << "Could not open archive for unzipping:" << fileCompressed << "Error:" << zip.getZipError();
|
||||||
|
;
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
return MMCZip::extractSubDir(&zip, subdir, dir);
|
return extractSubDir(&zip, subdir, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ours
|
// ours
|
||||||
bool MMCZip::extractFile(QString fileCompressed, QString file, QString target)
|
bool extractFile(QString fileCompressed, QString file, QString target)
|
||||||
{
|
{
|
||||||
QuaZip zip(fileCompressed);
|
QuaZip zip(fileCompressed);
|
||||||
if (!zip.open(QuaZip::mdUnzip))
|
if (!zip.open(QuaZip::mdUnzip)) {
|
||||||
{
|
|
||||||
// check if this is a minimum size empty zip file...
|
// check if this is a minimum size empty zip file...
|
||||||
QFileInfo fileInfo(fileCompressed);
|
QFileInfo fileInfo(fileCompressed);
|
||||||
if (fileInfo.size() == 22) {
|
if (fileInfo.size() == 22) {
|
||||||
@ -407,13 +383,14 @@ bool MMCZip::extractFile(QString fileCompressed, QString file, QString target)
|
|||||||
qWarning() << "Could not open archive for unzipping:" << fileCompressed << "Error:" << zip.getZipError();
|
qWarning() << "Could not open archive for unzipping:" << fileCompressed << "Error:" << zip.getZipError();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return MMCZip::extractRelFile(&zip, file, target);
|
return extractRelFile(&zip, file, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MMCZip::collectFileListRecursively(const QString& rootDir, const QString& subDir, QFileInfoList *files,
|
bool collectFileListRecursively(const QString& rootDir, const QString& subDir, QFileInfoList* files, FilterFunction excludeFilter)
|
||||||
MMCZip::FilterFunction excludeFilter) {
|
{
|
||||||
QDir rootDirectory(rootDir);
|
QDir rootDirectory(rootDir);
|
||||||
if (!rootDirectory.exists()) return false;
|
if (!rootDirectory.exists())
|
||||||
|
return false;
|
||||||
|
|
||||||
QDir directory;
|
QDir directory;
|
||||||
if (subDir == nullptr)
|
if (subDir == nullptr)
|
||||||
@ -421,7 +398,8 @@ bool MMCZip::collectFileListRecursively(const QString& rootDir, const QString& s
|
|||||||
else
|
else
|
||||||
directory = QDir(subDir);
|
directory = QDir(subDir);
|
||||||
|
|
||||||
if (!directory.exists()) return false; // shouldn't ever happen
|
if (!directory.exists())
|
||||||
|
return false; // shouldn't ever happen
|
||||||
|
|
||||||
// recurse directories
|
// recurse directories
|
||||||
QFileInfoList entries = directory.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::Hidden);
|
QFileInfoList entries = directory.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
@ -439,7 +417,88 @@ bool MMCZip::collectFileListRecursively(const QString& rootDir, const QString& s
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
files->append(e); // we want the original paths for MMCZip::compressDirFiles
|
files->append(e); // we want the original paths for compressDirFiles
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ExportToZipTask::executeTask()
|
||||||
|
{
|
||||||
|
setStatus("Adding files...");
|
||||||
|
setProgress(0, m_files.length());
|
||||||
|
m_build_zip_future = QtConcurrent::run(QThreadPool::globalInstance(), [this]() { return exportZip(); });
|
||||||
|
connect(&m_build_zip_watcher, &QFutureWatcher<ZipResult>::finished, this, &ExportToZipTask::finish);
|
||||||
|
m_build_zip_watcher.setFuture(m_build_zip_future);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto ExportToZipTask::exportZip() -> ZipResult
|
||||||
|
{
|
||||||
|
if (!m_dir.exists()) {
|
||||||
|
return ZipResult(tr("Folder doesn't exist"));
|
||||||
|
}
|
||||||
|
if (!m_output.isOpen() && !m_output.open(QuaZip::mdCreate)) {
|
||||||
|
return ZipResult(tr("Could not create file"));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto fileName : m_extra_files.keys()) {
|
||||||
|
if (m_build_zip_future.isCanceled())
|
||||||
|
return ZipResult();
|
||||||
|
QuaZipFile indexFile(&m_output);
|
||||||
|
if (!indexFile.open(QIODevice::WriteOnly, QuaZipNewInfo(fileName))) {
|
||||||
|
return ZipResult(tr("Could not create:") + fileName);
|
||||||
|
}
|
||||||
|
indexFile.write(m_extra_files[fileName]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const QFileInfo& file : m_files) {
|
||||||
|
if (m_build_zip_future.isCanceled())
|
||||||
|
return ZipResult();
|
||||||
|
|
||||||
|
auto absolute = file.absoluteFilePath();
|
||||||
|
auto relative = m_dir.relativeFilePath(absolute);
|
||||||
|
setStatus("Compresing: " + relative);
|
||||||
|
setProgress(m_progress + 1, m_progressTotal);
|
||||||
|
if (m_follow_symlinks) {
|
||||||
|
if (file.isSymLink())
|
||||||
|
absolute = file.symLinkTarget();
|
||||||
|
else
|
||||||
|
absolute = file.canonicalFilePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_exclude_files.contains(relative) && !JlCompress::compressFile(&m_output, absolute, m_destination_prefix + relative)) {
|
||||||
|
return ZipResult(tr("Could not read and compress %1").arg(relative));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_output.close();
|
||||||
|
if (m_output.getZipError() != 0) {
|
||||||
|
return ZipResult(tr("A zip error occurred"));
|
||||||
|
}
|
||||||
|
return ZipResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExportToZipTask::finish()
|
||||||
|
{
|
||||||
|
if (m_build_zip_future.isCanceled()) {
|
||||||
|
QFile::remove(m_output_path);
|
||||||
|
emitAborted();
|
||||||
|
} else if (auto result = m_build_zip_future.result(); result.has_value()) {
|
||||||
|
QFile::remove(m_output_path);
|
||||||
|
emitFailed(result.value());
|
||||||
|
} else {
|
||||||
|
emitSucceeded();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ExportToZipTask::abort()
|
||||||
|
{
|
||||||
|
if (m_build_zip_future.isRunning()) {
|
||||||
|
m_build_zip_future.cancel();
|
||||||
|
// NOTE: Here we don't do `emitAborted()` because it will be done when `m_build_zip_future` actually cancels, which may not occur
|
||||||
|
// immediately.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace MMCZip
|
@ -1,7 +1,8 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* PolyMC - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
||||||
|
* Copyright (c) 2023 Trial97 <alexandru.tripon97@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -35,24 +36,28 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QString>
|
#include <quazip.h>
|
||||||
#include <QFileInfo>
|
|
||||||
#include <QSet>
|
|
||||||
#include "minecraft/mod/Mod.h"
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
#include <quazip/JlCompress.h>
|
#include <quazip/JlCompress.h>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QFileInfo>
|
||||||
|
#include <QFuture>
|
||||||
|
#include <QFutureWatcher>
|
||||||
|
#include <QHash>
|
||||||
|
#include <QSet>
|
||||||
|
#include <QString>
|
||||||
|
#include <functional>
|
||||||
|
#include <memory>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
#include "minecraft/mod/Mod.h"
|
||||||
|
#include "tasks/Task.h"
|
||||||
|
|
||||||
namespace MMCZip
|
namespace MMCZip {
|
||||||
{
|
|
||||||
using FilterFunction = std::function<bool(const QString&)>;
|
using FilterFunction = std::function<bool(const QString&)>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merge two zip files, using a filter function
|
* Merge two zip files, using a filter function
|
||||||
*/
|
*/
|
||||||
bool mergeZipFiles(QuaZip *into, QFileInfo from, QSet<QString> &contained,
|
bool mergeZipFiles(QuaZip* into, QFileInfo from, QSet<QString>& contained, const FilterFunction filter = nullptr);
|
||||||
const FilterFunction filter = nullptr);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compress directory, by providing a list of files to compress
|
* Compress directory, by providing a list of files to compress
|
||||||
@ -141,4 +146,47 @@ namespace MMCZip
|
|||||||
* \return true for success or false for failure
|
* \return true for success or false for failure
|
||||||
*/
|
*/
|
||||||
bool collectFileListRecursively(const QString& rootDir, const QString& subDir, QFileInfoList* files, FilterFunction excludeFilter);
|
bool collectFileListRecursively(const QString& rootDir, const QString& subDir, QFileInfoList* files, FilterFunction excludeFilter);
|
||||||
}
|
|
||||||
|
class ExportToZipTask : public Task {
|
||||||
|
public:
|
||||||
|
ExportToZipTask(QString outputPath, QDir dir, QFileInfoList files, QString destinationPrefix = "", bool followSymlinks = false)
|
||||||
|
: m_output_path(outputPath)
|
||||||
|
, m_output(outputPath)
|
||||||
|
, m_dir(dir)
|
||||||
|
, m_files(files)
|
||||||
|
, m_destination_prefix(destinationPrefix)
|
||||||
|
, m_follow_symlinks(followSymlinks)
|
||||||
|
{
|
||||||
|
setAbortable(true);
|
||||||
|
};
|
||||||
|
ExportToZipTask(QString outputPath, QString dir, QFileInfoList files, QString destinationPrefix = "", bool followSymlinks = false)
|
||||||
|
: ExportToZipTask(outputPath, QDir(dir), files, destinationPrefix, followSymlinks){};
|
||||||
|
|
||||||
|
virtual ~ExportToZipTask() = default;
|
||||||
|
|
||||||
|
void setExcludeFiles(QStringList excludeFiles) { m_exclude_files = excludeFiles; }
|
||||||
|
void addExtraFile(QString fileName, QByteArray data) { m_extra_files.insert(fileName, data); }
|
||||||
|
|
||||||
|
typedef std::optional<QString> ZipResult;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void executeTask() override;
|
||||||
|
bool abort() override;
|
||||||
|
|
||||||
|
ZipResult exportZip();
|
||||||
|
void finish();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString m_output_path;
|
||||||
|
QuaZip m_output;
|
||||||
|
QDir m_dir;
|
||||||
|
QFileInfoList m_files;
|
||||||
|
QString m_destination_prefix;
|
||||||
|
bool m_follow_symlinks;
|
||||||
|
QStringList m_exclude_files;
|
||||||
|
QHash<QString, QByteArray> m_extra_files;
|
||||||
|
|
||||||
|
QFuture<ZipResult> m_build_zip_future;
|
||||||
|
QFutureWatcher<ZipResult> m_build_zip_watcher;
|
||||||
|
};
|
||||||
|
} // namespace MMCZip
|
||||||
|
@ -1,5 +1,24 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
/*
|
||||||
|
* Prism Launcher - Minecraft Launcher
|
||||||
|
* Copyright (c) 2023 Trial97 <alexandru.tripon97@gmail.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "JavaInstall.h"
|
#include "JavaInstall.h"
|
||||||
|
|
||||||
|
#include "BaseVersion.h"
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
|
|
||||||
bool JavaInstall::operator<(const JavaInstall& rhs)
|
bool JavaInstall::operator<(const JavaInstall& rhs)
|
||||||
@ -7,12 +26,10 @@ bool JavaInstall::operator<(const JavaInstall &rhs)
|
|||||||
auto archCompare = StringUtils::naturalCompare(arch, rhs.arch, Qt::CaseInsensitive);
|
auto archCompare = StringUtils::naturalCompare(arch, rhs.arch, Qt::CaseInsensitive);
|
||||||
if (archCompare != 0)
|
if (archCompare != 0)
|
||||||
return archCompare < 0;
|
return archCompare < 0;
|
||||||
if(id < rhs.id)
|
if (id < rhs.id) {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(id > rhs.id)
|
if (id > rhs.id) {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return StringUtils::naturalCompare(path, rhs.path, Qt::CaseInsensitive) < 0;
|
return StringUtils::naturalCompare(path, rhs.path, Qt::CaseInsensitive) < 0;
|
||||||
@ -27,3 +44,21 @@ bool JavaInstall::operator>(const JavaInstall &rhs)
|
|||||||
{
|
{
|
||||||
return (!operator<(rhs)) && (!operator==(rhs));
|
return (!operator<(rhs)) && (!operator==(rhs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool JavaInstall::operator<(BaseVersion& a)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return operator<(dynamic_cast<JavaInstall&>(a));
|
||||||
|
} catch (const std::bad_cast& e) {
|
||||||
|
return BaseVersion::operator<(a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool JavaInstall::operator>(BaseVersion& a)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return operator>(dynamic_cast<JavaInstall&>(a));
|
||||||
|
} catch (const std::bad_cast& e) {
|
||||||
|
return BaseVersion::operator>(a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,30 +1,37 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
/*
|
||||||
|
* Prism Launcher - Minecraft Launcher
|
||||||
|
* Copyright (c) 2023 Trial97 <alexandru.tripon97@gmail.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "BaseVersion.h"
|
#include "BaseVersion.h"
|
||||||
#include "JavaVersion.h"
|
#include "JavaVersion.h"
|
||||||
|
|
||||||
struct JavaInstall : public BaseVersion
|
struct JavaInstall : public BaseVersion {
|
||||||
{
|
|
||||||
JavaInstall() {}
|
JavaInstall() {}
|
||||||
JavaInstall(QString id, QString arch, QString path)
|
JavaInstall(QString id, QString arch, QString path) : id(id), arch(arch), path(path) {}
|
||||||
: id(id), arch(arch), path(path)
|
virtual QString descriptor() { return id.toString(); }
|
||||||
{
|
|
||||||
}
|
|
||||||
virtual QString descriptor()
|
|
||||||
{
|
|
||||||
return id.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual QString name()
|
virtual QString name() { return id.toString(); }
|
||||||
{
|
|
||||||
return id.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual QString typeString() const
|
virtual QString typeString() const { return arch; }
|
||||||
{
|
|
||||||
return arch;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
virtual bool operator<(BaseVersion& a) override;
|
||||||
|
virtual bool operator>(BaseVersion& a) override;
|
||||||
bool operator<(const JavaInstall& rhs);
|
bool operator<(const JavaInstall& rhs);
|
||||||
bool operator==(const JavaInstall& rhs);
|
bool operator==(const JavaInstall& rhs);
|
||||||
bool operator>(const JavaInstall& rhs);
|
bool operator>(const JavaInstall& rhs);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
||||||
* Copyright (C) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
* Copyright (C) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||||
* Copyright (C) 2022 TheKodeToad <TheKodeToad@proton.me>
|
* Copyright (C) 2022 TheKodeToad <TheKodeToad@proton.me>
|
||||||
|
* Copyright (c) 2023 seth <getchoo at tuta dot io>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -186,6 +187,10 @@ void MinecraftInstance::loadSpecificSettings()
|
|||||||
m_settings->registerOverride(global_settings->getSetting("CloseAfterLaunch"), miscellaneousOverride);
|
m_settings->registerOverride(global_settings->getSetting("CloseAfterLaunch"), miscellaneousOverride);
|
||||||
m_settings->registerOverride(global_settings->getSetting("QuitAfterGameStop"), miscellaneousOverride);
|
m_settings->registerOverride(global_settings->getSetting("QuitAfterGameStop"), miscellaneousOverride);
|
||||||
|
|
||||||
|
// Mod loader specific options
|
||||||
|
auto modLoaderSettings = m_settings->registerSetting("OverrideModLoaderSettings", false);
|
||||||
|
m_settings->registerOverride(global_settings->getSetting("DisableQuiltBeacon"), modLoaderSettings);
|
||||||
|
|
||||||
m_settings->set("InstanceType", "OneSix");
|
m_settings->set("InstanceType", "OneSix");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,6 +396,12 @@ QStringList MinecraftInstance::extraArguments()
|
|||||||
agent->library()->getApplicableFiles(runtimeContext(), jar, temp1, temp2, temp3, getLocalLibraryPath());
|
agent->library()->getApplicableFiles(runtimeContext(), jar, temp1, temp2, temp3, getLocalLibraryPath());
|
||||||
list.append("-javaagent:"+jar[0]+(agent->argument().isEmpty() ? "" : "="+agent->argument()));
|
list.append("-javaagent:"+jar[0]+(agent->argument().isEmpty() ? "" : "="+agent->argument()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const auto loaders = version->getModLoaders();
|
||||||
|
if (loaders.has_value() && loaders.value() & ResourceAPI::Quilt && settings()->get("DisableQuiltBeacon").toBool())
|
||||||
|
list.append("-Dloader.disable_beacon=true");
|
||||||
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ bool AuthSession::MakeOffline(QString offline_playername)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
session = "-";
|
session = "-";
|
||||||
|
access_token = "0";
|
||||||
player_name = offline_playername;
|
player_name = offline_playername;
|
||||||
status = PlayableOffline;
|
status = PlayableOffline;
|
||||||
return true;
|
return true;
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
#include "MinecraftAccount.h"
|
#include "MinecraftAccount.h"
|
||||||
|
|
||||||
|
#include <QCryptographicHash>
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
@ -100,7 +101,7 @@ MinecraftAccountPtr MinecraftAccount::createOffline(const QString &username)
|
|||||||
account->data.yggdrasilToken.extra["clientToken"] = QUuid::createUuid().toString().remove(QRegularExpression("[{}-]"));
|
account->data.yggdrasilToken.extra["clientToken"] = QUuid::createUuid().toString().remove(QRegularExpression("[{}-]"));
|
||||||
account->data.minecraftEntitlement.ownsMinecraft = true;
|
account->data.minecraftEntitlement.ownsMinecraft = true;
|
||||||
account->data.minecraftEntitlement.canPlayMinecraft = true;
|
account->data.minecraftEntitlement.canPlayMinecraft = true;
|
||||||
account->data.minecraftProfile.id = QUuid::createUuid().toString().remove(QRegularExpression("[{}-]"));
|
account->data.minecraftProfile.id = uuidFromUsername(username).toString().remove(QRegularExpression("[{}-]"));
|
||||||
account->data.minecraftProfile.name = username;
|
account->data.minecraftProfile.name = username;
|
||||||
account->data.minecraftProfile.validity = Katabasis::Validity::Certain;
|
account->data.minecraftProfile.validity = Katabasis::Validity::Certain;
|
||||||
return account;
|
return account;
|
||||||
@ -334,3 +335,32 @@ void MinecraftAccount::incrementUses()
|
|||||||
qWarning() << "Profile" << data.profileId() << "is now in use.";
|
qWarning() << "Profile" << data.profileId() << "is now in use.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QUuid MinecraftAccount::uuidFromUsername(QString username) {
|
||||||
|
auto input = QString("OfflinePlayer:%1").arg(username).toUtf8();
|
||||||
|
|
||||||
|
// basically a reimplementation of Java's UUID#nameUUIDFromBytes
|
||||||
|
QByteArray digest = QCryptographicHash::hash(input, QCryptographicHash::Md5);
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
auto bOr = [](QByteArray& array, int index, char value) {
|
||||||
|
array[index] = array.at(index) | value;
|
||||||
|
};
|
||||||
|
auto bAnd = [](QByteArray& array, int index, char value) {
|
||||||
|
array[index] = array.at(index) & value;
|
||||||
|
};
|
||||||
|
#else
|
||||||
|
auto bOr = [](QByteArray& array, qsizetype index, char value) {
|
||||||
|
array[index] |= value;
|
||||||
|
};
|
||||||
|
auto bAnd = [](QByteArray& array, qsizetype index, char value) {
|
||||||
|
array[index] &= value;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
bAnd(digest, 6, (char) 0x0f); // clear version
|
||||||
|
bOr(digest, 6, (char) 0x30); // set to version 3
|
||||||
|
bAnd(digest, 8, (char) 0x3f); // clear variant
|
||||||
|
bOr(digest, 8, (char) 0x80); // set to IETF variant
|
||||||
|
|
||||||
|
return QUuid::fromRfc4122(digest);
|
||||||
|
}
|
||||||
|
@ -98,6 +98,8 @@ public: /* construction */
|
|||||||
static MinecraftAccountPtr loadFromJsonV2(const QJsonObject &json);
|
static MinecraftAccountPtr loadFromJsonV2(const QJsonObject &json);
|
||||||
static MinecraftAccountPtr loadFromJsonV3(const QJsonObject &json);
|
static MinecraftAccountPtr loadFromJsonV3(const QJsonObject &json);
|
||||||
|
|
||||||
|
static QUuid uuidFromUsername(QString username);
|
||||||
|
|
||||||
//! Saves a MinecraftAccount to a JSON object and returns it.
|
//! Saves a MinecraftAccount to a JSON object and returns it.
|
||||||
QJsonObject saveToJson() const;
|
QJsonObject saveToJson() const;
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
||||||
* Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me>
|
* Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me>
|
||||||
|
* Copyright (c) 2023 Trial97 <alexandru.tripon97@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -41,6 +42,9 @@
|
|||||||
#include <QFileSystemModel>
|
#include <QFileSystemModel>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include "FileIgnoreProxy.h"
|
#include "FileIgnoreProxy.h"
|
||||||
|
#include "QObjectPtr.h"
|
||||||
|
#include "ui/dialogs/CustomMessageBox.h"
|
||||||
|
#include "ui/dialogs/ProgressDialog.h"
|
||||||
#include "ui_ExportInstanceDialog.h"
|
#include "ui_ExportInstanceDialog.h"
|
||||||
|
|
||||||
#include <FileSystem.h>
|
#include <FileSystem.h>
|
||||||
@ -104,20 +108,14 @@ void SaveIcon(InstancePtr m_instance)
|
|||||||
auto& image = mmcIcon->m_images[mmcIcon->type()];
|
auto& image = mmcIcon->m_images[mmcIcon->type()];
|
||||||
auto& icon = image.icon;
|
auto& icon = image.icon;
|
||||||
auto sizes = icon.availableSizes();
|
auto sizes = icon.availableSizes();
|
||||||
if(sizes.size() == 0)
|
if (sizes.size() == 0) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto areaOf = [](QSize size)
|
auto areaOf = [](QSize size) { return size.width() * size.height(); };
|
||||||
{
|
|
||||||
return size.width() * size.height();
|
|
||||||
};
|
|
||||||
QSize largest = sizes[0];
|
QSize largest = sizes[0];
|
||||||
// find variant with largest area
|
// find variant with largest area
|
||||||
for(auto size: sizes)
|
for (auto size : sizes) {
|
||||||
{
|
if (areaOf(largest) < areaOf(size)) {
|
||||||
if(areaOf(largest) < areaOf(size))
|
|
||||||
{
|
|
||||||
largest = size;
|
largest = size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -125,16 +123,15 @@ void SaveIcon(InstancePtr m_instance)
|
|||||||
pixmap.save(FS::PathCombine(m_instance->instanceRoot(), iconKey + ".png"));
|
pixmap.save(FS::PathCombine(m_instance->instanceRoot(), iconKey + ".png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ExportInstanceDialog::doExport()
|
void ExportInstanceDialog::doExport()
|
||||||
{
|
{
|
||||||
auto name = FS::RemoveInvalidFilenameChars(m_instance->name());
|
auto name = FS::RemoveInvalidFilenameChars(m_instance->name());
|
||||||
|
|
||||||
const QString output = QFileDialog::getSaveFileName(
|
const QString output = QFileDialog::getSaveFileName(this, tr("Export %1").arg(m_instance->name()),
|
||||||
this, tr("Export %1").arg(m_instance->name()),
|
|
||||||
FS::PathCombine(QDir::homePath(), name + ".zip"), "Zip (*.zip)", nullptr);
|
FS::PathCombine(QDir::homePath(), name + ".zip"), "Zip (*.zip)", nullptr);
|
||||||
if (output.isEmpty())
|
if (output.isEmpty()) {
|
||||||
{
|
QDialog::done(QDialog::Rejected);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveIcon(m_instance);
|
SaveIcon(m_instance);
|
||||||
@ -143,46 +140,40 @@ bool ExportInstanceDialog::doExport()
|
|||||||
if (!MMCZip::collectFileListRecursively(m_instance->instanceRoot(), nullptr, &files,
|
if (!MMCZip::collectFileListRecursively(m_instance->instanceRoot(), nullptr, &files,
|
||||||
std::bind(&FileIgnoreProxy::filterFile, proxyModel, std::placeholders::_1))) {
|
std::bind(&FileIgnoreProxy::filterFile, proxyModel, std::placeholders::_1))) {
|
||||||
QMessageBox::warning(this, tr("Error"), tr("Unable to export instance"));
|
QMessageBox::warning(this, tr("Error"), tr("Unable to export instance"));
|
||||||
return false;
|
QDialog::done(QDialog::Rejected);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!MMCZip::compressDirFiles(output, m_instance->instanceRoot(), files, true))
|
auto task = makeShared<MMCZip::ExportToZipTask>(output, m_instance->instanceRoot(), files, "", true);
|
||||||
{
|
|
||||||
QMessageBox::warning(this, tr("Error"), tr("Unable to export instance"));
|
connect(task.get(), &Task::failed, this,
|
||||||
return false;
|
[this, output](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show(); });
|
||||||
}
|
connect(task.get(), &Task::finished, this, [task] { task->deleteLater(); });
|
||||||
return true;
|
|
||||||
|
ProgressDialog progress(this);
|
||||||
|
progress.setSkipButton(true, tr("Abort"));
|
||||||
|
auto result = progress.execWithTask(task.get());
|
||||||
|
QDialog::done(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExportInstanceDialog::done(int result)
|
void ExportInstanceDialog::done(int result)
|
||||||
{
|
{
|
||||||
savePackIgnore();
|
savePackIgnore();
|
||||||
if (result == QDialog::Accepted)
|
if (result == QDialog::Accepted) {
|
||||||
{
|
doExport();
|
||||||
if (doExport())
|
|
||||||
{
|
|
||||||
QDialog::done(QDialog::Accepted);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QDialog::done(result);
|
QDialog::done(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExportInstanceDialog::rowsInserted(QModelIndex parent, int top, int bottom)
|
void ExportInstanceDialog::rowsInserted(QModelIndex parent, int top, int bottom)
|
||||||
{
|
{
|
||||||
// WARNING: possible off-by-one?
|
// WARNING: possible off-by-one?
|
||||||
for(int i = top; i < bottom; i++)
|
for (int i = top; i < bottom; i++) {
|
||||||
{
|
|
||||||
auto node = proxyModel->index(i, 0, parent);
|
auto node = proxyModel->index(i, 0, parent);
|
||||||
if(proxyModel->shouldExpand(node))
|
if (proxyModel->shouldExpand(node)) {
|
||||||
{
|
|
||||||
auto expNode = node.parent();
|
auto expNode = node.parent();
|
||||||
if(!expNode.isValid())
|
if (!expNode.isValid()) {
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ui->treeView->expand(node);
|
ui->treeView->expand(node);
|
||||||
@ -199,8 +190,7 @@ void ExportInstanceDialog::loadPackIgnore()
|
|||||||
{
|
{
|
||||||
auto filename = ignoreFileName();
|
auto filename = ignoreFileName();
|
||||||
QFile ignoreFile(filename);
|
QFile ignoreFile(filename);
|
||||||
if(!ignoreFile.open(QIODevice::ReadOnly))
|
if (!ignoreFile.open(QIODevice::ReadOnly)) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto data = ignoreFile.readAll();
|
auto data = ignoreFile.readAll();
|
||||||
@ -216,12 +206,9 @@ void ExportInstanceDialog::savePackIgnore()
|
|||||||
{
|
{
|
||||||
auto data = proxyModel->blockedPaths().toStringList().join('\n').toUtf8();
|
auto data = proxyModel->blockedPaths().toStringList().join('\n').toUtf8();
|
||||||
auto filename = ignoreFileName();
|
auto filename = ignoreFileName();
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
FS::write(filename, data);
|
FS::write(filename, data);
|
||||||
}
|
} catch (const Exception& e) {
|
||||||
catch (const Exception &e)
|
|
||||||
{
|
|
||||||
qWarning() << e.cause();
|
qWarning() << e.cause();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me>
|
* Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me>
|
||||||
|
* Copyright (c) 2023 Trial97 <alexandru.tripon97@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -38,19 +39,17 @@
|
|||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "FileIgnoreProxy.h"
|
|
||||||
#include "FastFileIconProvider.h"
|
#include "FastFileIconProvider.h"
|
||||||
|
#include "FileIgnoreProxy.h"
|
||||||
|
|
||||||
class BaseInstance;
|
class BaseInstance;
|
||||||
typedef std::shared_ptr<BaseInstance> InstancePtr;
|
typedef std::shared_ptr<BaseInstance> InstancePtr;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui {
|
||||||
{
|
|
||||||
class ExportInstanceDialog;
|
class ExportInstanceDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExportInstanceDialog : public QDialog
|
class ExportInstanceDialog : public QDialog {
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -60,7 +59,7 @@ public:
|
|||||||
virtual void done(int result);
|
virtual void done(int result);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool doExport();
|
void doExport();
|
||||||
void loadPackIgnore();
|
void loadPackIgnore();
|
||||||
void savePackIgnore();
|
void savePackIgnore();
|
||||||
QString ignoreFileName();
|
QString ignoreFileName();
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* PolyMC - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
||||||
|
* Copyright (C) 2023 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -35,22 +36,18 @@
|
|||||||
|
|
||||||
#include "VisualGroup.h"
|
#include "VisualGroup.h"
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QDebug>
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QtMath>
|
#include <QtMath>
|
||||||
#include <QApplication>
|
#include <utility>
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
#include "InstanceView.h"
|
#include "InstanceView.h"
|
||||||
|
|
||||||
VisualGroup::VisualGroup(const QString &text, InstanceView *view) : view(view), text(text), collapsed(false)
|
VisualGroup::VisualGroup(QString text, InstanceView* view) : view(view), text(std::move(text)), collapsed(false) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
VisualGroup::VisualGroup(const VisualGroup *other)
|
VisualGroup::VisualGroup(const VisualGroup* other) : view(other->view), text(other->text), collapsed(other->collapsed) {}
|
||||||
: view(other->view), text(other->text), collapsed(other->collapsed)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void VisualGroup::update()
|
void VisualGroup::update()
|
||||||
{
|
{
|
||||||
@ -64,10 +61,8 @@ void VisualGroup::update()
|
|||||||
int positionInRow = 0;
|
int positionInRow = 0;
|
||||||
int currentRow = 0;
|
int currentRow = 0;
|
||||||
int offsetFromTop = 0;
|
int offsetFromTop = 0;
|
||||||
for (auto item: temp_items)
|
for (auto item : temp_items) {
|
||||||
{
|
if (positionInRow == itemsPerRow) {
|
||||||
if(positionInRow == itemsPerRow)
|
|
||||||
{
|
|
||||||
rows[currentRow].height = maxRowHeight;
|
rows[currentRow].height = maxRowHeight;
|
||||||
rows[currentRow].top = offsetFromTop;
|
rows[currentRow].top = offsetFromTop;
|
||||||
currentRow++;
|
currentRow++;
|
||||||
@ -83,8 +78,7 @@ void VisualGroup::update()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto itemHeight = view->itemDelegate()->sizeHint(viewItemOption, item).height();
|
auto itemHeight = view->itemDelegate()->sizeHint(viewItemOption, item).height();
|
||||||
if(itemHeight > maxRowHeight)
|
if (itemHeight > maxRowHeight) {
|
||||||
{
|
|
||||||
maxRowHeight = itemHeight;
|
maxRowHeight = itemHeight;
|
||||||
}
|
}
|
||||||
rows[currentRow].items.append(item);
|
rows[currentRow].items.append(item);
|
||||||
@ -97,12 +91,9 @@ void VisualGroup::update()
|
|||||||
QPair<int, int> VisualGroup::positionOf(const QModelIndex& index) const
|
QPair<int, int> VisualGroup::positionOf(const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
int y = 0;
|
int y = 0;
|
||||||
for (auto & row: rows)
|
for (auto& row : rows) {
|
||||||
{
|
for (auto x = 0; x < row.items.size(); x++) {
|
||||||
for(auto x = 0; x < row.items.size(); x++)
|
if (row.items[x] == index) {
|
||||||
{
|
|
||||||
if(row.items[x] == index)
|
|
||||||
{
|
|
||||||
return qMakePair(x, y);
|
return qMakePair(x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,169 +120,85 @@ VisualGroup::HitResults VisualGroup::hitScan(const QPoint &pos) const
|
|||||||
VisualGroup::HitResults results = VisualGroup::NoHit;
|
VisualGroup::HitResults results = VisualGroup::NoHit;
|
||||||
int y_start = verticalPosition();
|
int y_start = verticalPosition();
|
||||||
int body_start = y_start + headerHeight();
|
int body_start = y_start + headerHeight();
|
||||||
int body_end = body_start + contentHeight() + 5; // FIXME: wtf is this 5?
|
int body_end = body_start + contentHeight();
|
||||||
int y = pos.y();
|
int y = pos.y();
|
||||||
// int x = pos.x();
|
// int x = pos.x();
|
||||||
if (y < y_start)
|
if (y < y_start) {
|
||||||
{
|
|
||||||
results = VisualGroup::NoHit;
|
results = VisualGroup::NoHit;
|
||||||
}
|
} else if (y < body_start) {
|
||||||
else if (y < body_start)
|
|
||||||
{
|
|
||||||
results = VisualGroup::HeaderHit;
|
results = VisualGroup::HeaderHit;
|
||||||
int collapseSize = headerHeight() - 4;
|
int collapseSize = headerHeight() - 4;
|
||||||
|
|
||||||
// the icon
|
// the icon
|
||||||
QRect iconRect = QRect(view->m_leftMargin + 2, 2 + y_start, collapseSize, collapseSize);
|
QRect iconRect = QRect(view->m_leftMargin + 2, 2 + y_start, view->width() - 4, collapseSize);
|
||||||
if (iconRect.contains(pos))
|
if (iconRect.contains(pos)) {
|
||||||
{
|
|
||||||
results |= VisualGroup::CheckboxHit;
|
results |= VisualGroup::CheckboxHit;
|
||||||
}
|
}
|
||||||
}
|
} else if (y < body_end) {
|
||||||
else if (y < body_end)
|
|
||||||
{
|
|
||||||
results |= VisualGroup::BodyHit;
|
results |= VisualGroup::BodyHit;
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualGroup::drawHeader(QPainter *painter, const QStyleOptionViewItem &option)
|
void VisualGroup::drawHeader(QPainter* painter, const QStyleOptionViewItem& option) const
|
||||||
{
|
{
|
||||||
painter->setRenderHint(QPainter::Antialiasing);
|
QRect optRect = option.rect;
|
||||||
|
optRect.setTop(optRect.top() + 7);
|
||||||
const QRect optRect = option.rect;
|
|
||||||
QFont font(QApplication::font());
|
QFont font(QApplication::font());
|
||||||
font.setBold(true);
|
font.setBold(true);
|
||||||
const QFontMetrics fontMetrics = QFontMetrics(font);
|
const QFontMetrics fontMetrics = QFontMetrics(font);
|
||||||
|
|
||||||
QColor outlineColor = option.palette.text().color();
|
|
||||||
outlineColor.setAlphaF(0.35);
|
|
||||||
|
|
||||||
//BEGIN: top left corner
|
|
||||||
{
|
|
||||||
painter->save();
|
|
||||||
painter->setPen(outlineColor);
|
|
||||||
const QPointF topLeft(optRect.topLeft());
|
|
||||||
QRectF arc(topLeft, QSizeF(4, 4));
|
|
||||||
arc.translate(0.5, 0.5);
|
|
||||||
painter->drawArc(arc, 1440, 1440);
|
|
||||||
painter->restore();
|
|
||||||
}
|
|
||||||
//END: top left corner
|
|
||||||
|
|
||||||
//BEGIN: left vertical line
|
|
||||||
{
|
|
||||||
QPoint start(optRect.topLeft());
|
|
||||||
start.ry() += 3;
|
|
||||||
QPoint verticalGradBottom(optRect.topLeft());
|
|
||||||
verticalGradBottom.ry() += fontMetrics.height() + 5;
|
|
||||||
QLinearGradient gradient(start, verticalGradBottom);
|
|
||||||
gradient.setColorAt(0, outlineColor);
|
|
||||||
gradient.setColorAt(1, Qt::transparent);
|
|
||||||
painter->fillRect(QRect(start, QSize(1, fontMetrics.height() + 5)), gradient);
|
|
||||||
}
|
|
||||||
//END: left vertical line
|
|
||||||
|
|
||||||
//BEGIN: horizontal line
|
|
||||||
{
|
|
||||||
QPoint start(optRect.topLeft());
|
|
||||||
start.rx() += 3;
|
|
||||||
QPoint horizontalGradTop(optRect.topLeft());
|
|
||||||
horizontalGradTop.rx() += optRect.width() - 6;
|
|
||||||
painter->fillRect(QRect(start, QSize(optRect.width() - 6, 1)), outlineColor);
|
|
||||||
}
|
|
||||||
//END: horizontal line
|
|
||||||
|
|
||||||
//BEGIN: top right corner
|
|
||||||
{
|
|
||||||
painter->save();
|
|
||||||
painter->setPen(outlineColor);
|
|
||||||
QPointF topRight(optRect.topRight());
|
|
||||||
topRight.rx() -= 4;
|
|
||||||
QRectF arc(topRight, QSizeF(4, 4));
|
|
||||||
arc.translate(0.5, 0.5);
|
|
||||||
painter->drawArc(arc, 0, 1440);
|
|
||||||
painter->restore();
|
|
||||||
}
|
|
||||||
//END: top right corner
|
|
||||||
|
|
||||||
//BEGIN: right vertical line
|
|
||||||
{
|
|
||||||
QPoint start(optRect.topRight());
|
|
||||||
start.ry() += 3;
|
|
||||||
QPoint verticalGradBottom(optRect.topRight());
|
|
||||||
verticalGradBottom.ry() += fontMetrics.height() + 5;
|
|
||||||
QLinearGradient gradient(start, verticalGradBottom);
|
|
||||||
gradient.setColorAt(0, outlineColor);
|
|
||||||
gradient.setColorAt(1, Qt::transparent);
|
|
||||||
painter->fillRect(QRect(start, QSize(1, fontMetrics.height() + 5)), gradient);
|
|
||||||
}
|
|
||||||
//END: right vertical line
|
|
||||||
|
|
||||||
//BEGIN: checkboxy thing
|
|
||||||
{
|
|
||||||
painter->save();
|
|
||||||
painter->setRenderHint(QPainter::Antialiasing, false);
|
|
||||||
painter->setFont(font);
|
painter->setFont(font);
|
||||||
QColor penColor(option.palette.text().color());
|
|
||||||
|
QPen pen;
|
||||||
|
pen.setWidth(2);
|
||||||
|
QColor penColor = option.palette.text().color();
|
||||||
penColor.setAlphaF(0.6);
|
penColor.setAlphaF(0.6);
|
||||||
painter->setPen(penColor);
|
pen.setColor(penColor);
|
||||||
QRect iconSubRect(option.rect);
|
painter->setPen(pen);
|
||||||
iconSubRect.setTop(iconSubRect.top() + 7);
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
iconSubRect.setLeft(iconSubRect.left() + 7);
|
|
||||||
|
|
||||||
int sizing = fontMetrics.height();
|
// sizes and offsets, to keep things consistent below
|
||||||
int even = ( (sizing - 1) % 2 );
|
int arrowOffsetLeft = fontMetrics.height() / 2 + 7;
|
||||||
|
int textOffsetLeft = arrowOffsetLeft * 2;
|
||||||
|
int arrowSize = 6;
|
||||||
|
int centerHeight = optRect.top() + fontMetrics.height() / 2;
|
||||||
|
|
||||||
iconSubRect.setHeight(sizing - even);
|
// BEGIN: arrow
|
||||||
iconSubRect.setWidth(sizing - even);
|
|
||||||
painter->drawRect(iconSubRect);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
if(collapsed)
|
|
||||||
painter->drawText(iconSubRect, Qt::AlignHCenter | Qt::AlignVCenter, "+");
|
|
||||||
else
|
|
||||||
painter->drawText(iconSubRect, Qt::AlignHCenter | Qt::AlignVCenter, "-");
|
|
||||||
*/
|
|
||||||
painter->setBrush(option.palette.text());
|
|
||||||
painter->fillRect(iconSubRect.x(), iconSubRect.y() + iconSubRect.height() / 2,
|
|
||||||
iconSubRect.width(), 2, penColor);
|
|
||||||
if (collapsed)
|
|
||||||
{
|
{
|
||||||
painter->fillRect(iconSubRect.x() + iconSubRect.width() / 2, iconSubRect.y(), 2,
|
QPolygon arrowPolygon;
|
||||||
iconSubRect.height(), penColor);
|
if (collapsed) {
|
||||||
|
arrowPolygon << QPoint(arrowOffsetLeft - arrowSize / 2, centerHeight - arrowSize)
|
||||||
|
<< QPoint(arrowOffsetLeft + arrowSize / 2, centerHeight)
|
||||||
|
<< QPoint(arrowOffsetLeft - arrowSize / 2, centerHeight + arrowSize);
|
||||||
|
painter->drawPolyline(arrowPolygon);
|
||||||
|
} else {
|
||||||
|
arrowPolygon << QPoint(arrowOffsetLeft - arrowSize, centerHeight - arrowSize / 2)
|
||||||
|
<< QPoint(arrowOffsetLeft, centerHeight + arrowSize / 2)
|
||||||
|
<< QPoint(arrowOffsetLeft + arrowSize, centerHeight - arrowSize / 2);
|
||||||
|
painter->drawPolyline(arrowPolygon);
|
||||||
}
|
}
|
||||||
|
|
||||||
painter->restore();
|
|
||||||
}
|
}
|
||||||
//END: checkboxy thing
|
// END: arrow
|
||||||
|
|
||||||
// BEGIN: text
|
// BEGIN: text
|
||||||
{
|
{
|
||||||
QRect textRect(option.rect);
|
QRect textRect(optRect);
|
||||||
textRect.setTop(textRect.top() + 7);
|
textRect.setTop(textRect.top());
|
||||||
textRect.setLeft(textRect.left() + 7 + fontMetrics.height() + 7);
|
textRect.setLeft(textOffsetLeft);
|
||||||
textRect.setHeight(fontMetrics.height());
|
textRect.setHeight(fontMetrics.height());
|
||||||
textRect.setRight(textRect.right() - 7);
|
textRect.setRight(textRect.right() - 7);
|
||||||
|
|
||||||
painter->save();
|
painter->drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, !text.isEmpty() ? text : QObject::tr("Ungrouped"));
|
||||||
painter->setFont(font);
|
|
||||||
QColor penColor(option.palette.text().color());
|
|
||||||
penColor.setAlphaF(0.6);
|
|
||||||
painter->setPen(penColor);
|
|
||||||
painter->drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, text);
|
|
||||||
painter->restore();
|
|
||||||
}
|
}
|
||||||
// END: text
|
// END: text
|
||||||
}
|
}
|
||||||
|
|
||||||
int VisualGroup::totalHeight() const
|
int VisualGroup::totalHeight() const
|
||||||
{
|
{
|
||||||
return headerHeight() + 5 + contentHeight(); // FIXME: wtf is that '5'?
|
return headerHeight() + contentHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
int VisualGroup::headerHeight() const
|
int VisualGroup::headerHeight()
|
||||||
{
|
{
|
||||||
QFont font(QApplication::font());
|
QFont font(QApplication::font());
|
||||||
font.setBold(true);
|
font.setBold(true);
|
||||||
@ -311,8 +218,7 @@ int VisualGroup::headerHeight() const
|
|||||||
|
|
||||||
int VisualGroup::contentHeight() const
|
int VisualGroup::contentHeight() const
|
||||||
{
|
{
|
||||||
if (collapsed)
|
if (collapsed) {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
auto last = rows[numRows() - 1];
|
auto last = rows[numRows() - 1];
|
||||||
@ -321,7 +227,7 @@ int VisualGroup::contentHeight() const
|
|||||||
|
|
||||||
int VisualGroup::numRows() const
|
int VisualGroup::numRows() const
|
||||||
{
|
{
|
||||||
return rows.size();
|
return (int)rows.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
int VisualGroup::verticalPosition() const
|
int VisualGroup::verticalPosition() const
|
||||||
@ -332,11 +238,9 @@ int VisualGroup::verticalPosition() const
|
|||||||
QList<QModelIndex> VisualGroup::items() const
|
QList<QModelIndex> VisualGroup::items() const
|
||||||
{
|
{
|
||||||
QList<QModelIndex> indices;
|
QList<QModelIndex> indices;
|
||||||
for (int i = 0; i < view->model()->rowCount(); ++i)
|
for (int i = 0; i < view->model()->rowCount(); ++i) {
|
||||||
{
|
|
||||||
const QModelIndex index = view->model()->index(i, 0);
|
const QModelIndex index = view->model()->index(i, 0);
|
||||||
if (index.data(InstanceViewRoles::GroupRole).toString() == text)
|
if (index.data(InstanceViewRoles::GroupRole).toString() == text) {
|
||||||
{
|
|
||||||
indices.append(index);
|
indices.append(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,24 @@
|
|||||||
/* Copyright 2013-2021 MultiMC Contributors
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
/*
|
||||||
|
* Prism Launcher - Minecraft Launcher
|
||||||
|
* Copyright (C) 2023 Tayou <git@tayou.org>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* This file incorporates work covered by the following copyright and
|
||||||
|
* permission notice:
|
||||||
|
*
|
||||||
|
* Copyright 2013-2021 MultiMC Contributors
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -42,8 +62,8 @@ struct VisualRow
|
|||||||
struct VisualGroup
|
struct VisualGroup
|
||||||
{
|
{
|
||||||
/* constructors */
|
/* constructors */
|
||||||
VisualGroup(const QString &text, InstanceView *view);
|
VisualGroup(QString text, InstanceView *view);
|
||||||
VisualGroup(const VisualGroup *other);
|
explicit VisualGroup(const VisualGroup *other);
|
||||||
|
|
||||||
/* data */
|
/* data */
|
||||||
InstanceView *view = nullptr;
|
InstanceView *view = nullptr;
|
||||||
@ -58,13 +78,13 @@ struct VisualGroup
|
|||||||
void update();
|
void update();
|
||||||
|
|
||||||
/// draw the header at y-position.
|
/// draw the header at y-position.
|
||||||
void drawHeader(QPainter *painter, const QStyleOptionViewItem &option);
|
void drawHeader(QPainter *painter, const QStyleOptionViewItem &option) const;
|
||||||
|
|
||||||
/// height of the group, in total. includes a small bit of padding.
|
/// height of the group, in total. includes a small bit of padding.
|
||||||
int totalHeight() const;
|
int totalHeight() const;
|
||||||
|
|
||||||
/// height of the group header, in pixels
|
/// height of the group header, in pixels
|
||||||
int headerHeight() const;
|
static int headerHeight() ;
|
||||||
|
|
||||||
/// height of the group content, in pixels
|
/// height of the group content, in pixels
|
||||||
int contentHeight() const;
|
int contentHeight() const;
|
||||||
|
@ -159,19 +159,6 @@ void AccountListPage::on_actionAddMojang_triggered()
|
|||||||
|
|
||||||
void AccountListPage::on_actionAddMicrosoft_triggered()
|
void AccountListPage::on_actionAddMicrosoft_triggered()
|
||||||
{
|
{
|
||||||
if(BuildConfig.BUILD_PLATFORM == "osx64") {
|
|
||||||
CustomMessageBox::selectable(
|
|
||||||
this,
|
|
||||||
tr("Microsoft Accounts not available"),
|
|
||||||
//: %1 refers to the launcher itself
|
|
||||||
tr(
|
|
||||||
"Microsoft accounts are only usable on macOS 10.13 or newer, with fully updated %1.\n\n"
|
|
||||||
"Please update both your operating system and %1."
|
|
||||||
).arg(BuildConfig.LAUNCHER_DISPLAYNAME),
|
|
||||||
QMessageBox::Warning
|
|
||||||
)->exec();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MinecraftAccountPtr account = MSALoginDialog::newAccount(
|
MinecraftAccountPtr account = MSALoginDialog::newAccount(
|
||||||
this,
|
this,
|
||||||
tr("Please enter your Mojang account email and password to add your account.")
|
tr("Please enter your Mojang account email and password to add your account.")
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||||
* Copyright (c) 2022 dada513 <dada513@protonmail.com>
|
* Copyright (c) 2022 dada513 <dada513@protonmail.com>
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* PolyMC - Minecraft Launcher
|
* PolyMC - Minecraft Launcher
|
||||||
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||||
|
* Copyright (C) 2023 seth <getchoo at tuta dot io>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -99,6 +100,9 @@ void MinecraftPage::applySettings()
|
|||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
s->set("CloseAfterLaunch", ui->closeAfterLaunchCheck->isChecked());
|
s->set("CloseAfterLaunch", ui->closeAfterLaunchCheck->isChecked());
|
||||||
s->set("QuitAfterGameStop", ui->quitAfterGameStopCheck->isChecked());
|
s->set("QuitAfterGameStop", ui->quitAfterGameStopCheck->isChecked());
|
||||||
|
|
||||||
|
// Mod loader settings
|
||||||
|
s->set("DisableQuiltBeacon", ui->disableQuiltBeaconCheckBox->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MinecraftPage::loadSettings()
|
void MinecraftPage::loadSettings()
|
||||||
@ -137,6 +141,8 @@ void MinecraftPage::loadSettings()
|
|||||||
|
|
||||||
ui->closeAfterLaunchCheck->setChecked(s->get("CloseAfterLaunch").toBool());
|
ui->closeAfterLaunchCheck->setChecked(s->get("CloseAfterLaunch").toBool());
|
||||||
ui->quitAfterGameStopCheck->setChecked(s->get("QuitAfterGameStop").toBool());
|
ui->quitAfterGameStopCheck->setChecked(s->get("QuitAfterGameStop").toBool());
|
||||||
|
|
||||||
|
ui->disableQuiltBeaconCheckBox->setChecked(s->get("DisableQuiltBeacon").toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MinecraftPage::retranslate()
|
void MinecraftPage::retranslate()
|
||||||
|
@ -190,6 +190,25 @@
|
|||||||
<string>Tweaks</string>
|
<string>Tweaks</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="modLoaderSettingsGroupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Mod loader settings</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="disableQuiltBeaconCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable Quilt Loader Beacon</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Disable Quilt loader's beacon for counting monthly active users</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="nativeLibWorkaroundGroupBox">
|
<widget class="QGroupBox" name="nativeLibWorkaroundGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
* PolyMC - Minecraft Launcher
|
* PolyMC - Minecraft Launcher
|
||||||
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||||
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
||||||
|
* Copyright (C) 2023 seth <getchoo at tuta dot io>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -50,9 +51,9 @@
|
|||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "minecraft/auth/AccountList.h"
|
#include "minecraft/auth/AccountList.h"
|
||||||
|
|
||||||
|
#include "FileSystem.h"
|
||||||
#include "java/JavaInstallList.h"
|
#include "java/JavaInstallList.h"
|
||||||
#include "java/JavaUtils.h"
|
#include "java/JavaUtils.h"
|
||||||
#include "FileSystem.h"
|
|
||||||
|
|
||||||
InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent)
|
InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent)
|
||||||
: QWidget(parent), ui(new Ui::InstanceSettingsPage), m_instance(inst)
|
: QWidget(parent), ui(new Ui::InstanceSettingsPage), m_instance(inst)
|
||||||
@ -280,6 +281,14 @@ void InstanceSettingsPage::applySettings()
|
|||||||
m_settings->reset("InstanceAccountId");
|
m_settings->reset("InstanceAccountId");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool overrideModLoaderSettings = ui->modLoaderSettingsGroupBox->isChecked();
|
||||||
|
m_settings->set("OverrideModLoaderSettings", overrideModLoaderSettings);
|
||||||
|
if (overrideModLoaderSettings) {
|
||||||
|
m_settings->set("DisableQuiltBeacon", ui->disableQuiltBeaconCheckBox->isChecked());
|
||||||
|
} else {
|
||||||
|
m_settings->reset("DisableQuiltBeacon");
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: This should probably be called by a signal instead
|
// FIXME: This should probably be called by a signal instead
|
||||||
m_instance->updateRuntimeContext();
|
m_instance->updateRuntimeContext();
|
||||||
}
|
}
|
||||||
@ -380,6 +389,10 @@ void InstanceSettingsPage::loadSettings()
|
|||||||
|
|
||||||
ui->instanceAccountGroupBox->setChecked(m_settings->get("UseAccountForInstance").toBool());
|
ui->instanceAccountGroupBox->setChecked(m_settings->get("UseAccountForInstance").toBool());
|
||||||
updateAccountsMenu();
|
updateAccountsMenu();
|
||||||
|
|
||||||
|
// Mod loader specific settings
|
||||||
|
ui->modLoaderSettingsGroupBox->setChecked(m_settings->get("OverrideModLoaderSettings").toBool());
|
||||||
|
ui->disableQuiltBeaconCheckBox->setChecked(m_settings->get("DisableQuiltBeacon").toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstanceSettingsPage::on_javaDetectBtn_clicked()
|
void InstanceSettingsPage::on_javaDetectBtn_clicked()
|
||||||
|
@ -541,6 +541,31 @@
|
|||||||
<string>Miscellaneous</string>
|
<string>Miscellaneous</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="modLoaderSettingsGroupBox">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Mod loader settings</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="VerticalLayout_16">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="disableQuiltBeaconCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable Quilt Loader Beacon</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Disable Quilt loader's beacon for counting monthly active users</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="gameTimeGroupBox">
|
<widget class="QGroupBox" name="gameTimeGroupBox">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
* Copyright (C) 2022 Tayou <tayou@gmx.net>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
Loading…
Reference in New Issue
Block a user