mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-27 10:05:41 -05:00
Merge pull request #244 from FunkinCrew/chart-edit-playtest
Enabling / Disabling "playtest" mode from chart editor
This commit is contained in:
commit
db76a0dd1d
3 changed files with 76 additions and 26 deletions
2
assets
2
assets
|
@ -1 +1 @@
|
||||||
Subproject commit 3c8ac202bbb93bf84c7dcd0697a9d7121d3c5283
|
Subproject commit 42b4bee68600bfb9c31831ccdd0579c00930d771
|
|
@ -139,6 +139,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
public static final CHART_EDITOR_TOOLBOX_NOTEDATA_LAYOUT:String = Paths.ui('chart-editor/toolbox/notedata');
|
public static final CHART_EDITOR_TOOLBOX_NOTEDATA_LAYOUT:String = Paths.ui('chart-editor/toolbox/notedata');
|
||||||
|
|
||||||
public static final CHART_EDITOR_TOOLBOX_EVENTDATA_LAYOUT:String = Paths.ui('chart-editor/toolbox/eventdata');
|
public static final CHART_EDITOR_TOOLBOX_EVENTDATA_LAYOUT:String = Paths.ui('chart-editor/toolbox/eventdata');
|
||||||
|
public static final CHART_EDITOR_TOOLBOX_PLAYTEST_PROPERTIES_LAYOUT:String = Paths.ui('chart-editor/toolbox/playtest-properties');
|
||||||
public static final CHART_EDITOR_TOOLBOX_METADATA_LAYOUT:String = Paths.ui('chart-editor/toolbox/metadata');
|
public static final CHART_EDITOR_TOOLBOX_METADATA_LAYOUT:String = Paths.ui('chart-editor/toolbox/metadata');
|
||||||
public static final CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT:String = Paths.ui('chart-editor/toolbox/difficulty');
|
public static final CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT:String = Paths.ui('chart-editor/toolbox/difficulty');
|
||||||
public static final CHART_EDITOR_TOOLBOX_PLAYER_PREVIEW_LAYOUT:String = Paths.ui('chart-editor/toolbox/player-preview');
|
public static final CHART_EDITOR_TOOLBOX_PLAYER_PREVIEW_LAYOUT:String = Paths.ui('chart-editor/toolbox/player-preview');
|
||||||
|
@ -516,6 +517,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
*/
|
*/
|
||||||
var playtestStartTime:Bool = false;
|
var playtestStartTime:Bool = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If true, playtesting a chart will let you "gameover" / die when you lose ur health!
|
||||||
|
*/
|
||||||
|
var playtestPracticeMode:Bool = false;
|
||||||
|
|
||||||
// Visuals
|
// Visuals
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2475,9 +2481,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
menubarItemDifficultyUp.onClick = _ -> incrementDifficulty(1);
|
menubarItemDifficultyUp.onClick = _ -> incrementDifficulty(1);
|
||||||
menubarItemDifficultyDown.onClick = _ -> incrementDifficulty(-1);
|
menubarItemDifficultyDown.onClick = _ -> incrementDifficulty(-1);
|
||||||
|
|
||||||
menubarItemPlaytestStartTime.onChange = event -> playtestStartTime = event.value;
|
|
||||||
menubarItemPlaytestStartTime.selected = playtestStartTime;
|
|
||||||
|
|
||||||
menuBarItemThemeLight.onChange = function(event:UIEvent) {
|
menuBarItemThemeLight.onChange = function(event:UIEvent) {
|
||||||
if (event.target.value) currentTheme = ChartEditorTheme.Light;
|
if (event.target.value) currentTheme = ChartEditorTheme.Light;
|
||||||
};
|
};
|
||||||
|
@ -2544,6 +2547,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
menubarItemToggleToolboxMetadata.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_METADATA_LAYOUT, event.value);
|
menubarItemToggleToolboxMetadata.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_METADATA_LAYOUT, event.value);
|
||||||
menubarItemToggleToolboxNotes.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_NOTEDATA_LAYOUT, event.value);
|
menubarItemToggleToolboxNotes.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_NOTEDATA_LAYOUT, event.value);
|
||||||
menubarItemToggleToolboxEvents.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_EVENTDATA_LAYOUT, event.value);
|
menubarItemToggleToolboxEvents.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_EVENTDATA_LAYOUT, event.value);
|
||||||
|
menubarItemToggleToolboxPlaytestProperties.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_PLAYTEST_PROPERTIES_LAYOUT, event.value);
|
||||||
menubarItemToggleToolboxPlayerPreview.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_PLAYER_PREVIEW_LAYOUT, event.value);
|
menubarItemToggleToolboxPlayerPreview.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_PLAYER_PREVIEW_LAYOUT, event.value);
|
||||||
menubarItemToggleToolboxOpponentPreview.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_OPPONENT_PREVIEW_LAYOUT, event.value);
|
menubarItemToggleToolboxOpponentPreview.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_OPPONENT_PREVIEW_LAYOUT, event.value);
|
||||||
|
|
||||||
|
@ -3430,7 +3434,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
{
|
{
|
||||||
gridPlayheadScrollAreaPressed = true;
|
gridPlayheadScrollAreaPressed = true;
|
||||||
}
|
}
|
||||||
else if (notePreview != null && FlxG.mouse.overlaps(notePreview))
|
else if (notePreview != null && !isCursorOverHaxeUI && FlxG.mouse.overlaps(notePreview))
|
||||||
{
|
{
|
||||||
// Clicked note preview
|
// Clicked note preview
|
||||||
notePreviewScrollAreaStartPos = new FlxPoint(FlxG.mouse.screenX, FlxG.mouse.screenY);
|
notePreviewScrollAreaStartPos = new FlxPoint(FlxG.mouse.screenX, FlxG.mouse.screenY);
|
||||||
|
@ -3882,7 +3886,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
if (FlxG.mouse.justPressed)
|
if (FlxG.mouse.justPressed)
|
||||||
{
|
{
|
||||||
// Just clicked to place a note.
|
// Just clicked to place a note.
|
||||||
if (overlapsGrid && !overlapsSelectionBorder)
|
if (!isCursorOverHaxeUI && overlapsGrid && !overlapsSelectionBorder)
|
||||||
{
|
{
|
||||||
// We clicked on the grid without moving the mouse.
|
// We clicked on the grid without moving the mouse.
|
||||||
|
|
||||||
|
@ -4027,7 +4031,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
|
|
||||||
var isOrWillSelect = overlapsSelection || dragTargetNote != null || dragTargetEvent != null;
|
var isOrWillSelect = overlapsSelection || dragTargetNote != null || dragTargetEvent != null;
|
||||||
// Handle grid cursor.
|
// Handle grid cursor.
|
||||||
if (overlapsGrid && !isOrWillSelect && !overlapsSelectionBorder && !gridPlayheadScrollAreaPressed)
|
if (!isCursorOverHaxeUI && overlapsGrid && !isOrWillSelect && !overlapsSelectionBorder && !gridPlayheadScrollAreaPressed)
|
||||||
{
|
{
|
||||||
// Indicate that we can place a note here.
|
// Indicate that we can place a note here.
|
||||||
|
|
||||||
|
@ -4097,6 +4101,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (!isCursorOverHaxeUI)
|
||||||
{
|
{
|
||||||
if (notePreview != null && FlxG.mouse.overlaps(notePreview))
|
if (notePreview != null && FlxG.mouse.overlaps(notePreview))
|
||||||
{
|
{
|
||||||
|
@ -4120,6 +4126,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Actually set the cursor mode to the one we specified earlier.
|
// Actually set the cursor mode to the one we specified earlier.
|
||||||
Cursor.cursorMode = targetCursorMode ?? Default;
|
Cursor.cursorMode = targetCursorMode ?? Default;
|
||||||
|
@ -4733,7 +4740,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
targetDifficulty: selectedDifficulty,
|
targetDifficulty: selectedDifficulty,
|
||||||
// TODO: Add this.
|
// TODO: Add this.
|
||||||
// targetCharacter: targetCharacter,
|
// targetCharacter: targetCharacter,
|
||||||
practiceMode: true,
|
practiceMode: playtestPracticeMode,
|
||||||
minimalMode: minimal,
|
minimalMode: minimal,
|
||||||
startTimestamp: startTimestamp,
|
startTimestamp: startTimestamp,
|
||||||
overrideMusic: true,
|
overrideMusic: true,
|
||||||
|
|
|
@ -80,6 +80,8 @@ class ChartEditorToolboxHandler
|
||||||
onShowToolboxNoteData(state, toolbox);
|
onShowToolboxNoteData(state, toolbox);
|
||||||
case ChartEditorState.CHART_EDITOR_TOOLBOX_EVENTDATA_LAYOUT:
|
case ChartEditorState.CHART_EDITOR_TOOLBOX_EVENTDATA_LAYOUT:
|
||||||
onShowToolboxEventData(state, toolbox);
|
onShowToolboxEventData(state, toolbox);
|
||||||
|
case ChartEditorState.CHART_EDITOR_TOOLBOX_PLAYTEST_PROPERTIES_LAYOUT:
|
||||||
|
onShowToolboxPlaytestProperties(state, toolbox);
|
||||||
case ChartEditorState.CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT:
|
case ChartEditorState.CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT:
|
||||||
onShowToolboxDifficulty(state, toolbox);
|
onShowToolboxDifficulty(state, toolbox);
|
||||||
case ChartEditorState.CHART_EDITOR_TOOLBOX_METADATA_LAYOUT:
|
case ChartEditorState.CHART_EDITOR_TOOLBOX_METADATA_LAYOUT:
|
||||||
|
@ -117,6 +119,8 @@ class ChartEditorToolboxHandler
|
||||||
onHideToolboxNoteData(state, toolbox);
|
onHideToolboxNoteData(state, toolbox);
|
||||||
case ChartEditorState.CHART_EDITOR_TOOLBOX_EVENTDATA_LAYOUT:
|
case ChartEditorState.CHART_EDITOR_TOOLBOX_EVENTDATA_LAYOUT:
|
||||||
onHideToolboxEventData(state, toolbox);
|
onHideToolboxEventData(state, toolbox);
|
||||||
|
case ChartEditorState.CHART_EDITOR_TOOLBOX_PLAYTEST_PROPERTIES_LAYOUT:
|
||||||
|
onHideToolboxPlaytestProperties(state, toolbox);
|
||||||
case ChartEditorState.CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT:
|
case ChartEditorState.CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT:
|
||||||
onHideToolboxDifficulty(state, toolbox);
|
onHideToolboxDifficulty(state, toolbox);
|
||||||
case ChartEditorState.CHART_EDITOR_TOOLBOX_METADATA_LAYOUT:
|
case ChartEditorState.CHART_EDITOR_TOOLBOX_METADATA_LAYOUT:
|
||||||
|
@ -175,6 +179,8 @@ class ChartEditorToolboxHandler
|
||||||
toolbox = buildToolboxNoteDataLayout(state);
|
toolbox = buildToolboxNoteDataLayout(state);
|
||||||
case ChartEditorState.CHART_EDITOR_TOOLBOX_EVENTDATA_LAYOUT:
|
case ChartEditorState.CHART_EDITOR_TOOLBOX_EVENTDATA_LAYOUT:
|
||||||
toolbox = buildToolboxEventDataLayout(state);
|
toolbox = buildToolboxEventDataLayout(state);
|
||||||
|
case ChartEditorState.CHART_EDITOR_TOOLBOX_PLAYTEST_PROPERTIES_LAYOUT:
|
||||||
|
toolbox = buildToolboxPlaytestPropertiesLayout(state);
|
||||||
case ChartEditorState.CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT:
|
case ChartEditorState.CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT:
|
||||||
toolbox = buildToolboxDifficultyLayout(state);
|
toolbox = buildToolboxDifficultyLayout(state);
|
||||||
case ChartEditorState.CHART_EDITOR_TOOLBOX_METADATA_LAYOUT:
|
case ChartEditorState.CHART_EDITOR_TOOLBOX_METADATA_LAYOUT:
|
||||||
|
@ -321,8 +327,12 @@ class ChartEditorToolboxHandler
|
||||||
|
|
||||||
static function onShowToolboxEventData(state:ChartEditorState, toolbox:CollapsibleDialog):Void {}
|
static function onShowToolboxEventData(state:ChartEditorState, toolbox:CollapsibleDialog):Void {}
|
||||||
|
|
||||||
|
static function onShowToolboxPlaytestProperties(state:ChartEditorState, toolbox:CollapsibleDialog):Void {}
|
||||||
|
|
||||||
static function onHideToolboxEventData(state:ChartEditorState, toolbox:CollapsibleDialog):Void {}
|
static function onHideToolboxEventData(state:ChartEditorState, toolbox:CollapsibleDialog):Void {}
|
||||||
|
|
||||||
|
static function onHideToolboxPlaytestProperties(state:ChartEditorState, toolbox:CollapsibleDialog):Void {}
|
||||||
|
|
||||||
static function buildEventDataFormFromSchema(state:ChartEditorState, target:Box, schema:SongEventSchema):Void
|
static function buildEventDataFormFromSchema(state:ChartEditorState, target:Box, schema:SongEventSchema):Void
|
||||||
{
|
{
|
||||||
trace(schema);
|
trace(schema);
|
||||||
|
@ -418,6 +428,39 @@ class ChartEditorToolboxHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static function buildToolboxPlaytestPropertiesLayout(state:ChartEditorState):Null<CollapsibleDialog>
|
||||||
|
{
|
||||||
|
// fill with playtest properties
|
||||||
|
var toolbox:CollapsibleDialog = cast RuntimeComponentBuilder.fromAsset(ChartEditorState.CHART_EDITOR_TOOLBOX_PLAYTEST_PROPERTIES_LAYOUT);
|
||||||
|
|
||||||
|
if (toolbox == null) return null;
|
||||||
|
|
||||||
|
toolbox.onDialogClosed = function(_) {
|
||||||
|
state.menubarItemToggleToolboxPlaytestProperties.selected = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var checkboxPracticeMode:Null<CheckBox> = toolbox.findComponent('practiceModeCheckbox', CheckBox);
|
||||||
|
if (checkboxPracticeMode == null) throw 'ChartEditorToolboxHandler.buildToolboxPlaytestPropertiesLayout() - Could not find practiceModeCheckbox component.';
|
||||||
|
|
||||||
|
checkboxPracticeMode.selected = state.playtestPracticeMode;
|
||||||
|
|
||||||
|
checkboxPracticeMode.onClick = _ -> {
|
||||||
|
state.playtestPracticeMode = checkboxPracticeMode.selected;
|
||||||
|
};
|
||||||
|
|
||||||
|
var checkboxStartTime:Null<CheckBox> = toolbox.findComponent('playtestStartTimeCheckbox', CheckBox);
|
||||||
|
if (checkboxStartTime == null)
|
||||||
|
throw 'ChartEditorToolboxHandler.buildToolboxPlaytestPropertiesLayout() - Could not find playtestStartTimeCheckbox component.';
|
||||||
|
|
||||||
|
checkboxStartTime.selected = state.playtestStartTime;
|
||||||
|
|
||||||
|
checkboxStartTime.onClick = _ -> {
|
||||||
|
state.playtestStartTime = checkboxStartTime.selected;
|
||||||
|
};
|
||||||
|
|
||||||
|
return toolbox;
|
||||||
|
}
|
||||||
|
|
||||||
static function buildToolboxDifficultyLayout(state:ChartEditorState):Null<CollapsibleDialog>
|
static function buildToolboxDifficultyLayout(state:ChartEditorState):Null<CollapsibleDialog>
|
||||||
{
|
{
|
||||||
var toolbox:CollapsibleDialog = cast RuntimeComponentBuilder.fromAsset(ChartEditorState.CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT);
|
var toolbox:CollapsibleDialog = cast RuntimeComponentBuilder.fromAsset(ChartEditorState.CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT);
|
||||||
|
|
Loading…
Reference in a new issue