From fa400781a2029838ec5201f9087e6340ed19c8ba Mon Sep 17 00:00:00 2001
From: "HRK.EXEX" <74143200+HRK-EXEX@users.noreply.github.com>
Date: Sun, 5 Jan 2025 22:59:08 +0900
Subject: [PATCH] Changed the adaptation target of gfSection + fixed the
version + templates changed
---
.github/ISSUE_TEMPLATE/crash.yml | 3 ---
.github/ISSUE_TEMPLATE/feature-request.yml | 4 ++--
.github/workflows/main.yml | 12 ++++++------
Project.xml | 6 +++---
source/backend/Song.hx | 14 ++++++++++++--
source/objects/Note.hx | 10 +++++-----
source/states/PlayState.hx | 20 +++++++-------------
7 files changed, 35 insertions(+), 34 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/crash.yml b/.github/ISSUE_TEMPLATE/crash.yml
index 0b6c7107..8845656e 100644
--- a/.github/ISSUE_TEMPLATE/crash.yml
+++ b/.github/ISSUE_TEMPLATE/crash.yml
@@ -38,9 +38,6 @@ body:
- "Mac"
- "Android"
- "iOS"
- - "HTML5"
- - "Flash/Air-based target"
- - "Neko, HashLink, or other build system"
validations:
required: true
diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml
index 77a9a791..23919cdc 100644
--- a/.github/ISSUE_TEMPLATE/feature-request.yml
+++ b/.github/ISSUE_TEMPLATE/feature-request.yml
@@ -1,9 +1,9 @@
name: Feature Request
-description: Request something to be added to P-Slice
+description: Request something to be added to H-Slice
labels: [enhancement]
body:
- type: textarea
attributes:
- label: What feature do you want to get added on the **P-Slice** engine?
+ label: What feature do you want to get added on the **H-Slice** engine?
validations:
required: true
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index af2c49f4..38278942 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -16,26 +16,26 @@ jobs:
- name: Windows
os: windows-2022
buildArgs: windows
- artifactName: H-Slice_0.1.3_Windows
+ artifactName: H-Slice_0.1.4_Windows
setupScript: .\"setup/windows.bat"
artifactPath: export\release\windows\bin\*
- name: Linux
os: ubuntu-22.04
buildArgs: linux
setupScript: sh ./setup/unix.sh
- artifactName: H-Slice_0.1.3_Linux
+ artifactName: H-Slice_0.1.4_Linux
artifactPath: export/release/linux/bin/*
- name: macOS x86_64
os: macos-14
buildArgs: "mac -64 -D HXCPP_M64"
setupScript: sh ./setup/mobile.sh
- artifactName: H-Slice_0.1.3_macOS_x64
+ artifactName: H-Slice_0.1.4_macOS_x64
artifactPath: export/release/macos/bin/*
- name: macOS AArch64
os: macos-15
buildArgs: mac
setupScript: sh ./setup/mobile.sh
- artifactName: H-Slice_0.1.3_macOS_arm64
+ artifactName: H-Slice_0.1.4_macOS_arm64
artifactPath: export/release/macos/bin/*
uses: ./.github/workflows/build.yml
with:
@@ -54,13 +54,13 @@ jobs:
os: macos-14
buildArgs: "android"
setupScript: sh ./setup/mobile.sh
- artifactName: H-Slice_0.1.3_Android
+ artifactName: H-Slice_0.1.4_Android
artifactPath: "export/release/android/bin/app/build/outputs/apk/release/*.apk"
- name: iOS
os: macos-15
buildArgs: "ios -nosign"
setupScript: sh ./setup/mobile.sh
- artifactName: H-Slice_0.1.3_iOS
+ artifactName: H-Slice_0.1.4_iOS
artifactPath: "export/release/ios/build/Release-iphoneos/*.ipa"
uses: ./.github/workflows/build.yml
with:
diff --git a/Project.xml b/Project.xml
index 2cdc7315..38e5f630 100644
--- a/Project.xml
+++ b/Project.xml
@@ -23,10 +23,10 @@ xsi:schemaLocation="http://lime.openfl.org/project/1.0.4 http://lime.openfl.org/
-
+
-
+
@@ -39,7 +39,7 @@ xsi:schemaLocation="http://lime.openfl.org/project/1.0.4 http://lime.openfl.org/
-
+
diff --git a/source/backend/Song.hx b/source/backend/Song.hx
index 2db09720..95c3b646 100644
--- a/source/backend/Song.hx
+++ b/source/backend/Song.hx
@@ -1,5 +1,6 @@
package backend;
+import haxe.ds.Vector;
import haxe.Json;
import backend.SongJson;
import lime.utils.Assets;
@@ -22,6 +23,8 @@ typedef SwagSong =
var stage:String;
var format:String;
+ @:optional var isOldVersion:Bool;
+
@:optional var gameOverChar:String;
@:optional var gameOverSound:String;
@:optional var gameOverLoop:String;
@@ -157,19 +160,26 @@ class Song
public static function parseJSON(rawData:String, ?nameForError:String = null, ?convertTo:String = 'psych_v1'):SwagSong
{
+ var isOldVer:Vector = new Vector(2);
var songJson:SwagSong = cast SongJson.parse(rawData);
if(Reflect.hasField(songJson, 'song'))
{
+ isOldVer[0] = true;
var subSong:SwagSong = Reflect.field(songJson, 'song');
if(subSong != null && Type.typeof(subSong) == TObject)
songJson = subSong;
- }
+ } else isOldVer[0] = false;
if(convertTo != null && convertTo.length > 0)
{
var fmt:String = songJson.format;
- if(fmt == null) fmt = songJson.format = 'unknown';
+ if(fmt == null)
+ {
+ fmt = songJson.format = 'unknown';
+ isOldVer[1] = true;
+ if (isOldVer[0] && isOldVer[1]) songJson.isOldVersion = true;
+ }
switch(convertTo)
{
diff --git a/source/objects/Note.hx b/source/objects/Note.hx
index 42757a42..2edc344f 100644
--- a/source/objects/Note.hx
+++ b/source/objects/Note.hx
@@ -30,7 +30,7 @@ typedef NoteSplashData = {
}
typedef CastNote = {
- strumTime:Float,
+ var strumTime:Float;
// noteData and flags
// 1st-8th bits are for noteData (256keys)
// 9th bit is for mustHit
@@ -41,10 +41,10 @@ typedef CastNote = {
// 14th bit is for noAnim
// 15th bit is for noMissAnim
// 16th bit is for blockHit
- noteData:Int,
- noteType:String,
- holdLength:Null,
- noteSkin:String
+ var noteData:Int;
+ @:optional var noteType:String;
+ var holdLength:Null;
+ var noteSkin:String;
}
var toBool = CoolUtil.bool;
diff --git a/source/states/PlayState.hx b/source/states/PlayState.hx
index 11bf2f54..2b631cdf 100644
--- a/source/states/PlayState.hx
+++ b/source/states/PlayState.hx
@@ -1655,6 +1655,7 @@ class PlayState extends MusicBeatState
private var noteTypes:Array = [];
private var eventsPushed:Array = [];
private var totalColumns:Int = 4;
+ private var gfSide:Bool = false;
public var bfVocal:Bool = false; // a.k.a. legacy voices
public var opVocal:Bool = false;
@@ -1674,8 +1675,9 @@ class PlayState extends MusicBeatState
songSpeed = ClientPrefs.getGameplaySetting('scrollspeed');
}
- var songData = SONG;
+ var songData:SwagSong = SONG;
Conductor.bpm = songData.bpm;
+ gfSide = !songData.isOldVersion;
curSong = songData.song;
@@ -1702,10 +1704,7 @@ class PlayState extends MusicBeatState
bfVocal = true;
}
}
- }
- catch (e:Dynamic)
- {
- }
+ } catch (e:Dynamic) {}
#if FLX_PITCH
if (bfVocal) vocals.pitch = playbackRate;
@@ -1715,13 +1714,8 @@ class PlayState extends MusicBeatState
if (opVocal) FlxG.sound.list.add(opponentVocals);
inst = new FlxSound();
- try
- {
- inst.loadEmbedded(Paths.inst(songData.song));
- }
- catch (e:Dynamic)
- {
- }
+ try { inst.loadEmbedded(Paths.inst(songData.song)); }
+ catch (e:Dynamic) {}
FlxG.sound.list.add(inst);
notes = new NoteGroup();
@@ -1820,7 +1814,7 @@ class PlayState extends MusicBeatState
};
swagNote.noteData |= gottaHitNote ? 1<<8 : 0; // mustHit
- swagNote.noteData |= (section.gfSection && (songNotes[1]<4) || songNotes[3] == 'GF Sing' || songNotes[3] == 4) ? 1<<11 : 0; // gfNote
+ swagNote.noteData |= (section.gfSection && (gfSide ? gottaHitNote : !gottaHitNote)) || songNotes[3] == 'GF Sing' || songNotes[3] == 4 ? 1<<11 : 0; // gfNote
swagNote.noteData |= (section.altAnim || (songNotes[3] == 'Alt Animation' || songNotes[3] == 1)) ? 1<<12 : 0; // altAnim
swagNote.noteData |= (songNotes[3] == 'No Animation' || songNotes[3] == 5) ? 1<<13 : 0; // noAnimation & noMissAnimaiton