Skip to content

Commit feeebc2

Browse files
more playstate fixes
1 parent 8a8617b commit feeebc2

File tree

3 files changed

+104
-46
lines changed

3 files changed

+104
-46
lines changed

.github/workflows/builds.yaml

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -43,51 +43,6 @@ jobs:
4343
pre_build_commands:
4444
artifact_path: export/release/linux/bin
4545

46-
- platform: Nintendo Switch
47-
os: ubuntu-latest
48-
container: devkitpro/devkita64:latest
49-
haxe_setup: |
50-
sudo apt-get update
51-
sudo apt-get install -y wget git neko libgc-dev
52-
wget https://github.com/HaxeFoundation/haxe/releases/download/4.3.4/haxe-4.3.4-linux64.tar.gz
53-
mkdir haxe_temp
54-
tar -xf haxe-4.3.4-linux64.tar.gz -C haxe_temp
55-
sudo cp -r haxe_temp/haxe_*/* /usr/local/bin/
56-
mkdir -p ~/haxelib
57-
haxelib --always --quiet setup ~/haxelib
58-
haxelib --global --always --quiet update haxelib
59-
build_cmd: haxelib run lime build Project.xml switch --app-version="4.0.0-${{ github.run_id}}" -D officialBuild
60-
extra_libs: |
61-
dkp-pacman -Sy --noconfirm
62-
dkp-pacman -S --needed --noconfirm \
63-
switch-bzip2 switch-cmake switch-curl switch-flac \
64-
switch-freetype switch-glad switch-glm switch-harfbuzz \
65-
switch-libdrm_nouveau switch-libjpeg-turbo switch-libmodplug \
66-
switch-libogg switch-libopus switch-libpng switch-libvorbis \
67-
switch-libvorbisidec switch-libwebp switch-mesa switch-mpg123 \
68-
switch-openal-soft switch-opusfile switch-pkg-config switch-sdl2 \
69-
switch-sdl2_gfx switch-sdl2_image switch-sdl2_mixer \
70-
switch-sdl2_net switch-sdl2_ttf switch-tools switch-zlib \
71-
switch-liblua51
72-
73-
haxelib --always --quiet install format
74-
haxelib --always --quiet install hxp
75-
haxelib --always --quiet git lime https://github.com/Slushi-Github/lime-nx.git
76-
haxelib --always --quiet git hxcpp https://github.com/Slushi-Github/hxcpp-nx.git
77-
haxelib --always --quiet git hx_libnx https://github.com/Slushi-Github/hx_libnx.git
78-
pre_build_commands: |
79-
HXCPP_PATH=$(haxelib libpath hxcpp)
80-
if [ -d "$HXCPP_PATH/tools/hxcpp" ]; then
81-
cd "$HXCPP_PATH/tools/hxcpp"
82-
haxe compile.hxml
83-
cd -
84-
else
85-
echo "::error::Can't change directory to HXCPP"
86-
fi
87-
88-
haxelib run lime rebuild switch
89-
artifact_path: export/release/switch/bin/*.nro
90-
9146
- platform: Android
9247
os: ubuntu-latest
9348
container:

.github/workflows/switch.yaml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: ALE Psych Builds
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
name: Build ${{ matrix.platform }}
10+
permissions: write-all
11+
runs-on: ${{ matrix.os }}
12+
container: ${{ matrix.container }}
13+
14+
strategy:
15+
matrix:
16+
include:
17+
- platform: Nintendo Switch
18+
os: ubuntu-latest
19+
container: devkitpro/devkita64:latest
20+
haxe_setup: |
21+
sudo apt-get update
22+
sudo apt-get install -y wget git neko libgc-dev
23+
wget https://github.com/HaxeFoundation/haxe/releases/download/4.3.4/haxe-4.3.4-linux64.tar.gz
24+
mkdir haxe_temp
25+
tar -xf haxe-4.3.4-linux64.tar.gz -C haxe_temp
26+
sudo cp -r haxe_temp/haxe_*/* /usr/local/bin/
27+
mkdir -p ~/haxelib
28+
haxelib --always --quiet setup ~/haxelib
29+
haxelib --global --always --quiet update haxelib
30+
build_cmd: haxelib run lime build Project.xml switch --app-version="4.0.0-${{ github.run_id}}" -D officialBuild
31+
extra_libs: |
32+
dkp-pacman -Sy --noconfirm
33+
dkp-pacman -S --needed --noconfirm \
34+
switch-bzip2 switch-cmake switch-curl switch-flac \
35+
switch-freetype switch-glad switch-glm switch-harfbuzz \
36+
switch-libdrm_nouveau switch-libjpeg-turbo switch-libmodplug \
37+
switch-libogg switch-libopus switch-libpng switch-libvorbis \
38+
switch-libvorbisidec switch-libwebp switch-mesa switch-mpg123 \
39+
switch-openal-soft switch-opusfile switch-pkg-config switch-sdl2 \
40+
switch-sdl2_gfx switch-sdl2_image switch-sdl2_mixer \
41+
switch-sdl2_net switch-sdl2_ttf switch-tools switch-zlib \
42+
switch-liblua51
43+
44+
haxelib --always --quiet install format
45+
haxelib --always --quiet install hxp
46+
haxelib --always --quiet git lime https://github.com/Slushi-Github/lime-nx.git
47+
haxelib --always --quiet git hxcpp https://github.com/Slushi-Github/hxcpp-nx.git
48+
haxelib --always --quiet git hx_libnx https://github.com/Slushi-Github/hx_libnx.git
49+
pre_build_commands: |
50+
HXCPP_PATH=$(haxelib libpath hxcpp)
51+
if [ -d "$HXCPP_PATH/tools/hxcpp" ]; then
52+
cd "$HXCPP_PATH/tools/hxcpp"
53+
haxe compile.hxml
54+
cd -
55+
else
56+
echo "::error::Can't change directory to HXCPP"
57+
fi
58+
59+
haxelib run lime rebuild switch
60+
artifact_path: export/release/switch/bin/*.nro
61+
62+
steps:
63+
- name: Pull the New Commit
64+
uses: actions/checkout@v4.1.7
65+
66+
- name: Setup Haxe
67+
if: ${{ !matrix.haxe_setup }}
68+
uses: krdlab/setup-haxe@master
69+
with:
70+
haxe-version: 4.3.7
71+
72+
- name: Custom Haxe Setup
73+
if: ${{ matrix.haxe_setup }}
74+
run: ${{ matrix.haxe_setup }}
75+
76+
- name: Install Main Libraries
77+
run: |
78+
haxelib --global git hmm https://github.com/ALE-Psych-Crew/hmm
79+
haxelib --global run hmm setup
80+
haxelib --global run hmm install
81+
82+
- name: Install Extra Libraries
83+
if: ${{ matrix.extra_libs }}
84+
run: ${{ matrix.extra_libs }}
85+
86+
- name: Pre-Build Commands
87+
if: ${{ matrix.pre_build_commands }}
88+
run: ${{ matrix.pre_build_commands }}
89+
90+
- name: Build for ${{ matrix.platform }}
91+
run: ${{ matrix.build_cmd }}
92+
93+
- name: Upload Game
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: ${{ matrix.platform }} Build
97+
path: ${{ matrix.artifact_path }}
98+
if-no-files-found: error

source/funkin/states/PlayState.hx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,8 @@ class PlayState extends ScriptState
12001200
scriptCallbackCall(POST, 'CharacterChange', null, [char, newChar], [newChar]);
12011201
}
12021202

1203+
var cameraTarget:Character;
1204+
12031205
function moveCamera(char:OneOfTwo<Character, Int>)
12041206
{
12051207
var character:Character = null;
@@ -1218,6 +1220,8 @@ class PlayState extends ScriptState
12181220
{
12191221
if (shouldMoveCamera && character != null)
12201222
{
1223+
cameraTarget = character;
1224+
12211225
final pos:FlxPoint = getCharacterCamera(character);
12221226

12231227
cast(camGame, FXCamera).position.set(pos.x, pos.y);
@@ -1289,7 +1293,8 @@ class PlayState extends ScriptState
12891293
function justPressedKey(event:KeyboardEvent)
12901294
{
12911295
if (scriptCallbackCall(ON, 'JustPressedKey', null, [event], [event.keyCode]))
1292-
strumLines.forEachAlive(strl -> strl.justPressedKey(event.keyCode));
1296+
if (Controls.anyJustPressed([event.keyCode]))
1297+
strumLines.forEachAlive(strl -> strl.justPressedKey(event.keyCode));
12931298

12941299
scriptCallbackCall(POST, 'JustPressedKey', null, [event], [event.keyCode]);
12951300
}

0 commit comments

Comments
 (0)