Merge remote-tracking branch 'origin/rewrite/master' into rewrite/feature/chart-editor-erect-template

This commit is contained in:
EliteMasterEric 2023-10-09 12:15:05 -04:00
commit 4b23eaea59
10 changed files with 89 additions and 127 deletions

View file

@ -3,18 +3,31 @@ description: "sets up haxe shit, using HMM!"
runs:
using: "composite"
steps:
- uses: krdlab/setup-haxe@v1.5.1
with:
haxe-version: 4.3.1
- name: Config haxelib
run: |
haxelib config
shell: bash
- name: Installing Haxe lol
run: |
haxe -version
haxelib git haxelib https://github.com/HaxeFoundation/haxelib.git development
haxelib version
haxelib --global install hmm
haxelib --global run hmm install --quiet
shell: bash
- uses: krdlab/setup-haxe@v1.5.1
with:
haxe-version: 4.3.1
- name: Config haxelib
run: |
haxelib config
shell: bash
- name: Installing Haxe lol
run: |
haxe -version
haxelib git haxelib https://github.com/HaxeFoundation/haxelib.git development
haxelib version
haxelib --global install hmm
shell: bash
- name: dependency install cache
id: cache-hmm
uses: actions/cache@v3
with:
path: .haxelib
key: ${{ runner.os }}-hmm-${{ hashFiles('**/hmm.json') }}
restore-keys: |
${{ runner.os }}-hmm-
${{ runner.os }}-
- if: ${{ steps.cache-hmm.outputs.cache-hit != 'true' }}
name: hmm install
run: |
haxelib --global run hmm install
shell: bash

View file

