diff --git a/source/game/EventHandeler.hx b/source/game/EventHandeler.hx index d68baa5340..65e16dc2bf 100644 --- a/source/game/EventHandeler.hx +++ b/source/game/EventHandeler.hx @@ -1,5 +1,6 @@ package game; +import utilities.NoteVariables; import game.TimeBar; import flixel.graphics.FlxGraphic; import openfl.utils.Assets; @@ -38,7 +39,7 @@ class EventHandeler { } case "set gf speed": if (Std.parseInt(event[2]) != null) - PlayState.instance.gfSpeed = Std.parseInt(event[2]); + game.gfSpeed = Std.parseInt(event[2]); case "character will idle": var char = PlayState.getCharFromEvent(event[2]); @@ -50,13 +51,13 @@ class EventHandeler { var hudCamZoomThing:Float = Std.parseFloat(event[3]); if (Math.isNaN(defaultCamZoomThing)) - defaultCamZoomThing = PlayState.instance.defaultCamZoom; + defaultCamZoomThing = game.defaultCamZoom; if (Math.isNaN(hudCamZoomThing)) hudCamZoomThing = 1; - PlayState.instance.defaultCamZoom = defaultCamZoomThing; - PlayState.instance.defaultHudCamZoom = hudCamZoomThing; + game.defaultCamZoom = defaultCamZoomThing; + game.defaultHudCamZoom = hudCamZoomThing; case "change character alpha": var char = PlayState.getCharFromEvent(event[2]); @@ -82,7 +83,7 @@ class EventHandeler { time = 1; if (Options.getData("flashingLights")) - PlayState.instance.camGame.flash(FlxColor.fromString(event[2].toLowerCase()), time); + game.camGame.flash(FlxColor.fromString(event[2].toLowerCase()), time); case "camera fade": var time = Std.parseFloat(event[3]); @@ -90,7 +91,7 @@ class EventHandeler { time = 1; if (Options.getData("flashingLights")) - PlayState.instance.camGame.fade(FlxColor.fromString(event[2].toLowerCase()), time); + game.camGame.fade(FlxColor.fromString(event[2].toLowerCase()), time); #end case "add camera zoom": if (game.cameraZooms && ((FlxG.camera.zoom < 1.35 && game.camZooming) || !game.camZooming)) { @@ -300,15 +301,15 @@ class EventHandeler { game.type_Configs.set("default", CoolUtil.coolTextFile(Paths.txt("arrow types/default"))); // reload ratings - game.uiMap.set("marvelous", FlxGraphic.fromAssetKey(Paths.image("ui skins/" + PlayState.SONG.ui_Skin + "/ratings/marvelous"))); - game.uiMap.set("sick", FlxGraphic.fromAssetKey(Paths.image("ui skins/" + PlayState.SONG.ui_Skin + "/ratings/sick"))); - game.uiMap.set("good", FlxGraphic.fromAssetKey(Paths.image("ui skins/" + PlayState.SONG.ui_Skin + "/ratings/good"))); - game.uiMap.set("bad", FlxGraphic.fromAssetKey(Paths.image("ui skins/" + PlayState.SONG.ui_Skin + "/ratings/bad"))); - game.uiMap.set("shit", FlxGraphic.fromAssetKey(Paths.image("ui skins/" + PlayState.SONG.ui_Skin + "/ratings/shit"))); + game.uiMap.set("marvelous", Paths.gpuBitmap("ui skins/" + PlayState.SONG.ui_Skin + "/ratings/marvelous")); + game.uiMap.set("sick", Paths.gpuBitmap("ui skins/" + PlayState.SONG.ui_Skin + "/ratings/sick")); + game.uiMap.set("good", Paths.gpuBitmap("ui skins/" + PlayState.SONG.ui_Skin + "/ratings/good")); + game.uiMap.set("bad", Paths.gpuBitmap("ui skins/" + PlayState.SONG.ui_Skin + "/ratings/bad")); + game.uiMap.set("shit", Paths.gpuBitmap("ui skins/" + PlayState.SONG.ui_Skin + "/ratings/shit")); // preload numbers for (i in 0...10) - game.uiMap.set(Std.string(i), FlxGraphic.fromAssetKey(Paths.image("ui skins/" + PlayState.SONG.ui_Skin + "/numbers/num" + Std.string(i)))); + game.uiMap.set(Std.string(i), Paths.gpuBitmap("ui skins/" + PlayState.SONG.ui_Skin + "/numbers/num" + Std.string(i))); game.timeBar = new TimeBar(PlayState.SONG, PlayState.storyDifficultyStr); PlayState.playerStrums.clear(); @@ -327,6 +328,64 @@ class EventHandeler { game.generateStaticArrows(0, true, false); } } + + for (note in game.notes.members) { + var oldAnim:String = note.animation.curAnim.name; + note.frames = Note.getFrames(note); + + var lmaoStuff:Float = Std.parseFloat(game.ui_settings[0]) * (Std.parseFloat(game.ui_settings[2]) + - (Std.parseFloat(game.mania_size[( note.mustPress ? PlayState.SONG.playerKeyCount : PlayState.SONG.keyCount) - 1]))); + + if (note.isSustainNote) + note.scale.set(lmaoStuff, + Std.parseFloat(game.ui_settings[0]) * (Std.parseFloat(game.ui_settings[2]) - (Std.parseFloat(game.mania_size[3])))); + else + note.scale.set(lmaoStuff, lmaoStuff); + + note.updateHitbox(); + + note.antialiasing = game.ui_settings[3] == "true"; + + var localKeyCount:Int = note.mustPress ? note.song.playerKeyCount : note.song.keyCount; + + note.animation.addByPrefix("default", NoteVariables.animationDirections[localKeyCount - 1][note.noteData] + "0", 24); + note.animation.addByPrefix("hold", NoteVariables.animationDirections[localKeyCount - 1][note.noteData] + " hold0", 24); + note.animation.addByPrefix("holdend", NoteVariables.animationDirections[localKeyCount - 1][note.noteData] + " hold end0", 24); + + note.shader = note.affectedbycolor ? note.colorSwap.shader : null; + + note.animation.play(oldAnim); + + } + + for (note in game.unspawnNotes) { + var oldAnim:String = note.animation.curAnim.name; + note.frames = Note.getFrames(note); + + var lmaoStuff:Float = Std.parseFloat(game.ui_settings[0]) * (Std.parseFloat(game.ui_settings[2]) + - (Std.parseFloat(game.mania_size[( note.mustPress ? PlayState.SONG.playerKeyCount : PlayState.SONG.keyCount) - 1]))); + + if (note.isSustainNote) + note.scale.set(lmaoStuff, + Std.parseFloat(game.ui_settings[0]) * (Std.parseFloat(game.ui_settings[2]) - (Std.parseFloat(game.mania_size[3])))); + else + note.scale.set(lmaoStuff, lmaoStuff); + + note.updateHitbox(); + + note.antialiasing = game.ui_settings[3] == "true"; + + + var localKeyCount:Int = note.mustPress ? note.song.playerKeyCount : note.song.keyCount; + + note.animation.addByPrefix("default", NoteVariables.animationDirections[localKeyCount - 1][note.noteData] + "0", 24); + note.animation.addByPrefix("hold", NoteVariables.animationDirections[localKeyCount - 1][note.noteData] + " hold0", 24); + note.animation.addByPrefix("holdend", NoteVariables.animationDirections[localKeyCount - 1][note.noteData] + " hold end0", 24); + + note.shader = note.affectedbycolor ? note.colorSwap.shader : null; + + note.animation.play(oldAnim); + } // FNFC stuff case 'focuscamera': switch (Std.string(event[2])) { diff --git a/source/game/Note.hx b/source/game/Note.hx index 7a09b10bda..542d4a10d2 100644 --- a/source/game/Note.hx +++ b/source/game/Note.hx @@ -66,6 +66,8 @@ class Note extends FlxSkewedSprite { public var inEditor:Bool = false; + public var song:SongData; + #if MODCHARTING_TOOLS /** * The mesh used for sustains to make them stretchy @@ -95,6 +97,23 @@ class Note extends FlxSkewedSprite { */ public static var beats:Array = [4, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192]; + public static function getFrames(note:Note):FlxAtlasFrames{ + if (PlayState.instance.types.contains(note.arrow_Type)) { + if (Assets.exists(Paths.image('ui skins/' + note.song.ui_Skin + "/arrows/" + note.arrow_Type, 'shared'))) { + return Paths.getSparrowAtlas('ui skins/' + note.song.ui_Skin + "/arrows/" + note.arrow_Type, 'shared' #if MODCHARTING_TOOLS ,note.song.modchartingTools || FlxG.state is modcharting.ModchartEditorState #end); + } else { + return Paths.getSparrowAtlas('ui skins/${note.song.ui_Skin}/arrows/default', 'shared' #if MODCHARTING_TOOLS ,note.song.modchartingTools || FlxG.state is modcharting.ModchartEditorState #end); + } + } else { + if (Assets.exists(Paths.image("ui skins/default/arrows/" + note.arrow_Type, 'shared'))) { + return Paths.getSparrowAtlas("ui skins/default/arrows/" + note.arrow_Type, 'shared' #if MODCHARTING_TOOLS ,note.song.modchartingTools || FlxG.state is modcharting.ModchartEditorState #end); + } else { + return Paths.getSparrowAtlas('ui skins/${note.song.ui_Skin}/arrows/default', 'shared' #if MODCHARTING_TOOLS ,note.song.modchartingTools || FlxG.state is modcharting.ModchartEditorState #end); + } + } + return Paths.getSparrowAtlas('ui skins/default/arrows/default', 'shared' #if MODCHARTING_TOOLS ,note.song.modchartingTools || FlxG.state is modcharting.ModchartEditorState #end); + } + public function new(strumTime:Float, noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false, ?character:Int = 0, ?arrowType:String = "default", ?song:SongData, ?characters:Array, ?mustPress:Bool = false, ?inEditor:Bool = false) { super(); @@ -118,27 +137,17 @@ class Note extends FlxSkewedSprite { this.noteData = noteData; + this.song = song; + x += 100; // MAKE SURE ITS DEFINITELY OFF SCREEN? y = -2000; - if (PlayState.instance.types.contains(arrow_Type)) { - if (Assets.exists(Paths.image('ui skins/' + song.ui_Skin + "/arrows/" + arrow_Type, 'shared'))) { - frames = Paths.getSparrowAtlas('ui skins/' + song.ui_Skin + "/arrows/" + arrow_Type, 'shared' #if MODCHARTING_TOOLS ,song.modchartingTools || FlxG.state is modcharting.ModchartEditorState #end); - } else { - frames = Paths.getSparrowAtlas('ui skins/${song.ui_Skin}/arrows/default', 'shared' #if MODCHARTING_TOOLS ,song.modchartingTools || FlxG.state is modcharting.ModchartEditorState #end); - } - } else { - if (Assets.exists(Paths.image("ui skins/default/arrows/" + arrow_Type, 'shared'))) { - frames = Paths.getSparrowAtlas("ui skins/default/arrows/" + arrow_Type, 'shared' #if MODCHARTING_TOOLS ,song.modchartingTools || FlxG.state is modcharting.ModchartEditorState #end); - } else { - frames = Paths.getSparrowAtlas('ui skins/${song.ui_Skin}/arrows/default', 'shared' #if MODCHARTING_TOOLS ,song.modchartingTools || FlxG.state is modcharting.ModchartEditorState #end); - } - } + frames = Note.getFrames(this); - animation.addByPrefix("default", NoteVariables.Other_Note_Anim_Stuff[localKeyCount - 1][noteData] + "0", 24); - animation.addByPrefix("hold", NoteVariables.Other_Note_Anim_Stuff[localKeyCount - 1][noteData] + " hold0", 24); - animation.addByPrefix("holdend", NoteVariables.Other_Note_Anim_Stuff[localKeyCount - 1][noteData] + " hold end0", 24); + animation.addByPrefix("default", NoteVariables.animationDirections[localKeyCount - 1][noteData] + "0", 24); + animation.addByPrefix("hold", NoteVariables.animationDirections[localKeyCount - 1][noteData] + " hold0", 24); + animation.addByPrefix("holdend", NoteVariables.animationDirections[localKeyCount - 1][noteData] + " hold end0", 24); var lmaoStuff:Float = Std.parseFloat(PlayState.instance.ui_settings[0]) * (Std.parseFloat(PlayState.instance.ui_settings[2]) - (Std.parseFloat(PlayState.instance.mania_size[localKeyCount - 1]))); @@ -235,7 +244,7 @@ class Note extends FlxSkewedSprite { var realKeyCount:Int = mustPress ? song.playerKeyCount : song.keyCount; - var noteColor = NoteColors.getNoteColor(NoteVariables.Other_Note_Anim_Stuff[realKeyCount - 1][noteData]); + var noteColor = NoteColors.getNoteColor(NoteVariables.animationDirections[realKeyCount - 1][noteData]); if (colorSwap != null && noteColor != null) { colorSwap.r = noteColor[0]; diff --git a/source/game/NoteSplash.hx b/source/game/NoteSplash.hx index 222b61f171..ff4e1f64fd 100644 --- a/source/game/NoteSplash.hx +++ b/source/game/NoteSplash.hx @@ -47,7 +47,7 @@ class NoteSplash extends FlxSprite { this.target = target; graphic.destroyOnNoUse = false; - animation.addByPrefix("default", "note splash " + NoteVariables.Other_Note_Anim_Stuff[localKeyCount - 1][noteData] + "0", FlxG.random.int(22, 26), + animation.addByPrefix("default", "note splash " + NoteVariables.animationDirections[localKeyCount - 1][noteData] + "0", FlxG.random.int(22, 26), false); animation.play("default", true); @@ -61,7 +61,7 @@ class NoteSplash extends FlxSprite { shader = affectedbycolor ? colorSwap.shader : null; - noteColor = NoteColors.getNoteColor(NoteVariables.Other_Note_Anim_Stuff[PlayState.SONG.keyCount - 1][noteData]); + noteColor = NoteColors.getNoteColor(NoteVariables.animationDirections[PlayState.SONG.keyCount - 1][noteData]); if(colorSwap != null && noteColor != null){ colorSwap.r = noteColor[0]; colorSwap.g = noteColor[1]; diff --git a/source/game/SongLoader.hx b/source/game/SongLoader.hx index 2b2469c4a4..4702eddcb4 100644 --- a/source/game/SongLoader.hx +++ b/source/game/SongLoader.hx @@ -156,7 +156,7 @@ class SongLoader { song.chartOffset = 0.0; // guarenteed safe value - song.keyCount = Math.floor(Math.min(song.keyCount, NoteVariables.Note_Count_Directions.length)); + song.keyCount = Math.floor(Math.min(song.keyCount, NoteVariables.maniaDirections.length)); if (song.events == null) song.events = []; diff --git a/source/game/StrumNote.hx b/source/game/StrumNote.hx index f33ff8e9b6..6ab54e1c0e 100644 --- a/source/game/StrumNote.hx +++ b/source/game/StrumNote.hx @@ -70,18 +70,18 @@ class StrumNote extends FlxSkewedSprite { frames = Assets.exists(Paths.image("ui skins/" + ui_Skin + "/arrows/strums")) ? Paths.getSparrowAtlas('ui skins/' + ui_Skin + "/arrows/strums") : Paths.getSparrowAtlas('ui skins/' + ui_Skin + "/arrows/default"); - var animation_Base_Name:String = NoteVariables.Note_Count_Directions[keyCount - 1][Std.int(Math.abs(noteData))].toLowerCase(); + var animation_Base_Name:String = NoteVariables.maniaDirections[keyCount - 1][Std.int(Math.abs(noteData))].toLowerCase(); animation.addByPrefix('static', animation_Base_Name + " static"); - animation.addByPrefix('pressed', NoteVariables.Other_Note_Anim_Stuff[keyCount - 1][noteData] + ' press', 24, false); - animation.addByPrefix('confirm', NoteVariables.Other_Note_Anim_Stuff[keyCount - 1][noteData] + ' confirm', 24, false); + animation.addByPrefix('pressed', NoteVariables.animationDirections[keyCount - 1][noteData] + ' press', 24, false); + animation.addByPrefix('confirm', NoteVariables.animationDirections[keyCount - 1][noteData] + ' confirm', 24, false); antialiasing = ui_settings[3] == "true"; setGraphicSize(Std.int((width * Std.parseFloat(ui_settings[0])) * (Std.parseFloat(ui_settings[2]) - (Std.parseFloat(mania_size[keyCount - 1]))))); updateHitbox(); - noteColor = NoteColors.getNoteColor(NoteVariables.Other_Note_Anim_Stuff[keyCount - 1][noteData]); + noteColor = NoteColors.getNoteColor(NoteVariables.animationDirections[keyCount - 1][noteData]); shader = affectedbycolor ? colorSwap.shader : null; if (affectedbycolor && PlayState.instance != null && colorSwap != null) { diff --git a/source/modding/ModchartUtilities.hx b/source/modding/ModchartUtilities.hx index 0f8d732d95..2dcd6f2b72 100644 --- a/source/modding/ModchartUtilities.hx +++ b/source/modding/ModchartUtilities.hx @@ -506,7 +506,7 @@ class ModchartUtilities { setLuaFunction("getSingDirectionID", function(id:Int) { var thing = ['singLEFT', 'singDOWN', 'singUP', 'singRIGHT']; - var singDir = NoteVariables.Character_Animation_Arrays[PlayState.SONG.playerKeyCount - 1][Std.int(Math.abs(id % PlayState.SONG.playerKeyCount))]; + var singDir = NoteVariables.characterAnimations[PlayState.SONG.playerKeyCount - 1][Std.int(Math.abs(id % PlayState.SONG.playerKeyCount))]; return thing.indexOf(singDir); }); diff --git a/source/states/PlayState.hx b/source/states/PlayState.hx index 7a460d1703..07711fbf8a 100644 --- a/source/states/PlayState.hx +++ b/source/states/PlayState.hx @@ -2179,7 +2179,7 @@ class PlayState extends MusicBeatState { if (!note.mustPress && note.strumTime <= Conductor.songPosition && note.shouldHit) { camZooming = true; - var singAnim:String = NoteVariables.Character_Animation_Arrays[getCorrectKeyCount(false) - 1][Std.int(Math.abs(note.noteData))] + var singAnim:String = NoteVariables.characterAnimations[getCorrectKeyCount(false) - 1][Std.int(Math.abs(note.noteData))] + (characterPlayingAs == 0 ? altAnim : "") + note.singAnimSuffix; if (note.singAnimPrefix != 'sing') { singAnim = singAnim.replace('sing', note.singAnimPrefix); @@ -3343,37 +3343,37 @@ class PlayState extends MusicBeatState { if (characterPlayingAs == 0) { if (boyfriend.otherCharacters != null && !(boyfriend.otherCharacters.length - 1 < note.character)) { if (note.characters.length <= 1) - boyfriend.otherCharacters[note.character].playAnim(NoteVariables.Character_Animation_Arrays[getCorrectKeyCount(true) - 1][direction] + boyfriend.otherCharacters[note.character].playAnim(NoteVariables.characterAnimations[getCorrectKeyCount(true) - 1][direction] + "miss", true); else { for (character in note.characters) { if (boyfriend.otherCharacters.length - 1 >= character) - boyfriend.otherCharacters[character].playAnim(NoteVariables.Character_Animation_Arrays[getCorrectKeyCount(true) - 1][direction] + boyfriend.otherCharacters[character].playAnim(NoteVariables.characterAnimations[getCorrectKeyCount(true) - 1][direction] + "miss", true); } } } else - boyfriend.playAnim(NoteVariables.Character_Animation_Arrays[getCorrectKeyCount(true) - 1][direction] + "miss", true); + boyfriend.playAnim(NoteVariables.characterAnimations[getCorrectKeyCount(true) - 1][direction] + "miss", true); } else { if (dad.otherCharacters != null && !(dad.otherCharacters.length - 1 < note.character)) if (note.characters.length <= 1) - dad.otherCharacters[note.character].playAnim(NoteVariables.Character_Animation_Arrays[getCorrectKeyCount(true) - 1][direction] + dad.otherCharacters[note.character].playAnim(NoteVariables.characterAnimations[getCorrectKeyCount(true) - 1][direction] + "miss", true); else { for (character in note.characters) { if (dad.otherCharacters.length - 1 >= character) - dad.otherCharacters[character].playAnim(NoteVariables.Character_Animation_Arrays[getCorrectKeyCount(true) - 1][direction] + dad.otherCharacters[character].playAnim(NoteVariables.characterAnimations[getCorrectKeyCount(true) - 1][direction] + "miss", true); } } else - dad.playAnim(NoteVariables.Character_Animation_Arrays[getCorrectKeyCount(true) - 1][direction] + "miss", true); + dad.playAnim(NoteVariables.characterAnimations[getCorrectKeyCount(true) - 1][direction] + "miss", true); } } else { if (characterPlayingAs == 0) - boyfriend.playAnim(NoteVariables.Character_Animation_Arrays[getCorrectKeyCount(true) - 1][direction] + "miss", true); + boyfriend.playAnim(NoteVariables.characterAnimations[getCorrectKeyCount(true) - 1][direction] + "miss", true); else - dad.playAnim(NoteVariables.Character_Animation_Arrays[getCorrectKeyCount(true) - 1][direction] + "miss", true); + dad.playAnim(NoteVariables.characterAnimations[getCorrectKeyCount(true) - 1][direction] + "miss", true); } calculateAccuracy(); @@ -3418,7 +3418,7 @@ class PlayState extends MusicBeatState { note.character ]; - var singAnim:String = NoteVariables.Character_Animation_Arrays[getCorrectKeyCount(true) - 1][Std.int(Math.abs(note.noteData % getCorrectKeyCount(true)))] + var singAnim:String = NoteVariables.characterAnimations[getCorrectKeyCount(true) - 1][Std.int(Math.abs(note.noteData % getCorrectKeyCount(true)))] + (characterPlayingAs == 1 ? altAnim : "") + note.singAnimSuffix; if (note.singAnimPrefix != 'sing') { diff --git a/source/substates/ControlMenuSubstate.hx b/source/substates/ControlMenuSubstate.hx index 667ba097ff..b38887e9cf 100644 --- a/source/substates/ControlMenuSubstate.hx +++ b/source/substates/ControlMenuSubstate.hx @@ -158,7 +158,7 @@ class ControlMenuSubstate extends MusicBeatSubstate { if(reset && shift) { - binds = NoteVariables.Default_Binds; + binds = NoteVariables.defaultBinds; fullscreenBind = "F11"; killBind = "R"; pauseBind = "ENTER"; @@ -253,8 +253,8 @@ class ControlMenuSubstate extends MusicBeatSubstate if(keyCount < 1) keyCount = 1; - if(keyCount > NoteVariables.Note_Count_Directions.length) - keyCount = NoteVariables.Note_Count_Directions.length; + if(keyCount > NoteVariables.maniaDirections.length) + keyCount = NoteVariables.maniaDirections.length; create_Arrows(); } diff --git a/source/substates/NoteColorSubstate.hx b/source/substates/NoteColorSubstate.hx index 9adcd82005..c829809539 100644 --- a/source/substates/NoteColorSubstate.hx +++ b/source/substates/NoteColorSubstate.hx @@ -90,13 +90,13 @@ class NoteColorSubstate extends MusicBeatSubstate { if(reset) { - current_ColorVals = NoteColors.defaultColors.get(NoteVariables.Other_Note_Anim_Stuff[key_Count - 1][selectedControl]); + current_ColorVals = NoteColors.defaultColors.get(NoteVariables.animationDirections[key_Count - 1][selectedControl]); arrow_Group.members[selectedControl].colorSwap.r = current_ColorVals[0]; arrow_Group.members[selectedControl].colorSwap.g = current_ColorVals[1]; arrow_Group.members[selectedControl].colorSwap.b = current_ColorVals[2]; - NoteColors.setNoteColor(NoteVariables.Other_Note_Anim_Stuff[key_Count - 1][selectedControl], current_ColorVals); + NoteColors.setNoteColor(NoteVariables.animationDirections[key_Count - 1][selectedControl], current_ColorVals); } if(back && selectingStuff) @@ -132,8 +132,8 @@ class NoteColorSubstate extends MusicBeatSubstate if(key_Count < 1) key_Count = 1; - if(key_Count > NoteVariables.Note_Count_Directions.length) - key_Count = NoteVariables.Note_Count_Directions.length; + if(key_Count > NoteVariables.maniaDirections.length) + key_Count = NoteVariables.maniaDirections.length; create_Arrows(); } @@ -162,7 +162,7 @@ class NoteColorSubstate extends MusicBeatSubstate arrow_Group.members[selectedControl].colorSwap.b = current_ColorVals[selectedValue]; } - NoteColors.setNoteColor(NoteVariables.Other_Note_Anim_Stuff[key_Count - 1][selectedControl], current_ColorVals); + NoteColors.setNoteColor(NoteVariables.animationDirections[key_Count - 1][selectedControl], current_ColorVals); } if(!selectingStuff && (leftP || rightP)) @@ -223,7 +223,7 @@ class NoteColorSubstate extends MusicBeatSubstate inline function updateColorValsBase() { - current_ColorVals = NoteColors.getNoteColor(NoteVariables.Other_Note_Anim_Stuff[key_Count - 1][selectedControl]); + current_ColorVals = NoteColors.getNoteColor(NoteVariables.animationDirections[key_Count - 1][selectedControl]); } function create_Arrows(?new_Key_Count) @@ -246,9 +246,9 @@ class NoteColorSubstate extends MusicBeatSubstate babyArrow.setGraphicSize(Std.int((babyArrow.width * Std.parseFloat(ui_settings[0])) * (Std.parseFloat(ui_settings[2]) - (Std.parseFloat(mania_size[key_Count-1]))))); babyArrow.updateHitbox(); - babyArrow.animation.addByPrefix('default', NoteVariables.Other_Note_Anim_Stuff[key_Count - 1][i] + "0"); - babyArrow.animation.addByPrefix('pressed', NoteVariables.Other_Note_Anim_Stuff[key_Count - 1][i] + ' press', 24, false); - babyArrow.animation.addByPrefix('confirm', NoteVariables.Other_Note_Anim_Stuff[key_Count - 1][i] + ' confirm', 24, false); + babyArrow.animation.addByPrefix('default', NoteVariables.animationDirections[key_Count - 1][i] + "0"); + babyArrow.animation.addByPrefix('pressed', NoteVariables.animationDirections[key_Count - 1][i] + ' press', 24, false); + babyArrow.animation.addByPrefix('confirm', NoteVariables.animationDirections[key_Count - 1][i] + ' confirm', 24, false); babyArrow.playAnim('default'); diff --git a/source/toolbox/ChartingState.hx b/source/toolbox/ChartingState.hx index 5189724d38..c4a2df31e6 100644 --- a/source/toolbox/ChartingState.hx +++ b/source/toolbox/ChartingState.hx @@ -411,12 +411,12 @@ class ChartingState extends MusicBeatState { stepperSpeed.name = 'song_speed'; var stepperKeyCount:FlxUINumericStepper = new FlxUINumericStepper(10, stepperSpeed.y + stepperSpeed.height, 1, 4, 1, - NoteVariables.Note_Count_Directions.length); + NoteVariables.maniaDirections.length); stepperKeyCount.value = _song.keyCount; stepperKeyCount.name = 'song_keycount'; var stepperPlayerKeyCount:FlxUINumericStepper = new FlxUINumericStepper(stepperKeyCount.x + (stepperKeyCount.width * 2) + 2, stepperKeyCount.y, 1, 4, - 1, NoteVariables.Note_Count_Directions.length); + 1, NoteVariables.maniaDirections.length); stepperPlayerKeyCount.value = _song.playerKeyCount; stepperPlayerKeyCount.name = 'song_playerkeycount'; @@ -1298,9 +1298,9 @@ class ChartingState extends MusicBeatState { if (note.rawNoteData % (_song.keyCount + _song.playerKeyCount) < _song.keyCount && _song.notes[curSection].mustHitSection || note.rawNoteData % (_song.keyCount + _song.playerKeyCount) >= _song.keyCount && !_song.notes[curSection].mustHitSection) { - lilBf.animation.play(NoteVariables.Other_Note_Anim_Stuff[_song.keyCount - 1][note.noteData], true); + lilBf.animation.play(NoteVariables.animationDirections[_song.keyCount - 1][note.noteData], true); } else { - lilOpp.animation.play(NoteVariables.Other_Note_Anim_Stuff[_song.keyCount - 1][note.noteData], true); + lilOpp.animation.play(NoteVariables.animationDirections[_song.keyCount - 1][note.noteData], true); } }); } @@ -1838,10 +1838,10 @@ class ChartingState extends MusicBeatState { goodNoteInfo = daNoteInfo - _song.playerKeyCount; var note:Note = new Note(daStrumTime, goodNoteInfo, null, false, 0, daType, _song, [0], mustPress, true); - lilBf.animation.addByPrefix(NoteVariables.Other_Note_Anim_Stuff[_song.keyCount - 1][note.noteData], - NoteVariables.Other_Note_Anim_Stuff[_song.keyCount - 1][note.noteData] + "0", 12); - lilOpp.animation.addByPrefix(NoteVariables.Other_Note_Anim_Stuff[_song.keyCount - 1][note.noteData], - NoteVariables.Other_Note_Anim_Stuff[_song.keyCount - 1][note.noteData] + "0", 12); + lilBf.animation.addByPrefix(NoteVariables.animationDirections[_song.keyCount - 1][note.noteData], + NoteVariables.animationDirections[_song.keyCount - 1][note.noteData] + "0", 12); + lilOpp.animation.addByPrefix(NoteVariables.animationDirections[_song.keyCount - 1][note.noteData], + NoteVariables.animationDirections[_song.keyCount - 1][note.noteData] + "0", 12); note.sustainLength = daSus; note.setGraphicSize((Std.parseInt(PlayState.instance.arrow_Configs.get(daType)[4]) ?? Std.parseInt(PlayState.instance.arrow_Configs.get(daType)[4])), diff --git a/source/utilities/NoteVariables.hx b/source/utilities/NoteVariables.hx index 1cd0732414..f78ab5657f 100644 --- a/source/utilities/NoteVariables.hx +++ b/source/utilities/NoteVariables.hx @@ -1,15 +1,15 @@ package utilities; class NoteVariables { - public static var Note_Count_Directions:Array>; - public static var Default_Binds:Array>; - public static var Other_Note_Anim_Stuff:Array>; - public static var Character_Animation_Arrays:Array>; + public static var maniaDirections:Array>; + public static var defaultBinds:Array>; + public static var animationDirections:Array>; + public static var characterAnimations:Array>; public static function init() { - Note_Count_Directions = CoolUtil.coolTextFileOfArrays(Paths.txt("mania data/maniaDirections")); - Default_Binds = CoolUtil.coolTextFileOfArrays(Paths.txt("mania data/defaultBinds")); - Other_Note_Anim_Stuff = CoolUtil.coolTextFileOfArrays(Paths.txt("mania data/maniaAnimationDirections")); - Character_Animation_Arrays = CoolUtil.coolTextFileOfArrays(Paths.txt("mania data/maniaCharacterAnimations")); + maniaDirections = CoolUtil.coolTextFileOfArrays(Paths.txt("mania data/maniaDirections")); + defaultBinds = CoolUtil.coolTextFileOfArrays(Paths.txt("mania data/defaultBinds")); + animationDirections = CoolUtil.coolTextFileOfArrays(Paths.txt("mania data/maniaAnimationDirections")); + characterAnimations = CoolUtil.coolTextFileOfArrays(Paths.txt("mania data/maniaCharacterAnimations")); } } diff --git a/source/utilities/Options.hx b/source/utilities/Options.hx index e41ee195f3..21355b0b24 100644 --- a/source/utilities/Options.hx +++ b/source/utilities/Options.hx @@ -109,13 +109,13 @@ class Options { @:noCompletion public static function fixBinds() { if (getData("binds", "binds") == null) - setData(NoteVariables.Default_Binds, "binds", "binds"); + setData(NoteVariables.defaultBinds, "binds", "binds"); else { var bindArray:Array = getData("binds", "binds"); - if (bindArray.length < NoteVariables.Default_Binds.length) { - for (i in Std.int(bindArray.length - 1)...NoteVariables.Default_Binds.length) { - bindArray[i] = NoteVariables.Default_Binds[i]; + if (bindArray.length < NoteVariables.defaultBinds.length) { + for (i in Std.int(bindArray.length - 1)...NoteVariables.defaultBinds.length) { + bindArray[i] = NoteVariables.defaultBinds[i]; } setData(bindArray, "binds", "binds");