mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-03-21 17:39:20 +00:00
DECIMAL BPM support for da charters out there,
also changes to HealthIcon to better work in ChartingState
This commit is contained in:
parent
80cac358c2
commit
daef9e0759
|
@ -76,7 +76,7 @@ class ChartingState extends MusicBeatState
|
|||
**/
|
||||
var curSelectedNote:Array<Dynamic>;
|
||||
|
||||
var tempBpm:Int = 0;
|
||||
var tempBpm:Float = 0;
|
||||
|
||||
var vocals:FlxSound;
|
||||
|
||||
|
@ -171,6 +171,7 @@ class ChartingState extends MusicBeatState
|
|||
add(curRenderedNotes);
|
||||
add(curRenderedSustains);
|
||||
|
||||
changeSection();
|
||||
super.create();
|
||||
}
|
||||
|
||||
|
@ -217,11 +218,11 @@ class ChartingState extends MusicBeatState
|
|||
|
||||
var loadAutosaveBtn:FlxButton = new FlxButton(reloadSongJson.x, reloadSongJson.y + 30, 'load autosave', loadAutosave);
|
||||
|
||||
var stepperSpeed:FlxUINumericStepper = new FlxUINumericStepper(10, 80, 0.1, 1, 0.1, 10, 1);
|
||||
var stepperSpeed:FlxUINumericStepper = new FlxUINumericStepper(10, 80, 0.1, 1, 0.1, 10, 2);
|
||||
stepperSpeed.value = _song.speed;
|
||||
stepperSpeed.name = 'song_speed';
|
||||
|
||||
var stepperBPM:FlxUINumericStepper = new FlxUINumericStepper(10, 65, 1, 1, 1, 339, 0);
|
||||
var stepperBPM:FlxUINumericStepper = new FlxUINumericStepper(10, 65, 1, 100, 1, 999, 3);
|
||||
stepperBPM.value = Conductor.bpm;
|
||||
stepperBPM.name = 'song_bpm';
|
||||
|
||||
|
@ -230,14 +231,15 @@ class ChartingState extends MusicBeatState
|
|||
var player1DropDown = new FlxUIDropDownMenu(10, 100, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String)
|
||||
{
|
||||
_song.player1 = characters[Std.parseInt(character)];
|
||||
updateHeads();
|
||||
});
|
||||
player1DropDown.selectedLabel = _song.player1;
|
||||
|
||||
var player2DropDown = new FlxUIDropDownMenu(140, 100, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String)
|
||||
{
|
||||
_song.player2 = characters[Std.parseInt(character)];
|
||||
updateHeads();
|
||||
});
|
||||
|
||||
player2DropDown.selectedLabel = _song.player2;
|
||||
|
||||
var tab_group_song = new FlxUI(null, UI_box);
|
||||
|
@ -276,7 +278,7 @@ class ChartingState extends MusicBeatState
|
|||
stepperLength.value = _song.notes[curSection].lengthInSteps;
|
||||
stepperLength.name = "section_length";
|
||||
|
||||
stepperSectionBPM = new FlxUINumericStepper(10, 80, 1, Conductor.bpm, 0, 999, 0);
|
||||
stepperSectionBPM = new FlxUINumericStepper(10, 80, 1, Conductor.bpm, 1, 999, 3);
|
||||
stepperSectionBPM.value = Conductor.bpm;
|
||||
stepperSectionBPM.name = 'section_bpm';
|
||||
|
||||
|
@ -425,9 +427,9 @@ class ChartingState extends MusicBeatState
|
|||
}
|
||||
else if (wname == 'song_bpm')
|
||||
{
|
||||
tempBpm = Std.int(nums.value);
|
||||
tempBpm = nums.value;
|
||||
Conductor.mapBPMChanges(_song);
|
||||
Conductor.changeBPM(Std.int(nums.value));
|
||||
Conductor.changeBPM(nums.value);
|
||||
}
|
||||
else if (wname == 'note_susLength')
|
||||
{
|
||||
|
@ -436,7 +438,7 @@ class ChartingState extends MusicBeatState
|
|||
}
|
||||
else if (wname == 'section_bpm')
|
||||
{
|
||||
_song.notes[curSection].bpm = Std.int(nums.value);
|
||||
_song.notes[curSection].bpm = nums.value;
|
||||
updateGrid();
|
||||
}
|
||||
}
|
||||
|
@ -456,7 +458,7 @@ class ChartingState extends MusicBeatState
|
|||
}*/
|
||||
function sectionStartTime():Float
|
||||
{
|
||||
var daBPM:Int = _song.bpm;
|
||||
var daBPM:Float = _song.bpm;
|
||||
var daPos:Float = 0;
|
||||
for (i in 0...curSection)
|
||||
{
|
||||
|
@ -793,13 +795,13 @@ class ChartingState extends MusicBeatState
|
|||
{
|
||||
if (check_mustHitSection.checked)
|
||||
{
|
||||
leftIcon.animation.play('bf');
|
||||
rightIcon.animation.play('dad');
|
||||
leftIcon.changeIcon(_song.player1);
|
||||
rightIcon.changeIcon(_song.player2);
|
||||
}
|
||||
else
|
||||
{
|
||||
leftIcon.animation.play('dad');
|
||||
rightIcon.animation.play('bf');
|
||||
leftIcon.changeIcon(_song.player2);
|
||||
rightIcon.changeIcon(_song.player1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -831,7 +833,7 @@ class ChartingState extends MusicBeatState
|
|||
else
|
||||
{
|
||||
// get last bpm
|
||||
var daBPM:Int = _song.bpm;
|
||||
var daBPM:Float = _song.bpm;
|
||||
for (i in 0...curSection)
|
||||
if (_song.notes[i].changeBPM)
|
||||
daBPM = _song.notes[i].bpm;
|
||||
|
|
|
@ -11,12 +11,12 @@ typedef BPMChangeEvent =
|
|||
{
|
||||
var stepTime:Int;
|
||||
var songTime:Float;
|
||||
var bpm:Int;
|
||||
var bpm:Float;
|
||||
}
|
||||
|
||||
class Conductor
|
||||
{
|
||||
public static var bpm:Int = 100;
|
||||
public static var bpm:Float = 100;
|
||||
public static var crochet:Float = ((60 / bpm) * 1000); // beats in milliseconds
|
||||
public static var stepCrochet:Float = crochet / 4; // steps in milliseconds
|
||||
public static var songPosition:Float;
|
||||
|
@ -36,7 +36,7 @@ class Conductor
|
|||
{
|
||||
bpmChangeMap = [];
|
||||
|
||||
var curBPM:Int = song.bpm;
|
||||
var curBPM:Float = song.bpm;
|
||||
var totalSteps:Int = 0;
|
||||
var totalPos:Float = 0;
|
||||
for (i in 0...song.notes.length)
|
||||
|
@ -59,7 +59,7 @@ class Conductor
|
|||
trace("new BPM map BUDDY " + bpmChangeMap);
|
||||
}
|
||||
|
||||
public static function changeBPM(newBpm:Int)
|
||||
public static function changeBPM(newBpm:Float)
|
||||
{
|
||||
bpm = newBpm;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ class HealthIcon extends FlxSprite
|
|||
*/
|
||||
public var sprTracker:FlxSprite;
|
||||
|
||||
var char:String = 'bf';
|
||||
var char:String = '';
|
||||
var isPlayer:Bool = false;
|
||||
|
||||
public function new(char:String = 'bf', isPlayer:Bool = false)
|
||||
|
@ -19,9 +19,8 @@ class HealthIcon extends FlxSprite
|
|||
super();
|
||||
|
||||
this.isPlayer = isPlayer;
|
||||
this.char = char;
|
||||
|
||||
loadIcon(char);
|
||||
changeIcon(char);
|
||||
antialiasing = true;
|
||||
scrollFactor.set();
|
||||
}
|
||||
|
@ -33,29 +32,26 @@ class HealthIcon extends FlxSprite
|
|||
isOldIcon = !isOldIcon;
|
||||
|
||||
if (isOldIcon)
|
||||
{
|
||||
loadGraphic(Paths.image('icons/icon-bf-old'), true, 150, 150);
|
||||
animation.add('bf-old', [0, 1], 0, false, isPlayer);
|
||||
animation.play('bf-old');
|
||||
}
|
||||
changeIcon('bf-old');
|
||||
else
|
||||
loadIcon(char);
|
||||
changeIcon('bf');
|
||||
}
|
||||
|
||||
function loadIcon(char:String):Void
|
||||
public function changeIcon(newChar:String):Void
|
||||
{
|
||||
var realChar:String = "";
|
||||
switch (char)
|
||||
{
|
||||
case 'bf-pixel':
|
||||
realChar = char;
|
||||
default:
|
||||
realChar = char.split('-')[0].trim();
|
||||
}
|
||||
if (newChar != 'bf-pixel' && newChar != 'bf-old')
|
||||
newChar = newChar.split('-')[0].trim();
|
||||
|
||||
loadGraphic(Paths.image('icons/icon-' + realChar), true, 150, 150);
|
||||
animation.add(realChar, [0, 1], 0, false, isPlayer);
|
||||
animation.play(realChar);
|
||||
if (newChar != char)
|
||||
{
|
||||
if (animation.getByName(newChar) == null)
|
||||
{
|
||||
loadGraphic(Paths.image('icons/icon-' + newChar), true, 150, 150);
|
||||
animation.add(newChar, [0, 1], 0, false, isPlayer);
|
||||
}
|
||||
animation.play(newChar);
|
||||
char = newChar;
|
||||
}
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
|
|
|
@ -6,7 +6,7 @@ typedef SwagSection =
|
|||
var lengthInSteps:Int;
|
||||
var typeOfSection:Int;
|
||||
var mustHitSection:Bool;
|
||||
var bpm:Int;
|
||||
var bpm:Float;
|
||||
var changeBPM:Bool;
|
||||
var altAnim:Bool;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ typedef SwagSong =
|
|||
{
|
||||
var song:String;
|
||||
var notes:Array<SwagSection>;
|
||||
var bpm:Int;
|
||||
var bpm:Float;
|
||||
var needsVoices:Bool;
|
||||
var speed:Float;
|
||||
|
||||
|
@ -24,7 +24,7 @@ class Song
|
|||
{
|
||||
public var song:String;
|
||||
public var notes:Array<SwagSection>;
|
||||
public var bpm:Int;
|
||||
public var bpm:Float;
|
||||
public var needsVoices:Bool = true;
|
||||
public var speed:Float = 1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue