mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-27 10:05:41 -05:00
Merge pull request #255 from FunkinCrew/bugfix/move-to-funkincrew
Fixes for updated HaxeUI and Flixel.
This commit is contained in:
commit
4629702634
13 changed files with 102 additions and 113 deletions
2
assets
2
assets
|
@ -1 +1 @@
|
||||||
Subproject commit dfaf23dfa11ff67be2eea9113a80ff5dc0040f76
|
Subproject commit c354795f7f560fa096b855c6e6bca745f77fa414
|
|
@ -1097,23 +1097,6 @@ class PlayState extends MusicBeatSubState
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
/**
|
|
||||||
* This function is called whenever Flixel switches switching to a new FlxState.
|
|
||||||
* @return Whether to actually switch to the new state.
|
|
||||||
*/
|
|
||||||
@:haxe.warning("-WDeprecated")
|
|
||||||
override function switchTo(nextState:FlxState):Bool
|
|
||||||
{
|
|
||||||
var result:Bool = super.switchTo(nextState);
|
|
||||||
|
|
||||||
if (result)
|
|
||||||
{
|
|
||||||
performCleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes any references to the current stage, then clears the stage cache,
|
* Removes any references to the current stage, then clears the stage cache,
|
||||||
* then reloads all the stages.
|
* then reloads all the stages.
|
||||||
|
@ -1251,7 +1234,7 @@ class PlayState extends MusicBeatSubState
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function destroy():Void
|
public override function destroy():Void
|
||||||
{
|
{
|
||||||
if (currentConversation != null)
|
if (currentConversation != null)
|
||||||
{
|
{
|
||||||
|
@ -1259,6 +1242,8 @@ class PlayState extends MusicBeatSubState
|
||||||
currentConversation.kill();
|
currentConversation.kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
performCleanup();
|
||||||
|
|
||||||
super.destroy();
|
super.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2675,14 +2675,16 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
* Open the backups folder in the file explorer.
|
* Open the backups folder in the file explorer.
|
||||||
* Don't call this on HTML5.
|
* Don't call this on HTML5.
|
||||||
*/
|
*/
|
||||||
function openBackupsFolder(?_):Void
|
function openBackupsFolder(?_):Bool
|
||||||
{
|
{
|
||||||
#if sys
|
#if sys
|
||||||
// TODO: Is there a way to open a folder and highlight a file in it?
|
// TODO: Is there a way to open a folder and highlight a file in it?
|
||||||
var absoluteBackupsPath:String = Path.join([Sys.getCwd(), ChartEditorImportExportHandler.BACKUPS_PATH]);
|
var absoluteBackupsPath:String = Path.join([Sys.getCwd(), ChartEditorImportExportHandler.BACKUPS_PATH]);
|
||||||
WindowUtil.openFolder(absoluteBackupsPath);
|
WindowUtil.openFolder(absoluteBackupsPath);
|
||||||
|
return true;
|
||||||
#else
|
#else
|
||||||
trace('No file system access, cannot open backups folder.');
|
trace('No file system access, cannot open backups folder.');
|
||||||
|
return false;
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,14 +5,14 @@ import funkin.ui.debug.charting.dialogs.ChartEditorBaseDialog.DialogParams;
|
||||||
@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/dialogs/about.xml"))
|
@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/dialogs/about.xml"))
|
||||||
class ChartEditorAboutDialog extends ChartEditorBaseDialog
|
class ChartEditorAboutDialog extends ChartEditorBaseDialog
|
||||||
{
|
{
|
||||||
public function new(state2:ChartEditorState, params2:DialogParams)
|
public function new(chartEditorState2:ChartEditorState, params2:DialogParams)
|
||||||
{
|
{
|
||||||
super(state2, params2);
|
super(chartEditorState2, params2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function build(state:ChartEditorState, ?closable:Bool, ?modal:Bool):ChartEditorAboutDialog
|
public static function build(chartEditorState:ChartEditorState, ?closable:Bool, ?modal:Bool):ChartEditorAboutDialog
|
||||||
{
|
{
|
||||||
var dialog = new ChartEditorAboutDialog(state,
|
var dialog = new ChartEditorAboutDialog(chartEditorState,
|
||||||
{
|
{
|
||||||
closable: closable ?? true,
|
closable: closable ?? true,
|
||||||
modal: modal ?? true
|
modal: modal ?? true
|
||||||
|
|
|
@ -11,16 +11,16 @@ import haxe.ui.core.Component;
|
||||||
@:access(funkin.ui.debug.charting.ChartEditorState)
|
@:access(funkin.ui.debug.charting.ChartEditorState)
|
||||||
class ChartEditorBaseDialog extends Dialog
|
class ChartEditorBaseDialog extends Dialog
|
||||||
{
|
{
|
||||||
var state:ChartEditorState;
|
var chartEditorState:ChartEditorState;
|
||||||
var params:DialogParams;
|
var params:DialogParams;
|
||||||
|
|
||||||
var locked:Bool = false;
|
var locked:Bool = false;
|
||||||
|
|
||||||
public function new(state:ChartEditorState, params:DialogParams)
|
public function new(chartEditorState:ChartEditorState, params:DialogParams)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.state = state;
|
this.chartEditorState = chartEditorState;
|
||||||
this.params = params;
|
this.params = params;
|
||||||
|
|
||||||
this.destroyOnClose = true;
|
this.destroyOnClose = true;
|
||||||
|
@ -47,7 +47,7 @@ class ChartEditorBaseDialog extends Dialog
|
||||||
*/
|
*/
|
||||||
public function onClose(event:DialogEvent):Void
|
public function onClose(event:DialogEvent):Void
|
||||||
{
|
{
|
||||||
state.isHaxeUIDialogOpen = false;
|
chartEditorState.isHaxeUIDialogOpen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,13 +11,13 @@ import haxe.ui.containers.menus.Menu;
|
||||||
@:access(funkin.ui.debug.charting.ChartEditorState)
|
@:access(funkin.ui.debug.charting.ChartEditorState)
|
||||||
class ChartEditorBaseMenu extends Menu
|
class ChartEditorBaseMenu extends Menu
|
||||||
{
|
{
|
||||||
var state:ChartEditorState;
|
var chartEditorState:ChartEditorState;
|
||||||
|
|
||||||
public function new(state:ChartEditorState)
|
public function new(chartEditorState:ChartEditorState)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.state = state;
|
this.chartEditorState = chartEditorState;
|
||||||
|
|
||||||
// this.destroyOnClose = true;
|
// this.destroyOnClose = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,9 +24,9 @@ class ChartEditorCharacterIconSelectorMenu extends ChartEditorBaseMenu
|
||||||
public var charSelectScroll:ScrollView;
|
public var charSelectScroll:ScrollView;
|
||||||
public var charIconName:Label;
|
public var charIconName:Label;
|
||||||
|
|
||||||
public function new(state2:ChartEditorState, charType:CharacterType, lockPosition:Bool = false)
|
public function new(chartEditorState2:ChartEditorState, charType:CharacterType, lockPosition:Bool = false)
|
||||||
{
|
{
|
||||||
super(state2);
|
super(chartEditorState2);
|
||||||
|
|
||||||
initialize(charType, lockPosition);
|
initialize(charType, lockPosition);
|
||||||
this.alpha = 0;
|
this.alpha = 0;
|
||||||
|
@ -38,17 +38,17 @@ class ChartEditorCharacterIconSelectorMenu extends ChartEditorBaseMenu
|
||||||
{
|
{
|
||||||
var currentCharId:String = switch (charType)
|
var currentCharId:String = switch (charType)
|
||||||
{
|
{
|
||||||
case BF: state.currentSongMetadata.playData.characters.player;
|
case BF: chartEditorState.currentSongMetadata.playData.characters.player;
|
||||||
case GF: state.currentSongMetadata.playData.characters.girlfriend;
|
case GF: chartEditorState.currentSongMetadata.playData.characters.girlfriend;
|
||||||
case DAD: state.currentSongMetadata.playData.characters.opponent;
|
case DAD: chartEditorState.currentSongMetadata.playData.characters.opponent;
|
||||||
default: throw 'Invalid charType: ' + charType;
|
default: throw 'Invalid charType: ' + charType;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Position this menu.
|
// Position this menu.
|
||||||
var targetHealthIcon:Null<HealthIcon> = switch (charType)
|
var targetHealthIcon:Null<HealthIcon> = switch (charType)
|
||||||
{
|
{
|
||||||
case BF: state.healthIconBF;
|
case BF: chartEditorState.healthIconBF;
|
||||||
case DAD: state.healthIconDad;
|
case DAD: chartEditorState.healthIconDad;
|
||||||
default: null;
|
default: null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -101,14 +101,14 @@ class ChartEditorCharacterIconSelectorMenu extends ChartEditorBaseMenu
|
||||||
charButton.onClick = _ -> {
|
charButton.onClick = _ -> {
|
||||||
switch (charType)
|
switch (charType)
|
||||||
{
|
{
|
||||||
case BF: state.currentSongMetadata.playData.characters.player = charId;
|
case BF: chartEditorState.currentSongMetadata.playData.characters.player = charId;
|
||||||
case GF: state.currentSongMetadata.playData.characters.girlfriend = charId;
|
case GF: chartEditorState.currentSongMetadata.playData.characters.girlfriend = charId;
|
||||||
case DAD: state.currentSongMetadata.playData.characters.opponent = charId;
|
case DAD: chartEditorState.currentSongMetadata.playData.characters.opponent = charId;
|
||||||
default: throw 'Invalid charType: ' + charType;
|
default: throw 'Invalid charType: ' + charType;
|
||||||
};
|
};
|
||||||
|
|
||||||
state.healthIconsDirty = true;
|
chartEditorState.healthIconsDirty = true;
|
||||||
state.refreshToolbox(ChartEditorState.CHART_EDITOR_TOOLBOX_METADATA_LAYOUT);
|
chartEditorState.refreshToolbox(ChartEditorState.CHART_EDITOR_TOOLBOX_METADATA_LAYOUT);
|
||||||
};
|
};
|
||||||
|
|
||||||
charButton.onMouseOver = _ -> {
|
charButton.onMouseOver = _ -> {
|
||||||
|
@ -123,9 +123,9 @@ class ChartEditorCharacterIconSelectorMenu extends ChartEditorBaseMenu
|
||||||
charIconName.text = defaultText;
|
charIconName.text = defaultText;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function build(state2:ChartEditorState, charType:CharacterType, lockPosition:Bool = false):ChartEditorCharacterIconSelectorMenu
|
public static function build(chartEditorState:ChartEditorState, charType:CharacterType, lockPosition:Bool = false):ChartEditorCharacterIconSelectorMenu
|
||||||
{
|
{
|
||||||
var menu = new ChartEditorCharacterIconSelectorMenu(state2, charType, lockPosition);
|
var menu = new ChartEditorCharacterIconSelectorMenu(chartEditorState, charType, lockPosition);
|
||||||
|
|
||||||
Screen.instance.addComponent(menu);
|
Screen.instance.addComponent(menu);
|
||||||
|
|
||||||
|
|
|
@ -64,12 +64,12 @@ class ChartEditorUploadChartDialog extends ChartEditorBaseDialog
|
||||||
if (event.button != DialogButton.APPLY && !this.closable)
|
if (event.button != DialogButton.APPLY && !this.closable)
|
||||||
{
|
{
|
||||||
// User cancelled the wizard! Back to the welcome dialog.
|
// User cancelled the wizard! Back to the welcome dialog.
|
||||||
state.openWelcomeDialog(this.closable);
|
chartEditorState.openWelcomeDialog(this.closable);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (dropTarget in dropHandlers)
|
for (dropTarget in dropHandlers)
|
||||||
{
|
{
|
||||||
state.removeDropHandler(dropTarget);
|
chartEditorState.removeDropHandler(dropTarget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,20 +111,21 @@ class ChartEditorUploadChartDialog extends ChartEditorBaseDialog
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var result:Null<Array<String>> = ChartEditorImportExportHandler.loadFromFNFCPath(state, path.toString());
|
var result:Null<Array<String>> = ChartEditorImportExportHandler.loadFromFNFCPath(chartEditorState, path.toString());
|
||||||
if (result != null)
|
if (result != null)
|
||||||
{
|
{
|
||||||
state.success('Loaded Chart', result.length == 0 ? 'Loaded chart (${path.toString()})' : 'Loaded chart (${path.toString()})\n${result.join("\n")}');
|
chartEditorState.success('Loaded Chart',
|
||||||
|
result.length == 0 ? 'Loaded chart (${path.toString()})' : 'Loaded chart (${path.toString()})\n${result.join("\n")}');
|
||||||
this.hideDialog(DialogButton.APPLY);
|
this.hideDialog(DialogButton.APPLY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
state.failure('Failed to Load Chart', 'Failed to load chart (${path.toString()})');
|
chartEditorState.failure('Failed to Load Chart', 'Failed to load chart (${path.toString()})');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (err)
|
catch (err)
|
||||||
{
|
{
|
||||||
state.failure('Failed to Load Chart', 'Failed to load chart (${path.toString()}): ${err}');
|
chartEditorState.failure('Failed to Load Chart', 'Failed to load chart (${path.toString()}): ${err}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,19 +140,19 @@ class ChartEditorUploadChartDialog extends ChartEditorBaseDialog
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var result:Null<Array<String>> = ChartEditorImportExportHandler.loadFromFNFC(state, selectedFile.bytes);
|
var result:Null<Array<String>> = ChartEditorImportExportHandler.loadFromFNFC(chartEditorState, selectedFile.bytes);
|
||||||
if (result != null)
|
if (result != null)
|
||||||
{
|
{
|
||||||
state.success('Loaded Chart',
|
chartEditorState.success('Loaded Chart',
|
||||||
result.length == 0 ? 'Loaded chart (${selectedFile.name})' : 'Loaded chart (${selectedFile.name})\n${result.join("\n")}');
|
result.length == 0 ? 'Loaded chart (${selectedFile.name})' : 'Loaded chart (${selectedFile.name})\n${result.join("\n")}');
|
||||||
|
|
||||||
if (selectedFile.fullPath != null) state.currentWorkingFilePath = selectedFile.fullPath;
|
if (selectedFile.fullPath != null) chartEditorState.currentWorkingFilePath = selectedFile.fullPath;
|
||||||
this.hideDialog(DialogButton.APPLY);
|
this.hideDialog(DialogButton.APPLY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (err)
|
catch (err)
|
||||||
{
|
{
|
||||||
state.failure('Failed to Load Chart', 'Failed to load chart (${selectedFile.name}): ${err}');
|
chartEditorState.failure('Failed to Load Chart', 'Failed to load chart (${selectedFile.name}): ${err}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,26 +41,26 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog
|
||||||
|
|
||||||
// Add items to the Recent Charts list
|
// Add items to the Recent Charts list
|
||||||
#if sys
|
#if sys
|
||||||
for (chartPath in state.previousWorkingFilePaths)
|
for (chartPath in chartEditorState.previousWorkingFilePaths)
|
||||||
{
|
{
|
||||||
if (chartPath == null) continue;
|
if (chartPath == null) continue;
|
||||||
this.addRecentFilePath(state, chartPath);
|
this.addRecentFilePath(chartEditorState, chartPath);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
this.addHTML5RecentFileMessage();
|
this.addHTML5RecentFileMessage();
|
||||||
#end
|
#end
|
||||||
|
|
||||||
// Add items to the Load From Template list
|
// Add items to the Load From Template list
|
||||||
this.buildTemplateSongList(state);
|
this.buildTemplateSongList(chartEditorState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param state The current state of the chart editor.
|
* @param state The current state of the chart editor.
|
||||||
* @return A newly created `ChartEditorWelcomeDialog`.
|
* @return A newly created `ChartEditorWelcomeDialog`.
|
||||||
*/
|
*/
|
||||||
public static function build(state:ChartEditorState, ?closable:Bool, ?modal:Bool):ChartEditorWelcomeDialog
|
public static function build(chartEditorState:ChartEditorState, ?closable:Bool, ?modal:Bool):ChartEditorWelcomeDialog
|
||||||
{
|
{
|
||||||
var dialog = new ChartEditorWelcomeDialog(state,
|
var dialog = new ChartEditorWelcomeDialog(chartEditorState,
|
||||||
{
|
{
|
||||||
closable: closable ?? false,
|
closable: closable ?? false,
|
||||||
modal: modal ?? true
|
modal: modal ?? true
|
||||||
|
@ -102,12 +102,12 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog
|
||||||
var result:Null<Array<String>> = ChartEditorImportExportHandler.loadFromFNFCPath(state, chartPath);
|
var result:Null<Array<String>> = ChartEditorImportExportHandler.loadFromFNFCPath(state, chartPath);
|
||||||
if (result != null)
|
if (result != null)
|
||||||
{
|
{
|
||||||
state.success('Loaded Chart',
|
chartEditorState.success('Loaded Chart',
|
||||||
result.length == 0 ? 'Loaded chart (${chartPath.toString()})' : 'Loaded chart (${chartPath.toString()})\n${result.join("\n")}');
|
result.length == 0 ? 'Loaded chart (${chartPath.toString()})' : 'Loaded chart (${chartPath.toString()})\n${result.join("\n")}');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
state.error('Failed to Load Chart', 'Failed to load chart (${chartPath.toString()})');
|
chartEditorState.error('Failed to Load Chart', 'Failed to load chart (${chartPath.toString()})');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog
|
||||||
this.hideDialog(DialogButton.CANCEL);
|
this.hideDialog(DialogButton.CANCEL);
|
||||||
|
|
||||||
// Load song from template
|
// Load song from template
|
||||||
state.loadSongAsTemplate(targetSongId);
|
chartEditorState.loadSongAsTemplate(targetSongId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,7 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog
|
||||||
this.hideDialog(DialogButton.CANCEL);
|
this.hideDialog(DialogButton.CANCEL);
|
||||||
|
|
||||||
// Open the "Open Chart" dialog
|
// Open the "Open Chart" dialog
|
||||||
state.openBrowseFNFC(false);
|
chartEditorState.openBrowseFNFC(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -199,7 +199,7 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog
|
||||||
//
|
//
|
||||||
// Create Song Wizard
|
// Create Song Wizard
|
||||||
//
|
//
|
||||||
state.openCreateSongWizardBasicOnly(false);
|
chartEditorState.openCreateSongWizardBasicOnly(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -214,7 +214,7 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog
|
||||||
//
|
//
|
||||||
// Create Song Wizard
|
// Create Song Wizard
|
||||||
//
|
//
|
||||||
state.openCreateSongWizardErectOnly(false);
|
chartEditorState.openCreateSongWizardErectOnly(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -229,7 +229,7 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog
|
||||||
//
|
//
|
||||||
// Create Song Wizard
|
// Create Song Wizard
|
||||||
//
|
//
|
||||||
state.openCreateSongWizardBasicErect(false);
|
chartEditorState.openCreateSongWizardBasicErect(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -242,6 +242,6 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog
|
||||||
this.hideDialog(DialogButton.CANCEL);
|
this.hideDialog(DialogButton.CANCEL);
|
||||||
|
|
||||||
// Open the "Import Chart" dialog
|
// Open the "Import Chart" dialog
|
||||||
state.openImportChartWizard('legacy', false);
|
chartEditorState.openImportChartWizard('legacy', false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,6 +315,8 @@ class ChartEditorImportExportHandler
|
||||||
public static function getLatestBackupPath():Null<String>
|
public static function getLatestBackupPath():Null<String>
|
||||||
{
|
{
|
||||||
#if sys
|
#if sys
|
||||||
|
if (!sys.FileSystem.exists(BACKUPS_PATH)) sys.FileSystem.createDirectory(BACKUPS_PATH);
|
||||||
|
|
||||||
var entries:Array<String> = sys.FileSystem.readDirectory(BACKUPS_PATH);
|
var entries:Array<String> = sys.FileSystem.readDirectory(BACKUPS_PATH);
|
||||||
entries.sort(SortUtil.alphabetically);
|
entries.sort(SortUtil.alphabetically);
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,13 @@ import haxe.ui.core.Component;
|
||||||
@:access(funkin.ui.debug.charting.ChartEditorState)
|
@:access(funkin.ui.debug.charting.ChartEditorState)
|
||||||
class ChartEditorBaseToolbox extends CollapsibleDialog
|
class ChartEditorBaseToolbox extends CollapsibleDialog
|
||||||
{
|
{
|
||||||
var state:ChartEditorState;
|
var chartEditorState:ChartEditorState;
|
||||||
|
|
||||||
private function new(state:ChartEditorState)
|
private function new(chartEditorState:ChartEditorState)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.state = state;
|
this.chartEditorState = chartEditorState;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -40,9 +40,9 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||||
var frameVariation:Frame;
|
var frameVariation:Frame;
|
||||||
var frameDifficulty:Frame;
|
var frameDifficulty:Frame;
|
||||||
|
|
||||||
public function new(state2:ChartEditorState)
|
public function new(chartEditorState2:ChartEditorState)
|
||||||
{
|
{
|
||||||
super(state2);
|
super(chartEditorState2);
|
||||||
|
|
||||||
initialize();
|
initialize();
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||||
|
|
||||||
function onClose(event:UIEvent)
|
function onClose(event:UIEvent)
|
||||||
{
|
{
|
||||||
state.menubarItemToggleToolboxMetadata.selected = false;
|
chartEditorState.menubarItemToggleToolboxMetadata.selected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function initialize():Void
|
function initialize():Void
|
||||||
|
@ -67,11 +67,11 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||||
if (valid)
|
if (valid)
|
||||||
{
|
{
|
||||||
inputSongName.removeClass('invalid-value');
|
inputSongName.removeClass('invalid-value');
|
||||||
state.currentSongMetadata.songName = event.target.text;
|
chartEditorState.currentSongMetadata.songName = event.target.text;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
state.currentSongMetadata.songName = '';
|
chartEditorState.currentSongMetadata.songName = '';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -81,11 +81,11 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||||
if (valid)
|
if (valid)
|
||||||
{
|
{
|
||||||
inputSongArtist.removeClass('invalid-value');
|
inputSongArtist.removeClass('invalid-value');
|
||||||
state.currentSongMetadata.artist = event.target.text;
|
chartEditorState.currentSongMetadata.artist = event.target.text;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
state.currentSongMetadata.artist = '';
|
chartEditorState.currentSongMetadata.artist = '';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -94,41 +94,41 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||||
|
|
||||||
if (valid)
|
if (valid)
|
||||||
{
|
{
|
||||||
state.currentSongMetadata.playData.stage = event.data.id;
|
chartEditorState.currentSongMetadata.playData.stage = event.data.id;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var startingValueStage = ChartEditorDropdowns.populateDropdownWithStages(inputStage, state.currentSongMetadata.playData.stage);
|
var startingValueStage = ChartEditorDropdowns.populateDropdownWithStages(inputStage, chartEditorState.currentSongMetadata.playData.stage);
|
||||||
inputStage.value = startingValueStage;
|
inputStage.value = startingValueStage;
|
||||||
|
|
||||||
inputNoteStyle.onChange = function(event:UIEvent) {
|
inputNoteStyle.onChange = function(event:UIEvent) {
|
||||||
if (event.data?.id == null) return;
|
if (event.data?.id == null) return;
|
||||||
state.currentSongNoteStyle = event.data.id;
|
chartEditorState.currentSongNoteStyle = event.data.id;
|
||||||
};
|
};
|
||||||
|
|
||||||
inputBPM.onChange = function(event:UIEvent) {
|
inputBPM.onChange = function(event:UIEvent) {
|
||||||
if (event.value == null || event.value <= 0) return;
|
if (event.value == null || event.value <= 0) return;
|
||||||
|
|
||||||
// Use a command so we can undo/redo this action.
|
// Use a command so we can undo/redo this action.
|
||||||
var startingBPM = state.currentSongMetadata.timeChanges[0].bpm;
|
var startingBPM = chartEditorState.currentSongMetadata.timeChanges[0].bpm;
|
||||||
if (event.value != startingBPM)
|
if (event.value != startingBPM)
|
||||||
{
|
{
|
||||||
state.performCommand(new ChangeStartingBPMCommand(event.value));
|
chartEditorState.performCommand(new ChangeStartingBPMCommand(event.value));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inputOffsetInst.onChange = function(event:UIEvent) {
|
inputOffsetInst.onChange = function(event:UIEvent) {
|
||||||
if (event.value == null) return;
|
if (event.value == null) return;
|
||||||
|
|
||||||
state.currentInstrumentalOffset = event.value;
|
chartEditorState.currentInstrumentalOffset = event.value;
|
||||||
Conductor.instrumentalOffset = event.value;
|
Conductor.instrumentalOffset = event.value;
|
||||||
// Update song length.
|
// Update song length.
|
||||||
state.songLengthInMs = (state.audioInstTrack?.length ?? 1000.0) + Conductor.instrumentalOffset;
|
chartEditorState.songLengthInMs = (chartEditorState.audioInstTrack?.length ?? 1000.0) + Conductor.instrumentalOffset;
|
||||||
};
|
};
|
||||||
|
|
||||||
inputOffsetVocal.onChange = function(event:UIEvent) {
|
inputOffsetVocal.onChange = function(event:UIEvent) {
|
||||||
if (event.value == null) return;
|
if (event.value == null) return;
|
||||||
|
|
||||||
state.currentSongMetadata.offsets.setVocalOffset(state.currentSongMetadata.playData.characters.player, event.value);
|
chartEditorState.currentSongMetadata.offsets.setVocalOffset(chartEditorState.currentSongMetadata.playData.characters.player, event.value);
|
||||||
};
|
};
|
||||||
inputScrollSpeed.onChange = function(event:UIEvent) {
|
inputScrollSpeed.onChange = function(event:UIEvent) {
|
||||||
var valid:Bool = event.target.value != null && event.target.value > 0;
|
var valid:Bool = event.target.value != null && event.target.value > 0;
|
||||||
|
@ -136,25 +136,25 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||||
if (valid)
|
if (valid)
|
||||||
{
|
{
|
||||||
inputScrollSpeed.removeClass('invalid-value');
|
inputScrollSpeed.removeClass('invalid-value');
|
||||||
state.currentSongChartScrollSpeed = event.target.value;
|
chartEditorState.currentSongChartScrollSpeed = event.target.value;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
state.currentSongChartScrollSpeed = 1.0;
|
chartEditorState.currentSongChartScrollSpeed = 1.0;
|
||||||
}
|
}
|
||||||
labelScrollSpeed.text = 'Scroll Speed: ${state.currentSongChartScrollSpeed}x';
|
labelScrollSpeed.text = 'Scroll Speed: ${chartEditorState.currentSongChartScrollSpeed}x';
|
||||||
};
|
};
|
||||||
|
|
||||||
buttonCharacterOpponent.onClick = function(_) {
|
buttonCharacterOpponent.onClick = function(_) {
|
||||||
state.openCharacterDropdown(CharacterType.DAD, false);
|
chartEditorState.openCharacterDropdown(CharacterType.DAD, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
buttonCharacterGirlfriend.onClick = function(_) {
|
buttonCharacterGirlfriend.onClick = function(_) {
|
||||||
state.openCharacterDropdown(CharacterType.GF, false);
|
chartEditorState.openCharacterDropdown(CharacterType.GF, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
buttonCharacterPlayer.onClick = function(_) {
|
buttonCharacterPlayer.onClick = function(_) {
|
||||||
state.openCharacterDropdown(CharacterType.BF, false);
|
chartEditorState.openCharacterDropdown(CharacterType.BF, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
|
@ -162,17 +162,17 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||||
|
|
||||||
public override function refresh():Void
|
public override function refresh():Void
|
||||||
{
|
{
|
||||||
inputSongName.value = state.currentSongMetadata.songName;
|
inputSongName.value = chartEditorState.currentSongMetadata.songName;
|
||||||
inputSongArtist.value = state.currentSongMetadata.artist;
|
inputSongArtist.value = chartEditorState.currentSongMetadata.artist;
|
||||||
inputStage.value = state.currentSongMetadata.playData.stage;
|
inputStage.value = chartEditorState.currentSongMetadata.playData.stage;
|
||||||
inputNoteStyle.value = state.currentSongMetadata.playData.noteStyle;
|
inputNoteStyle.value = chartEditorState.currentSongMetadata.playData.noteStyle;
|
||||||
inputBPM.value = state.currentSongMetadata.timeChanges[0].bpm;
|
inputBPM.value = chartEditorState.currentSongMetadata.timeChanges[0].bpm;
|
||||||
inputScrollSpeed.value = state.currentSongChartScrollSpeed;
|
inputScrollSpeed.value = chartEditorState.currentSongChartScrollSpeed;
|
||||||
labelScrollSpeed.text = 'Scroll Speed: ${state.currentSongChartScrollSpeed}x';
|
labelScrollSpeed.text = 'Scroll Speed: ${chartEditorState.currentSongChartScrollSpeed}x';
|
||||||
frameVariation.text = 'Variation: ${state.selectedVariation.toTitleCase()}';
|
frameVariation.text = 'Variation: ${chartEditorState.selectedVariation.toTitleCase()}';
|
||||||
frameDifficulty.text = 'Difficulty: ${state.selectedDifficulty.toTitleCase()}';
|
frameDifficulty.text = 'Difficulty: ${chartEditorState.selectedDifficulty.toTitleCase()}';
|
||||||
|
|
||||||
var stageId:String = state.currentSongMetadata.playData.stage;
|
var stageId:String = chartEditorState.currentSongMetadata.playData.stage;
|
||||||
var stageData:Null<StageData> = StageDataParser.parseStageData(stageId);
|
var stageData:Null<StageData> = StageDataParser.parseStageData(stageId);
|
||||||
if (inputStage != null)
|
if (inputStage != null)
|
||||||
{
|
{
|
||||||
|
@ -183,21 +183,21 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox
|
||||||
|
|
||||||
var LIMIT = 6;
|
var LIMIT = 6;
|
||||||
|
|
||||||
var charDataOpponent:CharacterData = CharacterDataParser.fetchCharacterData(state.currentSongMetadata.playData.characters.opponent);
|
var charDataOpponent:CharacterData = CharacterDataParser.fetchCharacterData(chartEditorState.currentSongMetadata.playData.characters.opponent);
|
||||||
buttonCharacterOpponent.icon = CharacterDataParser.getCharPixelIconAsset(state.currentSongMetadata.playData.characters.opponent);
|
buttonCharacterOpponent.icon = CharacterDataParser.getCharPixelIconAsset(chartEditorState.currentSongMetadata.playData.characters.opponent);
|
||||||
buttonCharacterOpponent.text = charDataOpponent.name.length > LIMIT ? '${charDataOpponent.name.substr(0, LIMIT)}.' : '${charDataOpponent.name}';
|
buttonCharacterOpponent.text = charDataOpponent.name.length > LIMIT ? '${charDataOpponent.name.substr(0, LIMIT)}.' : '${charDataOpponent.name}';
|
||||||
|
|
||||||
var charDataGirlfriend:CharacterData = CharacterDataParser.fetchCharacterData(state.currentSongMetadata.playData.characters.girlfriend);
|
var charDataGirlfriend:CharacterData = CharacterDataParser.fetchCharacterData(chartEditorState.currentSongMetadata.playData.characters.girlfriend);
|
||||||
buttonCharacterGirlfriend.icon = CharacterDataParser.getCharPixelIconAsset(state.currentSongMetadata.playData.characters.girlfriend);
|
buttonCharacterGirlfriend.icon = CharacterDataParser.getCharPixelIconAsset(chartEditorState.currentSongMetadata.playData.characters.girlfriend);
|
||||||
buttonCharacterGirlfriend.text = charDataGirlfriend.name.length > LIMIT ? '${charDataGirlfriend.name.substr(0, LIMIT)}.' : '${charDataGirlfriend.name}';
|
buttonCharacterGirlfriend.text = charDataGirlfriend.name.length > LIMIT ? '${charDataGirlfriend.name.substr(0, LIMIT)}.' : '${charDataGirlfriend.name}';
|
||||||
|
|
||||||
var charDataPlayer:CharacterData = CharacterDataParser.fetchCharacterData(state.currentSongMetadata.playData.characters.player);
|
var charDataPlayer:CharacterData = CharacterDataParser.fetchCharacterData(chartEditorState.currentSongMetadata.playData.characters.player);
|
||||||
buttonCharacterPlayer.icon = CharacterDataParser.getCharPixelIconAsset(state.currentSongMetadata.playData.characters.player);
|
buttonCharacterPlayer.icon = CharacterDataParser.getCharPixelIconAsset(chartEditorState.currentSongMetadata.playData.characters.player);
|
||||||
buttonCharacterPlayer.text = charDataPlayer.name.length > LIMIT ? '${charDataPlayer.name.substr(0, LIMIT)}.' : '${charDataPlayer.name}';
|
buttonCharacterPlayer.text = charDataPlayer.name.length > LIMIT ? '${charDataPlayer.name.substr(0, LIMIT)}.' : '${charDataPlayer.name}';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function build(state:ChartEditorState):ChartEditorMetadataToolbox
|
public static function build(chartEditorState:ChartEditorState):ChartEditorMetadataToolbox
|
||||||
{
|
{
|
||||||
return new ChartEditorMetadataToolbox(state);
|
return new ChartEditorMetadataToolbox(chartEditorState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -874,15 +874,14 @@ class FreeplayState extends MusicBeatSubState
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@:haxe.warning("-WDeprecated")
|
public override function destroy():Void
|
||||||
override function switchTo(nextState:FlxState):Bool
|
|
||||||
{
|
{
|
||||||
|
super.destroy();
|
||||||
var daSong = songs[curSelected];
|
var daSong = songs[curSelected];
|
||||||
if (daSong != null)
|
if (daSong != null)
|
||||||
{
|
{
|
||||||
clearDaCache(daSong.songName);
|
clearDaCache(daSong.songName);
|
||||||
}
|
}
|
||||||
return super.switchTo(nextState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeDiff(change:Int = 0)
|
function changeDiff(change:Int = 0)
|
||||||
|
|
Loading…
Reference in a new issue