Format .hx files
Co-Authored-By: Eric <4635334+EliteMasterEric@users.noreply.github.com>
This commit is contained in:
@@ -30,8 +30,7 @@ import haxe.ui.events.UIEvent;
|
||||
* and adding/removing variations and difficulties.
|
||||
*/
|
||||
// @:nullSafety // TODO: Fix null safety when used with HaxeUI build macros.
|
||||
@:access(funkin.ui.debug.charting.ChartEditorState)
|
||||
@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/difficulty.xml"))
|
||||
@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/difficulty.xml"))
|
||||
class ChartEditorDifficultyToolbox extends ChartEditorBaseToolbox
|
||||
{
|
||||
var difficultyToolboxTree:TreeView;
|
||||
|
||||
@@ -31,16 +31,13 @@ import flixel.FlxG;
|
||||
/**
|
||||
* The toolbox which allows modifying information like Song Title, Scroll Speed, Characters/Stages, and starting BPM.
|
||||
*/
|
||||
@:access(funkin.ui.debug.charting.ChartEditorState)
|
||||
@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/event-data.xml"))
|
||||
@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/event-data.xml"))
|
||||
class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox
|
||||
{
|
||||
var toolboxEventsEventKind:DropDown;
|
||||
var toolboxEventsDataBox:VBox;
|
||||
|
||||
var easeGraphImage:Image;
|
||||
var easeDotImage:Image;
|
||||
|
||||
var _easeGraphSprite:Null<flixel.FlxSprite> = null;
|
||||
var _easeDotSprites:Array<flixel.FlxSprite> = [];
|
||||
var _dotTimer:Null<FlxTimer> = null;
|
||||
|
||||
@@ -21,8 +21,7 @@ import haxe.ui.events.UIEvent;
|
||||
* The toolbox which allows modifying information like Song Title, Scroll Speed, Characters/Stages, and starting BPM.
|
||||
*/
|
||||
// @:nullSafety // TODO: Fix null safety when used with HaxeUI build macros.
|
||||
@:access(funkin.ui.debug.charting.ChartEditorState)
|
||||
@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/freeplay.xml"))
|
||||
@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/freeplay.xml"))
|
||||
class ChartEditorFreeplayToolbox extends ChartEditorBaseToolbox
|
||||
{
|
||||
var waveformContainer:Absolute;
|
||||
@@ -40,18 +39,14 @@ class ChartEditorFreeplayToolbox extends ChartEditorBaseToolbox
|
||||
var previewSelectionSprite:SpriteWrapper;
|
||||
|
||||
static final TICK_LABEL_X_OFFSET:Float = 4.0;
|
||||
|
||||
static final PLAYHEAD_RIGHT_PAD:Float = 10.0;
|
||||
|
||||
static final BASE_SCALE:Float = 64.0;
|
||||
static final STARTING_SCALE:Float = 1024.0;
|
||||
static final MIN_SCALE:Float = 4.0;
|
||||
static final WAVEFORM_ZOOM_MULT:Float = 1.5;
|
||||
|
||||
static final MAGIC_SCALE_BASE_TIME:Float = 5.0;
|
||||
|
||||
var waveformScale:Float = STARTING_SCALE;
|
||||
|
||||
var playheadAbsolutePos(get, set):Float;
|
||||
|
||||
function get_playheadAbsolutePos():Float
|
||||
@@ -107,9 +102,7 @@ class ChartEditorFreeplayToolbox extends ChartEditorBaseToolbox
|
||||
var waveformMagicFactor:Float = 1.0;
|
||||
|
||||
var audioPreviewTracks:SoundGroup;
|
||||
|
||||
var tickTiledSprite:FlxTiledSprite;
|
||||
|
||||
var freeplayPreviewVolume(get, null):Float;
|
||||
|
||||
function get_freeplayPreviewVolume():Float
|
||||
@@ -377,7 +370,6 @@ class ChartEditorFreeplayToolbox extends ChartEditorBaseToolbox
|
||||
}
|
||||
|
||||
var waveformDragStartPos:Null<Float> = null;
|
||||
|
||||
var waveformDragPreviewStartPos:Float;
|
||||
var waveformDragPreviewEndPos:Float;
|
||||
|
||||
|
||||
@@ -27,8 +27,7 @@ import haxe.ui.events.UIEvent;
|
||||
* The toolbox which allows modifying information like Song Title, Scroll Speed, Characters/Stages, and starting BPM.
|
||||
*/
|
||||
// @:nullSafety // TODO: Fix null safety when used with HaxeUI build macros.
|
||||
@:access(funkin.ui.debug.charting.ChartEditorState)
|
||||
@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/metadata.xml"))
|
||||
@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/metadata.xml"))
|
||||
class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||
{
|
||||
var inputSongId:TextField;
|
||||
@@ -158,7 +157,8 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||
var startingValueNoteStyle = ChartEditorDropdowns.populateDropdownWithNoteStyles(inputNoteStyle, chartEditorState.currentSongMetadata.playData.noteStyle);
|
||||
inputNoteStyle.value = startingValueNoteStyle;
|
||||
|
||||
inputAlbum.onChange = (event:UIEvent) -> {
|
||||
inputAlbum.onChange = (event:UIEvent) ->
|
||||
{
|
||||
var valid:Bool = event.data != null && event.data.id != null;
|
||||
|
||||
if (valid)
|
||||
@@ -169,7 +169,8 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||
var startingValueAlbum = ChartEditorDropdowns.populateDropdownWithAlbums(inputAlbum, chartEditorState.currentSongMetadata.playData?.album);
|
||||
inputAlbum.value = startingValueAlbum;
|
||||
|
||||
inputStickerPack.onChange = (event:UIEvent) -> {
|
||||
inputStickerPack.onChange = (event:UIEvent) ->
|
||||
{
|
||||
var valid:Bool = event.data != null && event.data.id != null;
|
||||
|
||||
if (valid)
|
||||
@@ -177,19 +178,24 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||
chartEditorState.currentSongStickerPack = event.data.id;
|
||||
}
|
||||
}
|
||||
var startingValueStickerPack = ChartEditorDropdowns.populateDropdownWithStickerPacks(inputStickerPack, chartEditorState.currentSongMetadata.playData?.stickerPack);
|
||||
var startingValueStickerPack = ChartEditorDropdowns.populateDropdownWithStickerPacks(inputStickerPack,
|
||||
chartEditorState.currentSongMetadata.playData?.stickerPack);
|
||||
inputStickerPack.value = startingValueStickerPack;
|
||||
|
||||
inputTimeChange.onChange = function(event:UIEvent)
|
||||
{
|
||||
var currentTimeChange = refreshTimeChangeInputs();
|
||||
var previousTimeChange = chartEditorState.currentSongMetadata.timeChanges[inputTimeChange.selectedIndex - 1];
|
||||
var previousTimeChange = chartEditorState.currentSongMetadata.timeChanges[
|
||||
inputTimeChange.selectedIndex - 1
|
||||
];
|
||||
// Set the step of the timestamp to the step.
|
||||
inputTimeStamp.step = ((Constants.SECS_PER_MIN / (previousTimeChange?.bpm ?? currentTimeChange?.bpm ?? 100)) * Constants.MS_PER_SEC) * (4 / (previousTimeChange?.timeSignatureDen ?? currentTimeChange?.timeSignatureDen ?? 4)) / Constants.STEPS_PER_BEAT;
|
||||
// Set the min max values of the input timestamp to previous and next time change timestamps to in the array,
|
||||
// to prevent the conductor from breaking due to time change timestamps not being in ascending order.
|
||||
inputTimeStamp.min = (previousTimeChange?.timeStamp ?? 0);
|
||||
inputTimeStamp.max = (chartEditorState.currentSongMetadata.timeChanges[inputTimeChange.selectedIndex + 1]?.timeStamp ?? chartEditorState.songLengthInMs);
|
||||
inputTimeStamp.max = (chartEditorState.currentSongMetadata.timeChanges[
|
||||
inputTimeChange.selectedIndex + 1
|
||||
]?.timeStamp ?? chartEditorState.songLengthInMs);
|
||||
inputTimeStamp.max -= 1;
|
||||
|
||||
// Prevent the inital time change timestamp from being modified (it should always be 0) or removed.
|
||||
@@ -323,6 +329,7 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||
}
|
||||
|
||||
// Separate function because it needs to be refreshed in some of the time change commands, updating the entire toolbox would be wasteful.
|
||||
|
||||
public function refreshTimeChanges(startingTimeChangeIndex:Int = 0):Void
|
||||
{
|
||||
// Reset time change dropdown and the associated inputs
|
||||
@@ -390,9 +397,7 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||
var album:Null<Album> = AlbumRegistry.instance.fetchEntry(albumId);
|
||||
if (inputAlbum != null)
|
||||
{
|
||||
inputAlbum.value = (album != null) ?
|
||||
{id: album.id, text: album.getAlbumName()} :
|
||||
{id: "volume1", text: "Volume 1"};
|
||||
inputAlbum.value = (album != null) ? {id: album.id, text: album.getAlbumName()} : {id: "volume1", text: "Volume 1"};
|
||||
}
|
||||
|
||||
var LIMIT = 6;
|
||||
|
||||
@@ -17,18 +17,15 @@ import funkin.data.song.SongData.NoteParamData;
|
||||
/**
|
||||
* The toolbox which allows modifying information like Note Kind.
|
||||
*/
|
||||
@:access(funkin.ui.debug.charting.ChartEditorState)
|
||||
@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/note-data.xml"))
|
||||
@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/note-data.xml"))
|
||||
class ChartEditorNoteDataToolbox extends ChartEditorBaseToolbox
|
||||
{
|
||||
// 100 is the height used in note-data.xml
|
||||
static final DIALOG_HEIGHT:Int = 100;
|
||||
|
||||
// toolboxNotesGrid.height + 45
|
||||
// this is what i found out by printing this.height and grid.height
|
||||
// and then seeing that this.height is 100 and grid.height is 55
|
||||
static final HEIGHT_OFFSET:Int = 45;
|
||||
|
||||
// minimizing creates a gray bar the bottom, which would obscure the components,
|
||||
// which is why we use an extra offset of 20
|
||||
static final MINIMIZE_FIX:Int = 20;
|
||||
@@ -37,7 +34,6 @@ class ChartEditorNoteDataToolbox extends ChartEditorBaseToolbox
|
||||
var toolboxNotesNoteKind:DropDown;
|
||||
var toolboxNotesCustomKind:TextField;
|
||||
var toolboxNotesParams:Array<ToolboxNoteKindParam> = [];
|
||||
|
||||
var _initializing:Bool = true;
|
||||
|
||||
public function new(chartEditorState2:ChartEditorState)
|
||||
|
||||
@@ -21,8 +21,7 @@ import haxe.ui.events.UIEvent;
|
||||
*/
|
||||
// @:nullSafety // TODO: Fix null safety when used with HaxeUI build macros.
|
||||
|
||||
@:access(funkin.ui.debug.charting.ChartEditorState)
|
||||
@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/offsets.xml"))
|
||||
@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/offsets.xml"))
|
||||
class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox
|
||||
{
|
||||
var waveformContainer:Absolute;
|
||||
@@ -42,17 +41,13 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox
|
||||
var playheadSprite:SpriteWrapper;
|
||||
|
||||
static final TICK_LABEL_X_OFFSET:Float = 4.0;
|
||||
|
||||
static final PLAYHEAD_RIGHT_PAD:Float = 10.0;
|
||||
|
||||
static final BASE_SCALE:Float = 64.0;
|
||||
static final MIN_SCALE:Float = 4.0;
|
||||
static final WAVEFORM_ZOOM_MULT:Float = 1.5;
|
||||
|
||||
static final MAGIC_SCALE_BASE_TIME:Float = 5.0;
|
||||
|
||||
var waveformScale:Float = BASE_SCALE;
|
||||
|
||||
var playheadAbsolutePos(get, set):Float;
|
||||
|
||||
function get_playheadAbsolutePos():Float
|
||||
@@ -83,11 +78,8 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox
|
||||
var waveformMagicFactor:Float = 1.0;
|
||||
|
||||
var audioPreviewTracks:SoundGroup;
|
||||
|
||||
var tickTiledSprite:FlxTiledSprite;
|
||||
|
||||
var tickLabels:Array<Label> = [];
|
||||
|
||||
// Local store of the audio offsets, so we can detect when they change.
|
||||
var audioPreviewPlayerOffset:Float = 0;
|
||||
var audioPreviewOpponentOffset:Float = 0;
|
||||
|
||||
Reference in New Issue
Block a user