diff --git a/source/funkin/backend/system/Flags.hx b/source/funkin/backend/system/Flags.hx index dd3815e4..87795b27 100644 --- a/source/funkin/backend/system/Flags.hx +++ b/source/funkin/backend/system/Flags.hx @@ -197,6 +197,36 @@ 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_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/editors/character/CharacterAnimButton.hx b/source/funkin/editors/character/CharacterAnimButton.hx index 80c4e287..065a0d85 100644 --- a/source/funkin/editors/character/CharacterAnimButton.hx +++ b/source/funkin/editors/character/CharacterAnimButton.hx @@ -424,12 +424,12 @@ class CharacterAnimButton extends UIButton { public function toggleGhost() { if (valid && parent.ghosts.indexOf(anim) == -1) { - FlxG.sound.play(Paths.sound('editors/character/ghostEnable')); + 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('editors/character/ghostDisable')); + 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 6c20f83b..ae6822ea 100644 --- a/source/funkin/editors/character/CharacterAnimsWindow.hx +++ b/source/funkin/editors/character/CharacterAnimsWindow.hx @@ -99,7 +99,7 @@ class CharacterAnimsWindow extends UIButtonList { displayAnimsFramesList.remove(name); public function deleteAnimation(button:CharacterAnimButton, addToUndo:Bool = true) { - FlxG.sound.play(Paths.sound('editors/delete')); + 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 c80e001c..264f7039 100644 --- a/source/funkin/editors/character/CharacterEditor.hx +++ b/source/funkin/editors/character/CharacterEditor.hx @@ -498,7 +498,7 @@ class CharacterEditor extends UIState { } function _undo(undo:CharacterEditorChange) { - FlxG.sound.play(Paths.sound('editors/undo')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_UNDO_SOUND)); switch (undo) { case null: // do nothing case CCharEditPosition(oldPos, newPos): @@ -569,7 +569,7 @@ class CharacterEditor extends UIState { } function _redo(redo:CharacterEditorChange) { - FlxG.sound.play(Paths.sound('editors/redo')); + 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 8cbfe1ea..b94fe140 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -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,7 +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 ? 'editors/charter/strumUnlock' : 'editors/charter/strumLock')); + 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; @@ -951,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; } @@ -1080,7 +1080,7 @@ class Charter extends UIState { if (selected == null) return selected; if (selected is CharterNote) { - FlxG.sound.play(Paths.sound('editors/charter/noteDelete')); + 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 @@ -1581,7 +1581,7 @@ class Charter extends UIState { function _file_saveas_psych(_) savePsychChartAs(); function _edit_copy(_, playSFX=true) { - if (playSFX) FlxG.sound.play(Paths.sound('editors/undo')); + if (playSFX) FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_COPY_SOUND)); if(selection.length == 0) return; var minStep:Float = selection[0].step; @@ -1600,7 +1600,7 @@ class Charter extends UIState { ]; } function _edit_paste(_) { - FlxG.sound.play(Paths.sound('editors/paste')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_PASTE_SOUND)); if (clipboard.length <= 0) return; var minStep = curStep; @@ -1628,7 +1628,7 @@ class Charter extends UIState { } function _edit_cut(_) { - FlxG.sound.play(Paths.sound('editors/cut')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_CUT_SOUND)); if (selection == null || selection.length == 0) return; _edit_copy(_, false); @@ -1636,7 +1636,7 @@ class Charter extends UIState { } function _edit_delete(_) { - FlxG.sound.play(Paths.sound('editors/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}); @@ -1645,7 +1645,7 @@ class Charter extends UIState { } function _undo(undo:CharterChange) { - FlxG.sound.play(Paths.sound('editors/undo')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_UNDO_SOUND)); switch(undo) { case null: // do nothing case CDeleteStrumLine(strumLineID, strumLine): @@ -1706,7 +1706,7 @@ class Charter extends UIState { } function _redo(redo:CharterChange) { - FlxG.sound.play(Paths.sound('editors/redo')); + FlxG.sound.play(Paths.sound(Flags.DEFAULT_EDITOR_REDO_SOUND)); switch(redo) { case null: // do nothing case CDeleteStrumLine(strumLineID, strumLine): @@ -2051,8 +2051,8 @@ class Charter extends UIState { inline function _snap_decreasesnap(_) changequant(-1); inline function _snap_resetsnap(_) setquant(16); - inline function changequant(change:Int) {FlxG.sound.play(Paths.sound('editors/charter/snappingChange')); quant = quants[FlxMath.wrap(quants.indexOf(quant) + change, 0, quants.length-1)]; buildSnapsUI();}; - inline function setquant(newQuant:Int) {FlxG.sound.play(Paths.sound('editors/charter/snappingChange')); 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]; @@ -2088,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(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/stage/StageEditor.hx b/source/funkin/editors/stage/StageEditor.hx index c7f33535..d02cc997 100644 --- a/source/funkin/editors/stage/StageEditor.hx +++ b/source/funkin/editors/stage/StageEditor.hx @@ -731,7 +731,7 @@ class StageEditor extends UIState { } function _edit_undo(_) { - FlxG.sound.play(Paths.sound('editors/undo')); + FlxG.sound.play(Flags.DEFAULT_EDITOR_UNDO_SOUND); var undo = undos.undo(); switch(undo) { case null: @@ -757,7 +757,7 @@ class StageEditor extends UIState { } function _edit_redo(_) { - FlxG.sound.play(Paths.sound('editors/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/UIState.hx b/source/funkin/editors/ui/UIState.hx index faa1b4e6..24d905a4 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) @@ -154,7 +154,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/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) {