@ -36,9 +36,9 @@ runs:
./butler -V
shell: bash
- name: Upload game to itch.io
env:
env:
BUTLER_API_KEY: ${{inputs.butler-key}}
run: |
./butler login
./butler push ${{inputs.build-dir}} ninja-muffin24/funkin-secret:${{inputs.target}}-${GITHUB_REF##*/}
shell: bash
shell: bash

View file

@ -26,9 +26,11 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
token: ${{ secrets.GH_RO_PAT }}
- uses: ./.github/actions/setup-haxeshit
- name: Build game
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev xorg-dev libgl-dev libxi-dev libxext-dev libasound2-dev libxinerama-dev libxrandr-dev libgl1-mesa-dev
haxelib run lime build html5 -release --times
ls
@ -48,6 +50,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
token: ${{ secrets.GH_RO_PAT }}
- uses: ./.github/actions/setup-haxeshit
- name: Build game
run: |
@ -68,6 +71,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
token: ${{ secrets.GH_RO_PAT }}
- uses: ./.github/actions/setup-haxeshit
- name: Run unit tests
run: |

2
assets

@ -1 +1 @@
Subproject commit af2767368a273eaaf8010ba0de79f4f1a7482e16
Subproject commit ddc9c55a6c898dc6747dfc5a80295a6dc26e653c

View file

@ -139,7 +139,7 @@
"name": "openfl",
"type": "git",
"dir": null,
"ref": "d33d489a137ff8fdece4994cf1302f0b6334ed08",
"ref": "de9395d2f367a80f93f082e1b639b9cde2258bf1",
"url": "https://github.com/EliteMasterEric/openfl"
},
{

View file

@ -1879,6 +1879,7 @@ class PlayState extends MusicBeatSubState
{
// Grant the player health.
health += Constants.HEALTH_HOLD_BONUS_PER_SECOND * elapsed;
songScore += Std.int(Constants.SCORE_HOLD_BONUS_PER_SECOND * elapsed);
}
// TODO: Potential penalty for dropping a hold note?
@ -1999,103 +2000,6 @@ class PlayState extends MusicBeatSubState
}
}
/**
* Handle player inputs.
*/
function keyShit(test:Bool):Void
{
// control arrays, order L D R U
var holdArray:Array<Bool> = [controls.NOTE_LEFT, controls.NOTE_DOWN, controls.NOTE_UP, controls.NOTE_RIGHT];
var pressArray:Array<Bool> = [
controls.NOTE_LEFT_P,
controls.NOTE_DOWN_P,
controls.NOTE_UP_P,
controls.NOTE_RIGHT_P
];
var releaseArray:Array<Bool> = [
controls.NOTE_LEFT_R,
controls.NOTE_DOWN_R,
controls.NOTE_UP_R,
controls.NOTE_RIGHT_R
];
// if (pressArray.contains(true))
// {
// var lol:Array<Int> = cast pressArray;
// inputSpitter.push(Std.int(Conductor.songPosition) + ' ' + lol.join(' '));
// }
// HOLDS, check for sustain notes
if (holdArray.contains(true) && generatedMusic)
{
/*
activeNotes.forEachAlive(function(daNote:Note) {
if (daNote.isSustainNote && daNote.canBeHit && daNote.mustPress && holdArray[daNote.data.noteData]) goodNoteHit(daNote);
});
*/
}
// PRESSES, check for note hits
if (pressArray.contains(true) && generatedMusic)
{
Haptic.vibrate(100, 100);
if (currentStage != null && currentStage.getBoyfriend() != null)
{
currentStage.getBoyfriend().holdTimer = 0;
}
var possibleNotes:Array<NoteSprite> = []; // notes that can be hit
var directionList:Array<Int> = []; // directions that can be hit
var dumbNotes:Array<NoteSprite> = []; // notes to kill later
for (note in dumbNotes)
{
FlxG.log.add('killing dumb ass note at ' + note.noteData.time);
note.kill();
// activeNotes.remove(note, true);
note.destroy();
}
possibleNotes.sort((a, b) -> Std.int(a.noteData.time - b.noteData.time));
if (perfectMode)
{
goodNoteHit(possibleNotes[0], null);
}
else if (possibleNotes.length > 0)
{
for (shit in 0...pressArray.length)
{ // if a direction is hit that shouldn't be
if (pressArray[shit] && !directionList.contains(shit)) ghostNoteMiss(shit);
}
for (coolNote in possibleNotes)
{
if (pressArray[coolNote.noteData.getDirection()]) goodNoteHit(coolNote, null);
}
}
else
{
// HNGGG I really want to add an option for ghost tapping
// L + ratio
for (shit in 0...pressArray.length)
if (pressArray[shit]) ghostNoteMiss(shit, false);
}
}
if (currentStage == null) return;
for (keyId => isPressed in pressArray)
{
if (playerStrumline == null) continue;
var dir:NoteDirection = Strumline.DIRECTIONS[keyId];
if (isPressed && !playerStrumline.isConfirm(dir)) playerStrumline.playPress(dir);
if (!holdArray[keyId]) playerStrumline.playStatic(dir);
}
}
function goodNoteHit(note:NoteSprite, input:PreciseInputEvent):Void
{
var event:NoteScriptEvent = new NoteScriptEvent(ScriptEvent.NOTE_HIT, note, Highscore.tallies.combo + 1, true);
@ -2104,19 +2008,16 @@ class PlayState extends MusicBeatSubState
// Calling event.cancelEvent() skips all the other logic! Neat!
if (event.eventCanceled) return;
if (!note.isHoldNote)
{
Highscore.tallies.combo++;
Highscore.tallies.totalNotesHit++;
Highscore.tallies.combo++;
Highscore.tallies.totalNotesHit++;
if (Highscore.tallies.combo > Highscore.tallies.maxCombo) Highscore.tallies.maxCombo = Highscore.tallies.combo;
if (Highscore.tallies.combo > Highscore.tallies.maxCombo) Highscore.tallies.maxCombo = Highscore.tallies.combo;
popUpScore(note, input);
}
popUpScore(note, input);
playerStrumline.hitNote(note);
if (note.holdNoteSprite != null)
if (note.isHoldNote && note.holdNoteSprite != null)
{
playerStrumline.playNoteHoldCover(note.holdNoteSprite);
}

View file

@ -89,6 +89,7 @@ class ChartEditorDialogHandler
linkCreateBasic.onClick = function(_event) {
// Hide the welcome dialog
dialog.hideDialog(DialogButton.CANCEL);
state.stopWelcomeMusic();
//
// Create Song Wizard
@ -114,6 +115,7 @@ class ChartEditorDialogHandler
linkImportChartLegacy.onClick = function(_event) {
// Hide the welcome dialog
dialog.hideDialog(DialogButton.CANCEL);
state.stopWelcomeMusic();
// Open the "Import Chart" dialog
openImportChartWizard(state, 'legacy', false);
@ -124,6 +126,7 @@ class ChartEditorDialogHandler
buttonBrowse.onClick = function(_event) {
// Hide the welcome dialog
dialog.hideDialog(DialogButton.CANCEL);
state.stopWelcomeMusic();
// Open the "Open Chart" dialog
openBrowseWizard(state, false);
@ -152,6 +155,7 @@ class ChartEditorDialogHandler
linkTemplateSong.text = songName;
linkTemplateSong.onClick = function(_event) {
dialog.hideDialog(DialogButton.CANCEL);
state.stopWelcomeMusic();
// Load song from template
ChartEditorImportExportHandler.loadSongAsTemplate(state, targetSongId);
@ -160,6 +164,7 @@ class ChartEditorDialogHandler
splashTemplateContainer.addComponent(linkTemplateSong);
}
state.fadeInWelcomeMusic();
return dialog;
}

View file

@ -788,6 +788,11 @@ class ChartEditorState extends HaxeUIState
*/
// ==============================
/**
* The chill audio track that plays when you open the Chart Editor.
*/
public var welcomeMusic:FlxSound = new FlxSound();
/**
* The audio track for the instrumental.
* Replaced when switching instrumentals.
@ -1234,6 +1239,9 @@ class ChartEditorState extends HaxeUIState
// Get rid of any music from the previous state.
FlxG.sound.music.stop();
// Play the welcome music.
setupWelcomeMusic();
buildDefaultSongData();
buildBackground();
@ -1258,6 +1266,26 @@ class ChartEditorState extends HaxeUIState
ChartEditorDialogHandler.openWelcomeDialog(this, false);
}
function setupWelcomeMusic()
{
this.welcomeMusic.loadEmbedded(Paths.music('chartEditorLoop/chartEditorLoop'));
this.welcomeMusic.looped = true;
// this.welcomeMusic.play();
// fadeInWelcomeMusic();
}
public function fadeInWelcomeMusic():Void
{
this.welcomeMusic.play();
this.welcomeMusic.fadeIn(4, 0, 1.0);
}
public function stopWelcomeMusic():Void
{
// this.welcomeMusic.fadeOut(4, 0);
this.welcomeMusic.pause();
}
function buildDefaultSongData():Void
{
selectedVariation = Constants.DEFAULT_VARIATION;

View file

@ -324,10 +324,15 @@ class Constants
public static final HEALTH_MINE_PENALTY:Float = 15.0 / 100.0 * HEALTH_MAX; // 15.0%
/**
* If true, the player will not receive the ghost miss penalty if there are no notes within the hit window.
* This is the thing people have been begging for forever lolol.
* SCORE VALUES
*/
public static final GHOST_TAPPING:Bool = false;
// ==============================
/**
* The amount of score the player gains for every send they hold a hold note.
* A fraction of this value is granted every frame.
*/
public static final SCORE_HOLD_BONUS_PER_SECOND:Float = 250.0;
/**
* FILE EXTENSIONS
@ -367,6 +372,12 @@ class Constants
*/
// ==============================
/**
* If true, the player will not receive the ghost miss penalty if there are no notes within the hit window.
* This is the thing people have been begging for forever lolol.
*/
public static final GHOST_TAPPING:Bool = false;
/**
* The separator between an asset library and the asset path.
*/