mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-11-26 06:09:02 +00:00
Merge branch 'rewrite/master' into bugfix/weekend-1-bug-fixes
This commit is contained in:
commit
93ae7692c8
135
.github/actions/setup-haxe/action.yml
vendored
Normal file
135
.github/actions/setup-haxe/action.yml
vendored
Normal file
|
|
@ -0,0 +1,135 @@
|
||||||
|
name: setup-haxeshit
|
||||||
|
description: "sets up haxe shit, using HMM!"
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
haxe:
|
||||||
|
description: 'Version of haxe to install'
|
||||||
|
required: true
|
||||||
|
default: '4.3.4'
|
||||||
|
hxcpp-cache:
|
||||||
|
description: 'Whether to use a shared hxcpp compile cache'
|
||||||
|
required: true
|
||||||
|
default: 'true'
|
||||||
|
hxcpp-cache-path:
|
||||||
|
description: 'Path to create hxcpp cache in'
|
||||||
|
required: true
|
||||||
|
default: ${{ runner.temp }}/hxcpp_cache
|
||||||
|
targets:
|
||||||
|
description: 'Targets we plan to compile to. Installs native dependencies needed.'
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Setup timers
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "TIMER_HAXE=$(date +%s)" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Install Haxe
|
||||||
|
uses: funkincrew/ci-haxe@v3.1.0
|
||||||
|
with:
|
||||||
|
haxe-version: ${{ inputs.haxe }}
|
||||||
|
|
||||||
|
- name: Install native dependencies
|
||||||
|
if: ${{ runner.os == 'Linux' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
ls -lah /usr/lib/x86_64-linux-gnu/
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y \
|
||||||
|
g++ \
|
||||||
|
libx11-dev libxi-dev libxext-dev libxinerama-dev libxrandr-dev \
|
||||||
|
libgl-dev libgl1-mesa-dev \
|
||||||
|
libasound2-dev
|
||||||
|
ln -s /usr/lib/x86_64-linux-gnu/libffi.so.8 /usr/lib/x86_64-linux-gnu/libffi.so.6 || true
|
||||||
|
- name: Install linux-specific dependencies
|
||||||
|
if: ${{ runner.os == 'Linux' && contains(inputs.targets, 'linux') }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
apt-get install -y libvlc-dev libvlccore-dev
|
||||||
|
|
||||||
|
- name: Config haxelib
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "TIMER_HAXELIB=$(date +%s)" >> "$GITHUB_ENV"
|
||||||
|
haxelib --debug --never install haxelib 4.1.0 --global
|
||||||
|
haxelib --debug --never deleterepo || true
|
||||||
|
haxelib --debug --never newrepo
|
||||||
|
echo "HAXEPATH=$(haxelib config)" >> "$GITHUB_ENV"
|
||||||
|
haxelib --debug --never git haxelib https://github.com/HaxeFoundation/haxelib.git master
|
||||||
|
haxelib --debug --global install hmm
|
||||||
|
echo "TIMER_DEPS=$(date +%s)" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Restore cached dependencies
|
||||||
|
id: cache-hmm
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: .haxelib
|
||||||
|
key: haxe-hmm-${{ runner.os }}-${{ hashFiles('**/hmm.json') }}
|
||||||
|
|
||||||
|
- if: ${{ steps.cache-hmm.outputs.cache-hit != 'true' }}
|
||||||
|
name: Install dependencies
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
haxelib --debug --global run hmm install
|
||||||
|
echo "TIMER_DONE=$(date +%s)" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
# by default use a shared hxcpp cache
|
||||||
|
- if: ${{ inputs.hxcpp-cache == 'true' }}
|
||||||
|
name: Restore hxcpp cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ inputs.hxcpp-cache-path }}
|
||||||
|
key: haxe-hxcpp-${{ runner.os }}-${{ github.ref_name }}-${{ github.sha }}
|
||||||
|
restore-keys: haxe-hxcpp-${{ runner.os }}-${{ github.ref_name }}
|
||||||
|
# export env for it to reuse in builds
|
||||||
|
- if: ${{ inputs.hxcpp-cache == 'true' }}
|
||||||
|
name: Persist env for hxcpp cache
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "HXCPP_COMPILE_CACHE=${{ inputs.hxcpp-cache-path }}" >> "$GITHUB_ENV"
|
||||||
|
echo 'HXCPP_CACHE_MB="4096"' >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
# if it's explicitly disabled, still cache export/ since that then contains the builds
|
||||||
|
- if: ${{ inputs.hxcpp-cache != 'true' }}
|
||||||
|
name: Restore export cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ inputs.hxcpp-cache-path }}
|
||||||
|
key: haxe-export-${{ runner.os }}-${{ github.ref_name }}-${{ github.sha }}
|
||||||
|
restore-keys: haxe-export-${{ runner.os }}-${{ github.ref_name }}
|
||||||
|
|
||||||
|
- name: Print debug info
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cat << EOF
|
||||||
|
runner:
|
||||||
|
kernel: $(uname -a)
|
||||||
|
haxe:
|
||||||
|
version: $(haxe -version)
|
||||||
|
which: $(which haxe)
|
||||||
|
haxepath: $HAXEPATH
|
||||||
|
took: $((TIMER_HAXELIB - TIMER_HAXE))s
|
||||||
|
haxelib:
|
||||||
|
version: $(haxelib version)
|
||||||
|
which: $(which haxelib)
|
||||||
|
local:
|
||||||
|
config: $(haxelib config)
|
||||||
|
path: $(haxelib path haxelib || true)
|
||||||
|
global
|
||||||
|
config: $(haxelib config --global)
|
||||||
|
path: $(haxelib path haxelib --global || true)
|
||||||
|
system
|
||||||
|
version: $(haxelib --system version)
|
||||||
|
local:
|
||||||
|
config: $(haxelib --system config)
|
||||||
|
global:
|
||||||
|
config: $(haxelib --system config --global)
|
||||||
|
took: $((TIMER_DEPS - TIMER_HAXELIB))s
|
||||||
|
deps:
|
||||||
|
took: $((TIMER_DONE - TIMER_DEPS))s
|
||||||
|
hxcpp_cache: |
|
||||||
|
$(haxelib run hxcpp cache list || true)
|
||||||
|
EOF
|
||||||
55
.github/actions/setup-haxeshit/action.yml
vendored
55
.github/actions/setup-haxeshit/action.yml
vendored
|
|
@ -1,55 +0,0 @@
|
||||||
name: setup-haxeshit
|
|
||||||
description: "sets up haxe shit, using HMM!"
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Install Haxe lol
|
|
||||||
uses: funkincrew/ci-haxe@v3.1.0
|
|
||||||
with:
|
|
||||||
haxe-version: 4.3.3
|
|
||||||
- name: Config haxelib
|
|
||||||
run: |
|
|
||||||
haxelib --never install haxelib 4.1.0 --global
|
|
||||||
haxelib --never deleterepo || true
|
|
||||||
haxelib --never newrepo
|
|
||||||
echo "HAXEPATH=$(haxelib config)" >> "$GITHUB_ENV"
|
|
||||||
haxelib --never git haxelib https://github.com/HaxeFoundation/haxelib.git master
|
|
||||||
shell: bash
|
|
||||||
- name: Gather debug info
|
|
||||||
run: |
|
|
||||||
cat << EOF >> "$GITHUB_STEP_SUMMARY"
|
|
||||||
## haxe
|
|
||||||
- version: \`$(haxe -version)\`
|
|
||||||
- exe: \`$(which haxe)\`
|
|
||||||
## haxelib
|
|
||||||
- version: \`$(haxelib version)\`
|
|
||||||
- exe: \`$(which haxelib)\`
|
|
||||||
- path: \`$HAXEPATH\`
|
|
||||||
### local
|
|
||||||
- config: \`$(haxelib config)\`
|
|
||||||
- path: \`$(haxelib path haxelib || true)\`
|
|
||||||
### global
|
|
||||||
- config: \`$(haxelib config --global)\`
|
|
||||||
- path: \`$(haxelib path haxelib --global || true)\`
|
|
||||||
### system
|
|
||||||
- version: \`$(haxelib --system version)\`
|
|
||||||
- local: \`$(haxelib --system config)\`
|
|
||||||
- global: \`$(haxelib --system config --global)\`
|
|
||||||
EOF
|
|
||||||
shell: bash
|
|
||||||
- name: Install hmm
|
|
||||||
# hmm only supports global installs
|
|
||||||
run: |
|
|
||||||
haxelib --global install hmm
|
|
||||||
shell: bash
|
|
||||||
- name: Restore cached dependencies
|
|
||||||
id: cache-hmm
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: .haxelib
|
|
||||||
key: ${{ runner.os }}-hmm-${{ hashFiles('**/hmm.json') }}
|
|
||||||
- if: ${{ steps.cache-hmm.outputs.cache-hit != 'true' }}
|
|
||||||
name: hmm install
|
|
||||||
run: |
|
|
||||||
haxelib --global run hmm install
|
|
||||||
shell: bash
|
|
||||||
126
.github/actions/upload-itch/action.yml
vendored
126
.github/actions/upload-itch/action.yml
vendored
|
|
@ -1,44 +1,124 @@
|
||||||
name: upload-itch
|
name: upload-itch
|
||||||
description: "installs Butler, and uploads to itch.io!"
|
description: "installs Butler, and uploads to itch.io!"
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
butler-key:
|
butler-key:
|
||||||
description: "Butler API secret key"
|
description: "Butler API secret key"
|
||||||
required: true
|
required: true
|
||||||
|
itch-repo:
|
||||||
|
description: "Where to upload the game to"
|
||||||
|
required: true
|
||||||
|
default: "ninja-muffin24/funkin-secret"
|
||||||
build-dir:
|
build-dir:
|
||||||
description: "Directory of the game build"
|
description: "Directory of the game build"
|
||||||
required: true
|
required: false
|
||||||
target:
|
target:
|
||||||
description: "Target (html5, win, linux, mac)"
|
description: "Target (html5, windows, linux, macos)"
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Install butler Windows
|
|
||||||
if: runner.os == 'Windows'
|
# RUNNER_OS = Windows | macOS | Linux
|
||||||
run: |
|
# TARGET_BUILD = windows | macos | linux
|
||||||
curl -L -o butler.zip https://broth.itch.ovh/butler/windows-amd64/LATEST/archive/default
|
# TARGET_ITCH = win | macos | linux
|
||||||
7z x butler.zip
|
# TARGET_BUTLER_DOWNLOAD = windows-amd64 | darwin-amd64 | linux-amd64
|
||||||
./butler -v
|
- name: Setup variables
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Install butler Mac
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
run: |
|
run: |
|
||||||
curl -L -o butler.zip https://broth.itch.ovh/butler/darwin-amd64/LATEST/archive/default
|
TARGET_OS=${{ inputs.target }}
|
||||||
unzip butler.zip
|
RUNNER=${RUNNER_OS@L}
|
||||||
./butler -V
|
TARGET=${TARGET_OS@L}
|
||||||
|
case "$TARGET" in
|
||||||
|
"windows")
|
||||||
|
TARGET_ITCH=win
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
TARGET_ITCH=$TARGET
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
case "$RUNNER" in
|
||||||
|
"macos")
|
||||||
|
OS_NODE=darwin
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
OS_NODE=$RUNNER
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
BUTLER_PATH=$RUNNER_TEMP/butler
|
||||||
|
|
||||||
|
echo BUILD_DIR="export/release/$TARGET/bin" >> "$GITHUB_ENV"
|
||||||
|
echo ITCH_TAG=${{ inputs.itch-repo }}:$TARGET_ITCH-$GITHUB_REF_NAME >> "$GITHUB_ENV"
|
||||||
|
echo OS_AND_ARCH=$OS_NODE-amd64 >> "$GITHUB_ENV"
|
||||||
|
echo BUTLER_API_KEY=${{ inputs.butler-key }} >> "$GITHUB_ENV"
|
||||||
|
echo BUTLER_INSTALL_PATH=$BUTLER_PATH >> "$GITHUB_ENV"
|
||||||
|
echo TIMER_BUTLER=$(date +%s) >> "$GITHUB_ENV"
|
||||||
|
echo TARGET_ITCH=$TARGET_ITCH >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
echo "$BUTLER_PATH" >> "$GITHUB_PATH"
|
||||||
|
|
||||||
|
- name: Get latest butler version
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Install butler Linux
|
|
||||||
if: runner.os == 'Linux'
|
|
||||||
run: |
|
run: |
|
||||||
curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
|
LATEST=$(curl -sfL https://broth.itch.ovh/butler/$OS_AND_ARCH/LATEST)
|
||||||
|
echo BUTLER_LATEST=$LATEST >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
command -v butler \
|
||||||
|
&& echo BUTLER_CURRENT=$(butler -V 2>&1 | cut -d ',' -f 1) >> "$GITHUB_ENV" \
|
||||||
|
|| echo BUTLER_CURRENT=none >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Try to get butler from cache
|
||||||
|
id: cache-butler
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.BUTLER_INSTALL_PATH }}
|
||||||
|
key: butler-${{ runner.os }}-${{ env.BUTLER_LATEST }}
|
||||||
|
|
||||||
|
- if: steps.cache-butler.outputs.cache-hit == 'true'
|
||||||
|
name: Make sure butler is executable
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
chmod +x $BUTLER_INSTALL_PATH/butler
|
||||||
|
|
||||||
|
- if: steps.cache-butler.outputs.cache-hit != 'true'
|
||||||
|
name: Install butler
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p $BUTLER_INSTALL_PATH
|
||||||
|
cd $BUTLER_INSTALL_PATH
|
||||||
|
|
||||||
|
curl -L -o butler.zip https://broth.itch.ovh/butler/$OS_AND_ARCH/LATEST/archive/default
|
||||||
unzip butler.zip
|
unzip butler.zip
|
||||||
chmod +x butler
|
chmod +x butler
|
||||||
./butler -V
|
|
||||||
shell: bash
|
|
||||||
- name: Upload game to itch.io
|
- name: Upload game to itch.io
|
||||||
env:
|
|
||||||
BUTLER_API_KEY: ${{inputs.butler-key}}
|
|
||||||
run: |
|
|
||||||
./butler login
|
|
||||||
./butler push ${{inputs.build-dir}} ninja-muffin24/funkin-secret:${{inputs.target}}-${GITHUB_REF_NAME}
|
|
||||||
shell: bash
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "TIMER_UPLOAD=$(date +%s)" >> "$GITHUB_ENV"
|
||||||
|
butler login
|
||||||
|
butler push $BUILD_DIR $ITCH_TAG
|
||||||
|
echo "TIMER_DONE=$(date +%s)" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Print debug info
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cat << EOF
|
||||||
|
butler:
|
||||||
|
version: $(
|
||||||
|
if [[ "$BUTLER_CURRENT" == "$BUTLER_LATEST" ]]
|
||||||
|
then
|
||||||
|
echo $BUTLER_CURRENT
|
||||||
|
else
|
||||||
|
echo $BUTLER_CURRENT -> $BUTLER_LATEST
|
||||||
|
fi
|
||||||
|
)
|
||||||
|
install:
|
||||||
|
took: $(($TIMER_UPLOAD-$TIMER_BUTLER))s
|
||||||
|
upload:
|
||||||
|
tag: $TARGET_ITCH/$GITHUB_REF_NAME
|
||||||
|
took: $(($TIMER_DONE-$TIMER_UPLOAD))s
|
||||||
|
EOF
|
||||||
|
cat << EOF >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
### open in launcher: [$TARGET_ITCH/$GITHUB_REF_NAME](https://run.funkin.me/$TARGET_ITCH/$GITHUB_REF_NAME)
|
||||||
|
EOF
|
||||||
|
|
|
||||||
53
.github/workflows/build-docker-image.yml
vendored
Normal file
53
.github/workflows/build-docker-image.yml
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
name: Create and publish Docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- '**/Dockerfile'
|
||||||
|
- '.github/workflows/build-docker-image.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push-image:
|
||||||
|
runs-on: build-set
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Get checkout token
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
id: app_token
|
||||||
|
with:
|
||||||
|
app-id: ${{ vars.APP_ID }}
|
||||||
|
private-key: ${{ secrets.APP_PEM }}
|
||||||
|
owner: ${{ github.repository_owner }}
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: funkincrew/ci-checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: false
|
||||||
|
token: ${{ steps.app_token.outputs.token }}
|
||||||
|
|
||||||
|
- name: Log into GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3.1.0
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5.3.0
|
||||||
|
with:
|
||||||
|
context: ./build
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
ghcr.io/funkincrew/build-dependencies:latest
|
||||||
|
ghcr.io/funkincrew/build-dependencies:${{ github.sha }}
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.description=precooked haxe build-dependencies
|
||||||
|
org.opencontainers.image.revision=${{ github.sha }}
|
||||||
|
org.opencontainers.image.source=https://github.com/${{ github.repository }}
|
||||||
|
org.opencontainers.image.title=${{ github.repository_owner }}/build-dependencies
|
||||||
|
org.opencontainers.image.url=https://github.com/${{ github.repository }}
|
||||||
|
org.opencontainers.image.version=${{ github.sha }}
|
||||||
125
.github/workflows/build-game.yml
vendored
Normal file
125
.github/workflows/build-game.yml
vendored
Normal file
|
|
@ -0,0 +1,125 @@
|
||||||
|
name: Build and Upload nightly game builds
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths-ignore:
|
||||||
|
- '**/Dockerfile'
|
||||||
|
- '.github/workflows/build-docker-image.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build-game-on-host:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- target: windows
|
||||||
|
- target: macos
|
||||||
|
runs-on:
|
||||||
|
- ${{ matrix.target }}
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Make git happy
|
||||||
|
if: ${{ matrix.target == 'macos' }}
|
||||||
|
run: |
|
||||||
|
git config --global --add safe.directory $GITHUB_WORKSPACE
|
||||||
|
|
||||||
|
- name: Get checkout token
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
id: app_token
|
||||||
|
with:
|
||||||
|
app-id: ${{ vars.APP_ID }}
|
||||||
|
private-key: ${{ secrets.APP_PEM }}
|
||||||
|
owner: ${{ github.repository_owner }}
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: funkincrew/ci-checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: 'recursive'
|
||||||
|
token: ${{ steps.app_token.outputs.token }}
|
||||||
|
|
||||||
|
- name: Setup build environment
|
||||||
|
uses: ./.github/actions/setup-haxe
|
||||||
|
|
||||||
|
- name: Build game
|
||||||
|
if: ${{ matrix.target == 'windows' }}
|
||||||
|
run: |
|
||||||
|
haxelib run lime build windows -v -release -DGITHUB_BUILD
|
||||||
|
timeout-minutes: 120
|
||||||
|
- name: Build game
|
||||||
|
if: ${{ matrix.target != 'windows' }}
|
||||||
|
run: |
|
||||||
|
haxelib run lime build ${{ matrix.target }} -v -release --times -DGITHUB_BUILD
|
||||||
|
timeout-minutes: 120
|
||||||
|
|
||||||
|
- name: Upload build artifacts
|
||||||
|
uses: ./.github/actions/upload-itch
|
||||||
|
with:
|
||||||
|
butler-key: ${{ secrets.BUTLER_API_KEY}}
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
|
||||||
|
build-game-in-container:
|
||||||
|
runs-on: build-set
|
||||||
|
container: ghcr.io/funkincrew/build-dependencies:latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- target: linux
|
||||||
|
- target: html5
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Get checkout token
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
id: app_token
|
||||||
|
with:
|
||||||
|
app-id: ${{ vars.APP_ID }}
|
||||||
|
private-key: ${{ secrets.APP_PEM }}
|
||||||
|
owner: ${{ github.repository_owner }}
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: funkincrew/ci-checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: 'recursive'
|
||||||
|
token: ${{ steps.app_token.outputs.token }}
|
||||||
|
|
||||||
|
- name: Config haxelib
|
||||||
|
run: |
|
||||||
|
haxelib --never newrepo
|
||||||
|
echo "HAXEPATH=$(haxelib config)" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Restore cached dependencies
|
||||||
|
id: cache-hmm
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: .haxelib
|
||||||
|
key: haxe-hmm-${{ runner.os }}-${{ hashFiles('**/hmm.json') }}
|
||||||
|
|
||||||
|
- if: ${{ steps.cache-hmm.outputs.cache-hit != 'true' }}
|
||||||
|
name: Install dependencies
|
||||||
|
run: |
|
||||||
|
haxelib --global run hmm install
|
||||||
|
|
||||||
|
- if: ${{ matrix.target != 'html5' }}
|
||||||
|
name: Restore hxcpp cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /usr/share/hxcpp
|
||||||
|
key: haxe-hxcpp-${{ runner.os }}-${{ github.ref_name }}-${{ github.sha }}
|
||||||
|
restore-keys: haxe-hxcpp-${{ runner.os }}-${{ github.ref_name }}
|
||||||
|
|
||||||
|
- name: Build game
|
||||||
|
run: |
|
||||||
|
haxelib run lime build ${{ matrix.target }} -v -release --times -DGITHUB_BUILD
|
||||||
|
timeout-minutes: 120
|
||||||
|
|
||||||
|
- name: Upload build artifacts
|
||||||
|
uses: ./.github/actions/upload-itch
|
||||||
|
with:
|
||||||
|
butler-key: ${{ secrets.BUTLER_API_KEY}}
|
||||||
|
target: ${{ matrix.target }}
|
||||||
136
.github/workflows/build-shit.yml
vendored
136
.github/workflows/build-shit.yml
vendored
|
|
@ -1,136 +0,0 @@
|
||||||
name: build-upload
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
create-nightly-html5:
|
|
||||||
runs-on: [self-hosted, linux]
|
|
||||||
container: ubuntu:23.10
|
|
||||||
steps:
|
|
||||||
- name: Install tools missing in container
|
|
||||||
run: |
|
|
||||||
apt update
|
|
||||||
apt install -y sudo git curl unzip
|
|
||||||
- name: Fix git config on posix runner
|
|
||||||
# this can't be {{ github.workspace }} because that's not docker-aware
|
|
||||||
run: |
|
|
||||||
git config --global --add safe.directory $GITHUB_WORKSPACE
|
|
||||||
- name: Get checkout token
|
|
||||||
uses: actions/create-github-app-token@v1
|
|
||||||
id: app_token
|
|
||||||
with:
|
|
||||||
app-id: ${{ vars.APP_ID }}
|
|
||||||
private-key: ${{ secrets.APP_PEM }}
|
|
||||||
owner: ${{ github.repository_owner }}
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: funkincrew/ci-checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: 'recursive'
|
|
||||||
token: ${{ steps.app_token.outputs.token }}
|
|
||||||
- name: Install Haxe, dependencies
|
|
||||||
uses: ./.github/actions/setup-haxeshit
|
|
||||||
- name: Install native dependencies
|
|
||||||
run: |
|
|
||||||
apt install -y \
|
|
||||||
libx11-dev libxi-dev libxext-dev libxinerama-dev libxrandr-dev \
|
|
||||||
libgl-dev libgl1-mesa-dev \
|
|
||||||
libasound2-dev
|
|
||||||
- name: Build game
|
|
||||||
run: |
|
|
||||||
haxelib run lime build html5 -release --times -DGITHUB_BUILD
|
|
||||||
- name: Upload build artifacts
|
|
||||||
uses: ./.github/actions/upload-itch
|
|
||||||
with:
|
|
||||||
butler-key: ${{ secrets.BUTLER_API_KEY}}
|
|
||||||
build-dir: export/release/html5/bin
|
|
||||||
target: html5
|
|
||||||
create-nightly-win:
|
|
||||||
runs-on: [self-hosted, windows]
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
steps:
|
|
||||||
- name: Get checkout token
|
|
||||||
uses: actions/create-github-app-token@v1
|
|
||||||
id: app_token
|
|
||||||
with:
|
|
||||||
app-id: ${{ vars.APP_ID }}
|
|
||||||
private-key: ${{ secrets.APP_PEM }}
|
|
||||||
owner: ${{ github.repository_owner }}
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: funkincrew/ci-checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: 'recursive'
|
|
||||||
token: ${{ steps.app_token.outputs.token }}
|
|
||||||
- name: Install Haxe, dependencies
|
|
||||||
uses: ./.github/actions/setup-haxeshit
|
|
||||||
- name: Setup build cache
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ runner.temp }}/hxcpp_cache
|
|
||||||
- name: Restore build cache
|
|
||||||
id: cache-build-win
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
export
|
|
||||||
${{ runner.temp }}/hxcpp_cache
|
|
||||||
key: ${{ runner.os }}-build-win-${{ github.ref_name }}
|
|
||||||
- name: Build game
|
|
||||||
run: |
|
|
||||||
haxelib run lime build windows -v -release -DGITHUB_BUILD
|
|
||||||
env:
|
|
||||||
HXCPP_COMPILE_CACHE: "${{ runner.temp }}\\hxcpp_cache"
|
|
||||||
- name: Upload build artifacts
|
|
||||||
uses: ./.github/actions/upload-itch
|
|
||||||
with:
|
|
||||||
butler-key: ${{ secrets.BUTLER_API_KEY }}
|
|
||||||
build-dir: export/release/windows/bin
|
|
||||||
target: win
|
|
||||||
create-nightly-mac:
|
|
||||||
runs-on: [self-hosted, macos]
|
|
||||||
steps:
|
|
||||||
- name: Fix git config on posix runner
|
|
||||||
# this can't be {{ github.workspace }} because that's not docker-aware
|
|
||||||
run: |
|
|
||||||
git config --global --add safe.directory $GITHUB_WORKSPACE
|
|
||||||
- name: Get checkout token
|
|
||||||
uses: actions/create-github-app-token@v1
|
|
||||||
id: app_token
|
|
||||||
with:
|
|
||||||
app-id: ${{ vars.APP_ID }}
|
|
||||||
private-key: ${{ secrets.APP_PEM }}
|
|
||||||
owner: ${{ github.repository_owner }}
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: funkincrew/ci-checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: 'recursive'
|
|
||||||
token: ${{ steps.app_token.outputs.token }}
|
|
||||||
- name: Install Haxe, dependencies
|
|
||||||
uses: ./.github/actions/setup-haxeshit
|
|
||||||
- name: Setup build cache
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ runner.temp }}/hxcpp_cache
|
|
||||||
- name: Restore build cache
|
|
||||||
id: cache-build-win
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
export
|
|
||||||
${{ runner.temp }}/hxcpp_cache
|
|
||||||
key: ${{ runner.os }}-build-mac-${{ github.ref_name }}
|
|
||||||
- name: Build game
|
|
||||||
run: |
|
|
||||||
haxelib run lime build macos -release --times -DGITHUB_BUILD
|
|
||||||
env:
|
|
||||||
HXCPP_COMPILE_CACHE: "${{ runner.temp }}/hxcpp_cache"
|
|
||||||
- name: Upload build artifacts
|
|
||||||
uses: ./.github/actions/upload-itch
|
|
||||||
with:
|
|
||||||
butler-key: ${{ secrets.BUTLER_API_KEY}}
|
|
||||||
build-dir: export/release/macos/bin
|
|
||||||
target: macos
|
|
||||||
11
.github/workflows/cancel-merged-branches.yml
vendored
11
.github/workflows/cancel-merged-branches.yml
vendored
|
|
@ -1,18 +1,21 @@
|
||||||
name: cancel-merged-branches
|
name: Cancel queued workflows on PR merge
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- closed
|
- closed
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
cancel_stuff:
|
cancel_stuff:
|
||||||
if: github.event.pull_request.merged == true
|
if: github.event.pull_request.merged == true
|
||||||
runs-on: ubuntu-latest
|
runs-on: build-set
|
||||||
permissions:
|
permissions:
|
||||||
actions: write
|
actions: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/github-script@v7
|
- name: Cancel queued workflows for ${{ github.event.pull_request.head.ref }}
|
||||||
id: cancel-runs
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
result-encoding: string
|
result-encoding: string
|
||||||
retries: 3
|
retries: 3
|
||||||
|
|
|
||||||
10
.vscode/settings.json
vendored
10
.vscode/settings.json
vendored
|
|
@ -96,6 +96,11 @@
|
||||||
"target": "windows",
|
"target": "windows",
|
||||||
"args": ["-debug", "-DFORCE_DEBUG_VERSION"]
|
"args": ["-debug", "-DFORCE_DEBUG_VERSION"]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "Linux / Debug",
|
||||||
|
"target": "linux",
|
||||||
|
"args": ["-debug", "-DFORCE_DEBUG_VERSION"]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "HashLink / Debug",
|
"label": "HashLink / Debug",
|
||||||
"target": "hl",
|
"target": "hl",
|
||||||
|
|
@ -130,6 +135,11 @@
|
||||||
"-DFORCE_DEBUG_VERSION"
|
"-DFORCE_DEBUG_VERSION"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "Windows / Debug (Straight to Play - 2hot)",
|
||||||
|
"target": "windows",
|
||||||
|
"args": ["-debug", "-DSONG=2hot", "-DFORCE_DEBUG_VERSION"]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "HashLink / Debug (Straight to Play - Bopeebo Normal)",
|
"label": "HashLink / Debug (Straight to Play - Bopeebo Normal)",
|
||||||
"target": "hl",
|
"target": "hl",
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@
|
||||||
<library name="week6" preload="true" />
|
<library name="week6" preload="true" />
|
||||||
<library name="week7" preload="true" />
|
<library name="week7" preload="true" />
|
||||||
<library name="weekend1" preload="true" />
|
<library name="weekend1" preload="true" />
|
||||||
|
<library name="videos" preload="true" />
|
||||||
</section>
|
</section>
|
||||||
<section if="NO_PRELOAD_ALL">
|
<section if="NO_PRELOAD_ALL">
|
||||||
<library name="songs" preload="false" />
|
<library name="songs" preload="false" />
|
||||||
|
|
@ -58,10 +59,13 @@
|
||||||
<library name="week6" preload="false" />
|
<library name="week6" preload="false" />
|
||||||
<library name="week7" preload="false" />
|
<library name="week7" preload="false" />
|
||||||
<library name="weekend1" preload="false" />
|
<library name="weekend1" preload="false" />
|
||||||
|
<library name="videos" preload="false" />
|
||||||
</section>
|
</section>
|
||||||
<library name="art" preload="false" />
|
<library name="art" preload="false" />
|
||||||
<assets path="assets/songs" library="songs" exclude="*.fla|*.ogg|*.wav" if="web" />
|
<assets path="assets/songs" library="songs" exclude="*.fla|*.ogg|*.wav" if="web" />
|
||||||
<assets path="assets/songs" library="songs" exclude="*.fla|*.mp3|*.wav" unless="web" />
|
<assets path="assets/songs" library="songs" exclude="*.fla|*.mp3|*.wav" unless="web" />
|
||||||
|
<!-- Videos go in their own library because web never needs to preload them, they can just be streamed. -->
|
||||||
|
<assets path="assets/videos" library="videos" />
|
||||||
<assets path="assets/shared" library="shared" exclude="*.fla|*.ogg|*.wav" if="web" />
|
<assets path="assets/shared" library="shared" exclude="*.fla|*.ogg|*.wav" if="web" />
|
||||||
<assets path="assets/shared" library="shared" exclude="*.fla|*.mp3|*.wav" unless="web" />
|
<assets path="assets/shared" library="shared" exclude="*.fla|*.mp3|*.wav" unless="web" />
|
||||||
<assets path="assets/tutorial" library="tutorial" exclude="*.fla|*.ogg|*.wav" if="web" />
|
<assets path="assets/tutorial" library="tutorial" exclude="*.fla|*.ogg|*.wav" if="web" />
|
||||||
|
|
|
||||||
2
assets
2
assets
|
|
@ -1 +1 @@
|
||||||
Subproject commit 39c22184988e1b22bd63b07d83c30ece588e85df
|
Subproject commit 837a8639bd7abe4aa8786dc3790e8d4576f04f28
|
||||||
185
build/Dockerfile
Normal file
185
build/Dockerfile
Normal file
|
|
@ -0,0 +1,185 @@
|
||||||
|
FROM ubuntu:mantic
|
||||||
|
|
||||||
|
ARG haxe_version=4.3.4
|
||||||
|
ARG haxelib_version=4.1.0
|
||||||
|
ARG neko_version=2.3.0
|
||||||
|
|
||||||
|
# prepare runner
|
||||||
|
ENV GITHUB_HOME="/github/home"
|
||||||
|
|
||||||
|
RUN <<EOF
|
||||||
|
mkdir -p "$GITHUB_HOME"
|
||||||
|
mkdir -p /opt
|
||||||
|
mkdir -p /usr/share/hxcpp
|
||||||
|
mkdir -p /usr/local/bin
|
||||||
|
chmod -R 777 /opt
|
||||||
|
chmod -R 777 /usr/share
|
||||||
|
chmod -R 777 /usr/local/bin
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
# Prepare Ubuntu
|
||||||
|
# https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/configure-environment.sh
|
||||||
|
# https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/configure-system.sh
|
||||||
|
RUN <<EOF
|
||||||
|
echo 'vm.max_map_count=262144' | tee -a /etc/sysctl.conf
|
||||||
|
echo 'fs.inotify.max_user_watches=655360' | tee -a /etc/sysctl.conf
|
||||||
|
echo 'fs.inotify.max_user_instances=1280' | tee -a /etc/sysctl.conf
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND="noninteractive"
|
||||||
|
|
||||||
|
# Prepare APT
|
||||||
|
RUN <<EOF
|
||||||
|
cat <<EOC >> /etc/apt/apt.conf.d/10apt-autoremove
|
||||||
|
APT::Get::AutomaticRemove "0";
|
||||||
|
APT::Get::HideAutoRemove "1";
|
||||||
|
EOC
|
||||||
|
|
||||||
|
echo <<EOC >> /etc/apt/apt.conf.d/80retries
|
||||||
|
"APT::Acquire::Retries \"10\";"
|
||||||
|
EOC
|
||||||
|
|
||||||
|
echo <<EOC >> /etc/apt/apt.conf.d/90assumeyes
|
||||||
|
"APT::Get::Assume-Yes \"true\";"
|
||||||
|
EOC
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Prepare apt-fast
|
||||||
|
RUN <<EOF
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y --no-install-recommends software-properties-common
|
||||||
|
add-apt-repository -y ppa:apt-fast/stable
|
||||||
|
apt-get -y install apt-fast
|
||||||
|
echo debconf apt-fast/maxdownloads string 8 | debconf-set-selections
|
||||||
|
echo debconf apt-fast/dlflag boolean true | debconf-set-selections
|
||||||
|
echo debconf apt-fast/aptmanager string apt-get | debconf-set-selections
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Base packages
|
||||||
|
# https://github.com/actions/runner-images/blob/main/images/ubuntu/toolsets/toolset-2204.json#L114
|
||||||
|
RUN <<EOF
|
||||||
|
apt-fast install -y --no-install-recommends \
|
||||||
|
ca-certificates \
|
||||||
|
bzip2 curl g++ gcc make jq tar unzip wget \
|
||||||
|
sudo git openssh-client
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Prepare git
|
||||||
|
RUN <<EOF
|
||||||
|
cat <<EOC >> /etc/gitconfig
|
||||||
|
[safe]
|
||||||
|
directory = *
|
||||||
|
EOC
|
||||||
|
|
||||||
|
ssh-keyscan -t rsa,ecdsa,ed25519 github.com >> /etc/ssh/ssh_known_hosts
|
||||||
|
ssh-keyscan -t rsa,ecdsa,ed25519 ravy.dev >> /etc/ssh/ssh_known_hosts
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Haxe native dependencies
|
||||||
|
RUN <<EOF
|
||||||
|
apt-fast install -y --no-install-recommends \
|
||||||
|
libc6-dev libffi-dev \
|
||||||
|
libx11-dev libxi-dev libxext-dev libxinerama-dev libxrandr-dev \
|
||||||
|
libgl-dev libgl1-mesa-dev \
|
||||||
|
libasound2-dev \
|
||||||
|
libvlc-dev libvlccore-dev
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Janky libffi.6 fix
|
||||||
|
RUN <<EOF
|
||||||
|
ln -s \
|
||||||
|
/usr/lib/x86_64-linux-gnu/libffi.so.8 \
|
||||||
|
/usr/lib/x86_64-linux-gnu/libffi.so.6 \
|
||||||
|
|| true
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# neko
|
||||||
|
# https://github.com/HaxeFoundation/neko/releases/download/v2-3-0/neko-2.3.0-linux64.tar.gz
|
||||||
|
RUN <<EOF
|
||||||
|
neko_url=$(curl https://api.github.com/repos/HaxeFoundation/neko/releases -sfL \
|
||||||
|
| jq '.[] | select(.name == "'"$neko_version"'")' \
|
||||||
|
| jq '.assets[] | select(.name | endswith("linux64.tar.gz"))' \
|
||||||
|
| jq -r '.browser_download_url')
|
||||||
|
curl -sfL "$neko_url" | tar -xz -C /usr/local
|
||||||
|
EOF
|
||||||
|
|
||||||
|
RUN <<EOF
|
||||||
|
neko_path="$(find /usr/local -maxdepth 1 -type d -name 'neko*')"
|
||||||
|
ln -s "$neko_path" /usr/local/neko
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ENV NEKOPATH="/usr/local/neko"
|
||||||
|
ENV LD_LIBRARY_PATH="$NEKOPATH:$LD_LIBRARY_PATH"
|
||||||
|
ENV PATH="$NEKOPATH:$PATH"
|
||||||
|
|
||||||
|
# haxe
|
||||||
|
# https://github.com/HaxeFoundation/haxe/releases/download/4.0.5/haxe-4.0.5-linux64.tar.gz
|
||||||
|
RUN <<EOF
|
||||||
|
haxe_url=$(curl https://api.github.com/repos/HaxeFoundation/haxe/releases -sfL \
|
||||||
|
| jq '.[] | select(.name == "'"$haxe_version"'")' \
|
||||||
|
| jq '.assets[] | select(.name | endswith("linux64.tar.gz"))' \
|
||||||
|
| jq -r '.browser_download_url')
|
||||||
|
curl -sfL "$haxe_url" | tar -xz -C /usr/local
|
||||||
|
EOF
|
||||||
|
|
||||||
|
RUN <<EOF
|
||||||
|
haxe_path="$(find /usr/local -maxdepth 1 -type d -name 'haxe*')"
|
||||||
|
ln -s "$haxe_path" /usr/local/haxe
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ENV HAXEPATH="/usr/local/haxe"
|
||||||
|
ENV HAXE_STD_PATH="$HAXEPATH/std"
|
||||||
|
ENV PATH="$HAXEPATH:$PATH"
|
||||||
|
|
||||||
|
# haxelib
|
||||||
|
RUN <<EOF
|
||||||
|
HOME=/etc haxelib setup "$HAXEPATH/lib"
|
||||||
|
haxelib --global --never install haxelib $haxelib_version
|
||||||
|
haxelib --global --never git haxelib https://github.com/HaxeFoundation/haxelib.git master
|
||||||
|
haxelib --global --never install hmm
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# hxcpp
|
||||||
|
ENV HXCPP_COMPILE_CACHE="/usr/share/hxcpp"
|
||||||
|
ENV HXCPP_CACHE_MB="4096"
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
# https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/cleanup.sh
|
||||||
|
RUN <<EOF
|
||||||
|
rm -r /var/cache/apt/apt-fast
|
||||||
|
apt-get clean
|
||||||
|
if [ -d /var/lib/apt/lists ]; then
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d /tmp ]; then
|
||||||
|
rm -rf /tmp/*
|
||||||
|
fi
|
||||||
|
if [ -d /root/.cache ]; then
|
||||||
|
rm -rf /root/.cache
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v journalctl; then
|
||||||
|
journalctl --rotate
|
||||||
|
journalctl --vacuum-time=1s
|
||||||
|
fi
|
||||||
|
if [ -d /var/log ]; then
|
||||||
|
find /var/log -type f -regex ".*\.gz$" -delete
|
||||||
|
find /var/log -type f -regex ".*\.[0-9]$" -delete
|
||||||
|
find /var/log/ -type f -exec cp /dev/null {} \;
|
||||||
|
fi
|
||||||
|
if [ -f /usr/local/bin/invoke_tests ]; then
|
||||||
|
rm -rf /usr/local/bin/invoke_tests
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Print debug info
|
||||||
|
RUN <<EOF
|
||||||
|
echo "/root"
|
||||||
|
ls -la /root
|
||||||
|
cat /root/.haxelib && echo
|
||||||
|
|
||||||
|
id
|
||||||
|
env
|
||||||
|
EOF
|
||||||
2
hmm.json
2
hmm.json
|
|
@ -104,7 +104,7 @@
|
||||||
"name": "lime",
|
"name": "lime",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"dir": null,
|
"dir": null,
|
||||||
"ref": "1359fe6ad52e91175dc636a516d460bd54ea22ed",
|
"ref": "43ebebdd8119936b99f23407057025c7849c5f5b",
|
||||||
"url": "https://github.com/FunkinCrew/lime"
|
"url": "https://github.com/FunkinCrew/lime"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -261,6 +261,35 @@ class InitState extends FlxState
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Rework loading behavior so we don't have to do this.
|
||||||
|
switch (songId)
|
||||||
|
{
|
||||||
|
case 'tutorial' | 'bopeebo' | 'fresh' | 'dadbattle':
|
||||||
|
Paths.setCurrentLevel('week1');
|
||||||
|
PlayStatePlaylist.campaignId = 'week1';
|
||||||
|
case 'spookeez' | 'south' | 'monster':
|
||||||
|
Paths.setCurrentLevel('week2');
|
||||||
|
PlayStatePlaylist.campaignId = 'week2';
|
||||||
|
case 'pico' | 'philly-nice' | 'blammed':
|
||||||
|
Paths.setCurrentLevel('week3');
|
||||||
|
PlayStatePlaylist.campaignId = 'week3';
|
||||||
|
case 'high' | 'satin-panties' | 'milf':
|
||||||
|
Paths.setCurrentLevel('week4');
|
||||||
|
PlayStatePlaylist.campaignId = 'week4';
|
||||||
|
case 'cocoa' | 'eggnog' | 'winter-horrorland':
|
||||||
|
Paths.setCurrentLevel('week5');
|
||||||
|
PlayStatePlaylist.campaignId = 'week5';
|
||||||
|
case 'senpai' | 'roses' | 'thorns':
|
||||||
|
Paths.setCurrentLevel('week6');
|
||||||
|
PlayStatePlaylist.campaignId = 'week6';
|
||||||
|
case 'ugh' | 'guns' | 'stress':
|
||||||
|
Paths.setCurrentLevel('week7');
|
||||||
|
PlayStatePlaylist.campaignId = 'week7';
|
||||||
|
case 'darnell' | 'lit-up' | '2hot' | 'blazin':
|
||||||
|
Paths.setCurrentLevel('weekend1');
|
||||||
|
PlayStatePlaylist.campaignId = 'weekend1';
|
||||||
|
}
|
||||||
|
|
||||||
LoadingState.loadPlayState(
|
LoadingState.loadPlayState(
|
||||||
{
|
{
|
||||||
targetSong: songData,
|
targetSong: songData,
|
||||||
|
|
@ -283,6 +312,10 @@ class InitState extends FlxState
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Rework loading behavior so we don't have to do this.
|
||||||
|
Paths.setCurrentLevel(levelId);
|
||||||
|
PlayStatePlaylist.campaignId = levelId;
|
||||||
|
|
||||||
PlayStatePlaylist.playlistSongIds = currentLevel.getSongs();
|
PlayStatePlaylist.playlistSongIds = currentLevel.getSongs();
|
||||||
PlayStatePlaylist.isStoryMode = true;
|
PlayStatePlaylist.isStoryMode = true;
|
||||||
PlayStatePlaylist.campaignScore = 0;
|
PlayStatePlaylist.campaignScore = 0;
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ class Paths
|
||||||
|
|
||||||
public static function videos(key:String, ?library:String):String
|
public static function videos(key:String, ?library:String):String
|
||||||
{
|
{
|
||||||
return getPath('videos/$key.${Constants.EXT_VIDEO}', BINARY, library);
|
return getPath('videos/$key.${Constants.EXT_VIDEO}', BINARY, library ?? 'videos');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function voices(song:String, ?suffix:String = ''):String
|
public static function voices(song:String, ?suffix:String = ''):String
|
||||||
|
|
|
||||||
|
|
@ -223,11 +223,12 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||||
// already paused before we lost focus.
|
// already paused before we lost focus.
|
||||||
if (_lostFocus && !_alreadyPaused)
|
if (_lostFocus && !_alreadyPaused)
|
||||||
{
|
{
|
||||||
|
trace('Resuming audio (${this._label}) on focus!');
|
||||||
resume();
|
resume();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
trace('Not resuming audio on focus!');
|
trace('Not resuming audio (${this._label}) on focus!');
|
||||||
}
|
}
|
||||||
_lostFocus = false;
|
_lostFocus = false;
|
||||||
}
|
}
|
||||||
|
|
@ -402,6 +403,12 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
||||||
sound.group = FlxG.sound.defaultSoundGroup;
|
sound.group = FlxG.sound.defaultSoundGroup;
|
||||||
sound.persist = true;
|
sound.persist = true;
|
||||||
|
|
||||||
|
// Make sure to add the sound to the list.
|
||||||
|
// If it's already in, it won't get re-added.
|
||||||
|
// If it's not in the list (it gets removed by FunkinSound.playMusic()),
|
||||||
|
// it will get re-added (then if this was called by playMusic(), removed again)
|
||||||
|
FlxG.sound.list.add(sound);
|
||||||
|
|
||||||
// Call onLoad() because the sound already loaded
|
// Call onLoad() because the sound already loaded
|
||||||
if (onLoad != null && sound._sound != null) onLoad();
|
if (onLoad != null && sound._sound != null) onLoad();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -240,8 +240,8 @@ class PolymodHandler
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
assetLibraryPaths: [
|
assetLibraryPaths: [
|
||||||
'default' => 'preload', 'shared' => 'shared', 'songs' => 'songs', 'tutorial' => 'tutorial', 'week1' => 'week1', 'week2' => 'week2',
|
'default' => 'preload', 'shared' => 'shared', 'songs' => 'songs', 'videos' => 'videos', 'tutorial' => 'tutorial', 'week1' => 'week1',
|
||||||
'week3' => 'week3', 'week4' => 'week4', 'week5' => 'week5', 'week6' => 'week6', 'week7' => 'week7', 'weekend1' => 'weekend1',
|
'week2' => 'week2', 'week3' => 'week3', 'week4' => 'week4', 'week5' => 'week5', 'week6' => 'week6', 'week7' => 'week7', 'weekend1' => 'weekend1',
|
||||||
],
|
],
|
||||||
coreAssetRedirect: CORE_FOLDER,
|
coreAssetRedirect: CORE_FOLDER,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2392,13 +2392,6 @@ class PlayState extends MusicBeatSubState
|
||||||
|
|
||||||
// Display the combo meter and add the calculation to the score.
|
// Display the combo meter and add the calculation to the score.
|
||||||
popUpScore(note, event.score, event.judgement, event.healthChange);
|
popUpScore(note, event.score, event.judgement, event.healthChange);
|
||||||
|
|
||||||
if (note.isHoldNote && note.holdNoteSprite != null)
|
|
||||||
{
|
|
||||||
playerStrumline.playNoteHoldCover(note.holdNoteSprite);
|
|
||||||
}
|
|
||||||
|
|
||||||
vocals.playerVolume = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2680,6 +2673,13 @@ class PlayState extends MusicBeatSubState
|
||||||
}
|
}
|
||||||
comboPopUps.displayRating(daRating);
|
comboPopUps.displayRating(daRating);
|
||||||
if (Highscore.tallies.combo >= 10 || Highscore.tallies.combo == 0) comboPopUps.displayCombo(Highscore.tallies.combo);
|
if (Highscore.tallies.combo >= 10 || Highscore.tallies.combo == 0) comboPopUps.displayCombo(Highscore.tallies.combo);
|
||||||
|
|
||||||
|
if (daNote.isHoldNote && daNote.holdNoteSprite != null)
|
||||||
|
{
|
||||||
|
playerStrumline.playNoteHoldCover(daNote.holdNoteSprite);
|
||||||
|
}
|
||||||
|
|
||||||
|
vocals.playerVolume = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2790,7 +2790,7 @@ class PlayState extends MusicBeatSubState
|
||||||
// adds current song data into the tallies for the level (story levels)
|
// adds current song data into the tallies for the level (story levels)
|
||||||
Highscore.talliesLevel = Highscore.combineTallies(Highscore.tallies, Highscore.talliesLevel);
|
Highscore.talliesLevel = Highscore.combineTallies(Highscore.tallies, Highscore.talliesLevel);
|
||||||
|
|
||||||
if (Save.instance.isSongHighScore(currentSong.id, currentDifficulty, data))
|
if (!isPracticeMode && !isBotPlayMode && Save.instance.isSongHighScore(currentSong.id, currentDifficulty, data))
|
||||||
{
|
{
|
||||||
Save.instance.setSongScore(currentSong.id, currentDifficulty, data);
|
Save.instance.setSongScore(currentSong.id, currentDifficulty, data);
|
||||||
#if newgrounds
|
#if newgrounds
|
||||||
|
|
@ -3076,18 +3076,18 @@ class PlayState extends MusicBeatSubState
|
||||||
title: PlayStatePlaylist.isStoryMode ? ('${PlayStatePlaylist.campaignTitle}') : ('${currentChart.songName} by ${currentChart.songArtist}'),
|
title: PlayStatePlaylist.isStoryMode ? ('${PlayStatePlaylist.campaignTitle}') : ('${currentChart.songName} by ${currentChart.songArtist}'),
|
||||||
scoreData:
|
scoreData:
|
||||||
{
|
{
|
||||||
score: songScore,
|
score: PlayStatePlaylist.isStoryMode ? PlayStatePlaylist.campaignScore : songScore,
|
||||||
tallies:
|
tallies:
|
||||||
{
|
{
|
||||||
sick: Highscore.tallies.sick,
|
sick: talliesToUse.sick,
|
||||||
good: Highscore.tallies.good,
|
good: talliesToUse.good,
|
||||||
bad: Highscore.tallies.bad,
|
bad: talliesToUse.bad,
|
||||||
shit: Highscore.tallies.shit,
|
shit: talliesToUse.shit,
|
||||||
missed: Highscore.tallies.missed,
|
missed: talliesToUse.missed,
|
||||||
combo: Highscore.tallies.combo,
|
combo: talliesToUse.combo,
|
||||||
maxCombo: Highscore.tallies.maxCombo,
|
maxCombo: talliesToUse.maxCombo,
|
||||||
totalNotesHit: Highscore.tallies.totalNotesHit,
|
totalNotesHit: talliesToUse.totalNotesHit,
|
||||||
totalNotes: Highscore.tallies.totalNotes,
|
totalNotes: talliesToUse.totalNotes,
|
||||||
},
|
},
|
||||||
accuracy: Highscore.tallies.totalNotesHit / Highscore.tallies.totalNotes,
|
accuracy: Highscore.tallies.totalNotesHit / Highscore.tallies.totalNotes,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -80,34 +80,34 @@ class ResultState extends MusicBeatSubState
|
||||||
bgFlash.visible = false;
|
bgFlash.visible = false;
|
||||||
add(bgFlash);
|
add(bgFlash);
|
||||||
|
|
||||||
var bfGfExcellent:FlxAtlasSprite = new FlxAtlasSprite(380, -170, Paths.animateAtlas("resultScreen/resultsBoyfriendExcellent", "shared"));
|
// var bfGfExcellent:FlxAtlasSprite = new FlxAtlasSprite(380, -170, Paths.animateAtlas("resultScreen/resultsBoyfriendExcellent", "shared"));
|
||||||
bfGfExcellent.visible = false;
|
// bfGfExcellent.visible = false;
|
||||||
add(bfGfExcellent);
|
// add(bfGfExcellent);
|
||||||
|
//
|
||||||
|
// var bfPerfect:FlxAtlasSprite = new FlxAtlasSprite(370, -180, Paths.animateAtlas("resultScreen/resultsBoyfriendPerfect", "shared"));
|
||||||
|
// bfPerfect.visible = false;
|
||||||
|
// add(bfPerfect);
|
||||||
|
//
|
||||||
|
// var bfSHIT:FlxAtlasSprite = new FlxAtlasSprite(0, 20, Paths.animateAtlas("resultScreen/resultsBoyfriendSHIT", "shared"));
|
||||||
|
// bfSHIT.visible = false;
|
||||||
|
// add(bfSHIT);
|
||||||
|
//
|
||||||
|
// bfGfExcellent.anim.onComplete = () -> {
|
||||||
|
// bfGfExcellent.anim.curFrame = 28;
|
||||||
|
// bfGfExcellent.anim.play(); // unpauses this anim, since it's on PlayOnce!
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// bfPerfect.anim.onComplete = () -> {
|
||||||
|
// bfPerfect.anim.curFrame = 136;
|
||||||
|
// bfPerfect.anim.play(); // unpauses this anim, since it's on PlayOnce!
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// bfSHIT.anim.onComplete = () -> {
|
||||||
|
// bfSHIT.anim.curFrame = 150;
|
||||||
|
// bfSHIT.anim.play(); // unpauses this anim, since it's on PlayOnce!
|
||||||
|
// };
|
||||||
|
|
||||||
var bfPerfect:FlxAtlasSprite = new FlxAtlasSprite(370, -180, Paths.animateAtlas("resultScreen/resultsBoyfriendPerfect", "shared"));
|
var gf:FlxSprite = FunkinSprite.createSparrow(625, 325, 'resultScreen/resultGirlfriendGOOD');
|
||||||
bfPerfect.visible = false;
|
|
||||||
add(bfPerfect);
|
|
||||||
|
|
||||||
var bfSHIT:FlxAtlasSprite = new FlxAtlasSprite(0, 20, Paths.animateAtlas("resultScreen/resultsBoyfriendSHIT", "shared"));
|
|
||||||
bfSHIT.visible = false;
|
|
||||||
add(bfSHIT);
|
|
||||||
|
|
||||||
bfGfExcellent.anim.onComplete = () -> {
|
|
||||||
bfGfExcellent.anim.curFrame = 28;
|
|
||||||
bfGfExcellent.anim.play(); // unpauses this anim, since it's on PlayOnce!
|
|
||||||
};
|
|
||||||
|
|
||||||
bfPerfect.anim.onComplete = () -> {
|
|
||||||
bfPerfect.anim.curFrame = 136;
|
|
||||||
bfPerfect.anim.play(); // unpauses this anim, since it's on PlayOnce!
|
|
||||||
};
|
|
||||||
|
|
||||||
bfSHIT.anim.onComplete = () -> {
|
|
||||||
bfSHIT.anim.curFrame = 150;
|
|
||||||
bfSHIT.anim.play(); // unpauses this anim, since it's on PlayOnce!
|
|
||||||
};
|
|
||||||
|
|
||||||
var gf:FlxSprite = FunkinSprite.createSparrow(500, 300, 'resultScreen/resultGirlfriendGOOD');
|
|
||||||
gf.animation.addByPrefix("clap", "Girlfriend Good Anim", 24, false);
|
gf.animation.addByPrefix("clap", "Girlfriend Good Anim", 24, false);
|
||||||
gf.visible = false;
|
gf.visible = false;
|
||||||
gf.animation.finishCallback = _ -> {
|
gf.animation.finishCallback = _ -> {
|
||||||
|
|
@ -268,9 +268,9 @@ class ResultState extends MusicBeatSubState
|
||||||
|
|
||||||
switch (resultsVariation)
|
switch (resultsVariation)
|
||||||
{
|
{
|
||||||
case SHIT:
|
// case SHIT:
|
||||||
bfSHIT.visible = true;
|
// bfSHIT.visible = true;
|
||||||
bfSHIT.playAnimation("");
|
// bfSHIT.playAnimation("");
|
||||||
|
|
||||||
case NORMAL:
|
case NORMAL:
|
||||||
boyfriend.animation.play('fall');
|
boyfriend.animation.play('fall');
|
||||||
|
|
@ -292,9 +292,9 @@ class ResultState extends MusicBeatSubState
|
||||||
gf.animation.play('clap', true);
|
gf.animation.play('clap', true);
|
||||||
gf.visible = true;
|
gf.visible = true;
|
||||||
});
|
});
|
||||||
case PERFECT:
|
// case PERFECT:
|
||||||
bfPerfect.visible = true;
|
// bfPerfect.visible = true;
|
||||||
bfPerfect.playAnimation("");
|
// bfPerfect.playAnimation("");
|
||||||
|
|
||||||
// bfGfExcellent.visible = true;
|
// bfGfExcellent.visible = true;
|
||||||
// bfGfExcellent.playAnimation("");
|
// bfGfExcellent.playAnimation("");
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,13 @@ class VideoCutscene
|
||||||
if (!openfl.Assets.exists(filePath))
|
if (!openfl.Assets.exists(filePath))
|
||||||
{
|
{
|
||||||
// Display a popup.
|
// Display a popup.
|
||||||
lime.app.Application.current.window.alert('Video file does not exist: ${filePath}', 'Error playing video');
|
// lime.app.Application.current.window.alert('Video file does not exist: ${filePath}', 'Error playing video');
|
||||||
return;
|
// return;
|
||||||
|
|
||||||
|
// TODO: After moving videos to their own library,
|
||||||
|
// this function ALWAYS FAILS on web, but the video still plays.
|
||||||
|
// I think that's due to a weird quirk with how OpenFL libraries work.
|
||||||
|
trace('Video file does not exist: ${filePath}');
|
||||||
}
|
}
|
||||||
|
|
||||||
var rawFilePath = Paths.stripLibrary(filePath);
|
var rawFilePath = Paths.stripLibrary(filePath);
|
||||||
|
|
|
||||||
|
|
@ -693,7 +693,7 @@ class Save
|
||||||
trace("[SAVE] Checking for legacy save data...");
|
trace("[SAVE] Checking for legacy save data...");
|
||||||
var legacySave:FlxSave = new FlxSave();
|
var legacySave:FlxSave = new FlxSave();
|
||||||
legacySave.bind(SAVE_NAME_LEGACY, SAVE_PATH_LEGACY);
|
legacySave.bind(SAVE_NAME_LEGACY, SAVE_PATH_LEGACY);
|
||||||
if (legacySave?.data == null)
|
if (legacySave.isEmpty())
|
||||||
{
|
{
|
||||||
trace("[SAVE] No legacy save data found.");
|
trace("[SAVE] No legacy save data found.");
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -57,10 +57,6 @@ class CreditsDataHandler
|
||||||
{line: 'KawaiSprite'},
|
{line: 'KawaiSprite'},
|
||||||
{line: 'evilsk8r'},
|
{line: 'evilsk8r'},
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
header: 'Kickstarter Backers',
|
|
||||||
appendBackers: true
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
@ -68,11 +64,11 @@ class CreditsDataHandler
|
||||||
|
|
||||||
public static function fetchBackerEntries():Array<String>
|
public static function fetchBackerEntries():Array<String>
|
||||||
{
|
{
|
||||||
// TODO: Replace this with a web request.
|
// TODO: Implement a web request.
|
||||||
// We can't just grab the current Kickstarter data and include it in builds,
|
// We can't just grab the current Kickstarter data and include it in builds,
|
||||||
// because we don't want to deadname people who haven't logged into the portal yet.
|
// because we don't want to deadname people who haven't logged into the portal yet.
|
||||||
// It can be async and paginated for performance!
|
// It can be async and paginated for performance!
|
||||||
return ['See the list of backers at $BACKER_PUBLIC_URL.'];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HARDCODED_CREDITS
|
#if HARDCODED_CREDITS
|
||||||
|
|
@ -99,12 +95,19 @@ class CreditsDataHandler
|
||||||
|
|
||||||
static function fetchCreditsData():funkin.data.JsonFile
|
static function fetchCreditsData():funkin.data.JsonFile
|
||||||
{
|
{
|
||||||
|
#if !macro
|
||||||
var rawJson:String = openfl.Assets.getText(CREDITS_DATA_PATH).trim();
|
var rawJson:String = openfl.Assets.getText(CREDITS_DATA_PATH).trim();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
fileName: CREDITS_DATA_PATH,
|
fileName: CREDITS_DATA_PATH,
|
||||||
contents: rawJson
|
contents: rawJson
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
|
return {
|
||||||
|
fileName: CREDITS_DATA_PATH,
|
||||||
|
contents: null
|
||||||
|
};
|
||||||
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
static function parseCreditsData(file:JsonFile):Null<CreditsData>
|
static function parseCreditsData(file:JsonFile):Null<CreditsData>
|
||||||
|
|
|
||||||
|
|
@ -117,12 +117,6 @@ class ChartEditorNoteSprite extends FlxSprite
|
||||||
{
|
{
|
||||||
noteFrameCollection.pushFrame(frame);
|
noteFrameCollection.pushFrame(frame);
|
||||||
}
|
}
|
||||||
var frameCollectionNormal2:FlxAtlasFrames = Paths.getSparrowAtlas('NoteHoldNormal');
|
|
||||||
|
|
||||||
for (frame in frameCollectionNormal2.frames)
|
|
||||||
{
|
|
||||||
noteFrameCollection.pushFrame(frame);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pixel notes
|
// Pixel notes
|
||||||
var graphicPixel = FlxG.bitmap.add(Paths.image('weeb/pixelUI/arrows-pixels', 'week6'), false, null);
|
var graphicPixel = FlxG.bitmap.add(Paths.image('weeb/pixelUI/arrows-pixels', 'week6'), false, null);
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ class AlbumRoll extends FlxSpriteGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
var newAlbumArt:FlxAtlasSprite;
|
var newAlbumArt:FlxAtlasSprite;
|
||||||
var difficultyStars:DifficultyStars;
|
|
||||||
|
|
||||||
|
// var difficultyStars:DifficultyStars;
|
||||||
var _exitMovers:Null<FreeplayState.ExitMoverData>;
|
var _exitMovers:Null<FreeplayState.ExitMoverData>;
|
||||||
|
|
||||||
var albumData:Album;
|
var albumData:Album;
|
||||||
|
|
@ -65,9 +65,9 @@ class AlbumRoll extends FlxSpriteGroup
|
||||||
|
|
||||||
add(newAlbumArt);
|
add(newAlbumArt);
|
||||||
|
|
||||||
difficultyStars = new DifficultyStars(140, 39);
|
// difficultyStars = new DifficultyStars(140, 39);
|
||||||
difficultyStars.stars.visible = false;
|
// difficultyStars.stars.visible = false;
|
||||||
add(difficultyStars);
|
// add(difficultyStars);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onAlbumFinish(animName:String):Void
|
function onAlbumFinish(animName:String):Void
|
||||||
|
|
@ -86,7 +86,7 @@ class AlbumRoll extends FlxSpriteGroup
|
||||||
{
|
{
|
||||||
if (albumId == null)
|
if (albumId == null)
|
||||||
{
|
{
|
||||||
difficultyStars.stars.visible = false;
|
// difficultyStars.stars.visible = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -132,13 +132,6 @@ class AlbumRoll extends FlxSpriteGroup
|
||||||
speed: 0.4,
|
speed: 0.4,
|
||||||
wait: 0
|
wait: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
exitMovers.set([difficultyStars],
|
|
||||||
{
|
|
||||||
x: FlxG.width * 1.2,
|
|
||||||
speed: 0.2,
|
|
||||||
wait: 0.3
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var titleTimer:Null<FlxTimer> = null;
|
var titleTimer:Null<FlxTimer> = null;
|
||||||
|
|
@ -151,10 +144,10 @@ class AlbumRoll extends FlxSpriteGroup
|
||||||
newAlbumArt.visible = true;
|
newAlbumArt.visible = true;
|
||||||
newAlbumArt.playAnimation(animNames.get('$albumId-active'), false, false, false);
|
newAlbumArt.playAnimation(animNames.get('$albumId-active'), false, false, false);
|
||||||
|
|
||||||
difficultyStars.stars.visible = false;
|
// difficultyStars.stars.visible = false;
|
||||||
new FlxTimer().start(0.75, function(_) {
|
new FlxTimer().start(0.75, function(_) {
|
||||||
// showTitle();
|
// showTitle();
|
||||||
showStars();
|
// showStars();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -163,18 +156,16 @@ class AlbumRoll extends FlxSpriteGroup
|
||||||
newAlbumArt.playAnimation(animNames.get('$albumId-trans'), false, false, false);
|
newAlbumArt.playAnimation(animNames.get('$albumId-trans'), false, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDifficultyStars(?difficulty:Int):Void
|
// public function setDifficultyStars(?difficulty:Int):Void
|
||||||
{
|
// {
|
||||||
if (difficulty == null) return;
|
// if (difficulty == null) return;
|
||||||
|
// difficultyStars.difficulty = difficulty;
|
||||||
difficultyStars.difficulty = difficulty;
|
// }
|
||||||
}
|
// /**
|
||||||
|
// * Make the album stars visible.
|
||||||
/**
|
// */
|
||||||
* Make the album stars visible.
|
// public function showStars():Void
|
||||||
*/
|
// {
|
||||||
public function showStars():Void
|
// difficultyStars.stars.visible = false; // true;
|
||||||
{
|
// }
|
||||||
difficultyStars.stars.visible = false; // true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,106 +0,0 @@
|
||||||
package funkin.ui.freeplay;
|
|
||||||
|
|
||||||
import flixel.group.FlxSpriteGroup;
|
|
||||||
import funkin.graphics.adobeanimate.FlxAtlasSprite;
|
|
||||||
import funkin.graphics.shaders.HSVShader;
|
|
||||||
|
|
||||||
class DifficultyStars extends FlxSpriteGroup
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Internal handler var for difficulty... ranges from 0... to 15
|
|
||||||
* 0 is 1 star... 15 is 0 stars!
|
|
||||||
*/
|
|
||||||
var curDifficulty(default, set):Int = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Range between 0 and 15
|
|
||||||
*/
|
|
||||||
public var difficulty(default, set):Int = 1;
|
|
||||||
|
|
||||||
public var stars:FlxAtlasSprite;
|
|
||||||
|
|
||||||
var flames:FreeplayFlames;
|
|
||||||
|
|
||||||
var hsvShader:HSVShader;
|
|
||||||
|
|
||||||
public function new(x:Float, y:Float)
|
|
||||||
{
|
|
||||||
super(x, y);
|
|
||||||
|
|
||||||
hsvShader = new HSVShader();
|
|
||||||
|
|
||||||
flames = new FreeplayFlames(0, 0);
|
|
||||||
add(flames);
|
|
||||||
|
|
||||||
stars = new FlxAtlasSprite(0, 0, Paths.animateAtlas("freeplay/freeplayStars"));
|
|
||||||
stars.anim.play("diff stars");
|
|
||||||
add(stars);
|
|
||||||
|
|
||||||
stars.shader = hsvShader;
|
|
||||||
|
|
||||||
for (memb in flames.members)
|
|
||||||
memb.shader = hsvShader;
|
|
||||||
}
|
|
||||||
|
|
||||||
override function update(elapsed:Float):Void
|
|
||||||
{
|
|
||||||
super.update(elapsed);
|
|
||||||
|
|
||||||
// "loops" the current animation
|
|
||||||
// for clarity, the animation file looks like
|
|
||||||
// frame : stars
|
|
||||||
// 0-99: 1 star
|
|
||||||
// 100-199: 2 stars
|
|
||||||
// ......
|
|
||||||
// 1300-1499: 15 stars
|
|
||||||
// 1500 : 0 stars
|
|
||||||
if (curDifficulty < 15 && stars.anim.curFrame >= (curDifficulty + 1) * 100)
|
|
||||||
{
|
|
||||||
stars.anim.play("diff stars", true, false, curDifficulty * 100);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function set_difficulty(value:Int):Int
|
|
||||||
{
|
|
||||||
difficulty = value;
|
|
||||||
|
|
||||||
if (difficulty <= 0)
|
|
||||||
{
|
|
||||||
difficulty = 0;
|
|
||||||
curDifficulty = 15;
|
|
||||||
}
|
|
||||||
else if (difficulty <= 15)
|
|
||||||
{
|
|
||||||
difficulty = value;
|
|
||||||
curDifficulty = difficulty - 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
difficulty = 15;
|
|
||||||
curDifficulty = difficulty - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (difficulty > 10) flames.flameCount = difficulty - 10;
|
|
||||||
else
|
|
||||||
flames.flameCount = 0;
|
|
||||||
|
|
||||||
return difficulty;
|
|
||||||
}
|
|
||||||
|
|
||||||
function set_curDifficulty(value:Int):Int
|
|
||||||
{
|
|
||||||
curDifficulty = value;
|
|
||||||
if (curDifficulty == 15)
|
|
||||||
{
|
|
||||||
stars.anim.play("diff stars", true, false, 1500);
|
|
||||||
stars.anim.pause();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
stars.anim.curFrame = Std.int(curDifficulty * 100);
|
|
||||||
stars.anim.play("diff stars", true, false, curDifficulty * 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
return curDifficulty;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -469,6 +469,10 @@ class FreeplayState extends MusicBeatSubState
|
||||||
|
|
||||||
albumRoll.playIntro();
|
albumRoll.playIntro();
|
||||||
|
|
||||||
|
new FlxTimer().start(0.75, function(_) {
|
||||||
|
// albumRoll.showTitle();
|
||||||
|
});
|
||||||
|
|
||||||
FlxTween.tween(grpDifficulties, {x: 90}, 0.6, {ease: FlxEase.quartOut});
|
FlxTween.tween(grpDifficulties, {x: 90}, 0.6, {ease: FlxEase.quartOut});
|
||||||
|
|
||||||
var diffSelLeft:DifficultySelector = new DifficultySelector(20, grpDifficulties.y - 10, false, controls);
|
var diffSelLeft:DifficultySelector = new DifficultySelector(20, grpDifficulties.y - 10, false, controls);
|
||||||
|
|
@ -634,14 +638,7 @@ class FreeplayState extends MusicBeatSubState
|
||||||
funnyMenu.favIcon.visible = tempSongs[i].isFav;
|
funnyMenu.favIcon.visible = tempSongs[i].isFav;
|
||||||
funnyMenu.hsvShader = hsvShader;
|
funnyMenu.hsvShader = hsvShader;
|
||||||
|
|
||||||
if (i < 8)
|
|
||||||
{
|
|
||||||
funnyMenu.initJumpIn(Math.min(i, 4), force);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
funnyMenu.forcePosition();
|
funnyMenu.forcePosition();
|
||||||
}
|
|
||||||
|
|
||||||
grpCapsules.add(funnyMenu);
|
grpCapsules.add(funnyMenu);
|
||||||
}
|
}
|
||||||
|
|
@ -1039,9 +1036,6 @@ class FreeplayState extends MusicBeatSubState
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the difficulty star count on the right.
|
|
||||||
albumRoll.setDifficultyStars(daSong?.songRating);
|
|
||||||
|
|
||||||
// Set the album graphic and play the animation if relevant.
|
// Set the album graphic and play the animation if relevant.
|
||||||
var newAlbumId:String = daSong?.albumId;
|
var newAlbumId:String = daSong?.albumId;
|
||||||
if (albumRoll.albumId != newAlbumId)
|
if (albumRoll.albumId != newAlbumId)
|
||||||
|
|
@ -1161,10 +1155,6 @@ class FreeplayState extends MusicBeatSubState
|
||||||
{
|
{
|
||||||
currentDifficulty = rememberedDifficulty;
|
currentDifficulty = rememberedDifficulty;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the difficulty star count on the right.
|
|
||||||
var daSong:Null<FreeplaySongData> = grpCapsules.members[curSelected]?.songData;
|
|
||||||
albumRoll.setDifficultyStars(daSong?.songRating ?? 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeSelection(change:Int = 0):Void
|
function changeSelection(change:Int = 0):Void
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package funkin.ui.mainmenu;
|
package funkin.ui.mainmenu;
|
||||||
|
|
||||||
|
import funkin.graphics.FunkinSprite;
|
||||||
import flixel.addons.transition.FlxTransitionableState;
|
import flixel.addons.transition.FlxTransitionableState;
|
||||||
import funkin.ui.debug.DebugMenuSubState;
|
import funkin.ui.debug.DebugMenuSubState;
|
||||||
import flixel.FlxObject;
|
import flixel.FlxObject;
|
||||||
|
|
@ -67,7 +68,7 @@ class MainMenuState extends MusicBeatState
|
||||||
camFollow = new FlxObject(0, 0, 1, 1);
|
camFollow = new FlxObject(0, 0, 1, 1);
|
||||||
add(camFollow);
|
add(camFollow);
|
||||||
|
|
||||||
magenta = new FlxSprite(Paths.image('menuDesat'));
|
magenta = new FlxSprite(Paths.image('menuBGMagenta'));
|
||||||
magenta.scrollFactor.x = bg.scrollFactor.x;
|
magenta.scrollFactor.x = bg.scrollFactor.x;
|
||||||
magenta.scrollFactor.y = bg.scrollFactor.y;
|
magenta.scrollFactor.y = bg.scrollFactor.y;
|
||||||
magenta.setGraphicSize(Std.int(bg.width));
|
magenta.setGraphicSize(Std.int(bg.width));
|
||||||
|
|
@ -75,7 +76,6 @@ class MainMenuState extends MusicBeatState
|
||||||
magenta.x = bg.x;
|
magenta.x = bg.x;
|
||||||
magenta.y = bg.y;
|
magenta.y = bg.y;
|
||||||
magenta.visible = false;
|
magenta.visible = false;
|
||||||
magenta.color = 0xFFfd719b;
|
|
||||||
|
|
||||||
// TODO: Why doesn't this line compile I'm going fucking feral
|
// TODO: Why doesn't this line compile I'm going fucking feral
|
||||||
|
|
||||||
|
|
@ -174,6 +174,7 @@ class MainMenuState extends MusicBeatState
|
||||||
{
|
{
|
||||||
FlxG.cameras.reset(new FunkinCamera());
|
FlxG.cameras.reset(new FunkinCamera());
|
||||||
FlxG.camera.follow(camFollow, null, 0.06);
|
FlxG.camera.follow(camFollow, null, 0.06);
|
||||||
|
FlxG.camera.snapToTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
function createMenuItem(name:String, atlas:String, callback:Void->Void, fireInstantly:Bool = false):Void
|
function createMenuItem(name:String, atlas:String, callback:Void->Void, fireInstantly:Bool = false):Void
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,7 @@ class OptionsState extends MusicBeatState
|
||||||
|
|
||||||
override function create()
|
override function create()
|
||||||
{
|
{
|
||||||
var menuBG = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
|
var menuBG = new FlxSprite().loadGraphic(Paths.image('menuBGBlue'));
|
||||||
menuBG.color = 0xFFea71fd;
|
|
||||||
menuBG.setGraphicSize(Std.int(menuBG.width * 1.1));
|
menuBG.setGraphicSize(Std.int(menuBG.width * 1.1));
|
||||||
menuBG.updateHitbox();
|
menuBG.updateHitbox();
|
||||||
menuBG.screenCenter();
|
menuBG.screenCenter();
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,6 @@ class LoadingState extends MusicBeatSubState
|
||||||
{
|
{
|
||||||
// TODO: This section is a hack! Redo this later when we have a proper asset caching system.
|
// TODO: This section is a hack! Redo this later when we have a proper asset caching system.
|
||||||
FunkinSprite.preparePurgeCache();
|
FunkinSprite.preparePurgeCache();
|
||||||
FunkinSprite.cacheTexture(Paths.image('combo'));
|
|
||||||
FunkinSprite.cacheTexture(Paths.image('healthBar'));
|
FunkinSprite.cacheTexture(Paths.image('healthBar'));
|
||||||
FunkinSprite.cacheTexture(Paths.image('menuDesat'));
|
FunkinSprite.cacheTexture(Paths.image('menuDesat'));
|
||||||
FunkinSprite.cacheTexture(Paths.image('combo'));
|
FunkinSprite.cacheTexture(Paths.image('combo'));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue