1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-12 08:25:13 +00:00

Merge pull request #350 from FunkinCrew/feature/blazin-animation-work

Several chart editor fixes
This commit is contained in:
Cameron Taylor 2024-02-29 02:24:59 -05:00 committed by GitHub
commit 45e256ebbb
5 changed files with 33 additions and 26 deletions

2
assets

@ -1 +1 @@
Subproject commit 84b1574294e7a7af21adf1a0e4894c88431ca43d
Subproject commit 8b914574fc4724c5fe483f4f9d81081bb1518c12

View file

@ -631,8 +631,9 @@ class PlayState extends MusicBeatSubState
// Initialize the judgements and combo meter.
comboPopUps = new PopUpStuff();
comboPopUps.cameras = [camHUD];
comboPopUps.zIndex = 900;
add(comboPopUps);
comboPopUps.cameras = [camHUD];
// The little dial that shows up when you hold the Skip Cutscene key.
skipTimer = new FlxPieDial(16, 16, 32, FlxColor.WHITE, 36, CIRCLE, true, 24);
@ -1277,6 +1278,7 @@ class PlayState extends MusicBeatSubState
{
var animShit:ComboMilestone = new ComboMilestone(-100, 300, Highscore.tallies.combo);
animShit.scrollFactor.set(0.6, 0.6);
animShit.zIndex = 1100;
animShit.cameras = [camHUD];
add(animShit);
@ -1363,18 +1365,21 @@ class PlayState extends MusicBeatSubState
healthBarBG = FunkinSprite.create(0, healthBarYPos, Paths.image('healthBar'));
healthBarBG.screenCenter(X);
healthBarBG.scrollFactor.set(0, 0);
healthBarBG.zIndex = 800;
add(healthBarBG);
healthBar = new FlxBar(healthBarBG.x + 4, healthBarBG.y + 4, RIGHT_TO_LEFT, Std.int(healthBarBG.width - 8), Std.int(healthBarBG.height - 8), this,
'healthLerp', 0, 2);
healthBar.scrollFactor.set();
healthBar.createFilledBar(Constants.COLOR_HEALTH_BAR_RED, Constants.COLOR_HEALTH_BAR_GREEN);
healthBar.zIndex = 801;
add(healthBar);
// The score text below the health bar.
scoreText = new FlxText(healthBarBG.x + healthBarBG.width - 190, healthBarBG.y + 30, 0, '', 20);
scoreText.setFormat(Paths.font('vcr.ttf'), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
scoreText.scrollFactor.set();
scoreText.zIndex = 802;
add(scoreText);
// Move the health bar to the HUD camera.
@ -1488,6 +1493,7 @@ class PlayState extends MusicBeatSubState
iconP2 = new HealthIcon('dad', 1);
iconP2.y = healthBar.y - (iconP2.height / 2);
dad.initHealthIcon(true); // Apply the character ID here
iconP2.zIndex = 850;
add(iconP2);
iconP2.cameras = [camHUD];
@ -1507,6 +1513,7 @@ class PlayState extends MusicBeatSubState
iconP1 = new HealthIcon('bf', 0);
iconP1.y = healthBar.y - (iconP1.height / 2);
boyfriend.initHealthIcon(false); // Apply the character ID here
iconP1.zIndex = 850;
add(iconP1);
iconP1.cameras = [camHUD];
@ -1574,13 +1581,13 @@ class PlayState extends MusicBeatSubState
playerStrumline.x = FlxG.width / 2 + Constants.STRUMLINE_X_OFFSET; // Classic style
// playerStrumline.x = FlxG.width - playerStrumline.width - Constants.STRUMLINE_X_OFFSET; // Centered style
playerStrumline.y = Preferences.downscroll ? FlxG.height - playerStrumline.height - Constants.STRUMLINE_Y_OFFSET : Constants.STRUMLINE_Y_OFFSET;
playerStrumline.zIndex = 200;
playerStrumline.zIndex = 1001;
playerStrumline.cameras = [camHUD];
// Position the opponent strumline on the left half of the screen
opponentStrumline.x = Constants.STRUMLINE_X_OFFSET;
opponentStrumline.y = Preferences.downscroll ? FlxG.height - opponentStrumline.height - Constants.STRUMLINE_Y_OFFSET : Constants.STRUMLINE_Y_OFFSET;
opponentStrumline.zIndex = 100;
opponentStrumline.zIndex = 1000;
opponentStrumline.cameras = [camHUD];
if (!PlayStatePlaylist.isStoryMode)

View file

@ -191,7 +191,11 @@ class AnimateAtlasCharacter extends BaseCharacter
_skipTransformChildren = true;
super.kill();
_skipTransformChildren = false;
this.mainSprite.kill();
if (this.mainSprite != null)
{
this.mainSprite.kill();
this.mainSprite = null;
}
}
/**

View file

@ -5,6 +5,7 @@ import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.tweens.FlxTween;
import funkin.graphics.FunkinSprite;
import funkin.play.PlayState;
import flixel.util.FlxDirection;
class PopUpStuff extends FlxTypedGroup<FlxSprite>
{
@ -30,14 +31,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
rating.zIndex = 1000;
rating.x = FlxG.width * 0.50;
rating.x -= FlxG.camera.scroll.x * 0.2;
// make sure rating is visible lol!
// if (rating.x < FlxG.camera.scroll.x)
// rating.x = FlxG.camera.scroll.x;
// else if (rating.x > FlxG.camera.scroll.x + FlxG.camera.width - rating.width)
// rating.x = FlxG.camera.scroll.x + FlxG.camera.width - rating.width;
// FlxG.camera.scroll.y +
// rating.x -= FlxG.camera.scroll.x * 0.2;
rating.y = FlxG.camera.height * 0.4 - 60;
rating.acceleration.y = 550;
rating.velocity.y -= FlxG.random.int(140, 175);
@ -91,13 +85,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
var comboSpr:FunkinSprite = FunkinSprite.create(Paths.image(pixelShitPart1 + 'combo' + pixelShitPart2));
comboSpr.y = FlxG.camera.height * 0.4 + 80;
comboSpr.x = FlxG.width * 0.50;
comboSpr.x -= FlxG.camera.scroll.x * 0.2;
// make sure combo is visible lol!
// 194 fits 4 combo digits
// if (comboSpr.x < FlxG.camera.scroll.x + 194)
// comboSpr.x = FlxG.camera.scroll.x + 194;
// else if (comboSpr.x > FlxG.camera.scroll.x + FlxG.camera.width - comboSpr.width)
// comboSpr.x = FlxG.camera.scroll.x + FlxG.camera.width - comboSpr.width;
// comboSpr.x -= FlxG.camera.scroll.x * 0.2;
comboSpr.acceleration.y = 600;
comboSpr.velocity.y -= 150;

View file

@ -2838,12 +2838,15 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
menuBarItemInputStyleNone.onClick = function(event:UIEvent) {
currentLiveInputStyle = None;
};
menuBarItemInputStyleNone.selected = currentLiveInputStyle == None;
menuBarItemInputStyleNumberKeys.onClick = function(event:UIEvent) {
currentLiveInputStyle = NumberKeys;
};
menuBarItemInputStyleNumberKeys.selected = currentLiveInputStyle == NumberKeys;
menuBarItemInputStyleWASD.onClick = function(event:UIEvent) {
currentLiveInputStyle = WASD;
currentLiveInputStyle = WASDKeys;
};
menuBarItemInputStyleWASD.selected = currentLiveInputStyle == WASDKeys;
menubarItemAbout.onClick = _ -> this.openAboutDialog();
menubarItemWelcomeDialog.onClick = _ -> this.openWelcomeDialog(true);
@ -2942,7 +2945,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
menubarItemPlaybackSpeed.onChange = event -> {
var pitch:Float = (event.value.toFloat() * 2.0) / 100.0;
pitch = Math.floor(pitch / 0.25) * 0.25; // Round to nearest 0.25.
pitch = Math.floor(pitch / 0.05) * 0.05; // Round to nearest 5%
pitch = Math.max(0.05, Math.min(2.0, pitch)); // Clamp to 5% to 200%
#if FLX_PITCH
if (audioInstTrack != null) audioInstTrack.pitch = pitch;
audioVocalTrackGroup.pitch = pitch;
@ -4933,7 +4937,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
// Place notes at the playhead.
switch (currentLiveInputStyle)
{
case ChartEditorLiveInputStyle.WASD:
case ChartEditorLiveInputStyle.WASDKeys:
if (FlxG.keys.justPressed.A) placeNoteAtPlayhead(4);
if (FlxG.keys.justPressed.S) placeNoteAtPlayhead(5);
if (FlxG.keys.justPressed.W) placeNoteAtPlayhead(6);
@ -5236,6 +5240,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
}
// Would bind Ctrl+A and Ctrl+D here, but they are already bound to Select All and Select None.
}
else
{
trace('Ignoring keybinds for View menu items because we are in live input mode (${currentLiveInputStyle}).');
}
}
/**
@ -6125,7 +6133,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
}
/**
* Available input modes for the chart editor state.
* Available input modes for the chart editor state. Numbers/arrows/WASD available for other keybinds.
*/
enum ChartEditorLiveInputStyle
{
@ -6140,9 +6148,9 @@ enum ChartEditorLiveInputStyle
NumberKeys;
/**
* WASD to place notes on opponent's side, arrow keys to place notes on player's side.
* WASD to place notes on opponent's side, Arrow keys to place notes on player's side.
*/
WASD;
WASDKeys;
}
typedef ChartEditorParams =