diff --git a/assets/music/breakfast.mp3 b/assets/music/breakfast.mp3 index abefad59..e0b4daae 100644 Binary files a/assets/music/breakfast.mp3 and b/assets/music/breakfast.mp3 differ diff --git a/assets/music/breakfast.ogg b/assets/music/breakfast.ogg index fe682396..4481da0c 100644 Binary files a/assets/music/breakfast.ogg and b/assets/music/breakfast.ogg differ diff --git a/assets/music/freakyMenu.mp3 b/assets/music/freakyMenu.mp3 index 8132bfef..6133ccf5 100644 Binary files a/assets/music/freakyMenu.mp3 and b/assets/music/freakyMenu.mp3 differ diff --git a/assets/music/freakyMenu.ogg b/assets/music/freakyMenu.ogg index f41d8284..3357b22e 100644 Binary files a/assets/music/freakyMenu.ogg and b/assets/music/freakyMenu.ogg differ diff --git a/assets/music/gameOver.mp3 b/assets/music/gameOver.mp3 index e8f76e09..f8bd41cb 100644 Binary files a/assets/music/gameOver.mp3 and b/assets/music/gameOver.mp3 differ diff --git a/assets/music/gameOver.ogg b/assets/music/gameOver.ogg index 0c2bd3a4..b515e1a4 100644 Binary files a/assets/music/gameOver.ogg and b/assets/music/gameOver.ogg differ diff --git a/assets/songs/test/song/Inst.mp3 b/assets/songs/test/song/Inst.mp3 index 87d99324..ad220314 100644 Binary files a/assets/songs/test/song/Inst.mp3 and b/assets/songs/test/song/Inst.mp3 differ diff --git a/assets/songs/test/song/Inst.ogg b/assets/songs/test/song/Inst.ogg index 35483ca5..f8b40108 100644 Binary files a/assets/songs/test/song/Inst.ogg and b/assets/songs/test/song/Inst.ogg differ diff --git a/assets/songs/test/song/Voices.mp3 b/assets/songs/test/song/Voices.mp3 index 70ea05e0..5323ab93 100644 Binary files a/assets/songs/test/song/Voices.mp3 and b/assets/songs/test/song/Voices.mp3 differ diff --git a/assets/songs/test/song/Voices.ogg b/assets/songs/test/song/Voices.ogg index eaefa49d..8d19ec35 100644 Binary files a/assets/songs/test/song/Voices.ogg and b/assets/songs/test/song/Voices.ogg differ diff --git a/assets/sounds/editors/dropdownAppear.ogg b/assets/sounds/editors/dropdownAppear.ogg new file mode 100644 index 00000000..689ea982 Binary files /dev/null and b/assets/sounds/editors/dropdownAppear.ogg differ diff --git a/assets/sounds/editors/windowClose.ogg b/assets/sounds/editors/windowClose.ogg new file mode 100644 index 00000000..36ee3d44 Binary files /dev/null and b/assets/sounds/editors/windowClose.ogg differ diff --git a/assets/sounds/sfxTodo.md b/assets/sounds/sfxTodo.md index 2155df7a..614245dd 100644 --- a/assets/sounds/sfxTodo.md +++ b/assets/sounds/sfxTodo.md @@ -39,8 +39,6 @@ Putting this txt in here so others can edit and commit this to suggest or add mi - Selecting Notes (via `CTRL + Drag` or `CTRL + A`) [] - Hitsounds [x] - Metronome [] -- Creating an Event [] -- Pulling up Event Editing menu [] - Scrolling Up/Down (via `Scroll Wheel` or `W/S`) [x] - Note Snapping Change [x] - Locking Strums [x] diff --git a/source/funkin/backend/system/Flags.hx b/source/funkin/backend/system/Flags.hx index e7bdad75..f60fc621 100644 --- a/source/funkin/backend/system/Flags.hx +++ b/source/funkin/backend/system/Flags.hx @@ -26,9 +26,9 @@ class Flags { public static var MOD_DOWNLOAD_LINK:String = ""; public static var MOD_DEPENDENCIES:Array = []; - public static var MOD_ICON64:String = ""; - public static var MOD_ICON32:String = ""; - public static var MOD_ICON16:String = ""; + @:noCompletion public static var MOD_ICON64:String = ""; + @:noCompletion public static var MOD_ICON32:String = ""; + @:noCompletion public static var MOD_ICON16:String = ""; public static var MOD_ICON:String = ""; public static var MOD_DISCORD_CLIENT_ID:String = ""; @@ -197,6 +197,38 @@ class Flags { public static var URL_EDITOR_FALLBACK:String = "https://www.youtube.com/watch?v=9Youam7GYdQ"; public static var URL_FNF_ITCH:String = "https://ninja-muffin24.itch.io/funkin"; + /** + * Default editor sound paths + */ + public static var DEFAULT_EDITOR_AUTOSAVE_SOUND = "editors/autosave"; + public static var DEFAULT_EDITOR_BUTTONCLICK_SOUND = "editors/buttonClick"; + public static var DEFAULT_EDITOR_CLICK_SOUND = "editors/click"; + public static var DEFAULT_EDITOR_COPY_SOUND = "editors/copy"; + public static var DEFAULT_EDITOR_CUT_SOUND = "editors/cut"; + public static var DEFAULT_EDITOR_DELETE_SOUND = "editors/delete"; + public static var DEFAULT_EDITOR_OFFSETDRAG_SOUND = "editors/offsetDrag"; + public static var DEFAULT_EDITOR_PASTE_SOUND = "editors/paste"; + public static var DEFAULT_EDITOR_REDO_SOUND = "editors/redo"; + public static var DEFAULT_EDITOR_SAVE_SOUND = "editors/save"; + public static var DEFAULT_EDITOR_TEXTREMOVE_SOUND = "editors/textRemove"; + public static var DEFAULT_EDITOR_TEXTTYPE_SOUND = "editors/textType"; + public static var DEFAULT_EDITOR_UNDO_SOUND = "editors/undo"; + public static var DEFAULT_EDITOR_WINDOWAPPEAR_SOUND = "editors/windowAppear"; + public static var DEFAULT_EDITOR_WINDOWCLOSE_SOUND = "editors/windowClose"; + public static var DEFAULT_EDITOR_DROPDOWNAPPEAR_SOUND = "editors/dropdownAppear"; + public static var DEFAULT_CHARTER_HITSOUND_SOUND = "editors/charter/hitsound"; + public static var DEFAULT_CHARTER_METRONOME_SOUND = "editors/charter/metronome"; + public static var DEFAULT_CHARTER_NOTEDELETE_SOUND = "editors/charter/noteDelete"; + public static var DEFAULT_CHARTER_NOTEPLACE_SOUND = "editors/charter/notePlace"; + public static var DEFAULT_CHARTER_SCROLL_SOUND = "editors/charter/scroll"; + public static var DEFAULT_CHARTER_SNAPPINGCHANGE_SOUND = "editors/charter/snappingChange"; + public static var DEFAULT_CHARTER_STRUMLOCK_SOUND = "editors/charter/strumLock"; + public static var DEFAULT_CHARTER_STRUMUNLOCK_SOUND = "editors/charter/strumUnlock"; + public static var DEFAULT_CHARTER_SUSTAINADD_SOUND = "editors/charter/sustainAdd"; + public static var DEFAULT_CHARTER_SUSTAINDELETE_SOUND = "editors/charter/sustainDelete"; + public static var DEFAULT_CHARACTER_GHOSTDISABLE_SOUND = "editors/character/ghostDisable"; + public static var DEFAULT_CHARACTER_GHOSTENABLE_SOUND = "editors/character/ghostEnable"; + public static var DEFAULT_GLSL_VERSION:String = "120"; @:also(funkin.backend.utils.HttpUtil.userAgent) public static var USER_AGENT:String = 'request'; diff --git a/source/funkin/backend/system/framerate/CodenameBuildField.hx b/source/funkin/backend/system/framerate/CodenameBuildField.hx index 30f79f1d..57238298 100644 --- a/source/funkin/backend/system/framerate/CodenameBuildField.hx +++ b/source/funkin/backend/system/framerate/CodenameBuildField.hx @@ -12,9 +12,10 @@ class CodenameBuildField extends TextField { reload(); } - public function reload() + public function reload() { text = '${Flags.VERSION_MESSAGE}'; #if debug text += '\n${Flags.COMMIT_MESSAGE}'; #end + } } diff --git a/source/funkin/backend/utils/CoolUtil.hx b/source/funkin/backend/utils/CoolUtil.hx index 005078de..d24e153a 100644 --- a/source/funkin/backend/utils/CoolUtil.hx +++ b/source/funkin/backend/utils/CoolUtil.hx @@ -408,7 +408,7 @@ final class CoolUtil * @return FPS-Modified Ratio */ @:noUsing public static inline function getFPSRatio(ratio:Float):Float { - return CoolUtil.bound(ratio * 60 * FlxG.elapsed, 0.0, 1.0); + return 1.0 - Math.pow(1.0 - ratio, FlxG.elapsed * 60); } /** * Tries to get a color from a `Dynamic` variable. diff --git a/source/funkin/backend/utils/WindowUtils.hx b/source/funkin/backend/utils/WindowUtils.hx index 065a1573..706c36e4 100644 --- a/source/funkin/backend/utils/WindowUtils.hx +++ b/source/funkin/backend/utils/WindowUtils.hx @@ -57,6 +57,17 @@ final class WindowUtils { updateTitle(); } + /** + * Sets the window title and icon. + * @param title The title to set. + * @param image The image to set as the icon. + **/ + public static inline function setWindow(?name:String, ?image:String) + { + Lib.application.window.setIcon(lime.graphics.Image.fromBytes(Assets.getBytes(Flags.MOD_ICON != null ? Flags.MOD_ICON : image))); + title = Flags.MOD_NAME != null ? Flags.MOD_NAME : title; + } + /** * Updates the window title to have the current title and prefix/suffix. **/ diff --git a/source/funkin/editors/character/CharacterAnimButton.hx b/source/funkin/editors/character/CharacterAnimButton.hx index 66d220ae..065a0d85 100644 --- a/source/funkin/editors/character/CharacterAnimButton.hx +++ b/source/funkin/editors/character/CharacterAnimButton.hx @@ -424,10 +424,12 @@ class CharacterAnimButton extends UIButton { public function toggleGhost() { if (valid && parent.ghosts.indexOf(anim) == -1) { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARACTER_GHOSTENABLE_SOUND)); parent.ghosts.push(anim); ghostIcon.animation.play("alive", true); ghostIcon.color = 0xFFFFFFFF; } else { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARACTER_GHOSTDISABLE_SOUND)); parent.ghosts.remove(anim); ghostIcon.animation.play("dead", true); ghostIcon.color = 0xFFADADAD; diff --git a/source/funkin/editors/character/CharacterAnimsWindow.hx b/source/funkin/editors/character/CharacterAnimsWindow.hx index fe4387d2..ae6822ea 100644 --- a/source/funkin/editors/character/CharacterAnimsWindow.hx +++ b/source/funkin/editors/character/CharacterAnimsWindow.hx @@ -99,6 +99,7 @@ class CharacterAnimsWindow extends UIButtonList { displayAnimsFramesList.remove(name); public function deleteAnimation(button:CharacterAnimButton, addToUndo:Bool = true) { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_DELETE_SOUND)); if (buttons.members.length <= 1) return; if (character.getAnimName() == button.anim) @:privateAccess CharacterEditor.instance._animation_down(null); diff --git a/source/funkin/editors/character/CharacterEditor.hx b/source/funkin/editors/character/CharacterEditor.hx index 9fb0f469..68f167fd 100644 --- a/source/funkin/editors/character/CharacterEditor.hx +++ b/source/funkin/editors/character/CharacterEditor.hx @@ -453,6 +453,7 @@ class CharacterEditor extends UIState { function _file_save(_) { #if sys + FlxG.sound.play(Paths.sound('editors/save')); CoolUtil.safeSaveFile( '${Paths.getAssetsRoot()}/data/characters/${character.curCharacter}.xml', buildCharacter() @@ -464,6 +465,7 @@ class CharacterEditor extends UIState { } function _file_saveas(_) { + FlxG.sound.play(Paths.sound('editors/save')); openSubState(new SaveSubstate(buildCharacter(), { defaultSaveFile: '${character.curCharacter}.xml' })); @@ -497,6 +499,7 @@ class CharacterEditor extends UIState { } function _undo(undo:CharacterEditorChange) { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_UNDO_SOUND)); switch (undo) { case null: // do nothing case CCharEditPosition(oldPos, newPos): @@ -567,6 +570,7 @@ class CharacterEditor extends UIState { } function _redo(redo:CharacterEditorChange) { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_REDO_SOUND)); switch (redo) { case null: // do nothing case CCharEditPosition(oldPos, newPos): diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index c7e20fc5..f1e2a3ce 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -210,7 +210,7 @@ class Charter extends UIState { { label: translate("edit.copy"), keybind: [CONTROL, C], - onSelect: _edit_copy + onSelect: cast _edit_copy }, { label: translate("edit.paste"), @@ -408,8 +408,8 @@ class Charter extends UIState { } ]; - hitsound = FlxG.sound.load(Paths.sound('editors/charter/hitsound')); - metronome = FlxG.sound.load(Paths.sound('editors/charter/metronome')); + hitsound = FlxG.sound.load(Paths.sound(Flags.DEFAULT_CHARTER_HITSOUND_SOUND)); + metronome = FlxG.sound.load(Paths.sound(Flags.DEFAULT_CHARTER_METRONOME_SOUND)); charterCamera = FlxG.camera; uiCamera = new FlxCamera(); @@ -511,6 +511,7 @@ class Charter extends UIState { strumlineLockButton = new CharterStrumlineButton("editors/charter/lock-strumline", translate("lock-unlock")); strumlineLockButton.onClick = function () { + FlxG.sound.play(Paths.sound(!strumLines.draggable ? Flags.DEFAULT_CHARTER_STRUMUNLOCK_SOUND : Flags.DEFAULT_CHARTER_STRUMLOCK_SOUND)); if (strumLines != null) { strumLines.draggable = !strumLines.draggable; strumlineLockButton.textTweenColor.color = strumLines.draggable ? 0xFF5C95CA : 0xFFE16565; @@ -950,7 +951,7 @@ class Charter extends UIState { notesGroup.add(note); selection = [note]; undos.addToUndo(CCreateSelection([note])); - FlxG.sound.play(Paths.sound('editors/charter/notePlace')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARTER_NOTEPLACE_SOUND)); } isSelecting = false; } @@ -1079,6 +1080,7 @@ class Charter extends UIState { if (selected == null) return selected; if (selected is CharterNote) { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARTER_NOTEDELETE_SOUND)); var note:CharterNote = cast selected; note.strumLineID = strumLines.members.indexOf(note.strumLine); note.strumLine = null; // For static undos :D @@ -1472,6 +1474,7 @@ class Charter extends UIState { public static function saveChart(shouldBuild:Bool = true, withEvents:Bool = true) { #if sys + FlxG.sound.play(Paths.sound('editors/save')); saveTo('${Paths.getAssetsRoot()}/songs/${__song.toLowerCase()}', !withEvents, shouldBuild); if (undos != null) undos.save(); #else @@ -1488,6 +1491,7 @@ class Charter extends UIState { public static function saveEvents(shouldBuild:Bool = true) { #if sys + FlxG.sound.play(Paths.sound('editors/save')); if (shouldBuild && instance != null) instance.buildChart(); var data = {events: Chart.filterChartForSaving(PlayState.SONG, false, false, true).events}; @@ -1510,6 +1514,7 @@ class Charter extends UIState { public static function saveMeta(shouldBuild:Bool = true) { #if sys + FlxG.sound.play(Paths.sound('editors/save')); if (shouldBuild && instance != null) instance.buildChart(); CoolUtil.safeSaveFile( '${Paths.getAssetsRoot()}/songs/${__song.toLowerCase()}/meta.json', @@ -1575,7 +1580,8 @@ class Charter extends UIState { function _file_saveas_fnflegacy(_) saveLegacyChartAs(); function _file_saveas_psych(_) savePsychChartAs(); - function _edit_copy(_) { + function _edit_copy(_, playSFX=true) { + if (playSFX) FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_COPY_SOUND)); if(selection.length == 0) return; var minStep:Float = selection[0].step; @@ -1594,6 +1600,7 @@ class Charter extends UIState { ]; } function _edit_paste(_) { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_PASTE_SOUND)); if (clipboard.length <= 0) return; var minStep = curStep; @@ -1613,7 +1620,7 @@ class Charter extends UIState { } } selection = sObjects; - _edit_copy(_); // to fix stupid bugs + _edit_copy(_, false); // to fix stupid bugs checkSelectionForBPMUpdates(); @@ -1621,13 +1628,15 @@ class Charter extends UIState { } function _edit_cut(_) { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_CUT_SOUND)); if (selection == null || selection.length == 0) return; - _edit_copy(_); + _edit_copy(_, false); deleteSelection(selection, false); } function _edit_delete(_) { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_DELETE_SOUND)); if (selection == null || selection.length == 0) return; selection.loop((n:CharterNote) -> { noteDeleteAnims.deleteNotes.push({note: n, time: noteDeleteAnims.deleteTime}); @@ -1636,6 +1645,7 @@ class Charter extends UIState { } function _undo(undo:CharterChange) { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_UNDO_SOUND)); switch(undo) { case null: // do nothing case CDeleteStrumLine(strumLineID, strumLine): @@ -1696,6 +1706,7 @@ class Charter extends UIState { } function _redo(redo:CharterChange) { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_REDO_SOUND)); switch(redo) { case null: // do nothing case CDeleteStrumLine(strumLineID, strumLine): @@ -2040,8 +2051,8 @@ class Charter extends UIState { inline function _snap_decreasesnap(_) changequant(-1); inline function _snap_resetsnap(_) setquant(16); - inline function changequant(change:Int) {quant = quants[FlxMath.wrap(quants.indexOf(quant) + change, 0, quants.length-1)]; buildSnapsUI();}; - inline function setquant(newQuant:Int) {quant = newQuant; buildSnapsUI();} + inline function changequant(change:Int) {FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARTER_SNAPPINGCHANGE_SOUND)); quant = quants[FlxMath.wrap(quants.indexOf(quant) + change, 0, quants.length-1)]; buildSnapsUI();}; + inline function setquant(newQuant:Int) {FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARTER_SNAPPINGCHANGE_SOUND)); quant = newQuant; buildSnapsUI();} function buildSnapsUI():Array { var snapsTopButton:UITopMenuButton = topMenuSpr == null ? null : cast topMenuSpr.members[snapIndex]; @@ -2077,12 +2088,12 @@ class Charter extends UIState { } inline function _note_addsustain(t) { - FlxG.sound.play(Paths.sound('editors/charter/sustainAdd')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARTER_SUSTAINADD_SOUND)); changeNoteSustain(1); } inline function _note_subtractsustain(t) { - FlxG.sound.play(Paths.sound('editors/charter/sustainDelete')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_CHARTER_SUSTAINDELETE_SOUND)); changeNoteSustain(-1); } diff --git a/source/funkin/editors/charter/CharterAutoSaveUI.hx b/source/funkin/editors/charter/CharterAutoSaveUI.hx index b7222471..901cba9a 100644 --- a/source/funkin/editors/charter/CharterAutoSaveUI.hx +++ b/source/funkin/editors/charter/CharterAutoSaveUI.hx @@ -82,7 +82,7 @@ class CharterAutoSaveUI extends UISliceSprite { icon.animation.curAnim.curFrame = 1; for (member in [this, progressBar, progressBarBack, autosavingText]) member.color = 0xFFA3EC95; - FlxG.sound.play(Paths.sound("editors/autosave")); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_AUTOSAVE_SOUND)); (new FlxTimer()).start(1, (_) -> {disappearAnimation();}); }); diff --git a/source/funkin/editors/charter/CharterEventAdd.hx b/source/funkin/editors/charter/CharterEventAdd.hx index 0031a78d..dca9d308 100644 --- a/source/funkin/editors/charter/CharterEventAdd.hx +++ b/source/funkin/editors/charter/CharterEventAdd.hx @@ -30,12 +30,17 @@ class CharterEventAdd extends UISliceSprite { if (curCharterEvent != null) Charter.instance.openSubState(new CharterEventScreenNew(curCharterEvent)); else { + CharterEventGroup.stopThisFuckingShitDudeIstg = true; var chartEvent = new CharterEvent(step, [], global); - chartEvent.events = []; chartEvent.global = global; Charter.instance.createSelection([chartEvent]); Charter.instance.openSubState(new CharterEventScreenNew(chartEvent)); + sprAlpha = 0; + alpha = sprAlpha * 0.75; + text.alpha = sprAlpha; + + sideText.alpha = sprAlpha; } } } @@ -43,6 +48,7 @@ class CharterEventAdd extends UISliceSprite { public override function update(elapsed:Float) { super.update(elapsed); + if (FlxG.state.subState != null) return; text.follow(this, global ? bWidth - text.width - (text.text == TU.translate("charter.addEvent") ? 15 : 20) : 20, (bHeight - text.height) / 2); sideText.follow(this, (bWidth/2) - (sideText.fieldWidth/2), -(sideText.height + 2)); alpha = sprAlpha * 0.75; @@ -52,6 +58,7 @@ class CharterEventAdd extends UISliceSprite { } public function updatePos(step:Float) { + if (FlxG.state.subState != null) return; curCharterEvent = null; this.step = step; this.y = (step * 40) - (bHeight / 2); @@ -61,6 +68,7 @@ class CharterEventAdd extends UISliceSprite { } public function updateEdit(event:CharterEvent) { + if (FlxG.state.subState != null) return; curCharterEvent = event; this.y = event.y; text.text = TU.translate("charter.editEvent"); diff --git a/source/funkin/editors/charter/CharterEventGroup.hx b/source/funkin/editors/charter/CharterEventGroup.hx index d7be0864..41c9e09e 100644 --- a/source/funkin/editors/charter/CharterEventGroup.hx +++ b/source/funkin/editors/charter/CharterEventGroup.hx @@ -4,6 +4,7 @@ import flixel.util.FlxSort; import funkin.editors.charter.CharterBackdropGroup.EventBackdrop; class CharterEventGroup extends FlxTypedGroup { + public static var stopThisFuckingShitDudeIstg = false; public var eventsBackdrop:EventBackdrop; public var eventsRowText:UIText; @@ -11,12 +12,12 @@ class CharterEventGroup extends FlxTypedGroup { var __lastSort:Int = 0; public override function update(elapsed:Float) { - filterEvents(); + super.update(elapsed); + if (!CharterEventGroup.stopThisFuckingShitDudeIstg) filterEvents(); if (autoSort && members.length != __lastSort) sortEvents(); eventsRowText.y = FlxMath.lerp(eventsRowText.y, -40 + (members[0] != null ? Math.min(members[0].y, 0) : 0), 1/20); - super.update(elapsed); } public override function remove(v:CharterEvent, force:Bool = true):CharterEvent { diff --git a/source/funkin/editors/charter/CharterEventScreenNew.hx b/source/funkin/editors/charter/CharterEventScreenNew.hx index 2ea20ce6..6f1fb7fd 100644 --- a/source/funkin/editors/charter/CharterEventScreenNew.hx +++ b/source/funkin/editors/charter/CharterEventScreenNew.hx @@ -284,9 +284,8 @@ class CharterEventScreenNew extends MusicBeatSubstate { } public function quit() { + CharterEventGroup.stopThisFuckingShitDudeIstg = false; saveCurTab(); - chartEvent.refreshEventIcons(); - Charter.instance.updateBPMEvents(); if (events.length <= 0) Charter.instance.deleteSelection([chartEvent]); @@ -296,6 +295,8 @@ class CharterEventScreenNew extends MusicBeatSubstate { Charter.undos.addToUndo(CEditEvent(chartEvent, oldEvents, [for (event in events) Reflect.copy(event)])); } + chartEvent.refreshEventIcons(); + Charter.instance.updateBPMEvents(); close(); } diff --git a/source/funkin/editors/stage/StageEditor.hx b/source/funkin/editors/stage/StageEditor.hx index 0ed80aee..8900c24f 100644 --- a/source/funkin/editors/stage/StageEditor.hx +++ b/source/funkin/editors/stage/StageEditor.hx @@ -508,6 +508,7 @@ class StageEditor extends UIState { function _file_save(_) { #if sys + FlxG.sound.play(Paths.sound('editors/save')); CoolUtil.safeSaveFile( '${Paths.getAssetsRoot()}/data/stages/${__stage}.xml', buildStage() @@ -519,6 +520,7 @@ class StageEditor extends UIState { } function _file_saveas(_) { + FlxG.sound.play(Paths.sound('editors/save')); openSubState(new SaveSubstate(buildStage(), { defaultSaveFile: '${__stage}.xml' })); @@ -729,6 +731,7 @@ class StageEditor extends UIState { } function _edit_undo(_) { + FlxG.sound.play(Flags.DEFAULT_EDITOR_UNDO_SOUND); var undo = undos.undo(); switch(undo) { case null: @@ -754,6 +757,7 @@ class StageEditor extends UIState { } function _edit_redo(_) { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_REDO_SOUND)); var redo = undos.redo(); switch(redo) { case null: diff --git a/source/funkin/editors/ui/UIButton.hx b/source/funkin/editors/ui/UIButton.hx index b3f81f54..2064e3d7 100644 --- a/source/funkin/editors/ui/UIButton.hx +++ b/source/funkin/editors/ui/UIButton.hx @@ -30,7 +30,7 @@ class UIButton extends UISliceSprite { super.onHovered(); if (FlxG.mouse.justPressed) { hasBeenPressed = true; - FlxG.sound.play(Paths.sound('editors/buttonClick')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_BUTTONCLICK_SOUND)); } if (FlxG.mouse.justReleased && callback != null && shouldPress && hasBeenPressed) { callback(); diff --git a/source/funkin/editors/ui/UIDropDown.hx b/source/funkin/editors/ui/UIDropDown.hx index 0dbd1545..d0cfb323 100644 --- a/source/funkin/editors/ui/UIDropDown.hx +++ b/source/funkin/editors/ui/UIDropDown.hx @@ -87,6 +87,7 @@ class UIDropDown extends UISliceSprite { } public function openContextMenu() { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_DROPDOWNAPPEAR_SOUND)); var screenPos = getScreenPosition(null, __lastDrawCameras[0] == null ? FlxG.camera : __lastDrawCameras[0]); curMenu = UIState.state.openContextMenu([ for(k=>o in items) { diff --git a/source/funkin/editors/ui/UIState.hx b/source/funkin/editors/ui/UIState.hx index faa1b4e6..97db4580 100644 --- a/source/funkin/editors/ui/UIState.hx +++ b/source/funkin/editors/ui/UIState.hx @@ -106,7 +106,7 @@ class UIState extends MusicBeatState { } if (FlxG.mouse.justPressed) { - FlxG.sound.play(Paths.sound('editors/click')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_CLICK_SOUND)); } if (FlxG.mouse.justReleased) @@ -147,6 +147,7 @@ class UIState extends MusicBeatState { } public function closeCurrentContextMenu() { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_WINDOWCLOSE_SOUND)); if(curContextMenu != null) { curContextMenu.close(); curContextMenu = null; @@ -154,7 +155,7 @@ class UIState extends MusicBeatState { } public function openContextMenu(options:Array, ?callback:UIContextMenuCallback, ?x:Float, ?y:Float, ?w:Int) { - FlxG.sound.play(Paths.sound('editors/windowAppear')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_WINDOWAPPEAR_SOUND)); var state = FlxG.state; while(state.subState != null && !(state._requestSubStateReset && state._requestedSubState == null)) state = state.subState; diff --git a/source/funkin/editors/ui/UISubstateWindow.hx b/source/funkin/editors/ui/UISubstateWindow.hx index be975868..61c9f5ca 100644 --- a/source/funkin/editors/ui/UISubstateWindow.hx +++ b/source/funkin/editors/ui/UISubstateWindow.hx @@ -86,6 +86,7 @@ class UISubstateWindow extends MusicBeatSubstate { } public override function destroy() { + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_WINDOWCLOSE_SOUND)); super.destroy(); for(e in camShaders) e.removeShader(blurShader); diff --git a/source/funkin/editors/ui/UITextBox.hx b/source/funkin/editors/ui/UITextBox.hx index 49627320..371297f2 100644 --- a/source/funkin/editors/ui/UITextBox.hx +++ b/source/funkin/editors/ui/UITextBox.hx @@ -110,7 +110,7 @@ class UITextBox extends UISliceSprite implements IUIFocusable { case RIGHT: changeSelection(1); case BACKSPACE: - FlxG.sound.play(Paths.sound('editors/textRemove')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_TEXTREMOVE_SOUND)); if (position > 0) { label.text = label.text.substr(0, position-1) + label.text.substr(position); changeSelection(-1); @@ -120,7 +120,7 @@ class UITextBox extends UISliceSprite implements IUIFocusable { case END: position = label.text.length; case V: - FlxG.sound.play(Paths.sound('editors/textType')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_TEXTTYPE_SOUND)); // Hey lj here, fixed copying because before we checked if the modifier was left or right ctrl // but somehow it gave a int outside of the KeyModifier's range :sob: // apparently there is a boolean that just checks for you. yw :D @@ -131,14 +131,14 @@ class UITextBox extends UISliceSprite implements IUIFocusable { var data:String = Clipboard.generalClipboard.getData(TEXT_FORMAT); if (data != null) onTextInput(data); case C: - FlxG.sound.play(Paths.sound('editors/textType')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_TEXTTYPE_SOUND)); // if we are not holding ctrl, ignore if (!modifier.ctrlKey) return; // copying Clipboard.generalClipboard.setData(TEXT_FORMAT, label.text); default: - FlxG.sound.play(Paths.sound('editors/textType')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_TEXTTYPE_SOUND)); } } diff --git a/source/funkin/editors/ui/UIWindow.hx b/source/funkin/editors/ui/UIWindow.hx index b494e3fa..e7b994e9 100644 --- a/source/funkin/editors/ui/UIWindow.hx +++ b/source/funkin/editors/ui/UIWindow.hx @@ -15,7 +15,7 @@ class UIWindow extends UISliceSprite { content = new FlxTypedGroup(); members.push(content); - FlxG.sound.play(Paths.sound('editors/windowAppear')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_WINDOWAPPEAR_SOUND)); } public override function update(elapsed:Float) { diff --git a/source/funkin/menus/WarningState.hx b/source/funkin/menus/WarningState.hx index 19359ffb..d51d6667 100644 --- a/source/funkin/menus/WarningState.hx +++ b/source/funkin/menus/WarningState.hx @@ -18,7 +18,7 @@ class WarningState extends MusicBeatState { disclaimer = new FunkinText(16, titleAlphabet.y + titleAlphabet.height + 10, FlxG.width - 32, "", 32); disclaimer.alignment = CENTER; - disclaimer.text = "This is a warning state! Make a script #./data/states/WarningState.hx# to edit this text! \n\n Note: you can use asterisks or hashtags to highlight your text in red or yellow, or you can just make your own markup using postCreate (you have to change the text in create() to apply the default markup)"; + disclaimer.text = "This is a warning state! Make a script #./data/states/WarningState.hx# to edit this text! \n\n Note: you can use *asterisks* or #hashtags# to highlight your text in *red* or #yellow#, or you can just make your own markup using postCreate (you have to change the text in create() to apply the default markup)"; super.create();