Skip to content

Commit

Permalink
Changed the adaptation target of gfSection + fixed the version + temp…
Browse files Browse the repository at this point in the history
…lates changed
  • Loading branch information
HRK-EXEX committed Jan 5, 2025
1 parent e66b82f commit fa40078
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 34 deletions.
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/crash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ body:
- "Mac"
- "Android"
- "iOS"
- "HTML5"
- "Flash/Air-based target"
- "Neko, HashLink, or other build system"
validations:
required: true

Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ xsi:schemaLocation="http://lime.openfl.org/project/1.0.4 http://lime.openfl.org/

<!-- ______________________ PSYCH ENGINE CUSTOMIZATION ______________________ -->

<!-- Compiles mod support for P-Slice. Feel free to disable if you're making a source mod -->
<!-- Compiles mod support for H-Slice. Feel free to disable if you're making a source mod -->
<define name="MODS_ALLOWED" if="desktop || mobile" />

<!-- Adds support for Psuch's lua/HScript files-->
<!-- Adds support for Psych's lua/HScript files-->
<define name="HSCRIPT_ALLOWED" if="desktop || mobile"/>
<define name="LUA_ALLOWED" if="cpp" />

Expand All @@ -39,7 +39,7 @@ xsi:schemaLocation="http://lime.openfl.org/project/1.0.4 http://lime.openfl.org/
<!-- Adds support for touchscreen devices (like mobiles)-->
<define name="TOUCH_CONTROLS_ALLOWED" if="mobile || web" />

<!-- Do you want to check for P-Slice updates?-->
<!-- Do you want to check for H-Slice updates?-->
<define name="CHECK_FOR_UPDATES"/>

<!-- Do you want to support playing videos in your build?-->
Expand Down
14 changes: 12 additions & 2 deletions source/backend/Song.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package backend;

import haxe.ds.Vector;
import haxe.Json;
import backend.SongJson;
import lime.utils.Assets;
Expand All @@ -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;
Expand Down Expand Up @@ -157,19 +160,26 @@ class Song

public static function parseJSON(rawData:String, ?nameForError:String = null, ?convertTo:String = 'psych_v1'):SwagSong
{
var isOldVer:Vector<Bool> = 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)
{
Expand Down
10 changes: 5 additions & 5 deletions source/objects/Note.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<Float>,
noteSkin:String
var noteData:Int;
@:optional var noteType:String;
var holdLength:Null<Float>;
var noteSkin:String;
}

var toBool = CoolUtil.bool;
Expand Down
20 changes: 7 additions & 13 deletions source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,7 @@ class PlayState extends MusicBeatState
private var noteTypes:Array<String> = [];
private var eventsPushed:Array<String> = [];
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;
Expand All @@ -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;

Expand All @@ -1702,10 +1704,7 @@ class PlayState extends MusicBeatState
bfVocal = true;
}
}
}
catch (e:Dynamic)
{
}
} catch (e:Dynamic) {}

#if FLX_PITCH
if (bfVocal) vocals.pitch = playbackRate;
Expand All @@ -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();
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit fa40078

Please sign in to comment.