mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-02-17 04:11:23 -05:00
player char select
This commit is contained in:
parent
181e3f85b8
commit
9ffffe9c8a
1 changed files with 74 additions and 56 deletions
|
@ -2089,8 +2089,26 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
healthIconBF.zIndex = 30;
|
||||
|
||||
FlxMouseEvent.add(healthIconDad, function(_) {
|
||||
trace("clicked dad");
|
||||
createAndOpenCharSelect(1);
|
||||
});
|
||||
|
||||
FlxMouseEvent.add(healthIconBF, function(_) {
|
||||
createAndOpenCharSelect(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param charType 0 == BF, 1 == Dad
|
||||
*/
|
||||
function createAndOpenCharSelect(charType:Int = 0):Void
|
||||
{
|
||||
var charData = currentSongMetadata.playData.characters;
|
||||
var currentChar:String = switch (charType)
|
||||
{
|
||||
case 0: charData.player;
|
||||
case 1: charData.opponent;
|
||||
default: throw 'Invalid charType: ' + charType;
|
||||
};
|
||||
var toolbox:CollapsibleDialog = cast haxe.ui.RuntimeComponentBuilder.fromAsset(Paths.ui('chart-editor/toolbox/iconselector'));
|
||||
toolbox.showDialog(false);
|
||||
var scrollView = toolbox.findComponent('charSelectScroll');
|
||||
|
@ -2123,12 +2141,17 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
image.width = 70;
|
||||
image.height = 70;
|
||||
|
||||
if (char == currentSongMetadata.playData.characters.opponent) image.selected = true;
|
||||
if (char == currentChar) image.selected = true;
|
||||
|
||||
image.icon = CharacterDataParser.getCharPixelIconAsset(char);
|
||||
image.onClick = _ -> {
|
||||
healthIconsDirty = true;
|
||||
currentSongMetadata.playData.characters.opponent = char;
|
||||
switch (charType)
|
||||
{
|
||||
case 0: currentSongMetadata.playData.characters.player = char;
|
||||
case 1: currentSongMetadata.playData.characters.opponent = char;
|
||||
default: throw 'Invalid charType: ' + charType;
|
||||
};
|
||||
toolbox.hideDialog(haxe.ui.containers.dialogs.Dialog.DialogButton.APPLY);
|
||||
|
||||
// var label = toolbox.findComponent('charIconName');
|
||||
|
@ -2144,11 +2167,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
|
||||
toolbox.x = FlxG.mouse.screenX;
|
||||
toolbox.y = FlxG.mouse.screenY;
|
||||
});
|
||||
|
||||
FlxMouseEvent.add(healthIconBF, function(_) {
|
||||
trace("clicked bf");
|
||||
});
|
||||
}
|
||||
|
||||
function buildNotePreview():Void
|
||||
|
|
Loading…
Reference in a new issue