2023-10-26 05:46:22 -04:00
|
|
|
package funkin.ui.debug.charting.components;
|
|
|
|
|
2024-01-12 06:13:34 -05:00
|
|
|
import flixel.addons.display.FlxSliceSprite;
|
2023-10-26 05:46:22 -04:00
|
|
|
import flixel.FlxSprite;
|
2024-01-12 06:13:34 -05:00
|
|
|
import flixel.math.FlxRect;
|
2023-10-26 05:46:22 -04:00
|
|
|
import funkin.data.song.SongData.SongEventData;
|
2024-01-12 06:13:34 -05:00
|
|
|
import funkin.data.song.SongData.SongNoteData;
|
|
|
|
import funkin.ui.debug.charting.handlers.ChartEditorThemeHandler;
|
2023-10-26 05:46:22 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A sprite that can be used to display a square over a selected note or event in the chart.
|
|
|
|
* Designed to be used and reused efficiently. Has no gameplay functionality.
|
|
|
|
*/
|
2024-01-12 06:13:34 -05:00
|
|
|
@:nullSafety
|
|
|
|
@:access(funkin.ui.debug.charting.ChartEditorState)
|
|
|
|
class ChartEditorSelectionSquareSprite extends FlxSliceSprite
|
2023-10-26 05:46:22 -04:00
|
|
|
{
|
|
|
|
public var noteData:Null<SongNoteData>;
|
|
|
|
public var eventData:Null<SongEventData>;
|
|
|
|
|
2024-01-12 06:13:34 -05:00
|
|
|
public function new(chartEditorState:ChartEditorState)
|
2023-10-26 05:46:22 -04:00
|
|
|
{
|
2024-01-12 06:13:34 -05:00
|
|
|
super(chartEditorState.selectionSquareBitmap,
|
|
|
|
new FlxRect(ChartEditorThemeHandler.SELECTION_SQUARE_BORDER_WIDTH
|
|
|
|
+ 4, ChartEditorThemeHandler.SELECTION_SQUARE_BORDER_WIDTH
|
|
|
|
+ 4,
|
|
|
|
ChartEditorState.GRID_SIZE
|
|
|
|
- (2 * ChartEditorThemeHandler.SELECTION_SQUARE_BORDER_WIDTH + 8),
|
|
|
|
ChartEditorState.GRID_SIZE
|
|
|
|
- (2 * ChartEditorThemeHandler.SELECTION_SQUARE_BORDER_WIDTH + 8)),
|
|
|
|
32, 32);
|
2023-10-26 05:46:22 -04:00
|
|
|
}
|
|
|
|
}
|