Compare commits
54 Commits
fix-update
...
develop
Author | SHA1 | Date | |
---|---|---|---|
60234a550b | |||
|
67bca78946 | ||
|
2706ec5db6 | ||
|
48689d1b79 | ||
|
8940008b41 | ||
|
7050d01aab | ||
|
b9ba1f1c65 | ||
|
d873774547 | ||
|
7c6204b5f1 | ||
|
dd3a788f7b | ||
|
c479712f32 | ||
|
b43764d355 | ||
|
0565bd7c68 | ||
|
3e46252058 | ||
|
8239d03e0e | ||
|
62fdcd5c33 | ||
|
fa9259a167 | ||
|
11d1952696 | ||
|
1220f8fd6e | ||
|
19f5f25540 | ||
|
c95eedd72c | ||
|
631d465583 | ||
|
b65d0d1fe6 | ||
|
f56dfbafb2 | ||
|
de438aea84 | ||
|
3ec0820b45 | ||
|
07dac3127a | ||
|
67e6e5e7b1 | ||
|
80baecf088 | ||
|
b1e0b70833 | ||
|
f66c5b116f | ||
|
2c5a869dba | ||
|
31d99a35e7 | ||
|
491cb1e5a2 | ||
|
2c014a075d | ||
|
6b6da03aa4 | ||
|
6ec444e0c4 | ||
|
e0088f7811 | ||
|
9d66c25d42 | ||
|
41e90afbab | ||
|
32b45d0fd7 | ||
|
2129244378 | ||
|
cbcbda6d4c | ||
|
4de9053c05 | ||
|
b4b9051793 | ||
|
d7e190cabb | ||
|
1a02c19176 | ||
|
8990841c8b | ||
|
a1537bf42d | ||
|
d08118b05a | ||
|
72a8ff070e | ||
|
6f8fc48839 | ||
|
25d90beb12 | ||
|
fec49be639 |
133
.github/workflows/build.yml
vendored
133
.github/workflows/build.yml
vendored
@ -39,9 +39,6 @@ on:
|
||||
APPLE_NOTARIZE_PASSWORD:
|
||||
description: Password used for notarizing macOS builds
|
||||
required: false
|
||||
CACHIX_AUTH_TOKEN:
|
||||
description: Private token for authenticating against Cachix cache
|
||||
required: false
|
||||
GPG_PRIVATE_KEY:
|
||||
description: Private key for AppImage signing
|
||||
required: false
|
||||
@ -59,15 +56,18 @@ jobs:
|
||||
qt_ver: 5
|
||||
qt_host: linux
|
||||
qt_arch: ""
|
||||
qt_version: "5.12.8"
|
||||
qt_version: "5.15.2"
|
||||
qt_modules: "qtnetworkauth"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
qt_ver: 6
|
||||
qt_host: linux
|
||||
qt_arch: ""
|
||||
qt_version: "6.2.4"
|
||||
qt_version: "6.5.3"
|
||||
qt_modules: "qt5compat qtimageformats qtnetworkauth"
|
||||
linuxdeploy_hash: "4648f278ab3ef31f819e67c30d50f462640e5365a77637d7e6f2ad9fd0b4522a linuxdeploy-x86_64.AppImage"
|
||||
linuxdeploy_qt_hash: "15106be885c1c48a021198e7e1e9a48ce9d02a86dd0a1848f00bdbf3c1c92724 linuxdeploy-plugin-qt-x86_64.AppImage"
|
||||
appimageupdate_hash: "f1747cf60058e99f1bb9099ee9787d16c10241313b7acec81810ea1b1e568c11 AppImageUpdate-x86_64.AppImage"
|
||||
|
||||
- os: windows-2022
|
||||
name: "Windows-MinGW-w64"
|
||||
@ -80,9 +80,9 @@ jobs:
|
||||
architecture: "x64"
|
||||
vcvars_arch: "amd64"
|
||||
qt_ver: 6
|
||||
qt_host: windows
|
||||
qt_arch: ""
|
||||
qt_version: "6.7.3"
|
||||
qt_host: "windows"
|
||||
qt_arch: "win64_msvc2022_64"
|
||||
qt_version: "6.8.1"
|
||||
qt_modules: "qt5compat qtimageformats qtnetworkauth"
|
||||
nscurl_tag: "v24.9.26.122"
|
||||
nscurl_sha256: "AEE6C4BE3CB6455858E9C1EE4B3AFE0DB9960FA03FE99CCDEDC28390D57CCBB0"
|
||||
@ -93,9 +93,9 @@ jobs:
|
||||
architecture: "arm64"
|
||||
vcvars_arch: "amd64_arm64"
|
||||
qt_ver: 6
|
||||
qt_host: windows
|
||||
qt_arch: "win64_msvc2019_arm64"
|
||||
qt_version: "6.7.3"
|
||||
qt_host: "windows"
|
||||
qt_arch: "win64_msvc2022_arm64_cross_compiled"
|
||||
qt_version: "6.8.1"
|
||||
qt_modules: "qt5compat qtimageformats qtnetworkauth"
|
||||
nscurl_tag: "v24.9.26.122"
|
||||
nscurl_sha256: "AEE6C4BE3CB6455858E9C1EE4B3AFE0DB9960FA03FE99CCDEDC28390D57CCBB0"
|
||||
@ -106,7 +106,7 @@ jobs:
|
||||
qt_ver: 6
|
||||
qt_host: mac
|
||||
qt_arch: ""
|
||||
qt_version: "6.7.3"
|
||||
qt_version: "6.8.1"
|
||||
qt_modules: "qt5compat qtimageformats qtnetworkauth"
|
||||
|
||||
- os: macos-14
|
||||
@ -173,7 +173,7 @@ jobs:
|
||||
|
||||
- name: Retrieve ccache cache (Windows MinGW-w64)
|
||||
if: runner.os == 'Windows' && matrix.msystem != '' && inputs.build_type == 'Debug'
|
||||
uses: actions/cache@v4.1.1
|
||||
uses: actions/cache@v4.2.0
|
||||
with:
|
||||
path: '${{ github.workspace }}\.ccache'
|
||||
key: ${{ matrix.os }}-mingw-w64-ccache-${{ github.run_id }}
|
||||
@ -206,7 +206,7 @@ jobs:
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install ninja-build extra-cmake-modules scdoc appstream
|
||||
sudo apt-get -y install ninja-build extra-cmake-modules scdoc appstream libxcb-cursor-dev
|
||||
|
||||
- name: Install Dependencies (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
@ -216,14 +216,14 @@ jobs:
|
||||
|
||||
- name: Install host Qt (Windows MSVC arm64)
|
||||
if: runner.os == 'Windows' && matrix.architecture == 'arm64'
|
||||
uses: jurplel/install-qt-action@v3
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
aqtversion: "==3.1.*"
|
||||
py7zrversion: ">=0.20.2"
|
||||
version: ${{ matrix.qt_version }}
|
||||
host: "windows"
|
||||
target: "desktop"
|
||||
arch: ""
|
||||
arch: ${{ matrix.qt_arch }}
|
||||
modules: ${{ matrix.qt_modules }}
|
||||
cache: ${{ inputs.is_qt_cached }}
|
||||
cache-key-prefix: host-qt-arm64-windows
|
||||
@ -232,7 +232,7 @@ jobs:
|
||||
|
||||
- name: Install Qt (macOS, Linux & Windows MSVC)
|
||||
if: matrix.msystem == ''
|
||||
uses: jurplel/install-qt-action@v3
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
aqtversion: "==3.1.*"
|
||||
py7zrversion: ">=0.20.2"
|
||||
@ -252,19 +252,26 @@ jobs:
|
||||
|
||||
- name: Prepare AppImage (Linux)
|
||||
if: runner.os == 'Linux' && matrix.qt_ver != 5
|
||||
env:
|
||||
APPIMAGEUPDATE_HASH: ${{ matrix.appimageupdate_hash }}
|
||||
LINUXDEPLOY_HASH: ${{ matrix.linuxdeploy_hash }}
|
||||
LINUXDEPLOY_QT_HASH: ${{ matrix.linuxdeploy_qt_hash }}
|
||||
run: |
|
||||
wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
|
||||
wget "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage"
|
||||
wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
|
||||
wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20250213-2/linuxdeploy-x86_64.AppImage"
|
||||
wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/1-alpha-20250213-1/linuxdeploy-plugin-qt-x86_64.AppImage"
|
||||
|
||||
wget "https://github.com/AppImageCommunity/AppImageUpdate/releases/download/continuous/AppImageUpdate-x86_64.AppImage"
|
||||
wget "https://github.com/AppImageCommunity/AppImageUpdate/releases/download/2.0.0-alpha-1-20241225/AppImageUpdate-x86_64.AppImage"
|
||||
|
||||
sudo apt install libopengl0
|
||||
sha256sum -c - <<< "$LINUXDEPLOY_HASH"
|
||||
sha256sum -c - <<< "$LINUXDEPLOY_QT_HASH"
|
||||
sha256sum -c - <<< "$APPIMAGEUPDATE_HASH"
|
||||
|
||||
sudo apt install libopengl0 libfuse2
|
||||
|
||||
- name: Add QT_HOST_PATH var (Windows MSVC arm64)
|
||||
if: runner.os == 'Windows' && matrix.architecture == 'arm64'
|
||||
run: |
|
||||
echo "QT_HOST_PATH=${{ github.workspace }}\HostQt\Qt\${{ matrix.qt_version }}\msvc2019_64" >> $env:GITHUB_ENV
|
||||
echo "QT_HOST_PATH=${{ github.workspace }}\HostQt\Qt\${{ matrix.qt_version }}\msvc2022_64" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Setup java (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
@ -519,8 +526,8 @@ jobs:
|
||||
|
||||
cp -r ${{ runner.workspace }}/Qt/${{ matrix.qt_version }}/gcc_64/plugins/iconengines/* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines
|
||||
|
||||
cp /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
|
||||
cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
|
||||
cp /usr/lib/x86_64-linux-gnu/libcrypto.so.* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
|
||||
cp /usr/lib/x86_64-linux-gnu/libssl.so.* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
|
||||
cp /usr/lib/x86_64-linux-gnu/libOpenGL.so.0* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
|
||||
|
||||
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib"
|
||||
@ -555,9 +562,9 @@ jobs:
|
||||
mkdir ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
||||
cp /lib/x86_64-linux-gnu/libbz2.so.1.0 ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
||||
cp /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
||||
cp /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
||||
cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
||||
cp /usr/lib/x86_64-linux-gnu/libffi.so.7 ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
||||
cp /usr/lib/x86_64-linux-gnu/libcrypto.so.* ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
||||
cp /usr/lib/x86_64-linux-gnu/libssl.so.* ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
||||
cp /usr/lib/x86_64-linux-gnu/libffi.so.*.* ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
||||
mv ${{ env.INSTALL_PORTABLE_DIR }}/bin/*.so* ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
||||
|
||||
for l in $(find ${{ env.INSTALL_PORTABLE_DIR }} -type f); do l=${l#$(pwd)/}; l=${l#${{ env.INSTALL_PORTABLE_DIR }}/}; l=${l#./}; echo $l; done > ${{ env.INSTALL_PORTABLE_DIR }}/manifest.txt
|
||||
@ -629,71 +636,3 @@ jobs:
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
ccache -s
|
||||
|
||||
flatpak:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: bilelmoussaoui/flatpak-github-actions:kde-6.7
|
||||
options: --privileged
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
if: inputs.build_type == 'Debug'
|
||||
with:
|
||||
submodules: "true"
|
||||
- name: Build Flatpak (Linux)
|
||||
if: inputs.build_type == 'Debug'
|
||||
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
|
||||
with:
|
||||
bundle: "Shattered Prism.flatpak"
|
||||
manifest-path: flatpak/org.lunaislazier.ShatteredPrism.yml
|
||||
|
||||
nix:
|
||||
name: Nix (${{ matrix.system }})
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-22.04
|
||||
system: x86_64-linux
|
||||
|
||||
- os: macos-13
|
||||
system: x86_64-darwin
|
||||
|
||||
- os: macos-14
|
||||
system: aarch64-darwin
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v30
|
||||
|
||||
# For PRs
|
||||
- name: Setup Nix Magic Cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@v8
|
||||
|
||||
# For in-tree builds
|
||||
- name: Setup Cachix
|
||||
uses: cachix/cachix-action@v15
|
||||
with:
|
||||
name: unmojang
|
||||
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
||||
|
||||
- name: Run flake checks
|
||||
run: |
|
||||
nix flake check --print-build-logs --show-trace
|
||||
|
||||
- name: Build debug package
|
||||
if: ${{ inputs.build_type == 'Debug' }}
|
||||
run: |
|
||||
nix build --print-build-logs .#shatteredprism-debug
|
||||
|
||||
- name: Build release package
|
||||
if: ${{ inputs.build_type != 'Debug' }}
|
||||
run: |
|
||||
nix build --print-build-logs .#shatteredprism
|
||||
|
62
.github/workflows/flatpak.yml
vendored
Normal file
62
.github/workflows/flatpak.yml
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
name: Flatpak
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "**/LICENSE"
|
||||
- ".github/ISSUE_TEMPLATE/**"
|
||||
- ".markdownlint**"
|
||||
- "nix/**"
|
||||
# We don't do anything with these artifacts on releases. They go to Flathub
|
||||
tags-ignore:
|
||||
- "*"
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "**/LICENSE"
|
||||
- ".github/ISSUE_TEMPLATE/**"
|
||||
- ".markdownlint**"
|
||||
- "nix/**"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build (${{ matrix.arch }})
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-22.04
|
||||
arch: x86_64
|
||||
|
||||
- os: ubuntu-22.04-arm
|
||||
arch: aarch64
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
container:
|
||||
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.8
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Set short version
|
||||
shell: bash
|
||||
run: |
|
||||
echo "VERSION=${GITHUB_SHA::7}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Build Flatpak
|
||||
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
|
||||
with:
|
||||
bundle: ShatteredPrism-${{ runner.os }}-${{ env.VERSION }}-Flatpak.flatpak
|
||||
manifest-path: flatpak/org.lunaislazier.ShatteredPrism.yml
|
||||
arch: ${{ matrix.arch }}
|
88
.github/workflows/nix.yml
vendored
Normal file
88
.github/workflows/nix.yml
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
name: Nix
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "**/LICENSE"
|
||||
- ".github/ISSUE_TEMPLATE/**"
|
||||
- ".markdownlint**"
|
||||
- "flatpak/**"
|
||||
tags:
|
||||
- "*"
|
||||
pull_request_target:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "**/LICENSE"
|
||||
- ".github/ISSUE_TEMPLATE/**"
|
||||
- ".markdownlint**"
|
||||
- "flatpak/**"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
DEBUG: ${{ github.ref_type != 'tag' }}
|
||||
USE_DETERMINATE: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build (${{ matrix.system }})
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-22.04
|
||||
system: x86_64-linux
|
||||
|
||||
- os: ubuntu-22.04-arm
|
||||
system: aarch64-linux
|
||||
|
||||
- os: macos-13
|
||||
system: x86_64-darwin
|
||||
|
||||
- os: macos-14
|
||||
system: aarch64-darwin
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
uses: DeterminateSystems/nix-installer-action@v16
|
||||
with:
|
||||
determinate: ${{ env.USE_DETERMINATE }}
|
||||
|
||||
# For PRs
|
||||
- name: Setup Nix Magic Cache
|
||||
if: ${{ env.USE_DETERMINATE }}
|
||||
uses: DeterminateSystems/flakehub-cache-action@v1
|
||||
|
||||
# For in-tree builds
|
||||
- name: Setup Cachix
|
||||
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
|
||||
uses: cachix/cachix-action@v15
|
||||
with:
|
||||
name: lunaislazier
|
||||
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
||||
|
||||
- name: Run Flake checks
|
||||
run: |
|
||||
nix flake check --print-build-logs --show-trace
|
||||
|
||||
- name: Build debug package
|
||||
if: ${{ env.DEBUG }}
|
||||
run: |
|
||||
nix build --print-build-logs .#shatteredprism-debug
|
||||
|
||||
- name: Build release package
|
||||
if: ${{ !env.DEBUG }}
|
||||
run: |
|
||||
nix build --print-build-logs .#shatteredprism
|
1
.github/workflows/trigger_builds.yml
vendored
1
.github/workflows/trigger_builds.yml
vendored
@ -38,6 +38,5 @@ jobs:
|
||||
APPLE_NOTARIZE_APPLE_ID: ${{ secrets.APPLE_NOTARIZE_APPLE_ID }}
|
||||
APPLE_NOTARIZE_TEAM_ID: ${{ secrets.APPLE_NOTARIZE_TEAM_ID }}
|
||||
APPLE_NOTARIZE_PASSWORD: ${{ secrets.APPLE_NOTARIZE_PASSWORD }}
|
||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
||||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
GPG_PRIVATE_KEY_ID: ${{ secrets.GPG_PRIVATE_KEY_ID }}
|
||||
|
1
.github/workflows/trigger_release.yml
vendored
1
.github/workflows/trigger_release.yml
vendored
@ -23,7 +23,6 @@ jobs:
|
||||
APPLE_NOTARIZE_APPLE_ID: ${{ secrets.APPLE_NOTARIZE_APPLE_ID }}
|
||||
APPLE_NOTARIZE_TEAM_ID: ${{ secrets.APPLE_NOTARIZE_TEAM_ID }}
|
||||
APPLE_NOTARIZE_PASSWORD: ${{ secrets.APPLE_NOTARIZE_PASSWORD }}
|
||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
||||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
GPG_PRIVATE_KEY_ID: ${{ secrets.GPG_PRIVATE_KEY_ID }}
|
||||
|
||||
|
15
.github/workflows/winget.yml
vendored
15
.github/workflows/winget.yml
vendored
@ -1,15 +0,0 @@
|
||||
name: Publish to WinGet
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: vedantmgoyal2009/winget-releaser@v2
|
||||
with:
|
||||
identifier: PrismLauncher.PrismLauncher
|
||||
version: ${{ github.event.release.tag_name }}
|
||||
installers-regex: 'PrismLauncher-Windows-MSVC(:?-arm64|-Legacy)?-Setup-.+\.exe$'
|
||||
token: ${{ secrets.WINGET_TOKEN }}
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -47,8 +47,12 @@ run/
|
||||
|
||||
# Nix/NixOS
|
||||
.direnv/
|
||||
.pre-commit-config.yaml
|
||||
## Used when manually invoking stdenv phases
|
||||
outputs/
|
||||
## Regular artifacts
|
||||
result
|
||||
result-*
|
||||
repl-result-*
|
||||
|
||||
# Flatpak
|
||||
.flatpak-builder
|
||||
|
@ -4,6 +4,9 @@ MD012: false
|
||||
# MD013/line-length - Line length
|
||||
MD013: false
|
||||
|
||||
# MD022/blanks-around-headings
|
||||
MD022: false
|
||||
|
||||
# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content
|
||||
MD024:
|
||||
siblings-only: true
|
||||
|
@ -78,6 +78,13 @@ else()
|
||||
# ATL's pack list needs more than the default 1 Mib stack on windows
|
||||
if(WIN32)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--stack,8388608 ${CMAKE_EXE_LINKER_FLAGS}")
|
||||
|
||||
# -ffunction-sections and -fdata-sections help reduce binary size
|
||||
# -mguard=cf enables Control Flow Guard
|
||||
# TODO: Look into -gc-sections to further reduce binary size
|
||||
foreach(lang C CXX)
|
||||
set("CMAKE_${lang}_FLAGS_RELEASE" "-ffunction-sections -fdata-sections -mguard=cf")
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -106,14 +113,14 @@ if ((CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebI
|
||||
else()
|
||||
# AppleClang and Clang
|
||||
message(STATUS "Address Sanitizer available on Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=null")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=null")
|
||||
endif()
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
# GCC
|
||||
message(STATUS "Address Sanitizer available on GCC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover")
|
||||
link_libraries("asan")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
message(STATUS "Address Sanitizer available on MSVC")
|
||||
@ -181,12 +188,11 @@ set(Launcher_FMLLIBS_BASE_URL "https://files.prismlauncher.org/fmllibs/" CACHE S
|
||||
|
||||
######## Set version numbers ########
|
||||
set(Launcher_VERSION_MAJOR 1)
|
||||
set(Launcher_VERSION_MINOR 4)
|
||||
set(Launcher_VERSION_PATCH 0)
|
||||
set(Launcher_VERSION_MINOR 7)
|
||||
|
||||
set(Launcher_VERSION_NAME "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_PATCH}")
|
||||
set(Launcher_VERSION_NAME4 "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_PATCH}.0")
|
||||
set(Launcher_VERSION_NAME4_COMMA "${Launcher_VERSION_MAJOR},${Launcher_VERSION_MINOR},${Launcher_VERSION_PATCH},0")
|
||||
set(Launcher_VERSION_NAME "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}")
|
||||
set(Launcher_VERSION_NAME4 "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.0.0")
|
||||
set(Launcher_VERSION_NAME4_COMMA "${Launcher_VERSION_MAJOR},${Launcher_VERSION_MINOR},0,0")
|
||||
|
||||
# Build platform.
|
||||
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.")
|
||||
@ -390,8 +396,8 @@ if(UNIX AND APPLE)
|
||||
set(MACOSX_SPARKLE_UPDATE_PUBLIC_KEY "" CACHE STRING "Public key for Sparkle update feed")
|
||||
set(MACOSX_SPARKLE_UPDATE_FEED_URL "" CACHE STRING "URL for Sparkle update feed")
|
||||
|
||||
set(MACOSX_SPARKLE_DOWNLOAD_URL "https://github.com/sparkle-project/Sparkle/releases/download/2.5.2/Sparkle-2.5.2.tar.xz" CACHE STRING "URL to Sparkle release archive")
|
||||
set(MACOSX_SPARKLE_SHA256 "572dd67ae398a466f19f343a449e1890bac1ef74885b4739f68f979a8a89884b" CACHE STRING "SHA256 checksum for Sparkle release archive")
|
||||
set(MACOSX_SPARKLE_DOWNLOAD_URL "https://github.com/sparkle-project/Sparkle/releases/download/2.6.4/Sparkle-2.6.4.tar.xz" CACHE STRING "URL to Sparkle release archive")
|
||||
set(MACOSX_SPARKLE_SHA256 "50612a06038abc931f16011d7903b8326a362c1074dabccb718404ce8e585f0b" CACHE STRING "SHA256 checksum for Sparkle release archive")
|
||||
set(MACOSX_SPARKLE_DIR "${CMAKE_BINARY_DIR}/frameworks/Sparkle")
|
||||
|
||||
# directories to look for dependencies
|
||||
|
@ -1,7 +1,7 @@
|
||||
## Shattered Prism
|
||||
|
||||
Shattered Prism - Minecraft Launcher
|
||||
Copyright (C) 2024-2024 Shattered Prism Contributors
|
||||
Copyright (C) 2024-2025 Shattered Prism Contributors
|
||||
|
||||
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
|
||||
@ -35,7 +35,7 @@
|
||||
## Fjord Launcher
|
||||
|
||||
Fjord Launcher - Minecraft Launcher
|
||||
Copyright (C) 2024-2024 Fjord Launcher Contributors
|
||||
Copyright (C) 2024-2025 Fjord Launcher Contributors
|
||||
|
||||
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
|
||||
@ -103,7 +103,7 @@
|
||||
## Prism Launcher
|
||||
|
||||
Prism Launcher - Minecraft Launcher
|
||||
Copyright (C) 2022-2024 Prism Launcher Contributors
|
||||
Copyright (C) 2022-2025 Prism Launcher Contributors
|
||||
|
||||
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
|
||||
|
12
README.md
12
README.md
@ -8,10 +8,13 @@
|
||||
|
||||
<p align="center">
|
||||
Shattered Prism is a custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once.<br />
|
||||
<br />This is a <b>fork</b> of PrismLauncher and is <b>not</b> endorsed by it.
|
||||
<br />This is a <b>fork</b> of FjordLauncher and is <b>not</b> endorsed by it or Prism.
|
||||
</p>
|
||||
|
||||
# Why does this exist?
|
||||
## Why does this exist?
|
||||
|
||||
This project was originally a direct fork of upstream Prism, but spent most of it's time as a small group-oriented continuation of fn2006's PollyMC, except with continued support for Microsoft authentication and being without branding that would get it confused for a uh... *similarly named project*. Luckily though, [@evan-goode](https://github.com/evan-goode) eventually created Fjord and this project has been based upon it ever since!
|
||||
## Differences from PrismLauncher
|
||||
|
||||
- Fully removed PrismLauncher's DRM.
|
||||
- Restores the ability to download modpacks from FTB.
|
||||
@ -25,10 +28,11 @@
|
||||
|
||||
## Community & Support
|
||||
|
||||
Feel free to create a GitHub issue if you find a bug or want to suggest something, it is currently the **only** way to contact anyone regarding this project.
|
||||
Feel free to create a GitHub issue if you find a bug or want to suggest something.
|
||||
|
||||
Do **not** ask for support on any of the official PrismLauncher channels as they cannot be held responsible for any issues caused by the changes made.
|
||||
For any other project-related inquiries, reach me at either my [Bluesky](https://bsky.app/profile/moonlitvtuber.org) or [Twitter](https://twitter.com/lunasc_ope).
|
||||
|
||||
Do **not** ask for support on any of the official PrismLauncher channels, please refer to the FjordLauncher ones **only** if the issue is shared between these two projects.
|
||||
|
||||
## License [](LICENSE)
|
||||
|
||||
|
@ -58,7 +58,6 @@ Config::Config()
|
||||
// Version information
|
||||
VERSION_MAJOR = @Launcher_VERSION_MAJOR@;
|
||||
VERSION_MINOR = @Launcher_VERSION_MINOR@;
|
||||
VERSION_PATCH = @Launcher_VERSION_PATCH@;
|
||||
|
||||
BUILD_PLATFORM = "@Launcher_BUILD_PLATFORM@";
|
||||
BUILD_ARTIFACT = "@Launcher_BUILD_ARTIFACT@";
|
||||
@ -137,7 +136,7 @@ Config::Config()
|
||||
|
||||
QString Config::versionString() const
|
||||
{
|
||||
return QString("%1.%2.%3").arg(VERSION_MAJOR).arg(VERSION_MINOR).arg(VERSION_PATCH);
|
||||
return QString("%1.%2").arg(VERSION_MAJOR).arg(VERSION_MINOR);
|
||||
}
|
||||
|
||||
QString Config::printableVersionString() const
|
||||
|
@ -59,8 +59,6 @@ class Config {
|
||||
int VERSION_MAJOR;
|
||||
/// The minor version number.
|
||||
int VERSION_MINOR;
|
||||
/// The patch version number.
|
||||
int VERSION_PATCH;
|
||||
|
||||
/**
|
||||
* The version channel
|
||||
@ -181,7 +179,7 @@ class Config {
|
||||
QString FMLLIBS_BASE_URL;
|
||||
QString TRANSLATION_FILES_URL;
|
||||
|
||||
QString MODPACKSCH_API_BASE_URL = "https://api.modpacks.ch/";
|
||||
QString MODPACKSCH_API_BASE_URL = "https://api.feed-the-beast.com/v1/modpacks/";
|
||||
|
||||
QString LEGACY_FTB_CDN_BASE_URL = "https://dist.creeper.host/FTB2/";
|
||||
|
||||
|
@ -7,7 +7,9 @@
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>A Minecraft mod wants to access your microphone.</string>
|
||||
<key>NSDownloadsFolderUsageDescription</key>
|
||||
<string>Fjord uses access to your Downloads folder to help you more quickly add mods that can't be automatically downloaded to your instance. You can change where Fjord scans for downloaded mods in Settings or the prompt that appears.</string>
|
||||
<string>Shattered Prism uses access to your Downloads folder to help you more quickly add mods that can't be automatically downloaded to your instance. You can change where Shattered Prism scans for downloaded mods in Settings or the prompt that appears.</string>
|
||||
<key>NSLocalNetworkUsageDescription</key>
|
||||
<string>Minecraft uses the local network to find and connect to LAN servers.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
@ -55,7 +57,7 @@
|
||||
<string>mrpack</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Fjord Launcher instance</string>
|
||||
<string>Shattered Prism instance</string>
|
||||
<key>CFBundleTypeOSTypes</key>
|
||||
<array>
|
||||
<string>TEXT</string>
|
||||
@ -81,10 +83,10 @@
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>FjordLauncher</string>
|
||||
<string>ShatteredPrism</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>fjordlauncher</string>
|
||||
<string>shatteredprism</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
|
13
default.nix
13
default.nix
@ -1,9 +1,4 @@
|
||||
(import (
|
||||
let
|
||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||
in
|
||||
fetchTarball {
|
||||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}
|
||||
) { src = ./.; }).defaultNix
|
||||
(import (fetchTarball {
|
||||
url = "https://github.com/edolstra/flake-compat/archive/ff81ac966bb2cae68946d5ed5fc4994f96d0ffec.tar.gz";
|
||||
sha256 = "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=";
|
||||
}) { src = ./.; }).defaultNix
|
||||
|
18
flake.lock
generated
18
flake.lock
generated
@ -3,11 +3,11 @@
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"lastModified": 1733328505,
|
||||
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -34,11 +34,11 @@
|
||||
},
|
||||
"nix-filter": {
|
||||
"locked": {
|
||||
"lastModified": 1710156097,
|
||||
"narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=",
|
||||
"lastModified": 1731533336,
|
||||
"narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=",
|
||||
"owner": "numtide",
|
||||
"repo": "nix-filter",
|
||||
"rev": "3342559a24e85fc164b295c3444e8a139924675b",
|
||||
"rev": "f7653272fd234696ae94229839a99b73c9ab7de0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -49,11 +49,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1729256560,
|
||||
"narHash": "sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c+cHUJwA=",
|
||||
"lastModified": 1739866667,
|
||||
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0",
|
||||
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
139
flake.nix
139
flake.nix
@ -15,28 +15,6 @@
|
||||
url = "github:PrismLauncher/libnbtplusplus";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
nix-filter.url = "github:numtide/nix-filter";
|
||||
|
||||
/*
|
||||
Inputs below this are optional and can be removed
|
||||
|
||||
```
|
||||
{
|
||||
inputs.shatteredprism = {
|
||||
url = "github:lunaislazier/ShatteredPrism";
|
||||
inputs = {
|
||||
flake-compat.follows = "";
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
*/
|
||||
|
||||
flake-compat = {
|
||||
url = "github:edolstra/flake-compat";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
@ -44,9 +22,8 @@
|
||||
self,
|
||||
nixpkgs,
|
||||
libnbtplusplus,
|
||||
nix-filter,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
|
||||
@ -58,45 +35,119 @@
|
||||
forAllSystems = lib.genAttrs systems;
|
||||
nixpkgsFor = forAllSystems (system: nixpkgs.legacyPackages.${system});
|
||||
in
|
||||
|
||||
{
|
||||
checks = forAllSystems (
|
||||
system:
|
||||
|
||||
let
|
||||
checks' = nixpkgsFor.${system}.callPackage ./nix/checks.nix { inherit self; };
|
||||
pkgs = nixpkgsFor.${system};
|
||||
llvm = pkgs.llvmPackages_19;
|
||||
in
|
||||
lib.filterAttrs (_: lib.isDerivation) checks'
|
||||
|
||||
{
|
||||
formatting =
|
||||
pkgs.runCommand "check-formatting"
|
||||
{
|
||||
nativeBuildInputs = with pkgs; [
|
||||
deadnix
|
||||
llvm.clang-tools
|
||||
markdownlint-cli
|
||||
nixfmt-rfc-style
|
||||
statix
|
||||
];
|
||||
}
|
||||
''
|
||||
cd ${self}
|
||||
|
||||
echo "Running clang-format...."
|
||||
clang-format --dry-run --style='file' --Werror */**.{c,cc,cpp,h,hh,hpp}
|
||||
|
||||
echo "Running deadnix..."
|
||||
deadnix --fail
|
||||
|
||||
echo "Running markdownlint..."
|
||||
markdownlint --dot .
|
||||
|
||||
echo "Running nixfmt..."
|
||||
find -type f -name '*.nix' -exec nixfmt --check {} +
|
||||
|
||||
echo "Running statix"
|
||||
statix check .
|
||||
|
||||
touch $out
|
||||
'';
|
||||
}
|
||||
);
|
||||
|
||||
devShells = forAllSystems (
|
||||
system:
|
||||
|
||||
let
|
||||
pkgs = nixpkgsFor.${system};
|
||||
llvm = pkgs.llvmPackages_19;
|
||||
|
||||
packages' = self.packages.${system};
|
||||
|
||||
# Re-use our package wrapper to wrap our development environment
|
||||
qt-wrapper-env = packages'.shatteredprism.overrideAttrs (old: {
|
||||
name = "qt-wrapper-env";
|
||||
|
||||
# Required to use script-based makeWrapper below
|
||||
strictDeps = true;
|
||||
|
||||
# We don't need/want the unwrapped Fjord package
|
||||
paths = [ ];
|
||||
|
||||
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [
|
||||
# Ensure the wrapper is script based so it can be sourced
|
||||
pkgs.makeWrapper
|
||||
];
|
||||
|
||||
# Inspired by https://discourse.nixos.org/t/python-qt-woes/11808/10
|
||||
buildCommand = ''
|
||||
makeQtWrapper ${lib.getExe pkgs.runtimeShellPackage} "$out"
|
||||
sed -i '/^exec/d' "$out"
|
||||
'';
|
||||
});
|
||||
in
|
||||
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
inputsFrom = [ self.packages.${system}.shatteredprism-unwrapped ];
|
||||
buildInputs = with pkgs; [
|
||||
inputsFrom = [ packages'.shatteredprism-unwrapped ];
|
||||
|
||||
packages = with pkgs; [
|
||||
ccache
|
||||
ninja
|
||||
llvm.clang-tools
|
||||
];
|
||||
|
||||
cmakeBuildType = "Debug";
|
||||
cmakeFlags = [ "-GNinja" ] ++ packages'.shatteredprism.cmakeFlags;
|
||||
dontFixCmake = true;
|
||||
|
||||
shellHook = ''
|
||||
echo "Sourcing ${qt-wrapper-env}"
|
||||
source ${qt-wrapper-env}
|
||||
|
||||
git submodule update --init --force
|
||||
|
||||
if [ ! -f compile_commands.json ]; then
|
||||
cmakeConfigurePhase
|
||||
cd ..
|
||||
ln -s "$cmakeBuildDir"/compile_commands.json compile_commands.json
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
formatter = forAllSystems (system: nixpkgsFor.${system}.nixfmt-rfc-style);
|
||||
|
||||
overlays.default =
|
||||
final: prev:
|
||||
let
|
||||
version = builtins.substring 0 8 self.lastModifiedDate or "dirty";
|
||||
in
|
||||
{
|
||||
overlays.default = final: prev: {
|
||||
shatteredprism-unwrapped = prev.callPackage ./nix/unwrapped.nix {
|
||||
inherit
|
||||
libnbtplusplus
|
||||
nix-filter
|
||||
self
|
||||
version
|
||||
;
|
||||
};
|
||||
|
||||
@ -105,6 +156,7 @@
|
||||
|
||||
packages = forAllSystems (
|
||||
system:
|
||||
|
||||
let
|
||||
pkgs = nixpkgsFor.${system};
|
||||
|
||||
@ -117,6 +169,7 @@
|
||||
default = shatteredPackages.shatteredprism;
|
||||
};
|
||||
in
|
||||
|
||||
# Only output them if they're available on the current system
|
||||
lib.filterAttrs (_: lib.meta.availableOn pkgs.stdenv.hostPlatform) packages
|
||||
);
|
||||
@ -124,16 +177,18 @@
|
||||
# We put these under legacyPackages as they are meant for CI, not end user consumption
|
||||
legacyPackages = forAllSystems (
|
||||
system:
|
||||
|
||||
let
|
||||
shatteredPackages = self.packages.${system};
|
||||
legacyPackages = self.legacyPackages.${system};
|
||||
packages' = self.packages.${system};
|
||||
legacyPackages' = self.legacyPackages.${system};
|
||||
in
|
||||
|
||||
{
|
||||
shatteredprism-debug = shatteredPackages.shatteredprism.override {
|
||||
shatteredprism-unwrapped = legacyPackages.shatteredprism-unwrapped-debug;
|
||||
shatteredprism-debug = packages'.shatteredprism.override {
|
||||
shatteredprism-unwrapped = legacyPackages'.shatteredprism-unwrapped-debug;
|
||||
};
|
||||
|
||||
shatteredprism-unwrapped-debug = shatteredPackages.shatteredprism-unwrapped.overrideAttrs {
|
||||
shatteredprism-unwrapped-debug = packages'.shatteredprism-unwrapped.overrideAttrs {
|
||||
cmakeBuildType = "Debug";
|
||||
dontStrip = true;
|
||||
};
|
||||
|
20
flatpak/flite.json
Normal file
20
flatpak/flite.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "flite",
|
||||
"config-opts": [
|
||||
"--enable-shared",
|
||||
"--with-audio=pulseaudio"
|
||||
],
|
||||
"no-parallel-make": true,
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/festvox/flite.git",
|
||||
"tag": "v2.2",
|
||||
"commit": "e9e2e37c329dbe98bfeb27a1828ef9a71fa84f88",
|
||||
"x-checker-data": {
|
||||
"type": "git",
|
||||
"tag-pattern": "^v([\\d.]+)$"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -8,11 +8,7 @@
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://gitlab.freedesktop.org/libdecor/libdecor.git",
|
||||
"commit": "73260393a97291c887e1074ab7f318e031be0ac6"
|
||||
},
|
||||
{
|
||||
"type": "patch",
|
||||
"path": "patches/weird_libdecor.patch"
|
||||
"commit": "c2bd8ad6fa42c0cb17553ce77ad8a87d1f543b1f"
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
id: org.lunaislazier.ShatteredPrism
|
||||
runtime: org.kde.Platform
|
||||
runtime-version: 6.7
|
||||
runtime-version: '6.8'
|
||||
sdk: org.kde.Sdk
|
||||
sdk-extensions:
|
||||
- org.freedesktop.Sdk.Extension.openjdk17
|
||||
@ -19,6 +19,12 @@ finish-args:
|
||||
- --filesystem=xdg-download:ro
|
||||
# FTBApp import
|
||||
- --filesystem=~/.ftba:ro
|
||||
# Userspace visibility for manual hugepages configuration
|
||||
# Required for -XX:+UseLargePages
|
||||
- --filesystem=/sys/kernel/mm/hugepages:ro
|
||||
# Userspace visibility for transparent hugepages configuration
|
||||
# Required for -XX:+UseTransparentHugePages
|
||||
- --filesystem=/sys/kernel/mm/transparent_hugepage:ro
|
||||
|
||||
modules:
|
||||
# Might be needed by some Controller mods (see https://github.com/isXander/Controlify/issues/31)
|
||||
@ -27,11 +33,16 @@ modules:
|
||||
# Needed for proper Wayland support
|
||||
- libdecor.json
|
||||
|
||||
# Text to Speech in the game
|
||||
- flite.json
|
||||
|
||||
- name: shatteredprism
|
||||
buildsystem: cmake-ninja
|
||||
builddir: true
|
||||
config-opts:
|
||||
- -DLauncher_BUILD_PLATFORM=flatpak
|
||||
# This allows us to manage and update Java independently of this Flatpak
|
||||
- -DLauncher_ENABLE_JAVA_DOWNLOADER=ON
|
||||
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
build-options:
|
||||
env:
|
||||
@ -47,18 +58,14 @@ modules:
|
||||
config-opts:
|
||||
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
- -DBUILD_SHARED_LIBS:BOOL=ON
|
||||
- -DGLFW_USE_WAYLAND:BOOL=ON
|
||||
- -DGLFW_BUILD_WAYLAND:BOOL=ON
|
||||
- -DGLFW_BUILD_DOCS:BOOL=OFF
|
||||
sources:
|
||||
- type: git
|
||||
url: https://github.com/glfw/glfw.git
|
||||
commit: 3fa2360720eeba1964df3c0ecf4b5df8648a8e52
|
||||
commit: 7b6aead9fb88b3623e3b3725ebb42670cbe4c579 # 3.4
|
||||
- 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
|
||||
path: patches/0009-Defer-setting-cursor-position-until-the-cursor-is-lo.patch
|
||||
cleanup:
|
||||
- /include
|
||||
- /lib/cmake
|
||||
@ -68,8 +75,8 @@ modules:
|
||||
buildsystem: autotools
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://xorg.freedesktop.org/archive/individual/app/xrandr-1.5.2.tar.xz
|
||||
sha256: c8bee4790d9058bacc4b6246456c58021db58a87ddda1a9d0139bf5f18f1f240
|
||||
url: https://xorg.freedesktop.org/archive/individual/app/xrandr-1.5.3.tar.xz
|
||||
sha256: f8dd7566adb74147fab9964680b6bbadee87cf406a7fcff51718a5e6949b841c
|
||||
x-checker-data:
|
||||
type: anitya
|
||||
project-id: 14957
|
||||
@ -91,8 +98,8 @@ modules:
|
||||
sources:
|
||||
- type: archive
|
||||
dest-filename: gamemode.tar.gz
|
||||
url: https://api.github.com/repos/FeralInteractive/gamemode/tarball/1.8.1
|
||||
sha256: 969cf85b5ca3944f3e315cd73a0ee9bea4f9c968cd7d485e9f4745bc1e679c4e
|
||||
url: https://api.github.com/repos/FeralInteractive/gamemode/tarball/1.8.2
|
||||
sha256: 2886d4ce543c78bd2a364316d5e7fd59ef06b71de63f896b37c6d3dc97658f60
|
||||
x-checker-data:
|
||||
type: json
|
||||
url: https://api.github.com/repos/FeralInteractive/gamemode/releases/latest
|
||||
|
@ -1,24 +0,0 @@
|
||||
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,
|
@ -1,17 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
@ -1,20 +0,0 @@
|
||||
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)
|
@ -0,0 +1,59 @@
|
||||
From 9997ae55a47de469ea26f8437c30b51483abda5f Mon Sep 17 00:00:00 2001
|
||||
From: Dan Klishch <danilklishch@gmail.com>
|
||||
Date: Sat, 30 Sep 2023 23:38:05 -0400
|
||||
Subject: Defer setting cursor position until the cursor is locked
|
||||
|
||||
---
|
||||
src/wl_platform.h | 3 +++
|
||||
src/wl_window.c | 14 ++++++++++++--
|
||||
2 files changed, 15 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/wl_platform.h b/src/wl_platform.h
|
||||
index ca34f66e..cd1f227f 100644
|
||||
--- a/src/wl_platform.h
|
||||
+++ b/src/wl_platform.h
|
||||
@@ -403,6 +403,9 @@ typedef struct _GLFWwindowWayland
|
||||
int scaleSize;
|
||||
int compositorPreferredScale;
|
||||
|
||||
+ double askedCursorPosX, askedCursorPosY;
|
||||
+ GLFWbool didAskForSetCursorPos;
|
||||
+
|
||||
struct zwp_relative_pointer_v1* relativePointer;
|
||||
struct zwp_locked_pointer_v1* lockedPointer;
|
||||
struct zwp_confined_pointer_v1* confinedPointer;
|
||||
diff --git a/src/wl_window.c b/src/wl_window.c
|
||||
index 1de26558..0df16747 100644
|
||||
--- a/src/wl_window.c
|
||||
+++ b/src/wl_window.c
|
||||
@@ -2586,8 +2586,9 @@ void _glfwGetCursorPosWayland(_GLFWwindow* window, double* xpos, double* ypos)
|
||||
|
||||
void _glfwSetCursorPosWayland(_GLFWwindow* window, double x, double y)
|
||||
{
|
||||
- _glfwInputError(GLFW_FEATURE_UNAVAILABLE,
|
||||
- "Wayland: The platform does not support setting the cursor position");
|
||||
+ window->wl.didAskForSetCursorPos = true;
|
||||
+ window->wl.askedCursorPosX = x;
|
||||
+ window->wl.askedCursorPosY = y;
|
||||
}
|
||||
|
||||
void _glfwSetCursorModeWayland(_GLFWwindow* window, int mode)
|
||||
@@ -2819,6 +2820,15 @@ static const struct zwp_relative_pointer_v1_listener relativePointerListener =
|
||||
static void lockedPointerHandleLocked(void* userData,
|
||||
struct zwp_locked_pointer_v1* lockedPointer)
|
||||
{
|
||||
+ _GLFWwindow* window = userData;
|
||||
+
|
||||
+ if (window->wl.didAskForSetCursorPos)
|
||||
+ {
|
||||
+ window->wl.didAskForSetCursorPos = false;
|
||||
+ zwp_locked_pointer_v1_set_cursor_position_hint(window->wl.lockedPointer,
|
||||
+ wl_fixed_from_double(window->wl.askedCursorPosX),
|
||||
+ wl_fixed_from_double(window->wl.askedCursorPosY));
|
||||
+ }
|
||||
}
|
||||
|
||||
static void lockedPointerHandleUnlocked(void* userData,
|
||||
--
|
||||
2.42.0
|
||||
|
@ -1,40 +0,0 @@
|
||||
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 *
|
56
launcher/Application.cpp
Normal file → Executable file
56
launcher/Application.cpp
Normal file → Executable file
@ -48,6 +48,7 @@
|
||||
#include "net/PasteUpload.h"
|
||||
#include "pathmatcher/MultiMatcher.h"
|
||||
#include "pathmatcher/SimplePrefixMatcher.h"
|
||||
#include "tasks/Task.h"
|
||||
#include "tools/GenericProfiler.h"
|
||||
#include "ui/InstanceWindow.h"
|
||||
#include "ui/MainWindow.h"
|
||||
@ -165,6 +166,8 @@
|
||||
#define STRINGIFY(x) #x
|
||||
#define TOSTRING(x) STRINGIFY(x)
|
||||
|
||||
#include "onimai.h"
|
||||
|
||||
static const QLatin1String liveCheckFile("live.check");
|
||||
|
||||
PixmapCache* PixmapCache::s_instance = nullptr;
|
||||
@ -931,6 +934,8 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
||||
connect(this, &Application::clickedOnDock, [this]() { this->showMainWindow(); });
|
||||
#endif
|
||||
|
||||
onimaiLoadLauncher(this);
|
||||
|
||||
connect(this, &Application::aboutToQuit, [this]() {
|
||||
if (m_instances) {
|
||||
// save any remaining instance state
|
||||
@ -1092,6 +1097,9 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
||||
bool Application::createSetupWizard()
|
||||
{
|
||||
bool javaRequired = [&]() {
|
||||
if (BuildConfig.JAVA_DOWNLOADER_ENABLED && m_settings->get("AutomaticJavaDownload").toBool()) {
|
||||
return false;
|
||||
}
|
||||
bool ignoreJavaWizard = m_settings->get("IgnoreJavaWizard").toBool();
|
||||
if (ignoreJavaWizard) {
|
||||
return false;
|
||||
@ -1104,10 +1112,7 @@ bool Application::createSetupWizard()
|
||||
}
|
||||
QString currentJavaPath = settings()->get("JavaPath").toString();
|
||||
QString actualPath = FS::ResolveExecutable(currentJavaPath);
|
||||
if (actualPath.isNull()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return actualPath.isNull();
|
||||
}();
|
||||
bool askjava = BuildConfig.JAVA_DOWNLOADER_ENABLED && !javaRequired && !m_settings->get("AutomaticJavaDownload").toBool() &&
|
||||
!m_settings->get("AutomaticJavaSwitch").toBool() && !m_settings->get("UserAskedAboutAutomaticJavaDownload").toBool();
|
||||
@ -1116,6 +1121,7 @@ bool Application::createSetupWizard()
|
||||
bool validWidgets = m_themeManager->isValidApplicationTheme(settings()->get("ApplicationTheme").toString());
|
||||
bool validIcons = m_themeManager->isValidIconTheme(settings()->get("IconTheme").toString());
|
||||
bool login = !m_accounts->anyAccountIsValid() && capabilities() & Application::SupportsMSA;
|
||||
login = false;
|
||||
bool themeInterventionRequired = !validWidgets || !validIcons;
|
||||
bool wizardRequired = javaRequired || languageRequired || pasteInterventionRequired || themeInterventionRequired || askjava || login;
|
||||
if (wizardRequired) {
|
||||
@ -1426,6 +1432,7 @@ bool Application::launch(InstancePtr instance, bool online, bool demo, Minecraft
|
||||
if (m_updateRunning) {
|
||||
qDebug() << "Cannot launch instances while an update is running. Please try again when updates are completed.";
|
||||
} else if (instance->canLaunch()) {
|
||||
QMutexLocker locker(&m_instanceExtrasMutex);
|
||||
auto& extras = m_instanceExtras[instance->id()];
|
||||
auto window = extras.window;
|
||||
if (window) {
|
||||
@ -1450,7 +1457,7 @@ bool Application::launch(InstancePtr instance, bool online, bool demo, Minecraft
|
||||
connect(controller.get(), &LaunchController::failed, this, &Application::controllerFailed);
|
||||
connect(controller.get(), &LaunchController::aborted, this, [this] { controllerFailed(tr("Aborted")); });
|
||||
addRunningInstance();
|
||||
controller->start();
|
||||
QMetaObject::invokeMethod(controller.get(), &Task::start, Qt::QueuedConnection);
|
||||
return true;
|
||||
} else if (instance->isRunning()) {
|
||||
showInstanceWindow(instance, "console");
|
||||
@ -1468,9 +1475,11 @@ bool Application::kill(InstancePtr instance)
|
||||
qWarning() << "Attempted to kill instance" << instance->id() << ", which isn't running.";
|
||||
return false;
|
||||
}
|
||||
QMutexLocker locker(&m_instanceExtrasMutex);
|
||||
auto& extras = m_instanceExtras[instance->id()];
|
||||
// NOTE: copy of the shared pointer keeps it alive
|
||||
auto controller = extras.controller;
|
||||
locker.unlock();
|
||||
if (controller) {
|
||||
return controller->abort();
|
||||
}
|
||||
@ -1524,12 +1533,14 @@ void Application::controllerSucceeded()
|
||||
if (!controller)
|
||||
return;
|
||||
auto id = controller->id();
|
||||
|
||||
QMutexLocker locker(&m_instanceExtrasMutex);
|
||||
auto& extras = m_instanceExtras[id];
|
||||
|
||||
// on success, do...
|
||||
if (controller->instance()->settings()->get("AutoCloseConsole").toBool()) {
|
||||
if (extras.window) {
|
||||
extras.window->close();
|
||||
QMetaObject::invokeMethod(extras.window, &QWidget::close, Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
extras.controller.reset();
|
||||
@ -1549,6 +1560,7 @@ void Application::controllerFailed(const QString& error)
|
||||
if (!controller)
|
||||
return;
|
||||
auto id = controller->id();
|
||||
QMutexLocker locker(&m_instanceExtrasMutex);
|
||||
auto& extras = m_instanceExtras[id];
|
||||
|
||||
// on failure, do... nothing
|
||||
@ -1606,6 +1618,7 @@ InstanceWindow* Application::showInstanceWindow(InstancePtr instance, QString pa
|
||||
if (!instance)
|
||||
return nullptr;
|
||||
auto id = instance->id();
|
||||
QMutexLocker locker(&m_instanceExtrasMutex);
|
||||
auto& extras = m_instanceExtras[id];
|
||||
auto& window = extras.window;
|
||||
|
||||
@ -1643,6 +1656,7 @@ void Application::on_windowClose()
|
||||
m_openWindows--;
|
||||
auto instWindow = qobject_cast<InstanceWindow*>(QObject::sender());
|
||||
if (instWindow) {
|
||||
QMutexLocker locker(&m_instanceExtrasMutex);
|
||||
auto& extras = m_instanceExtras[instWindow->instanceId()];
|
||||
extras.window = nullptr;
|
||||
if (extras.controller) {
|
||||
@ -1890,7 +1904,7 @@ bool Application::handleDataMigration(const QString& currentData,
|
||||
matcher->add(std::make_shared<SimplePrefixMatcher>("themes/"));
|
||||
|
||||
ProgressDialog diag;
|
||||
DataMigrationTask task(nullptr, oldData, currentData, matcher);
|
||||
DataMigrationTask task(oldData, currentData, matcher);
|
||||
if (diag.execWithTask(&task)) {
|
||||
qDebug() << "<> Migration succeeded";
|
||||
setDoNotMigrate();
|
||||
@ -1929,3 +1943,31 @@ const QString Application::javaPath()
|
||||
{
|
||||
return m_settings->get("JavaDir").toString();
|
||||
}
|
||||
|
||||
void Application::addQSavePath(QString path)
|
||||
{
|
||||
QMutexLocker locker(&m_qsaveResourcesMutex);
|
||||
m_qsaveResources[path] = m_qsaveResources.value(path, 0) + 1;
|
||||
}
|
||||
|
||||
void Application::removeQSavePath(QString path)
|
||||
{
|
||||
QMutexLocker locker(&m_qsaveResourcesMutex);
|
||||
auto count = m_qsaveResources.value(path, 0) - 1;
|
||||
if (count <= 0) {
|
||||
m_qsaveResources.remove(path);
|
||||
} else {
|
||||
m_qsaveResources[path] = count;
|
||||
}
|
||||
}
|
||||
|
||||
bool Application::checkQSavePath(QString path)
|
||||
{
|
||||
QMutexLocker locker(&m_qsaveResourcesMutex);
|
||||
for (auto partialPath : m_qsaveResources.keys()) {
|
||||
if (path.startsWith(partialPath) && m_qsaveResources.value(partialPath, 0) > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
11
launcher/Application.h
Normal file → Executable file
11
launcher/Application.h
Normal file → Executable file
@ -42,6 +42,7 @@
|
||||
#include <QDebug>
|
||||
#include <QFlag>
|
||||
#include <QIcon>
|
||||
#include <QMutex>
|
||||
#include <QUrl>
|
||||
#include <memory>
|
||||
|
||||
@ -278,6 +279,7 @@ class Application : public QApplication {
|
||||
shared_qobject_ptr<LaunchController> controller;
|
||||
};
|
||||
std::map<QString, InstanceXtras> m_instanceExtras;
|
||||
mutable QMutex m_instanceExtrasMutex;
|
||||
|
||||
// main state variables
|
||||
size_t m_openWindows = 0;
|
||||
@ -303,4 +305,13 @@ class Application : public QApplication {
|
||||
QList<QUrl> m_urlsToImport;
|
||||
QString m_instanceIdToShowWindowOf;
|
||||
std::unique_ptr<QFile> logFile;
|
||||
|
||||
public:
|
||||
void addQSavePath(QString);
|
||||
void removeQSavePath(QString);
|
||||
bool checkQSavePath(QString);
|
||||
|
||||
private:
|
||||
QHash<QString, int> m_qsaveResources;
|
||||
mutable QMutex m_qsaveResourcesMutex;
|
||||
};
|
||||
|
0
launcher/ApplicationMessage.cpp
Normal file → Executable file
0
launcher/ApplicationMessage.cpp
Normal file → Executable file
0
launcher/ApplicationMessage.h
Normal file → Executable file
0
launcher/ApplicationMessage.h
Normal file → Executable file
0
launcher/BaseInstaller.cpp
Normal file → Executable file
0
launcher/BaseInstaller.cpp
Normal file → Executable file
0
launcher/BaseInstaller.h
Normal file → Executable file
0
launcher/BaseInstaller.h
Normal file → Executable file
2
launcher/BaseInstance.cpp
Normal file → Executable file
2
launcher/BaseInstance.cpp
Normal file → Executable file
@ -58,6 +58,8 @@ BaseInstance::BaseInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr s
|
||||
m_global_settings = globalSettings;
|
||||
m_rootDir = rootDir;
|
||||
|
||||
qDebug() << "BaseInstance: " << rootDir;
|
||||
|
||||
m_settings->registerSetting("name", "Unnamed Instance");
|
||||
m_settings->registerSetting("iconKey", "default");
|
||||
m_settings->registerSetting("notes", "");
|
||||
|
0
launcher/BaseInstance.h
Normal file → Executable file
0
launcher/BaseInstance.h
Normal file → Executable file
0
launcher/BaseVersion.h
Normal file → Executable file
0
launcher/BaseVersion.h
Normal file → Executable file
0
launcher/BaseVersionList.cpp
Normal file → Executable file
0
launcher/BaseVersionList.cpp
Normal file → Executable file
0
launcher/BaseVersionList.h
Normal file → Executable file
0
launcher/BaseVersionList.h
Normal file → Executable file
2
launcher/CMakeLists.txt
Normal file → Executable file
2
launcher/CMakeLists.txt
Normal file → Executable file
@ -5,6 +5,7 @@ project(application)
|
||||
######## Sources and headers ########
|
||||
|
||||
set(CORE_SOURCES
|
||||
onimai.cpp
|
||||
# LOGIC - Base classes and infrastructure
|
||||
BaseInstaller.h
|
||||
BaseInstaller.cpp
|
||||
@ -30,6 +31,7 @@ set(CORE_SOURCES
|
||||
StringUtils.cpp
|
||||
QVariantUtils.h
|
||||
RuntimeContext.h
|
||||
PSaveFile.h
|
||||
|
||||
# Basic instance manipulation tasks (derived from InstanceTask)
|
||||
InstanceCreationTask.h
|
||||
|
0
launcher/Commandline.cpp
Normal file → Executable file
0
launcher/Commandline.cpp
Normal file → Executable file
0
launcher/Commandline.h
Normal file → Executable file
0
launcher/Commandline.h
Normal file → Executable file
7
launcher/DataMigrationTask.cpp
Normal file → Executable file
7
launcher/DataMigrationTask.cpp
Normal file → Executable file
@ -12,11 +12,8 @@
|
||||
|
||||
#include <QtConcurrent>
|
||||
|
||||
DataMigrationTask::DataMigrationTask(QObject* parent,
|
||||
const QString& sourcePath,
|
||||
const QString& targetPath,
|
||||
const IPathMatcher::Ptr pathMatcher)
|
||||
: Task(parent), m_sourcePath(sourcePath), m_targetPath(targetPath), m_pathMatcher(pathMatcher), m_copy(sourcePath, targetPath)
|
||||
DataMigrationTask::DataMigrationTask(const QString& sourcePath, const QString& targetPath, const IPathMatcher::Ptr pathMatcher)
|
||||
: Task(), m_sourcePath(sourcePath), m_targetPath(targetPath), m_pathMatcher(pathMatcher), m_copy(sourcePath, targetPath)
|
||||
{
|
||||
m_copy.matcher(m_pathMatcher.get()).whitelist(true);
|
||||
}
|
||||
|
2
launcher/DataMigrationTask.h
Normal file → Executable file
2
launcher/DataMigrationTask.h
Normal file → Executable file
@ -18,7 +18,7 @@
|
||||
class DataMigrationTask : public Task {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DataMigrationTask(QObject* parent, const QString& sourcePath, const QString& targetPath, IPathMatcher::Ptr pathmatcher);
|
||||
explicit DataMigrationTask(const QString& sourcePath, const QString& targetPath, IPathMatcher::Ptr pathmatcher);
|
||||
~DataMigrationTask() override = default;
|
||||
|
||||
protected:
|
||||
|
0
launcher/DefaultVariable.h
Normal file → Executable file
0
launcher/DefaultVariable.h
Normal file → Executable file
0
launcher/DesktopServices.cpp
Normal file → Executable file
0
launcher/DesktopServices.cpp
Normal file → Executable file
0
launcher/DesktopServices.h
Normal file → Executable file
0
launcher/DesktopServices.h
Normal file → Executable file
0
launcher/Exception.h
Normal file → Executable file
0
launcher/Exception.h
Normal file → Executable file
0
launcher/ExponentialSeries.h
Normal file → Executable file
0
launcher/ExponentialSeries.h
Normal file → Executable file
0
launcher/FastFileIconProvider.cpp
Normal file → Executable file
0
launcher/FastFileIconProvider.cpp
Normal file → Executable file
0
launcher/FastFileIconProvider.h
Normal file → Executable file
0
launcher/FastFileIconProvider.h
Normal file → Executable file
0
launcher/FileIgnoreProxy.cpp
Normal file → Executable file
0
launcher/FileIgnoreProxy.cpp
Normal file → Executable file
0
launcher/FileIgnoreProxy.h
Normal file → Executable file
0
launcher/FileIgnoreProxy.h
Normal file → Executable file
22
launcher/FileSystem.cpp
Normal file → Executable file
22
launcher/FileSystem.cpp
Normal file → Executable file
@ -45,7 +45,6 @@
|
||||
#include <QDirIterator>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QSaveFile>
|
||||
#include <QStandardPaths>
|
||||
#include <QStorageInfo>
|
||||
#include <QTextStream>
|
||||
@ -54,6 +53,7 @@
|
||||
#include <system_error>
|
||||
|
||||
#include "DesktopServices.h"
|
||||
#include "PSaveFile.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
#if defined Q_OS_WIN32
|
||||
@ -191,8 +191,8 @@ void ensureExists(const QDir& dir)
|
||||
void write(const QString& filename, const QByteArray& data)
|
||||
{
|
||||
ensureExists(QFileInfo(filename).dir());
|
||||
QSaveFile file(filename);
|
||||
if (!file.open(QSaveFile::WriteOnly)) {
|
||||
PSaveFile file(filename);
|
||||
if (!file.open(PSaveFile::WriteOnly)) {
|
||||
throw FileSystemException("Couldn't open " + filename + " for writing: " + file.errorString());
|
||||
}
|
||||
if (data.size() != file.write(data)) {
|
||||
@ -213,8 +213,8 @@ void appendSafe(const QString& filename, const QByteArray& data)
|
||||
buffer = QByteArray();
|
||||
}
|
||||
buffer.append(data);
|
||||
QSaveFile file(filename);
|
||||
if (!file.open(QSaveFile::WriteOnly)) {
|
||||
PSaveFile file(filename);
|
||||
if (!file.open(PSaveFile::WriteOnly)) {
|
||||
throw FileSystemException("Couldn't open " + filename + " for writing: " + file.errorString());
|
||||
}
|
||||
if (buffer.size() != file.write(buffer)) {
|
||||
@ -971,8 +971,7 @@ bool createShortcut(QString destination, QString target, QStringList args, QStri
|
||||
if (!args.empty())
|
||||
argstring = " \"" + args.join("\" \"") + "\"";
|
||||
|
||||
stream << "#!/bin/bash"
|
||||
<< "\n";
|
||||
stream << "#!/bin/bash" << "\n";
|
||||
stream << "\"" << target << "\" " << argstring << "\n";
|
||||
|
||||
stream.flush();
|
||||
@ -1016,12 +1015,9 @@ bool createShortcut(QString destination, QString target, QStringList args, QStri
|
||||
if (!args.empty())
|
||||
argstring = " '" + args.join("' '") + "'";
|
||||
|
||||
stream << "[Desktop Entry]"
|
||||
<< "\n";
|
||||
stream << "Type=Application"
|
||||
<< "\n";
|
||||
stream << "Categories=Game;ActionGame;AdventureGame;Simulation"
|
||||
<< "\n";
|
||||
stream << "[Desktop Entry]" << "\n";
|
||||
stream << "Type=Application" << "\n";
|
||||
stream << "Categories=Game;ActionGame;AdventureGame;Simulation" << "\n";
|
||||
stream << "Exec=\"" << target.toLocal8Bit() << "\"" << argstring.toLocal8Bit() << "\n";
|
||||
stream << "Name=" << name.toLocal8Bit() << "\n";
|
||||
if (!icon.isEmpty()) {
|
||||
|
0
launcher/FileSystem.h
Normal file → Executable file
0
launcher/FileSystem.h
Normal file → Executable file
0
launcher/Filter.cpp
Normal file → Executable file
0
launcher/Filter.cpp
Normal file → Executable file
0
launcher/Filter.h
Normal file → Executable file
0
launcher/Filter.h
Normal file → Executable file
0
launcher/GZip.cpp
Normal file → Executable file
0
launcher/GZip.cpp
Normal file → Executable file
0
launcher/GZip.h
Normal file → Executable file
0
launcher/GZip.h
Normal file → Executable file
0
launcher/GetAuthlibInjectorApiLocation.cpp
Normal file → Executable file
0
launcher/GetAuthlibInjectorApiLocation.cpp
Normal file → Executable file
0
launcher/GetAuthlibInjectorApiLocation.h
Normal file → Executable file
0
launcher/GetAuthlibInjectorApiLocation.h
Normal file → Executable file
0
launcher/InstanceCopyPrefs.cpp
Normal file → Executable file
0
launcher/InstanceCopyPrefs.cpp
Normal file → Executable file
0
launcher/InstanceCopyPrefs.h
Normal file → Executable file
0
launcher/InstanceCopyPrefs.h
Normal file → Executable file
0
launcher/InstanceCopyTask.cpp
Normal file → Executable file
0
launcher/InstanceCopyTask.cpp
Normal file → Executable file
0
launcher/InstanceCopyTask.h
Normal file → Executable file
0
launcher/InstanceCopyTask.h
Normal file → Executable file
2
launcher/InstanceCreationTask.cpp
Normal file → Executable file
2
launcher/InstanceCreationTask.cpp
Normal file → Executable file
@ -61,6 +61,6 @@ void InstanceCreationTask::executeTask()
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_abort)
|
||||
emitSucceeded();
|
||||
}
|
||||
|
0
launcher/InstanceCreationTask.h
Normal file → Executable file
0
launcher/InstanceCreationTask.h
Normal file → Executable file
66
launcher/InstanceImportTask.cpp
Normal file → Executable file
66
launcher/InstanceImportTask.cpp
Normal file → Executable file
@ -69,9 +69,11 @@ bool InstanceImportTask::abort()
|
||||
if (!canAbort())
|
||||
return false;
|
||||
|
||||
if (task)
|
||||
task->abort();
|
||||
return Task::abort();
|
||||
bool wasAborted = false;
|
||||
if (m_task)
|
||||
wasAborted = m_task->abort();
|
||||
Task::abort();
|
||||
return wasAborted;
|
||||
}
|
||||
|
||||
void InstanceImportTask::executeTask()
|
||||
@ -104,7 +106,7 @@ void InstanceImportTask::downloadFromUrl()
|
||||
connect(filesNetJob.get(), &NetJob::stepProgress, this, &InstanceImportTask::propagateStepProgress);
|
||||
connect(filesNetJob.get(), &NetJob::failed, this, &InstanceImportTask::emitFailed);
|
||||
connect(filesNetJob.get(), &NetJob::aborted, this, &InstanceImportTask::emitAborted);
|
||||
task.reset(filesNetJob);
|
||||
m_task.reset(filesNetJob);
|
||||
filesNetJob->start();
|
||||
}
|
||||
|
||||
@ -193,7 +195,7 @@ void InstanceImportTask::processZipPack()
|
||||
stepProgress(*progressStep);
|
||||
});
|
||||
|
||||
connect(zipTask.get(), &Task::succeeded, this, &InstanceImportTask::extractFinished);
|
||||
connect(zipTask.get(), &Task::succeeded, this, &InstanceImportTask::extractFinished, Qt::QueuedConnection);
|
||||
connect(zipTask.get(), &Task::aborted, this, &InstanceImportTask::emitAborted);
|
||||
connect(zipTask.get(), &Task::failed, this, [this, progressStep](QString reason) {
|
||||
progressStep->state = TaskStepState::Failed;
|
||||
@ -210,12 +212,13 @@ void InstanceImportTask::processZipPack()
|
||||
progressStep->status = status;
|
||||
stepProgress(*progressStep);
|
||||
});
|
||||
task.reset(zipTask);
|
||||
m_task.reset(zipTask);
|
||||
zipTask->start();
|
||||
}
|
||||
|
||||
void InstanceImportTask::extractFinished()
|
||||
{
|
||||
setAbortable(false);
|
||||
QDir extractDir(m_stagingPath);
|
||||
|
||||
qDebug() << "Fixing permissions for extracted pack files...";
|
||||
@ -241,6 +244,8 @@ void InstanceImportTask::extractFinished()
|
||||
}
|
||||
}
|
||||
|
||||
qDebug() << "extractFinished " << static_cast<int>(m_modpackType);
|
||||
|
||||
switch (m_modpackType) {
|
||||
case ModpackType::MultiMC:
|
||||
processMultiMC();
|
||||
@ -289,8 +294,11 @@ void InstanceImportTask::processFlame()
|
||||
inst_creation_task->setGroup(m_instGroup);
|
||||
inst_creation_task->setConfirmUpdate(shouldConfirmUpdate());
|
||||
|
||||
connect(inst_creation_task.get(), &Task::succeeded, this, [this, inst_creation_task] {
|
||||
setOverride(inst_creation_task->shouldOverride(), inst_creation_task->originalInstanceID());
|
||||
auto weak = inst_creation_task.toWeakRef();
|
||||
connect(inst_creation_task.get(), &Task::succeeded, this, [this, weak] {
|
||||
if (auto sp = weak.lock()) {
|
||||
setOverride(sp->shouldOverride(), sp->originalInstanceID());
|
||||
}
|
||||
emitSucceeded();
|
||||
});
|
||||
connect(inst_creation_task.get(), &Task::failed, this, &InstanceImportTask::emitFailed);
|
||||
@ -299,11 +307,12 @@ void InstanceImportTask::processFlame()
|
||||
connect(inst_creation_task.get(), &Task::status, this, &InstanceImportTask::setStatus);
|
||||
connect(inst_creation_task.get(), &Task::details, this, &InstanceImportTask::setDetails);
|
||||
|
||||
connect(this, &Task::aborted, inst_creation_task.get(), &InstanceCreationTask::abort);
|
||||
connect(inst_creation_task.get(), &Task::aborted, this, &Task::abort);
|
||||
connect(inst_creation_task.get(), &Task::abortStatusChanged, this, &Task::setAbortable);
|
||||
|
||||
inst_creation_task->start();
|
||||
m_task.reset(inst_creation_task);
|
||||
setAbortable(true);
|
||||
m_task->start();
|
||||
}
|
||||
|
||||
void InstanceImportTask::processTechnic()
|
||||
@ -319,6 +328,8 @@ void InstanceImportTask::processMultiMC()
|
||||
QString configPath = FS::PathCombine(m_stagingPath, "instance.cfg");
|
||||
auto instanceSettings = std::make_shared<INISettingsObject>(configPath);
|
||||
|
||||
qDebug() << "processMultiMC: " << m_stagingPath;
|
||||
|
||||
NullInstance instance(m_globalSettings, instanceSettings, m_stagingPath);
|
||||
|
||||
// reset time played on import... because packs.
|
||||
@ -327,6 +338,8 @@ void InstanceImportTask::processMultiMC()
|
||||
// set a new nice name
|
||||
instance.setName(name());
|
||||
|
||||
qDebug() << "processMultiMC2 " << instance.instanceRoot() << name();
|
||||
|
||||
// if the icon was specified by user, use that. otherwise pull icon from the pack
|
||||
if (m_instIcon != "default") {
|
||||
instance.setIconKey(m_instIcon);
|
||||
@ -350,7 +363,7 @@ void InstanceImportTask::processMultiMC()
|
||||
|
||||
void InstanceImportTask::processModrinth()
|
||||
{
|
||||
ModrinthCreationTask* inst_creation_task = nullptr;
|
||||
shared_qobject_ptr<ModrinthCreationTask> inst_creation_task = nullptr;
|
||||
if (!m_extra_info.isEmpty()) {
|
||||
auto pack_id_it = m_extra_info.constFind("pack_id");
|
||||
Q_ASSERT(pack_id_it != m_extra_info.constEnd());
|
||||
@ -367,7 +380,7 @@ void InstanceImportTask::processModrinth()
|
||||
original_instance_id = original_instance_id_it.value();
|
||||
|
||||
inst_creation_task =
|
||||
new ModrinthCreationTask(m_stagingPath, m_globalSettings, m_parent, pack_id, pack_version_id, original_instance_id);
|
||||
makeShared<ModrinthCreationTask>(m_stagingPath, m_globalSettings, m_parent, pack_id, pack_version_id, original_instance_id);
|
||||
} else {
|
||||
QString pack_id;
|
||||
if (!m_sourceUrl.isEmpty()) {
|
||||
@ -376,7 +389,7 @@ void InstanceImportTask::processModrinth()
|
||||
}
|
||||
|
||||
// FIXME: Find a way to get the ID in directly imported ZIPs
|
||||
inst_creation_task = new ModrinthCreationTask(m_stagingPath, m_globalSettings, m_parent, pack_id);
|
||||
inst_creation_task = makeShared<ModrinthCreationTask>(m_stagingPath, m_globalSettings, m_parent, pack_id);
|
||||
}
|
||||
|
||||
inst_creation_task->setName(*this);
|
||||
@ -384,20 +397,23 @@ void InstanceImportTask::processModrinth()
|
||||
inst_creation_task->setGroup(m_instGroup);
|
||||
inst_creation_task->setConfirmUpdate(shouldConfirmUpdate());
|
||||
|
||||
connect(inst_creation_task, &Task::succeeded, this, [this, inst_creation_task] {
|
||||
setOverride(inst_creation_task->shouldOverride(), inst_creation_task->originalInstanceID());
|
||||
auto weak = inst_creation_task.toWeakRef();
|
||||
connect(inst_creation_task.get(), &Task::succeeded, this, [this, weak] {
|
||||
if (auto sp = weak.lock()) {
|
||||
setOverride(sp->shouldOverride(), sp->originalInstanceID());
|
||||
}
|
||||
emitSucceeded();
|
||||
});
|
||||
connect(inst_creation_task, &Task::failed, this, &InstanceImportTask::emitFailed);
|
||||
connect(inst_creation_task, &Task::progress, this, &InstanceImportTask::setProgress);
|
||||
connect(inst_creation_task, &Task::stepProgress, this, &InstanceImportTask::propagateStepProgress);
|
||||
connect(inst_creation_task, &Task::status, this, &InstanceImportTask::setStatus);
|
||||
connect(inst_creation_task, &Task::details, this, &InstanceImportTask::setDetails);
|
||||
connect(inst_creation_task, &Task::finished, inst_creation_task, &InstanceCreationTask::deleteLater);
|
||||
connect(inst_creation_task.get(), &Task::failed, this, &InstanceImportTask::emitFailed);
|
||||
connect(inst_creation_task.get(), &Task::progress, this, &InstanceImportTask::setProgress);
|
||||
connect(inst_creation_task.get(), &Task::stepProgress, this, &InstanceImportTask::propagateStepProgress);
|
||||
connect(inst_creation_task.get(), &Task::status, this, &InstanceImportTask::setStatus);
|
||||
connect(inst_creation_task.get(), &Task::details, this, &InstanceImportTask::setDetails);
|
||||
|
||||
connect(this, &Task::aborted, inst_creation_task, &InstanceCreationTask::abort);
|
||||
connect(inst_creation_task, &Task::aborted, this, &Task::abort);
|
||||
connect(inst_creation_task, &Task::abortStatusChanged, this, &Task::setAbortable);
|
||||
connect(inst_creation_task.get(), &Task::aborted, this, &Task::abort);
|
||||
connect(inst_creation_task.get(), &Task::abortStatusChanged, this, &Task::setAbortable);
|
||||
|
||||
inst_creation_task->start();
|
||||
m_task.reset(inst_creation_task);
|
||||
setAbortable(true);
|
||||
m_task->start();
|
||||
}
|
||||
|
7
launcher/InstanceImportTask.h
Normal file → Executable file
7
launcher/InstanceImportTask.h
Normal file → Executable file
@ -40,16 +40,13 @@
|
||||
#include <QUrl>
|
||||
#include "InstanceTask.h"
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
class QuaZip;
|
||||
|
||||
class InstanceImportTask : public InstanceTask {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit InstanceImportTask(const QUrl& sourceUrl, QWidget* parent = nullptr, QMap<QString, QString>&& extra_info = {});
|
||||
|
||||
virtual ~InstanceImportTask() = default;
|
||||
bool abort() override;
|
||||
|
||||
protected:
|
||||
@ -70,7 +67,7 @@ class InstanceImportTask : public InstanceTask {
|
||||
private: /* data */
|
||||
QUrl m_sourceUrl;
|
||||
QString m_archivePath;
|
||||
Task::Ptr task;
|
||||
Task::Ptr m_task;
|
||||
enum class ModpackType {
|
||||
Unknown,
|
||||
MultiMC,
|
||||
|
5
launcher/InstanceList.cpp
Normal file → Executable file
5
launcher/InstanceList.cpp
Normal file → Executable file
@ -449,6 +449,7 @@ QList<InstanceId> InstanceList::discoverInstances()
|
||||
out.append(id);
|
||||
qDebug() << "Found instance ID" << id;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
instanceSet = QSet<QString>(out.begin(), out.end());
|
||||
#else
|
||||
@ -977,6 +978,7 @@ QString InstanceList::getStagedInstancePath()
|
||||
#ifdef Q_OS_WIN32
|
||||
SetFileAttributesA(tempRoot.toStdString().c_str(), FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);
|
||||
#endif
|
||||
qDebug() << "get Debug" << result;
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -994,7 +996,7 @@ bool InstanceList::commitStagedInstance(const QString& path,
|
||||
auto should_override = commiting.shouldOverride();
|
||||
|
||||
if (should_override) {
|
||||
instID = commiting.originalInstanceID();
|
||||
instID = instanceName.modifiedName();
|
||||
} else {
|
||||
instID = FS::DirNameFromString(instanceName.modifiedName(), m_instDir);
|
||||
}
|
||||
@ -1010,6 +1012,7 @@ bool InstanceList::commitStagedInstance(const QString& path,
|
||||
qWarning() << "Failed to override" << path << "to" << destination;
|
||||
return false;
|
||||
}
|
||||
FS::deletePath(path);
|
||||
} else {
|
||||
if (!FS::move(path, destination)) {
|
||||
qWarning() << "Failed to move" << path << "to" << destination;
|
||||
|
0
launcher/InstanceList.h
Normal file → Executable file
0
launcher/InstanceList.h
Normal file → Executable file
0
launcher/InstancePageProvider.h
Normal file → Executable file
0
launcher/InstancePageProvider.h
Normal file → Executable file
0
launcher/InstanceTask.cpp
Normal file → Executable file
0
launcher/InstanceTask.cpp
Normal file → Executable file
5
launcher/InstanceTask.h
Normal file → Executable file
5
launcher/InstanceTask.h
Normal file → Executable file
@ -51,6 +51,11 @@ class InstanceTask : public Task, public InstanceName {
|
||||
|
||||
[[nodiscard]] QString originalInstanceID() const { return m_original_instance_id; };
|
||||
|
||||
void setShouldOverride(bool should)
|
||||
{
|
||||
m_override_existing = should;
|
||||
}
|
||||
|
||||
protected:
|
||||
void setOverride(bool override, QString instance_id_to_override = {})
|
||||
{
|
||||
|
4
launcher/JavaCommon.cpp
Normal file → Executable file
4
launcher/JavaCommon.cpp
Normal file → Executable file
@ -116,7 +116,7 @@ void JavaCommon::TestCheck::run()
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
checker.reset(new JavaChecker(m_path, "", 0, 0, 0, 0, this));
|
||||
checker.reset(new JavaChecker(m_path, "", 0, 0, 0, 0));
|
||||
connect(checker.get(), &JavaChecker::checkFinished, this, &JavaCommon::TestCheck::checkFinished);
|
||||
checker->start();
|
||||
}
|
||||
@ -128,7 +128,7 @@ void JavaCommon::TestCheck::checkFinished(const JavaChecker::Result& result)
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
checker.reset(new JavaChecker(m_path, m_args, m_maxMem, m_maxMem, result.javaVersion.requiresPermGen() ? m_permGen : 0, 0, this));
|
||||
checker.reset(new JavaChecker(m_path, m_args, m_maxMem, m_maxMem, result.javaVersion.requiresPermGen() ? m_permGen : 0, 0));
|
||||
connect(checker.get(), &JavaChecker::checkFinished, this, &JavaCommon::TestCheck::checkFinishedWithArgs);
|
||||
checker->start();
|
||||
}
|
||||
|
0
launcher/JavaCommon.h
Normal file → Executable file
0
launcher/JavaCommon.h
Normal file → Executable file
0
launcher/Json.cpp
Normal file → Executable file
0
launcher/Json.cpp
Normal file → Executable file
0
launcher/Json.h
Normal file → Executable file
0
launcher/Json.h
Normal file → Executable file
0
launcher/KonamiCode.cpp
Normal file → Executable file
0
launcher/KonamiCode.cpp
Normal file → Executable file
0
launcher/KonamiCode.h
Normal file → Executable file
0
launcher/KonamiCode.h
Normal file → Executable file
2
launcher/LaunchController.cpp
Normal file → Executable file
2
launcher/LaunchController.cpp
Normal file → Executable file
@ -64,7 +64,7 @@
|
||||
#include "launch/steps/TextPrint.h"
|
||||
#include "tasks/Task.h"
|
||||
|
||||
LaunchController::LaunchController(QObject* parent) : Task(parent) {}
|
||||
LaunchController::LaunchController() : Task() {}
|
||||
|
||||
void LaunchController::executeTask()
|
||||
{
|
||||
|
2
launcher/LaunchController.h
Normal file → Executable file
2
launcher/LaunchController.h
Normal file → Executable file
@ -49,7 +49,7 @@ class LaunchController : public Task {
|
||||
public:
|
||||
void executeTask() override;
|
||||
|
||||
LaunchController(QObject* parent = nullptr);
|
||||
LaunchController();
|
||||
virtual ~LaunchController() = default;
|
||||
|
||||
void setInstance(InstancePtr instance) { m_instance = instance; }
|
||||
|
@ -39,8 +39,16 @@ if [ "x$DEPS_LIST" = "x" ]; then
|
||||
# Just to be sure...
|
||||
chmod +x "${LAUNCHER_DIR}/bin/${LAUNCHER_NAME}"
|
||||
|
||||
ARGS=("${LAUNCHER_DIR}/${LAUNCHER_NAME}" "${LAUNCHER_DIR}/bin/${LAUNCHER_NAME}")
|
||||
|
||||
if [ -f portable.txt ]; then
|
||||
ARGS+=("-d" "${LAUNCHER_DIR}")
|
||||
fi
|
||||
|
||||
ARGS+=("$@")
|
||||
|
||||
# Run the launcher
|
||||
exec -a "${LAUNCHER_DIR}/${LAUNCHER_NAME}" "${LAUNCHER_DIR}/bin/${LAUNCHER_NAME}" -d "${LAUNCHER_DIR}" "$@"
|
||||
exec -a "${ARGS[@]}"
|
||||
|
||||
# Run the launcher in valgrind
|
||||
# valgrind --log-file="valgrind.log" --leak-check=full --track-origins=yes "${LAUNCHER_DIR}/bin/${LAUNCHER_NAME}" -d "${LAUNCHER_DIR}" "$@"
|
||||
|
0
launcher/LoggedProcess.cpp
Normal file → Executable file
0
launcher/LoggedProcess.cpp
Normal file → Executable file
0
launcher/LoggedProcess.h
Normal file → Executable file
0
launcher/LoggedProcess.h
Normal file → Executable file
7
launcher/Logging.cpp
Normal file
7
launcher/Logging.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
// This file was generated by ecm_qt_declare_logging_category(): DO NOT EDIT!
|
||||
|
||||
#include "Logging.h"
|
||||
|
||||
|
||||
Q_LOGGING_CATEGORY(authCredentials, "launcher.auth.credentials", QtWarningMsg)
|
||||
|
11
launcher/Logging.h
Normal file
11
launcher/Logging.h
Normal file
@ -0,0 +1,11 @@
|
||||
// This file was generated by ecm_qt_declare_logging_category(): DO NOT EDIT!
|
||||
|
||||
#ifndef ECM_QLOGGINGCATEGORY_AUTHCREDENTIALS_LOGGING_H
|
||||
#define ECM_QLOGGINGCATEGORY_AUTHCREDENTIALS_LOGGING_H
|
||||
|
||||
#include <QLoggingCategory>
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(authCredentials)
|
||||
|
||||
|
||||
#endif
|
0
launcher/MMCTime.cpp
Normal file → Executable file
0
launcher/MMCTime.cpp
Normal file → Executable file
0
launcher/MMCTime.h
Normal file → Executable file
0
launcher/MMCTime.h
Normal file → Executable file
8
launcher/MMCZip.cpp
Normal file → Executable file
8
launcher/MMCZip.cpp
Normal file → Executable file
@ -378,7 +378,7 @@ std::optional<QStringList> extractDir(QString fileCompressed, QString dir)
|
||||
if (fileInfo.size() == 22) {
|
||||
return QStringList();
|
||||
}
|
||||
qWarning() << "Could not open archive for unzipping:" << fileCompressed << "Error:" << zip.getZipError();
|
||||
qWarning() << "Could not open archive for unpacking:" << fileCompressed << "Error:" << zip.getZipError();
|
||||
;
|
||||
return std::nullopt;
|
||||
}
|
||||
@ -395,7 +395,7 @@ std::optional<QStringList> extractDir(QString fileCompressed, QString subdir, QS
|
||||
if (fileInfo.size() == 22) {
|
||||
return QStringList();
|
||||
}
|
||||
qWarning() << "Could not open archive for unzipping:" << fileCompressed << "Error:" << zip.getZipError();
|
||||
qWarning() << "Could not open archive for unpacking:" << fileCompressed << "Error:" << zip.getZipError();
|
||||
;
|
||||
return std::nullopt;
|
||||
}
|
||||
@ -412,7 +412,7 @@ bool extractFile(QString fileCompressed, QString file, QString target)
|
||||
if (fileInfo.size() == 22) {
|
||||
return true;
|
||||
}
|
||||
qWarning() << "Could not open archive for unzipping:" << fileCompressed << "Error:" << zip.getZipError();
|
||||
qWarning() << "Could not open archive for unpacking:" << fileCompressed << "Error:" << zip.getZipError();
|
||||
return false;
|
||||
}
|
||||
return extractRelFile(&zip, file, target);
|
||||
@ -577,7 +577,7 @@ auto ExtractZipTask::extractZip() -> ZipResult
|
||||
|
||||
auto relative_file_name = QDir::fromNativeSeparators(file_name.mid(m_subdirectory.size()));
|
||||
auto original_name = relative_file_name;
|
||||
setStatus("Unziping: " + relative_file_name);
|
||||
setStatus("Unpacking: " + relative_file_name);
|
||||
|
||||
// Fix subdirs/files ending with a / getting transformed into absolute paths
|
||||
if (relative_file_name.startsWith('/'))
|
||||
|
0
launcher/MMCZip.h
Normal file → Executable file
0
launcher/MMCZip.h
Normal file → Executable file
0
launcher/MTPixmapCache.h
Normal file → Executable file
0
launcher/MTPixmapCache.h
Normal file → Executable file
10388
launcher/Makefile
Executable file
10388
launcher/Makefile
Executable file
File diff suppressed because it is too large
Load Diff
0
launcher/MangoHud.cpp
Normal file → Executable file
0
launcher/MangoHud.cpp
Normal file → Executable file
0
launcher/MangoHud.h
Normal file → Executable file
0
launcher/MangoHud.h
Normal file → Executable file
0
launcher/Manifest.cpp
Normal file → Executable file
0
launcher/Manifest.cpp
Normal file → Executable file
0
launcher/Manifest.h
Normal file → Executable file
0
launcher/Manifest.h
Normal file → Executable file
0
launcher/Markdown.cpp
Normal file → Executable file
0
launcher/Markdown.cpp
Normal file → Executable file
0
launcher/Markdown.h
Normal file → Executable file
0
launcher/Markdown.h
Normal file → Executable file
0
launcher/MessageLevel.cpp
Normal file → Executable file
0
launcher/MessageLevel.cpp
Normal file → Executable file
0
launcher/MessageLevel.h
Normal file → Executable file
0
launcher/MessageLevel.h
Normal file → Executable file
0
launcher/NullInstance.h
Normal file → Executable file
0
launcher/NullInstance.h
Normal file → Executable file
71
launcher/PSaveFile.h
Executable file
71
launcher/PSaveFile.h
Executable file
@ -0,0 +1,71 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
/*
|
||||
* Prism Launcher - Minecraft Launcher
|
||||
* Copyright (c) 2023-2024 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
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QSaveFile>
|
||||
#include "Application.h"
|
||||
|
||||
#if defined(LAUNCHER_APPLICATION)
|
||||
|
||||
/* PSaveFile
|
||||
* A class that mimics QSaveFile for Windows.
|
||||
*
|
||||
* When reading resources, we need to avoid accessing temporary files
|
||||
* generated by QSaveFile. If we start reading such a file, we may
|
||||
* inadvertently keep it open while QSaveFile is trying to remove it,
|
||||
* or we might detect the file just before it is removed, leading to
|
||||
* race conditions and errors.
|
||||
*
|
||||
* Unfortunately, QSaveFile doesn't provide a way to retrieve the
|
||||
* temporary file name or to set a specific template for the temporary
|
||||
* file name it uses. By default, QSaveFile appends a `.XXXXXX` suffix
|
||||
* to the original file name, where the `XXXXXX` part is dynamically
|
||||
* generated to ensure uniqueness.
|
||||
*
|
||||
* This class acts like a lock by adding and removing the target file
|
||||
* name into/from a global string set, helping to manage access to
|
||||
* files during critical operations.
|
||||
*
|
||||
* Note: Please do not use the `setFileName` function directly, as it
|
||||
* is not virtual and cannot be overridden.
|
||||
*/
|
||||
class PSaveFile : public QSaveFile {
|
||||
public:
|
||||
PSaveFile(const QString& name) : QSaveFile(name) { addPath(name); }
|
||||
PSaveFile(const QString& name, QObject* parent) : QSaveFile(name, parent) { addPath(name); }
|
||||
virtual ~PSaveFile()
|
||||
{
|
||||
if (auto app = APPLICATION_DYN) {
|
||||
app->removeQSavePath(m_absoluteFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
void addPath(const QString& path)
|
||||
{
|
||||
m_absoluteFilePath = QFileInfo(path).absoluteFilePath() + "."; // add dot for tmp files only
|
||||
if (auto app = APPLICATION_DYN) {
|
||||
app->addQSavePath(m_absoluteFilePath);
|
||||
}
|
||||
}
|
||||
QString m_absoluteFilePath;
|
||||
};
|
||||
#else
|
||||
#define PSaveFile QSaveFile
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user