Skip to content

Commit

Permalink
porting and sorting dialogs + an old bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
KoloInDaCrib committed Nov 24, 2024
1 parent c5c94ce commit 4332853
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 205 deletions.
20 changes: 18 additions & 2 deletions source/funkin/ui/debug/char/CharCreatorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package funkin.ui.debug.char;
import haxe.io.Path;
import haxe.ui.core.Screen;
import haxe.ui.backend.flixel.UIState;
import haxe.ui.containers.dialogs.Dialog;
import haxe.ui.containers.windows.WindowManager;
import funkin.audio.FunkinSound;
import funkin.input.Cursor;
Expand Down Expand Up @@ -67,10 +68,12 @@ class CharCreatorState extends UIState
// I feel like there should be more editor themes
// I don't dislike Artistic expression or anythin I had simply heard it a million times while making da editors and I'm getting a bit tired of it
// plus it's called *chart*EditorLoop so CHECKMATE liberals hehe -Kolo
Conductor.instance.forceBPM(null);
FunkinSound.playMusic('chartEditorLoop',
{
overrideExisting: true,
restartTrack: true
restartTrack: true,
mapTimeChanges: true
});

FlxG.sound.music.fadeIn(10, 0, 1);
Expand Down Expand Up @@ -103,7 +106,11 @@ class CharCreatorState extends UIState
menubarOptionCharSelect.onChange = function(_) switchToPage(CharacterSelect);
menubarOptionFreeplay.onChange = function(_) switchToPage(Freeplay);
menubarOptionResults.onChange = function(_) switchToPage(ResultScreen);

menubarItemNewChar.onClick = _ -> this.startWizard(wizardComplete);
menubarItemExport.onClick = _ -> this.exportAll();
menubarItemExit.onClick = _ -> exitEditor();
menubarItemAbout.onClick = _ -> new CharCreatorAboutDialog().showDialog();
}

function handleShortcuts():Void
Expand Down Expand Up @@ -149,7 +156,13 @@ class CharCreatorState extends UIState
{
Cursor.hide();
FlxG.switchState(() -> new DebugMenuSubState());
FlxG.sound.music.stop();
FunkinSound.playMusic('freakyMenu',
{
overrideExisting: true,
restartTrack: false,
// Continue playing this music between states, until a different music track gets played.
persist: true
});
}

function switchToPage(page:CharCreatorPage):Void
Expand Down Expand Up @@ -178,3 +191,6 @@ enum CharCreatorPage
Freeplay;
ResultScreen;
}

