Compare commits
10 commits
a30673c6df
...
7050be188f
Author | SHA1 | Date | |
---|---|---|---|
|
7050be188f | ||
|
1ff24f09c6 | ||
|
6e86b38990 | ||
|
d86830028e | ||
|
179c3033ba | ||
|
8903fa0dff | ||
|
ba601d8855 | ||
|
23138cfc99 | ||
|
9660667888 | ||
|
e4049f4b81 |
50
.github/actions/build-debug-info-post/action.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Prepare for Build Debug Info
|
name: Prepare for Build Debug Info
|
||||||
description: Provides debug info for the build process
|
description: Provides debug info for the build process
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
|
@ -9,25 +9,33 @@ inputs:
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Preprocess
|
- name: Preprocess
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir build-debug-info-preprocessed
|
mkdir build-debug-info-preprocessed
|
||||||
cd build
|
cd build
|
||||||
sed 's/\\\\/\//g' compile_commands.json | sed 's/D:\//\/d\//' > uni_compile_commands.json
|
sed 's/\\\\/\//g' compile_commands.json | sed 's/D:\//\/d\//' > uni_compile_commands.json
|
||||||
pip install compile-commands --break-system-packages
|
pip install compile-commands --break-system-packages
|
||||||
compile-commands --file=uni_compile_commands.json --filter_files='.*info\.rc.*' --filter='(.*) -o (.*)((?:/|\\).*)\.(?:obj|o) -c (.*)' --replacement="$BASH"' --noprofile --norc -c "mkdir -p ../build-debug-info-preprocessed/\g<2> && \g<1> -o ../build-debug-info-preprocessed/\g<2>\g<3>.i -E \g<4>"' -o ../build-debug-info/preprocess_commands.json --run --verbose
|
compile-commands --file=uni_compile_commands.json \
|
||||||
|
--filter_files='.*info\.rc.*' \
|
||||||
|
--filter='(.*) -o (.*)((?:/|\\).*)\.(?:obj|o) -c (.*)' \
|
||||||
|
--replacement="$BASH" \
|
||||||
|
--noprofile --norc -c "\
|
||||||
|
mkdir -p ../build-debug-info-preprocessed/\g<2> && \
|
||||||
|
\g<1> -o ../build-debug-info-preprocessed/\g<2>\g<3>.i -E \g<4>"' \
|
||||||
|
-o ../build-debug-info/preprocess_commands.json \
|
||||||
|
--run --verbose
|
||||||
|
|
||||||
- name: Upload Build Debug Info
|
- name: Upload Build Debug Info
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: geode-build-debug-info-${{ inputs.target }}
|
name: geode-build-debug-info-${{ inputs.target }}
|
||||||
path: ./build-debug-info/*
|
path: ./build-debug-info/*
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
|
|
||||||
- name: Upload Preprocessed Files
|
- name: Upload Preprocessed Files
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: geode-build-debug-info-preprocessed-${{ inputs.target }}
|
name: geode-build-debug-info-preprocessed-${{ inputs.target }}
|
||||||
path: ./build-debug-info-preprocessed/*
|
path: ./build-debug-info-preprocessed/*
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
|
|
30
.github/actions/build-debug-info/action.yml
vendored
|
@ -1,16 +1,18 @@
|
||||||
name: Prepare for Build Debug Info
|
name: Prepare for Build Debug Info
|
||||||
description: Provides debug info for the build process
|
description: Provides debug info for the build process
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
has-sccache:
|
has-sccache:
|
||||||
description: 'Whether the build action has sccache'
|
description: 'Whether the build action has sccache'
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
extra-configure:
|
extra-configure:
|
||||||
description: 'Extra stuff for CMake configure step'
|
description: 'Extra stuff for CMake configure step'
|
||||||
value: |
|
value: |
|
||||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||||
cp ./build/compile_commands.json ./build-debug-info/
|
cp ./build/compile_commands.json ./build-debug-info/
|
||||||
|
|
||||||
extra-build:
|
extra-build:
|
||||||
description: 'Extra stuff for CMake build step'
|
description: 'Extra stuff for CMake build step'
|
||||||
value: |
|
value: |
|
||||||
|
@ -20,17 +22,17 @@ outputs:
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir ./build-debug-info
|
mkdir ./build-debug-info
|
||||||
echo "SCCACHE_ERROR_LOG=$GITHUB_WORKSPACE/build-debug-info/sccache-log.txt" >> $GITHUB_ENV
|
echo "SCCACHE_ERROR_LOG=$GITHUB_WORKSPACE/build-debug-info/sccache-log.txt" >> $GITHUB_ENV
|
||||||
echo "SCCACHE_LOG=debug" >> $GITHUB_ENV
|
echo "SCCACHE_LOG=debug" >> $GITHUB_ENV
|
||||||
echo "RUST_BACKTRACE=1" >> $GITHUB_ENV
|
echo "RUST_BACKTRACE=1" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Checkout ninjatracing
|
- name: Checkout ninjatracing repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: 'nico/ninjatracing'
|
repository: 'nico/ninjatracing'
|
||||||
path: ninjatracing
|
path: ninjatracing
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
424
.github/workflows/build.yml
vendored
|
@ -16,8 +16,8 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '**' # every branch
|
- '**' # every branch
|
||||||
- '!no-build-**' # unless marked as no-build
|
- '!no-build-**' # unless marked as no-build
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
|
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
|
||||||
|
@ -36,103 +36,101 @@ jobs:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Prepare for Build Debug Info
|
- name: Prepare for Build Debug Info
|
||||||
id: build-debug-info
|
id: build-debug-info
|
||||||
uses: ./.github/actions/build-debug-info
|
uses: ./.github/actions/build-debug-info
|
||||||
with:
|
with:
|
||||||
has-sccache: ${{ inputs.use-ccache }}
|
has-sccache: ${{ inputs.use-ccache }}
|
||||||
if: inputs.build-debug-info
|
if: inputs.build-debug-info
|
||||||
|
|
||||||
- name: Setup caches
|
- name: Setup caches
|
||||||
uses: ./.github/actions/setup-cache
|
uses: ./.github/actions/setup-cache
|
||||||
with:
|
with:
|
||||||
host: linux
|
host: linux
|
||||||
target: win
|
target: win
|
||||||
use-ccache: ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
|
use-ccache: ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
|
||||||
|
|
||||||
- name: Setup Ninja
|
- name: Setup Ninja
|
||||||
uses: ./.github/actions/setup-ninja
|
uses: ./.github/actions/setup-ninja
|
||||||
with:
|
with:
|
||||||
host: linux
|
host: linux
|
||||||
|
|
||||||
- name: Setup CLI
|
- name: Setup CLI
|
||||||
uses: geode-sdk/cli/.github/actions/setup@main
|
uses: geode-sdk/cli/.github/actions/setup@main
|
||||||
|
|
||||||
- name: Download xwin
|
- name: Download xwin
|
||||||
uses: robinraju/release-downloader@v1.10
|
uses: robinraju/release-downloader@v1
|
||||||
with:
|
with:
|
||||||
repository: Jake-Shadle/xwin
|
repository: Jake-Shadle/xwin
|
||||||
latest: true
|
latest: true
|
||||||
fileName: 'xwin-*-x86_64-unknown-linux-musl.tar.gz'
|
fileName: 'xwin-*-x86_64-unknown-linux-musl.tar.gz'
|
||||||
tarBall: false
|
tarBall: false
|
||||||
zipBall: false
|
zipBall: false
|
||||||
out-file-path: "epic-xwin"
|
out-file-path: "epic-xwin"
|
||||||
|
|
||||||
- name: Prepare xwin
|
- name: Prepare xwin
|
||||||
run: |
|
run: |
|
||||||
tar -xzf epic-xwin/xwin-*-x86_64-unknown-linux-musl.tar.gz -C epic-xwin
|
tar -xzf epic-xwin/xwin-*-x86_64-unknown-linux-musl.tar.gz -C epic-xwin
|
||||||
mv epic-xwin/xwin-*-x86_64-unknown-linux-musl/xwin ./xwin
|
mv epic-xwin/xwin-*-x86_64-unknown-linux-musl/xwin ./xwin
|
||||||
./xwin --arch x86_64 --sdk-version 10.0.22621 --accept-license list
|
./xwin --arch x86_64 --sdk-version 10.0.22621 --accept-license list
|
||||||
|
|
||||||
# this caches '.xwin-cache/**/*' but that's actually only gonna
|
- name: Setup xwin Cache
|
||||||
# contain the manifest cuz we only ran `xwin list` so far
|
id: xwin-cache
|
||||||
- name: Setup xwin Cache
|
uses: actions/cache@v4
|
||||||
id: xwin-cache
|
with:
|
||||||
uses: actions/cache@v4
|
path: .xwin-cache
|
||||||
with:
|
key: xwin-win-v1-${{ hashFiles('.xwin-cache/**/*') }}
|
||||||
path: .xwin-cache
|
|
||||||
key: xwin-win-v1-${{ hashFiles('.xwin-cache/**/*') }}
|
|
||||||
|
|
||||||
- name: Download Windows headers
|
- name: Download Windows headers
|
||||||
run: ./xwin --arch x86_64 --sdk-version 10.0.22621 --accept-license splat --include-debug-libs
|
run: ./xwin --arch x86_64 --sdk-version 10.0.22621 --accept-license splat --include-debug-libs
|
||||||
if: steps.xwin-cache.outputs.cache-hit != 'true'
|
if: steps.xwin-cache.outputs.cache-hit != 'true'
|
||||||
|
|
||||||
- name: Download clang-msvc-sdk toolchain
|
- name: Download clang-msvc-sdk toolchain
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: 'geode-sdk/clang-msvc-sdk'
|
repository: 'geode-sdk/clang-msvc-sdk'
|
||||||
path: toolchain
|
path: toolchain
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: ${{ env.base-configure-command }} -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN ${{ steps.build-debug-info.outputs.extra-configure }}
|
run: ${{ env.base-configure-command }} -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN ${{ steps.build-debug-info.outputs.extra-configure }}
|
||||||
env:
|
env:
|
||||||
SPLAT_DIR: ${{ github.workspace }}/.xwin-cache/splat
|
SPLAT_DIR: ${{ github.workspace }}/.xwin-cache/splat
|
||||||
TOOLCHAIN: ${{ github.workspace }}/toolchain/clang-msvc.cmake
|
TOOLCHAIN: ${{ github.workspace }}/toolchain/clang-msvc.cmake
|
||||||
HOST_ARCH: x86_64
|
HOST_ARCH: x86_64
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
${{ env.base-build-command }}
|
${{ env.base-build-command }}
|
||||||
${{ steps.build-debug-info.outputs.extra-build }}
|
${{ steps.build-debug-info.outputs.extra-build }}
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: geode-win
|
name: geode-win
|
||||||
path: ./bin/nightly
|
path: ./bin/nightly
|
||||||
|
|
||||||
- name: Package Installer
|
- name: Package installer
|
||||||
run: |
|
run: |
|
||||||
sudo apt install nsis
|
sudo apt install nsis
|
||||||
makensis -WX -V3 ./installer/windows/installer.nsi
|
makensis -WX -V3 ./installer/windows/installer.nsi
|
||||||
|
|
||||||
- name: Upload Installer
|
- name: Upload installer
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: geode-installer-win
|
name: geode-installer-win
|
||||||
path: './installer/windows/geode-installer-win.exe'
|
path: './installer/windows/geode-installer-win.exe'
|
||||||
|
|
||||||
- name: Complete Build Debug Info
|
- name: Complete Build Debug Info
|
||||||
uses: ./.github/actions/build-debug-info-post
|
uses: ./.github/actions/build-debug-info-post
|
||||||
with:
|
with:
|
||||||
target: win
|
target: win
|
||||||
if: inputs.build-debug-info && (success() || failure())
|
if: inputs.build-debug-info && (success() || failure())
|
||||||
|
|
||||||
build-mac:
|
build-mac:
|
||||||
name: Build macOS
|
name: Build macOS
|
||||||
|
@ -142,213 +140,211 @@ jobs:
|
||||||
SCCACHE_CACHE_MULTIARCH: 1
|
SCCACHE_CACHE_MULTIARCH: 1
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Prepare for Build Debug Info
|
- name: Prepare for Build Debug Info
|
||||||
id: build-debug-info
|
id: build-debug-info
|
||||||
uses: ./.github/actions/build-debug-info
|
uses: ./.github/actions/build-debug-info
|
||||||
with:
|
with:
|
||||||
has-sccache: ${{ inputs.use-ccache }}
|
has-sccache: ${{ inputs.use-ccache }}
|
||||||
if: inputs.build-debug-info
|
if: inputs.build-debug-info
|
||||||
|
|
||||||
# due to very strange performance issues, sccache is currently disabled for macos. sorry
|
# macOS does not currently support sccache due to performance issues
|
||||||
|
# - name: Setup caches
|
||||||
|
# uses: ./.github/actions/setup-cache
|
||||||
|
# with:
|
||||||
|
# host: mac
|
||||||
|
# target: mac
|
||||||
|
# use-ccache: ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
|
||||||
|
|
||||||
# - name: Setup caches
|
- name: Setup Ninja
|
||||||
# uses: ./.github/actions/setup-cache
|
uses: ./.github/actions/setup-ninja
|
||||||
# with:
|
with:
|
||||||
# host: mac
|
host: mac
|
||||||
# target: mac
|
|
||||||
# use-ccache: ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
|
|
||||||
|
|
||||||
- name: Setup Ninja
|
- name: Setup CLI
|
||||||
uses: ./.github/actions/setup-ninja
|
uses: geode-sdk/cli/.github/actions/setup@main
|
||||||
with:
|
|
||||||
host: mac
|
|
||||||
|
|
||||||
- name: Setup CLI
|
- name: Configure
|
||||||
uses: geode-sdk/cli/.github/actions/setup@main
|
run: >
|
||||||
|
${{ env.base-configure-command }}
|
||||||
|
-DCMAKE_C_COMPILER=clang
|
||||||
|
-DCMAKE_CXX_COMPILER=clang++
|
||||||
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
|
||||||
|
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
|
||||||
|
-DGEODE_DISABLE_PRECOMPILED_HEADERS=OFF
|
||||||
|
${{ steps.build-debug-info.outputs.extra-configure }}
|
||||||
|
|
||||||
- name: Configure
|
- name: Build
|
||||||
run: >
|
run: |
|
||||||
${{ env.base-configure-command }}
|
${{ env.base-build-command }}
|
||||||
-DCMAKE_C_COMPILER=clang
|
${{ steps.build-debug-info.outputs.extra-build }}
|
||||||
-DCMAKE_CXX_COMPILER=clang++
|
|
||||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
|
|
||||||
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
|
|
||||||
-DGEODE_DISABLE_PRECOMPILED_HEADERS=OFF
|
|
||||||
${{ steps.build-debug-info.outputs.extra-configure }}
|
|
||||||
|
|
||||||
- name: Build
|
- name: Upload artifacts
|
||||||
run: |
|
uses: actions/upload-artifact@v4
|
||||||
${{ env.base-build-command }}
|
with:
|
||||||
${{ steps.build-debug-info.outputs.extra-build }}
|
name: geode-mac
|
||||||
|
path: ./bin/nightly
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Package installer
|
||||||
uses: actions/upload-artifact@v4
|
run: ./installer/mac/package.sh ./bin/nightly ./installer/mac/geode-installer-mac.pkg
|
||||||
with:
|
|
||||||
name: geode-mac
|
|
||||||
path: ./bin/nightly
|
|
||||||
|
|
||||||
- name: Package Installer
|
- name: Upload installer
|
||||||
run: ./installer/mac/package.sh ./bin/nightly ./installer/mac/geode-installer-mac.pkg
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: geode-installer-mac
|
||||||
|
path: './installer/mac/geode-installer-mac.pkg'
|
||||||
|
|
||||||
- name: Upload Installer
|
- name: Complete Build Debug Info
|
||||||
uses: actions/upload-artifact@v4
|
uses: ./.github/actions/build-debug-info-post
|
||||||
with:
|
with:
|
||||||
name: geode-installer-mac
|
target: mac
|
||||||
path: './installer/mac/geode-installer-mac.pkg'
|
if: inputs.build-debug-info && (success() || failure())
|
||||||
|
|
||||||
- name: Complete Build Debug Info
|
|
||||||
uses: ./.github/actions/build-debug-info-post
|
|
||||||
with:
|
|
||||||
target: mac
|
|
||||||
if: inputs.build-debug-info && (success() || failure())
|
|
||||||
|
|
||||||
build-android:
|
build-android:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
config:
|
config:
|
||||||
- name: Android (32-bit)
|
- name: Android (32-bit)
|
||||||
id: android32
|
id: android32
|
||||||
extra-configure: -DANDROID_ABI=armeabi-v7a
|
extra-configure: -DANDROID_ABI=armeabi-v7a
|
||||||
|
- name: Android (64-bit)
|
||||||
- name: Android (64-bit)
|
id: android64
|
||||||
id: android64
|
extra-configure: -DANDROID_ABI=arm64-v8a
|
||||||
extra-configure: -DANDROID_ABI=arm64-v8a
|
|
||||||
|
|
||||||
name: Build ${{ matrix.config.name }}
|
name: Build ${{ matrix.config.name }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Prepare for Build Debug Info
|
- name: Prepare for Build Debug Info
|
||||||
id: build-debug-info
|
id: build-debug-info
|
||||||
uses: ./.github/actions/build-debug-info
|
uses: ./.github/actions/build-debug-info
|
||||||
with:
|
with:
|
||||||
has-sccache: ${{ inputs.use-ccache }}
|
has-sccache: ${{ inputs.use-ccache }}
|
||||||
if: inputs.build-debug-info
|
if: inputs.build-debug-info
|
||||||
|
|
||||||
- name: Setup caches
|
- name: Setup caches
|
||||||
uses: ./.github/actions/setup-cache
|
uses: ./.github/actions/setup-cache
|
||||||
with:
|
with:
|
||||||
host: linux
|
host: linux
|
||||||
target: ${{ matrix.config.id }}
|
target: ${{ matrix.config.id }}
|
||||||
use-ccache: ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
|
use-ccache: ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
|
||||||
|
|
||||||
- name: Setup Ninja
|
- name: Setup Ninja
|
||||||
uses: ./.github/actions/setup-ninja
|
uses: ./.github/actions/setup-ninja
|
||||||
with:
|
with:
|
||||||
host: linux
|
host: linux
|
||||||
|
|
||||||
- name: Setup CLI
|
- name: Setup CLI
|
||||||
uses: geode-sdk/cli/.github/actions/setup@main
|
uses: geode-sdk/cli/.github/actions/setup@main
|
||||||
|
|
||||||
- name: Setup Breakpad Tools
|
- name: Setup Breakpad Tools
|
||||||
uses: ./.github/actions/setup-dump-sym
|
uses: ./.github/actions/setup-dump-sym
|
||||||
id: breakpad-tools
|
id: breakpad-tools
|
||||||
|
|
||||||
- name: Fix Ubuntu libcstd++
|
- name: Fix Ubuntu libcstd++
|
||||||
run: |
|
run: |
|
||||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install --only-upgrade libstdc++6
|
sudo apt-get install --only-upgrade libstdc++6
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: >
|
run: >
|
||||||
${{ env.base-configure-command }}
|
${{ env.base-configure-command }}
|
||||||
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake
|
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake
|
||||||
-DCMAKE_C_COMPILER=clang
|
-DCMAKE_C_COMPILER=clang
|
||||||
-DCMAKE_CXX_COMPILER=clang++
|
-DCMAKE_CXX_COMPILER=clang++
|
||||||
-DANDROID_PLATFORM=android-23
|
-DANDROID_PLATFORM=android-23
|
||||||
-DANDROID_STL=c++_shared
|
-DANDROID_STL=c++_shared
|
||||||
${{ matrix.config.extra-configure }}
|
${{ matrix.config.extra-configure }}
|
||||||
${{ steps.build-debug-info.outputs.extra-configure }}
|
${{ steps.build-debug-info.outputs.extra-configure }}
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
${{ env.base-build-command }}
|
${{ env.base-build-command }}
|
||||||
${{ steps.build-debug-info.outputs.extra-build }}
|
${{ steps.build-debug-info.outputs.extra-build }}
|
||||||
|
|
||||||
# hardcoding toolchain path :(
|
- name: Dump symbols
|
||||||
- name: Dump Symbols
|
run: |
|
||||||
run: |
|
${{ steps.breakpad-tools.outputs.binary-path }} ./bin/nightly/Geode.${{ matrix.config.id }}.so -o ./bin/nightly/Geode.${{ matrix.config.id }}.so.sym
|
||||||
${{ steps.breakpad-tools.outputs.binary-path }} ./bin/nightly/Geode.${{ matrix.config.id }}.so -o ./bin/nightly/Geode.${{ matrix.config.id }}.so.sym
|
$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip ./bin/nightly/Geode.${{ matrix.config.id }}.so
|
||||||
$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip ./bin/nightly/Geode.${{ matrix.config.id }}.so
|
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: geode-${{ matrix.config.id }}
|
name: geode-${{ matrix.config.id }}
|
||||||
path: ./bin/nightly
|
path: ./bin/nightly
|
||||||
|
|
||||||
- name: Complete Build Debug Info
|
- name: Complete Build Debug Info
|
||||||
uses: ./.github/actions/build-debug-info-post
|
uses: ./.github/actions/build-debug-info-post
|
||||||
with:
|
with:
|
||||||
target: ${{ matrix.config.id }}
|
target: ${{ matrix.config.id }}
|
||||||
if: inputs.build-debug-info && (success() || failure())
|
if: inputs.build-debug-info && (success() || failure())
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
name: Publish
|
name: Publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ build-windows, build-mac, build-android ]
|
needs: [ build-windows, build-mac, build-android ]
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Declare Version Variables
|
- name: Declare version variables
|
||||||
id: ref
|
id: ref
|
||||||
run: |
|
run: |
|
||||||
echo "version=$(cat VERSION | xargs)" >> $GITHUB_OUTPUT
|
echo "version=$(cat VERSION | xargs)" >> $GITHUB_OUTPUT
|
||||||
echo "hash=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
|
echo "hash=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Download Artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
|
|
||||||
- name: Move Installers
|
- name: Move installers
|
||||||
run: |
|
run: |
|
||||||
mv geode-installer-mac/geode-installer-mac.pkg geode-installer-${{ steps.ref.outputs.hash }}-mac.pkg
|
mv geode-installer-mac/geode-installer-mac.pkg geode-installer-${{ steps.ref.outputs.hash }}-mac.pkg
|
||||||
mv geode-installer-win/geode-installer-win.exe geode-installer-${{ steps.ref.outputs.hash }}-win.exe
|
mv geode-installer-win/geode-installer-win.exe geode-installer-${{ steps.ref.outputs.hash }}-win.exe
|
||||||
|
|
||||||
- name: Zip MacOS Artifacts
|
- name: Zip MacOS artifacts
|
||||||
uses: vimtor/action-zip@v1.2
|
uses: vimtor/action-zip@v1.2
|
||||||
with:
|
with:
|
||||||
files: geode-mac/Geode.dylib geode-mac/GeodeBootstrapper.dylib
|
files: geode-mac/Geode.dylib geode-mac/GeodeBootstrapper.dylib
|
||||||
dest: geode-${{ steps.ref.outputs.hash }}-mac.zip
|
dest: geode-${{ steps.ref.outputs.hash }}-mac.zip
|
||||||
|
|
||||||
- name: Zip Windows Artifacts
|
- name: Zip Windows artifacts
|
||||||
uses: vimtor/action-zip@v1.2
|
uses: vimtor/action-zip@v1.2
|
||||||
with:
|
with:
|
||||||
files: geode-win/XInput1_4.dll geode-win/Geode.dll geode-win/GeodeUpdater.exe geode-win/Geode.lib geode-win/Geode.pdb
|
files: geode-win/XInput1_4.dll geode-win/Geode.dll geode-win/GeodeUpdater.exe geode-win/Geode.lib geode-win/Geode.pdb
|
||||||
dest: geode-${{ steps.ref.outputs.hash }}-win.zip
|
dest: geode-${{ steps.ref.outputs.hash }}-win.zip
|
||||||
|
|
||||||
- name: Zip Android32 Artifacts
|
- name: Zip Android32 artifacts
|
||||||
uses: vimtor/action-zip@v1.2
|
uses: vimtor/action-zip@v1.2
|
||||||
with:
|
with:
|
||||||
files: geode-android32/Geode.android32.so geode-android32/Geode.android32.so.sym
|
files: geode-android32/Geode.android32.so geode-android32/Geode.android32.so.sym
|
||||||
dest: geode-${{ steps.ref.outputs.hash }}-android32.zip
|
dest: geode-${{ steps.ref.outputs.hash }}-android32.zip
|
||||||
|
|
||||||
- name: Zip Android64 Artifacts
|
- name: Zip Android64 artifacts
|
||||||
uses: vimtor/action-zip@v1.2
|
uses: vimtor/action-zip@v1.2
|
||||||
with:
|
with:
|
||||||
files: geode-android64/Geode.android64.so geode-android64/Geode.android64.so.sym
|
files: geode-android64/Geode.android64.so geode-android64/Geode.android64.so.sym
|
||||||
dest: geode-${{ steps.ref.outputs.hash }}-android64.zip
|
dest: geode-${{ steps.ref.outputs.hash }}-android64.zip
|
||||||
|
|
||||||
- name: Zip Resources
|
- name: Zip resources
|
||||||
uses: vimtor/action-zip@v1.2
|
uses: vimtor/action-zip@v1.2
|
||||||
with:
|
with:
|
||||||
files: geode-android64/resources
|
files: geode-android64/resources
|
||||||
dest: resources.zip
|
dest: resources.zip
|
||||||
|
|
||||||
- name: Update Development Release
|
- name: Update development release
|
||||||
uses: andelf/nightly-release@main
|
uses: andelf/nightly-release@main
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
20
.github/workflows/check-changelog.yml
vendored
|
@ -1,5 +1,4 @@
|
||||||
# check the changelog for non ascii characters
|
name: Check Changelog
|
||||||
name: Check CHANGELOG.md
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -11,16 +10,19 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
name: Check CHANGELOG.md
|
name: Check Changelog
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- run: |
|
- name: Check for non-ASCII characters in changelog
|
||||||
if grep -q -P -n "[\x80-\xFF]" CHANGELOG.md
|
run: |
|
||||||
then
|
if grep -q -P -n "[\x80-\xFF]" CHANGELOG.md; then
|
||||||
exit 1;
|
echo "Non-ASCII characters found in CHANGELOG.md"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "No non-ASCII characters found in CHANGELOG.md"
|
||||||
fi
|
fi
|
||||||
|
|
21
.github/workflows/draft.yml
vendored
|
@ -7,9 +7,10 @@ jobs:
|
||||||
draft:
|
draft:
|
||||||
name: Draft Release
|
name: Draft Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download Development Release
|
- name: Download development release
|
||||||
uses: robinraju/release-downloader@v1.9
|
uses: robinraju/release-downloader@v1
|
||||||
with:
|
with:
|
||||||
tag: nightly
|
tag: nightly
|
||||||
fileName: '*'
|
fileName: '*'
|
||||||
|
@ -17,14 +18,14 @@ jobs:
|
||||||
zipBall: true
|
zipBall: true
|
||||||
out-file-path: 'dev'
|
out-file-path: 'dev'
|
||||||
|
|
||||||
- name: Declare Version Variable
|
- name: Declare version variable
|
||||||
id: ref
|
id: ref
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(unzip -p ${{ github.workspace }}/dev/geode-nightly.zip geode-sdk-geode-*/VERSION | xargs)
|
VERSION=$(unzip -p ${{ github.workspace }}/dev/geode-nightly.zip geode-sdk-geode-*/VERSION | xargs)
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# test if release already exists
|
# Test if release already exists
|
||||||
set +e
|
set +e
|
||||||
curl --fail "https://api.github.com/repos/geode-sdk/geode/releases/tags/v$VERSION" --silent --output /dev/null
|
curl --fail "https://api.github.com/repos/geode-sdk/geode/releases/tags/v$VERSION" --silent --output /dev/null
|
||||||
RESULT=$?
|
RESULT=$?
|
||||||
|
@ -35,7 +36,7 @@ jobs:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Move Files
|
- name: Move files
|
||||||
run: |
|
run: |
|
||||||
mv dev/geode-installer-*-win.exe geode-installer-v${{ steps.ref.outputs.version }}-win.exe
|
mv dev/geode-installer-*-win.exe geode-installer-v${{ steps.ref.outputs.version }}-win.exe
|
||||||
mv dev/geode-installer-*-mac.pkg geode-installer-v${{ steps.ref.outputs.version }}-mac.pkg
|
mv dev/geode-installer-*-mac.pkg geode-installer-v${{ steps.ref.outputs.version }}-mac.pkg
|
||||||
|
@ -45,8 +46,8 @@ jobs:
|
||||||
mv dev/geode-*-android64.zip geode-v${{ steps.ref.outputs.version }}-android64.zip
|
mv dev/geode-*-android64.zip geode-v${{ steps.ref.outputs.version }}-android64.zip
|
||||||
mv dev/resources.zip resources.zip
|
mv dev/resources.zip resources.zip
|
||||||
|
|
||||||
- name: Create Draft Release
|
- name: Create draft release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v2
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
|
@ -54,9 +55,9 @@ jobs:
|
||||||
name: Geode v${{ steps.ref.outputs.version }}
|
name: Geode v${{ steps.ref.outputs.version }}
|
||||||
body: |
|
body: |
|
||||||
TODO before publishing:
|
TODO before publishing:
|
||||||
- mark if pre-release
|
- Mark if pre-release
|
||||||
- add changelog
|
- Add changelog
|
||||||
- remove this
|
- Remove this
|
||||||
draft: true
|
draft: true
|
||||||
files: |
|
files: |
|
||||||
./geode-installer-v${{ steps.ref.outputs.version }}-win.exe
|
./geode-installer-v${{ steps.ref.outputs.version }}-win.exe
|
||||||
|
|
28
.github/workflows/update-site.yml
vendored
|
@ -1,26 +1,22 @@
|
||||||
# Update the install page on the geode-sdk/website repository
|
|
||||||
name: Update Website
|
name: Update Website
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# # trigger when a new release is released
|
|
||||||
# release:
|
|
||||||
# types:
|
|
||||||
# - released
|
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
trigger:
|
trigger:
|
||||||
name: Trigger site build
|
name: Trigger site build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/github-script@v7
|
- name: Trigger build workflow on geode-sdk/website repository
|
||||||
with:
|
uses: actions/github-script@v7
|
||||||
github-token: ${{ secrets.GEODE_BOT_PUSH_BIN_TOKEN }}
|
with:
|
||||||
script: |
|
github-token: ${{ secrets.GEODE_BOT_PUSH_BIN_TOKEN }}
|
||||||
await github.rest.actions.createWorkflowDispatch({
|
script: |
|
||||||
owner: 'geode-sdk',
|
await github.rest.actions.createWorkflowDispatch({
|
||||||
repo: 'website',
|
owner: 'geode-sdk',
|
||||||
workflow_id: 'build.yml',
|
repo: 'website',
|
||||||
ref: 'main'
|
workflow_id: 'build.yml',
|
||||||
})
|
ref: 'main'
|
||||||
|
})
|
||||||
|
|
BIN
loader/resources/tag-joke.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
loader/resources/tag-modtober-long.png
Normal file
After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 17 KiB |
BIN
loader/resources/tag-paid-long.png
Normal file
After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 16 KiB |
|
@ -1079,7 +1079,7 @@ void Loader::Impl::installModManuallyFromFile(std::filesystem::path const& path,
|
||||||
createQuickPopup(
|
createQuickPopup(
|
||||||
"Already Installed",
|
"Already Installed",
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"The mod <cy>{}</c> <cj>v{}</c> has already been installed "
|
"The mod <cy>{}</c> <cj>{}</c> has already been installed "
|
||||||
"as version <cl>{}</c>. Do you want to <co>replace the "
|
"as version <cl>{}</c>. Do you want to <co>replace the "
|
||||||
"installed version with the file</c>?",
|
"installed version with the file</c>?",
|
||||||
meta.getID(), meta.getVersion(),
|
meta.getID(), meta.getVersion(),
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
#include "ui/mods/sources/ModListSource.hpp"
|
#include "ui/mods/sources/ModListSource.hpp"
|
||||||
#include <loader/LoaderImpl.hpp>
|
#include <loader/LoaderImpl.hpp>
|
||||||
|
|
||||||
|
static ModListDisplay MOD_LIST_DISPLAY = ModListDisplay::SmallList;
|
||||||
|
|
||||||
bool ModsStatusNode::init() {
|
bool ModsStatusNode::init() {
|
||||||
if (!CCNode::init())
|
if (!CCNode::init())
|
||||||
return false;
|
return false;
|
||||||
|
@ -649,7 +651,7 @@ void ModsLayer::gotoTab(ModListSource* src) {
|
||||||
m_currentSource = src;
|
m_currentSource = src;
|
||||||
|
|
||||||
// Update the state of the current list
|
// Update the state of the current list
|
||||||
m_lists.at(m_currentSource)->updateDisplay(m_display);
|
m_lists.at(m_currentSource)->updateDisplay(MOD_LIST_DISPLAY);
|
||||||
m_lists.at(m_currentSource)->activateSearch(m_showSearch);
|
m_lists.at(m_currentSource)->activateSearch(m_showSearch);
|
||||||
m_lists.at(m_currentSource)->updateState();
|
m_lists.at(m_currentSource)->updateState();
|
||||||
}
|
}
|
||||||
|
@ -711,7 +713,7 @@ void ModsLayer::updateState() {
|
||||||
// Update display button
|
// Update display button
|
||||||
for (auto btn : m_displayBtns) {
|
for (auto btn : m_displayBtns) {
|
||||||
static_cast<GeodeSquareSprite*>(btn->getNormalImage())->setState(
|
static_cast<GeodeSquareSprite*>(btn->getNormalImage())->setState(
|
||||||
static_cast<ModListDisplay>(btn->getTag()) == m_display
|
static_cast<ModListDisplay>(btn->getTag()) == MOD_LIST_DISPLAY
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -744,10 +746,11 @@ void ModsLayer::onGoToPage(CCObject*) {
|
||||||
popup->show();
|
popup->show();
|
||||||
}
|
}
|
||||||
void ModsLayer::onDisplay(CCObject* sender) {
|
void ModsLayer::onDisplay(CCObject* sender) {
|
||||||
m_display = static_cast<ModListDisplay>(sender->getTag());
|
MOD_LIST_DISPLAY = static_cast<ModListDisplay>(sender->getTag());
|
||||||
// Make sure to avoid a crash
|
// Make sure to avoid a crash
|
||||||
if (m_currentSource) {
|
if (m_currentSource) {
|
||||||
m_lists.at(m_currentSource)->updateDisplay(m_display);
|
m_lists.at(m_currentSource)->updateDisplay(MOD_LIST_DISPLAY);
|
||||||
|
m_lists.at(m_currentSource)->reloadPage();
|
||||||
}
|
}
|
||||||
this->updateState();
|
this->updateState();
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,6 @@ protected:
|
||||||
ModsStatusNode* m_statusNode;
|
ModsStatusNode* m_statusNode;
|
||||||
EventListener<UpdateModListStateFilter> m_updateStateListener;
|
EventListener<UpdateModListStateFilter> m_updateStateListener;
|
||||||
bool m_showSearch = true;
|
bool m_showSearch = true;
|
||||||
ModListDisplay m_display = ModListDisplay::SmallList;
|
|
||||||
std::vector<CCMenuItemSpriteExtra*> m_displayBtns;
|
std::vector<CCMenuItemSpriteExtra*> m_displayBtns;
|
||||||
|
|
||||||
bool init();
|
bool init();
|
||||||
|
|
|
@ -53,6 +53,10 @@ bool ModItem::init(ModSource&& source) {
|
||||||
m_versionLabel->setID("version-label");
|
m_versionLabel->setID("version-label");
|
||||||
m_versionLabel->setLayoutOptions(AxisLayoutOptions::create()->setScaleLimits(std::nullopt, .7f));
|
m_versionLabel->setLayoutOptions(AxisLayoutOptions::create()->setScaleLimits(std::nullopt, .7f));
|
||||||
m_titleContainer->addChild(m_versionLabel);
|
m_titleContainer->addChild(m_versionLabel);
|
||||||
|
|
||||||
|
m_versionDownloadSeparator = CCLabelBMFont::create("•", "bigFont.fnt");
|
||||||
|
m_versionDownloadSeparator->setOpacity(155);
|
||||||
|
m_titleContainer->addChild(m_versionDownloadSeparator);
|
||||||
|
|
||||||
m_titleContainer->setLayout(
|
m_titleContainer->setLayout(
|
||||||
RowLayout::create()
|
RowLayout::create()
|
||||||
|
@ -180,10 +184,7 @@ bool ModItem::init(ModSource&& source) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto viewBtn = CCMenuItemSpriteExtra::create(
|
auto viewBtn = CCMenuItemSpriteExtra::create(spr, this, menu_selector(ModItem::onView));
|
||||||
spr,
|
|
||||||
this, menu_selector(ModItem::onView)
|
|
||||||
);
|
|
||||||
viewBtn->setID("view-button");
|
viewBtn->setID("view-button");
|
||||||
m_viewMenu->addChild(viewBtn);
|
m_viewMenu->addChild(viewBtn);
|
||||||
|
|
||||||
|
@ -229,10 +230,23 @@ bool ModItem::init(ModSource&& source) {
|
||||||
m_badgeContainer->addChild(CCSprite::createWithSpriteFrameName("tag-featured.png"_spr));
|
m_badgeContainer->addChild(CCSprite::createWithSpriteFrameName("tag-featured.png"_spr));
|
||||||
}
|
}
|
||||||
if (metadata.tags.contains("paid")) {
|
if (metadata.tags.contains("paid")) {
|
||||||
m_badgeContainer->addChild(CCSprite::createWithSpriteFrameName("tag-paid.png"_spr));
|
auto shortVer = CCSprite::createWithSpriteFrameName("tag-paid.png"_spr);
|
||||||
|
shortVer->setTag(1);
|
||||||
|
m_badgeContainer->addChild(shortVer);
|
||||||
|
auto longVer = CCSprite::createWithSpriteFrameName("tag-paid-long.png"_spr);
|
||||||
|
longVer->setTag(2);
|
||||||
|
m_badgeContainer->addChild(longVer);
|
||||||
|
}
|
||||||
|
if (metadata.tags.contains("joke")) {
|
||||||
|
m_badgeContainer->addChild(CCSprite::createWithSpriteFrameName("tag-joke.png"_spr));
|
||||||
}
|
}
|
||||||
if (metadata.tags.contains("modtober24")) {
|
if (metadata.tags.contains("modtober24")) {
|
||||||
m_badgeContainer->addChild(CCSprite::createWithSpriteFrameName("tag-modtober.png"_spr));
|
auto shortVer = CCSprite::createWithSpriteFrameName("tag-modtober.png"_spr);
|
||||||
|
shortVer->setTag(1);
|
||||||
|
m_badgeContainer->addChild(shortVer);
|
||||||
|
auto longVer = CCSprite::createWithSpriteFrameName("tag-modtober-long.png"_spr);
|
||||||
|
longVer->setTag(2);
|
||||||
|
m_badgeContainer->addChild(longVer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show mod download count here already so people can make informed decisions
|
// Show mod download count here already so people can make informed decisions
|
||||||
|
@ -242,17 +256,18 @@ bool ModItem::init(ModSource&& source) {
|
||||||
auto downloads = CCLabelBMFont::create(numToAbbreviatedString(metadata.downloadCount).c_str(), "bigFont.fnt");
|
auto downloads = CCLabelBMFont::create(numToAbbreviatedString(metadata.downloadCount).c_str(), "bigFont.fnt");
|
||||||
downloads->setID("downloads-label");
|
downloads->setID("downloads-label");
|
||||||
downloads->setColor("mod-list-version-label"_cc3b);
|
downloads->setColor("mod-list-version-label"_cc3b);
|
||||||
downloads->limitLabelWidth(80, .5f, .1f);
|
downloads->limitLabelWidth(125, 1.f, .1f);
|
||||||
m_downloadCountContainer->addChildAtPosition(downloads, Anchor::Right, ccp(-0, 0), ccp(1, .5f));
|
m_downloadCountContainer->addChildAtPosition(downloads, Anchor::Right, ccp(-0, 0), ccp(1, .5f));
|
||||||
|
|
||||||
auto downloadsIcon = CCSprite::createWithSpriteFrameName("GJ_downloadsIcon_001.png");
|
auto downloadsIcon = CCSprite::createWithSpriteFrameName("GJ_downloadsIcon_001.png");
|
||||||
downloadsIcon->setID("downloads-icon-sprite");
|
downloadsIcon->setID("downloads-icon-sprite");
|
||||||
downloadsIcon->setScale(.75f);
|
downloadsIcon->setScale(1.2f);
|
||||||
m_downloadCountContainer->addChildAtPosition(downloadsIcon, Anchor::Left, ccp(5, 0));
|
m_downloadCountContainer->addChildAtPosition(downloadsIcon, Anchor::Left, ccp(8, 0));
|
||||||
|
|
||||||
|
// m_downloadCountContainer scale is controlled in updateState
|
||||||
m_downloadCountContainer->setContentSize({
|
m_downloadCountContainer->setContentSize({
|
||||||
downloads->getScaledContentWidth() + downloadsIcon->getScaledContentWidth(),
|
downloads->getScaledContentWidth() + downloadsIcon->getScaledContentWidth(),
|
||||||
25
|
30
|
||||||
});
|
});
|
||||||
m_downloadCountContainer->updateLayout();
|
m_downloadCountContainer->updateLayout();
|
||||||
|
|
||||||
|
@ -338,7 +353,7 @@ void ModItem::updateState() {
|
||||||
|
|
||||||
// Update the size of the mod cell itself
|
// Update the size of the mod cell itself
|
||||||
if (m_display == ModListDisplay::Grid) {
|
if (m_display == ModListDisplay::Grid) {
|
||||||
auto widthWithoutGaps = m_targetWidth - 10;
|
auto widthWithoutGaps = m_targetWidth - 7.5f;
|
||||||
this->setContentSize(ccp(widthWithoutGaps / roundf(widthWithoutGaps / 80), 100));
|
this->setContentSize(ccp(widthWithoutGaps / roundf(widthWithoutGaps / 80), 100));
|
||||||
m_bg->setContentSize(m_obContentSize / m_bg->getScale());
|
m_bg->setContentSize(m_obContentSize / m_bg->getScale());
|
||||||
}
|
}
|
||||||
|
@ -358,14 +373,19 @@ void ModItem::updateState() {
|
||||||
m_titleContainer->insertBefore(m_titleLabel, nullptr);
|
m_titleContainer->insertBefore(m_titleLabel, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show download separator if there is something to separate and we're in grid view
|
||||||
|
m_versionDownloadSeparator->setVisible(m_downloadCountContainer && m_display == ModListDisplay::Grid);
|
||||||
|
|
||||||
// Download counts go next to the version like on the website on grid view
|
// Download counts go next to the version like on the website on grid view
|
||||||
if (m_downloadCountContainer) {
|
if (m_downloadCountContainer) {
|
||||||
m_downloadCountContainer->removeFromParent();
|
m_downloadCountContainer->removeFromParent();
|
||||||
if (m_display == ModListDisplay::Grid) {
|
if (m_display == ModListDisplay::Grid) {
|
||||||
m_titleContainer->insertAfter(m_downloadCountContainer, m_versionLabel);
|
m_titleContainer->insertAfter(m_downloadCountContainer, m_versionDownloadSeparator);
|
||||||
|
m_downloadCountContainer->setLayoutOptions(AxisLayoutOptions::create()->setScaleLimits(.1f, .7f));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_viewMenu->addChild(m_downloadCountContainer);
|
m_viewMenu->addChild(m_downloadCountContainer);
|
||||||
|
m_downloadCountContainer->setLayoutOptions(AxisLayoutOptions::create()->setScaleLimits(.1f, .6f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,14 +393,31 @@ void ModItem::updateState() {
|
||||||
if (m_badgeContainer) {
|
if (m_badgeContainer) {
|
||||||
m_badgeContainer->removeFromParent();
|
m_badgeContainer->removeFromParent();
|
||||||
if (m_display == ModListDisplay::Grid) {
|
if (m_display == ModListDisplay::Grid) {
|
||||||
m_badgeContainer->setLayout(ColumnLayout::create()->setAutoGrowAxis(true));
|
m_badgeContainer->setLayout(
|
||||||
m_badgeContainer->setScale(.25f);
|
ColumnLayout::create()
|
||||||
this->addChildAtPosition(m_badgeContainer, Anchor::TopLeft, ccp(5, -5), ccp(0, 1));
|
->setAxisReverse(true)
|
||||||
|
->setAutoGrowAxis(true)
|
||||||
|
->setAxisAlignment(AxisAlignment::Start)
|
||||||
|
);
|
||||||
|
m_badgeContainer->getLayout()->ignoreInvisibleChildren(true);
|
||||||
|
m_badgeContainer->setScale(.3f);
|
||||||
|
this->addChildAtPosition(m_badgeContainer, Anchor::TopLeft, ccp(5, -2), ccp(0, 1));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_badgeContainer->setLayout(RowLayout::create()->setAutoGrowAxis(true));
|
m_badgeContainer->setLayout(
|
||||||
|
RowLayout::create()
|
||||||
|
->setAutoGrowAxis(true)
|
||||||
|
);
|
||||||
|
m_badgeContainer->getLayout()->ignoreInvisibleChildren(true);
|
||||||
m_titleContainer->addChild(m_badgeContainer);
|
m_titleContainer->addChild(m_badgeContainer);
|
||||||
}
|
}
|
||||||
|
// Long tags don't fit in the grid UI
|
||||||
|
for (auto child : CCArrayExt<CCNode*>(m_badgeContainer->getChildren())) {
|
||||||
|
if (child->getTag() > 0) {
|
||||||
|
child->setVisible(child->getTag() == (m_display == ModListDisplay::Grid ? 1 : 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_badgeContainer->updateLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
// On Grid View logo has constant size
|
// On Grid View logo has constant size
|
||||||
|
@ -558,6 +595,9 @@ void ModItem::updateState() {
|
||||||
m_recommendedBy->updateLayout();
|
m_recommendedBy->updateLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
limitNodeWidth(m_downloadWaiting, m_titleContainer->getContentWidth(), 1.f, .1f);
|
||||||
|
limitNodeWidth(m_downloadBarContainer, m_titleContainer->getContentWidth(), 1.f, .1f);
|
||||||
|
|
||||||
// Update positioning (jesus)
|
// Update positioning (jesus)
|
||||||
switch (m_display) {
|
switch (m_display) {
|
||||||
case ModListDisplay::Grid: {
|
case ModListDisplay::Grid: {
|
||||||
|
|
|
@ -48,6 +48,7 @@ protected:
|
||||||
Ref<CCNode> m_downloadCountContainer;
|
Ref<CCNode> m_downloadCountContainer;
|
||||||
ModListDisplay m_display = ModListDisplay::SmallList;
|
ModListDisplay m_display = ModListDisplay::SmallList;
|
||||||
float m_targetWidth = 300;
|
float m_targetWidth = 300;
|
||||||
|
CCLabelBMFont* m_versionDownloadSeparator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @warning Make sure `getMetadata` and `createModLogo` are callable
|
* @warning Make sure `getMetadata` and `createModLogo` are callable
|
||||||
|
|
|
@ -6,6 +6,22 @@
|
||||||
#include "../ModsLayer.hpp"
|
#include "../ModsLayer.hpp"
|
||||||
#include "../popups/ModtoberPopup.hpp"
|
#include "../popups/ModtoberPopup.hpp"
|
||||||
|
|
||||||
|
static size_t getDisplayPageSize(ModListSource* src, ModListDisplay display) {
|
||||||
|
if (src->isLocalModsOnly() && Mod::get()->template getSettingValue<bool>("infinite-local-mods-list")) {
|
||||||
|
return std::numeric_limits<size_t>::max();
|
||||||
|
}
|
||||||
|
return display == ModListDisplay::Grid ? 16 : 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
$execute {
|
||||||
|
listenForSettingChanges("infinite-local-mods-list", [](bool value) {
|
||||||
|
InstalledModListSource::get(InstalledModListType::All)->reset();
|
||||||
|
InstalledModListSource::get(InstalledModListType::OnlyErrors)->reset();
|
||||||
|
InstalledModListSource::get(InstalledModListType::OnlyOutdated)->reset();
|
||||||
|
// Updates is technically a server mod list :-) So I left it out here
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
bool ModList::init(ModListSource* src, CCSize const& size) {
|
bool ModList::init(ModListSource* src, CCSize const& size) {
|
||||||
if (!CCNode::init())
|
if (!CCNode::init())
|
||||||
return false;
|
return false;
|
||||||
|
@ -179,7 +195,7 @@ bool ModList::init(ModListSource* src, CCSize const& size) {
|
||||||
m_searchInput->setCallback([this](auto const&) {
|
m_searchInput->setCallback([this](auto const&) {
|
||||||
// If the source is already in memory, we can immediately update the
|
// If the source is already in memory, we can immediately update the
|
||||||
// search query
|
// search query
|
||||||
if (typeinfo_cast<InstalledModListSource*>(m_source)) {
|
if (m_source->isLocalModsOnly()) {
|
||||||
m_source->search(m_searchInput->getString());
|
m_source->search(m_searchInput->getString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -550,6 +566,7 @@ void ModList::updateTopContainer() {
|
||||||
|
|
||||||
void ModList::updateDisplay(ModListDisplay display) {
|
void ModList::updateDisplay(ModListDisplay display) {
|
||||||
m_display = display;
|
m_display = display;
|
||||||
|
m_source->setPageSize(getDisplayPageSize(m_source, m_display));
|
||||||
|
|
||||||
// Update all BaseModItems that are children of the list
|
// Update all BaseModItems that are children of the list
|
||||||
// There may be non-BaseModItems there (like separators) so gotta be type-safe
|
// There may be non-BaseModItems there (like separators) so gotta be type-safe
|
||||||
|
@ -570,7 +587,7 @@ void ModList::updateDisplay(ModListDisplay display) {
|
||||||
m_list->m_contentLayer->setLayout(
|
m_list->m_contentLayer->setLayout(
|
||||||
RowLayout::create()
|
RowLayout::create()
|
||||||
->setGrowCrossAxis(true)
|
->setGrowCrossAxis(true)
|
||||||
->setAxisAlignment(AxisAlignment::Center)
|
->setAxisAlignment(AxisAlignment::Start)
|
||||||
->setGap(2.5f)
|
->setGap(2.5f)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -634,6 +651,9 @@ void ModList::gotoPage(size_t page, bool update) {
|
||||||
// Clear list contents
|
// Clear list contents
|
||||||
m_list->m_contentLayer->removeAllChildren();
|
m_list->m_contentLayer->removeAllChildren();
|
||||||
m_page = page;
|
m_page = page;
|
||||||
|
|
||||||
|
// Update page size (if needed)
|
||||||
|
m_source->setPageSize(getDisplayPageSize(m_source, m_display));
|
||||||
|
|
||||||
// Start loading new page with generic loading message
|
// Start loading new page with generic loading message
|
||||||
this->showStatus(ModListUnkProgressStatus(), "Loading...");
|
this->showStatus(ModListUnkProgressStatus(), "Loading...");
|
||||||
|
|
|
@ -137,11 +137,8 @@ bool InstalledModListSource::isDefaultQuery() const {
|
||||||
return m_query.isDefault();
|
return m_query.isDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
$execute {
|
bool InstalledModListSource::isLocalModsOnly() const {
|
||||||
listenForSettingChanges("infinite-local-mods-list", [](bool value) {
|
return m_type == InstalledModListType::All ||
|
||||||
auto size = value ? std::numeric_limits<size_t>::max() : 10;
|
m_type == InstalledModListType::OnlyErrors ||
|
||||||
InstalledModListSource::get(InstalledModListType::All)->setPageSize(size);
|
m_type == InstalledModListType::OnlyOutdated;
|
||||||
InstalledModListSource::get(InstalledModListType::OnlyErrors)->setPageSize(size);
|
|
||||||
// Updates is technically a server mod list :-) So I left it out here
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,8 +62,10 @@ std::optional<size_t> ModListSource::getItemCount() const {
|
||||||
return m_cachedItemCount;
|
return m_cachedItemCount;
|
||||||
}
|
}
|
||||||
void ModListSource::setPageSize(size_t size) {
|
void ModListSource::setPageSize(size_t size) {
|
||||||
m_pageSize = size;
|
if (m_pageSize != size) {
|
||||||
this->reset();
|
m_pageSize = size;
|
||||||
|
this->reset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModListSource::reset() {
|
void ModListSource::reset() {
|
||||||
|
|
|
@ -77,6 +77,8 @@ public:
|
||||||
std::optional<size_t> getPageCount() const;
|
std::optional<size_t> getPageCount() const;
|
||||||
std::optional<size_t> getItemCount() const;
|
std::optional<size_t> getItemCount() const;
|
||||||
void setPageSize(size_t size);
|
void setPageSize(size_t size);
|
||||||
|
|
||||||
|
virtual bool isLocalModsOnly() const = 0;
|
||||||
|
|
||||||
static void clearAllCaches();
|
static void clearAllCaches();
|
||||||
};
|
};
|
||||||
|
@ -139,6 +141,8 @@ public:
|
||||||
InstalledModsQuery const& getQuery() const;
|
InstalledModsQuery const& getQuery() const;
|
||||||
InvalidateQueryAfter<InstalledModsQuery> getQueryMut();
|
InvalidateQueryAfter<InstalledModsQuery> getQueryMut();
|
||||||
bool isDefaultQuery() const override;
|
bool isDefaultQuery() const override;
|
||||||
|
|
||||||
|
bool isLocalModsOnly() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class ServerModListType {
|
enum class ServerModListType {
|
||||||
|
@ -171,6 +175,8 @@ public:
|
||||||
bool isDefaultQuery() const override;
|
bool isDefaultQuery() const override;
|
||||||
server::ModsQuery createDefaultQuery() const;
|
server::ModsQuery createDefaultQuery() const;
|
||||||
ServerModListType getType() const;
|
ServerModListType getType() const;
|
||||||
|
|
||||||
|
bool isLocalModsOnly() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ModPackListSource : public ModListSource {
|
class ModPackListSource : public ModListSource {
|
||||||
|
@ -187,6 +193,8 @@ public:
|
||||||
std::unordered_set<std::string> getModTags() const override;
|
std::unordered_set<std::string> getModTags() const override;
|
||||||
void setModTags(std::unordered_set<std::string> const& tags) override;
|
void setModTags(std::unordered_set<std::string> const& tags) override;
|
||||||
bool isDefaultQuery() const override;
|
bool isDefaultQuery() const override;
|
||||||
|
|
||||||
|
bool isLocalModsOnly() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool weightedFuzzyMatch(std::string const& str, std::string const& kw, double weight, double& out);
|
bool weightedFuzzyMatch(std::string const& str, std::string const& kw, double weight, double& out);
|
||||||
|
|
|
@ -21,3 +21,7 @@ void ModPackListSource::setModTags(std::unordered_set<std::string> const& set) {
|
||||||
bool ModPackListSource::isDefaultQuery() const {
|
bool ModPackListSource::isDefaultQuery() const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ModPackListSource::isLocalModsOnly() const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
@ -115,3 +115,7 @@ server::ModsQuery ServerModListSource::createDefaultQuery() const {
|
||||||
ServerModListType ServerModListSource::getType() const {
|
ServerModListType ServerModListSource::getType() const {
|
||||||
return m_type;
|
return m_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ServerModListSource::isLocalModsOnly() const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|