@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/components/about.xml"))
class CharCreatorAboutDialog extends Dialog {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,7 @@ package funkin.ui.debug.char.components.dialogs.freeplay;

import funkin.data.animation.AnimationData;

@:xml('
<collapsible-dialog title="DJ Animation Settings" width="250" height="250">
<vbox width="100%" height="100%">
<dropdown id="djAnimList" width="100%" height="25" />

<grid width="100%" columns="2">
<label text="Name" />
<textfield id="djAnimName" placeholder="Animation Name" />

<label text="Prefix" />
<textfield id="djAnimPrefix" placeholder="Animation Symbol" />

<label text="Loop" />
<checkbox id="djAnimLooped" text="Enabled" />

<label text="Offsets" />
<hbox>
<number-stepper id="djAnimOffsetX" pos="0" precision="1" />
<number-stepper id="djAnimOffsetY" pos="0" precision="1" />
</hbox>
</grid>

<hbox width="100%" style="justify-content:space-evenly" continuous="true">
<button id="djAnimSave" text="Save Anim"/>
<button id="djAnimDelete" text="Remove Anim"/>
</hbox>
</vbox>
</collapsible-dialog>
')
@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/freeplay/dj-anims-dialog.xml"))
@:access(funkin.ui.debug.char.pages.CharCreatorFreeplayPage)
class FreeplayDJAnimsDialog extends DefaultPageDialog
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package funkin.ui.debug.char.components.dialogs.freeplay;
import funkin.ui.debug.char.pages.CharCreatorFreeplayPage;
import funkin.data.freeplay.player.PlayerRegistry;

@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/freeplay-dj-settings-dialog.xml"))
@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/freeplay/dj-settings-dialog.xml"))
@:access(funkin.ui.debug.char.pages.CharCreatorFreeplayPage)
class FreeplayDJSettingsDialog extends DefaultPageDialog
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,7 @@ import flixel.util.FlxColor;
import openfl.display.BitmapData;

@:access(funkin.ui.debug.char.pages.CharCreatorFreeplayPage)
@:xml('
<?xml version="1.0" encoding="utf-8"?>
<collapsible-dialog width="400" height="425" title="Freeplay Style Settings" closable="false">
<vbox width="100%" height="100%">
<hbox width="100%" height="100%">

<vbox width="65%" height="100%">
<optionbox id="optionMakeNew" text="Use Custom" group="freepStypeGroup" selected="true"/>
<scrollview width="100%" height="100%" contentWidth="100%">
<vbox id="freeplayStyleNew" width="100%">

<section-header text="Asset Paths"/>
<hbox width="100%">
<textfield id="fieldBGAsset" placeholder="Background Asset Path" width="75%"/>
<button id="buttonBGAsset" text="Load" width="25%"/>
</hbox>
<hbox width="100%">
<textfield id="fieldArrow" placeholder="Arrows Asset Path" width="75%"/>
<button id="buttonArrow" text="Load" width="25%"/>
</hbox>
<hbox width="100%">
<textfield id="fieldNumbers" placeholder="Numbers Asset Path" width="75%"/>
<button id="buttonNumbers" text="Load" width="25%"/>
</hbox>
<hbox width="100%">
<textfield id="fieldCapsule" placeholder="Capsule Asset Path" width="75%"/>
<button id="buttonCapsule" text="Load" width="25%"/>
</hbox>

<section-header text="Capsule Colors"/>
<hbox width="100%">
<label text="Select" width="35%" />
<color-picker-popup id="selectPicker" width="65%"/>
</hbox>
<hbox width="100%">
<label text="Deselect" width="35%" />
<color-picker-popup id="deselectPicker" width="65%"/>
</hbox>

<section-header text="Start Delay"/>
<number-stepper id="delayStepper" pos="0" min="0"/>
</vbox>
</scrollview>
</vbox>

<vbox width="35%" height="100%">
<optionbox id="optionUsePreset" text="Use Preset" group="freepStypeGroup"/>
<scrollview width="100%" height="75%" contentWidth="100%">
<vbox id="freeplayStylePresets" width="100%" disabled="true"/>
</scrollview>

<button id="buttonApplyStyle" text="Apply Style" horizontalAlign="center"/>
</vbox>

</hbox>
</vbox>
</collapsible-dialog>
')
@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/freeplay/style-dialog.xml"))
class FreeplayStyleDialog extends DefaultPageDialog
{
var styleID:String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import funkin.data.character.CharacterData.CharacterRenderType;
import haxe.ui.containers.dialogs.CollapsibleDialog;
import haxe.ui.data.ArrayDataSource;

@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/anim-dialog.xml"))
@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/gameplay/anim-dialog.xml"))
class AddAnimDialog extends DefaultPageDialog
{
public var linkedChar:CharCreatorCharacter = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,71 +1,6 @@
package funkin.ui.debug.char.components.dialogs.gameplay;

@:xml('<?xml version="1.0" encoding="utf-8"?>
<collapsible-dialog title="Character Metadata" width="400" height="400">
<vbox width="100%" height="100%">
<hbox width="100%" height="100%">
<vbox width="50%" height="100%">
<frame text="Offsets" width="100%">
<hbox>
<number-stepper id="charOffsetsX" pos="0"/>
<number-stepper id="charOffsetsY" pos="0"/>
</hbox>
</frame>

<frame text="Camera Offsets" width="100%">
<hbox>
<number-stepper id="charCamOffsetsX" pos="0"/>
<number-stepper id="charCamOffsetsY" pos="0"/>
</hbox>
</frame>

<frame text="Scale" width="100%">
<vbox>
<number-stepper id="charScale" pos="1" min="0.05" step="0.05" precision="2"/>
</vbox>
</frame>

<frame text="Hold Timer" width="100%">
<vbox>
<number-stepper id="charHoldTimer" pos="8" min="0" precision="2"/>
</vbox>
</frame>

<frame text="Flip Horizontally" width="100%">
<vbox>
<checkbox id="charFlipX" text="Enabled"/>
</vbox>
</frame>

<frame text="Pixelated" width="100%">
<vbox>
<checkbox id="charIsPixel" text="Enabled"/>
</vbox>
</frame>
</vbox>

<frame text="Death Data" width="50%" height="100%">
<vbox width="100%">
<checkbox id="charHasDeathData" text="Enabled" />
<vbox id="charDeathBox" width="100%">

<section-header text="Camera Offsets" />
<hbox>
<number-stepper id="charDeathCamOffsetX" pos="0" />
<number-stepper id="charDeathCamOffsetY" pos="0" />
</hbox>

<section-header text="Camera Zoom" />
<number-stepper id="charDeathCamZoom" pos="1" min="0.11" />

<section-header text="Transition Delay" />
<number-stepper id="charDeathTransDelay" pos="0" min="0" />
</vbox>
</vbox>
</frame>
</hbox>
</vbox>
</collapsible-dialog>')
@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/gameplay/metadata-dialog.xml"))
class CharMetadataDialog extends DefaultPageDialog
{
override public function new(daPage:CharCreatorGameplayPage, char:CharCreatorCharacter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import funkin.util.SortUtil;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;

@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/ghost-dialog.xml"))
@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/gameplay/ghost-dialog.xml"))
class GhostSettingsDialog extends DefaultPageDialog
{
public var attachedMenu:GhostCharacterMenu;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,7 @@ import flixel.graphics.frames.FlxAtlasFrames;

using StringTools;

@:xml('<?xml version="1.0" encoding="utf-8"?>
<collapsible-dialog title="Health Icon Data" width="400" height="325">
<vbox width="100%" height="100%">
<hbox width="100%" height="25" verticalAlign="center" style="border:1px solid $normal-border-color">
<textfield id="healthIconLoadField" width="75%" height="100%" placeholder="Put the path to the Health Icon Image here."/>
<button id="healthIconLoadBtn" width="25%" height="100%" text="Load File"/>
</hbox>

<hbox width="100%">
<vbox width="50%">
<checkbox id="healthIconPixelated" text="Pixelated"/>
<checkbox id="healthIconFlipX" text="Flip on X-Axis"/>
<label text="Scale"/>
<number-stepper id="healthIconScale" min="0.05" step="0.05" pos="1" precision="2"/>
<label text="Offsets X/Y"/>
<hbox width="100%">
<number-stepper id="healthIconOffsetX" step="1" pos="0"/>
<number-stepper id="healthIconOffsetY" step="1" pos="0"/>
</hbox>

</vbox>

<vbox width="50%">
<image id="healthIconPreviewImg" width="150" height="150" horizontalAlign="center" style="border:1px solid $normal-border-color"/>
<button id="healthIconPreviewBtn" width="150" text="Refresh" horizontalAlign="center"/>

<label text="Current Animation" horizontalAlign="center"/>
<option-stepper id="healthIconCurAnim" width="125" horizontalAlign="center">
<data>
<item text="idle" />
<item text="winning" />
<item text="losing" />
<item text="toWinning" />
<item text="toLosing" />
<item text="fromWinning" />
<item text="fromLosing" />
</data>
</option-stepper>
</vbox>

</hbox>
</vbox>
</collapsible-dialog>')
@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/gameplay/icon-dialog.xml"))
class HealthIconDialog extends DefaultPageDialog
{
var healthIcon:FlxSprite;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import funkin.play.scoring.Scoring.ScoringRank;
import funkin.graphics.adobeanimate.FlxAtlasSprite;
import funkin.graphics.FunkinSprite;

@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/results-anim-dialog.xml"))
@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/results/results-anim-dialog.xml"))
@:access(funkin.ui.debug.char.pages.CharCreatorResultsPage)
class ResultsAnimDialog extends DefaultPageDialog
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import haxe.ui.data.ArrayDataSource;
import funkin.data.character.CharacterRegistry;
import funkin.util.SortUtil;

@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/playable-character-settings-dialog.xml"))
@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/char-creator/dialogs/select/playable-character-settings-dialog.xml"))
class PlayableCharacterSettingsDialog extends DefaultPageDialog
{
public var ownedCharacters(get, never):Array<String>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class CharCreatorGameplayPage extends CharCreatorDefaultPage
{
var bop = cast(spr, Bopper);

if (Conductor.instance.currentBeatTime % bop.danceEvery == 0) bop.dance();
if (Conductor.instance.currentBeat % bop.danceEvery == 0) bop.dance();
}
}
}
Expand Down

0 comments on commit 4332853

Please sign in to comment.