diff --git a/source/ColorpickSubstate.hx b/source/ColorpickSubstate.hx deleted file mode 100644 index 8a5b486b3..000000000 --- a/source/ColorpickSubstate.hx +++ /dev/null @@ -1,74 +0,0 @@ -package; - -import flixel.FlxG; -import flixel.addons.effects.chainable.FlxEffectSprite; -import flixel.addons.effects.chainable.FlxOutlineEffect; -import flixel.group.FlxGroup.FlxTypedGroup; -import flixel.util.FlxColor; -import shaderslmfao.ColorSwap; - -class ColorpickSubstate extends MusicBeatSubstate -{ - var curSelected:Int = 0; - - var grpNotes:FlxTypedGroup; - - public function new() - { - super(); - - grpNotes = new FlxTypedGroup(); - add(grpNotes); - - for (i in 0...4) - { - var note:Note = new Note(0, i); - - note.x = (100 * i) + i; - note.screenCenter(Y); - - var _effectSpr:FlxEffectSprite = new FlxEffectSprite(note, [new FlxOutlineEffect(FlxOutlineMode.FAST, FlxColor.WHITE, 4, 1)]); - add(_effectSpr); - _effectSpr.y = 0; - _effectSpr.x = i * 80; - _effectSpr.antialiasing = true; - _effectSpr.setGraphicSize(Std.int(_effectSpr.width * 0.7)); - _effectSpr.updateHitbox(); - - grpNotes.add(note); - } - } - - override function update(elapsed:Float) - { - if (controls.BACK) - { - FlxG.state.closeSubState(); - FlxG.state.openSubState(new OptionsSubState()); - } - - if (controls.UI_RIGHT_P) - curSelected += 1; - if (controls.UI_LEFT_P) - curSelected -= 1; - - if (curSelected < 0) - curSelected = grpNotes.members.length - 1; - if (curSelected >= grpNotes.members.length) - curSelected = 0; - - if (controls.UI_UP) - { - grpNotes.members[curSelected].colorSwap.update(elapsed * 0.3); - Note.arrowColors[curSelected] += elapsed * 0.3; - } - - if (controls.UI_DOWN) - { - grpNotes.members[curSelected].colorSwap.update(-elapsed * 0.3); - Note.arrowColors[curSelected] += -elapsed * 0.3; - } - - super.update(elapsed); - } -} diff --git a/source/OptionsSubState.hx b/source/OptionsSubState.hx index b1fd705f0..1b5071c74 100644 --- a/source/OptionsSubState.hx +++ b/source/OptionsSubState.hx @@ -1,10 +1,15 @@ package; +import Controls.Control; import flixel.FlxG; import flixel.FlxSprite; import flixel.group.FlxGroup.FlxTypedGroup; import flixel.text.FlxText; import flixel.util.FlxColor; +import polymod.Polymod; +#if desktop +import sys.FileSystem; +#end class OptionsSubState extends MusicBeatSubstate { @@ -72,13 +77,13 @@ class OptionsSubState extends MusicBeatSubstate { case "Colors": FlxG.state.closeSubState(); - FlxG.state.openSubState(new ColorpickSubstate()); + case "Controls": FlxG.state.closeSubState(); FlxG.state.openSubState(new ControlsSubState()); case "Mods": FlxG.state.closeSubState(); - FlxG.state.openSubState(new ModdingSubstate()); + // FlxG.state.openSubState(new ModdingSubstate()); case "Back": FlxG.switchState(new MainMenuState()); } diff --git a/source/TitleState.hx b/source/TitleState.hx index 98c681e7d..3e531bac7 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -62,11 +62,11 @@ class TitleState extends MusicBeatState FlxG.save.bind('funkin', 'ninjamuffin99'); PlayerSettings.init(); Highscore.load(); - + #if newgrounds NGio.init(); #end - + if (FlxG.save.data.weekUnlocked != null) { // FIX LATER!!! @@ -329,6 +329,9 @@ class TitleState extends MusicBeatState skipIntro(); } + if (FlxG.keys.justPressed.SPACE) + swagShader.hasOutline = !swagShader.hasOutline; + if (controls.UI_LEFT) { swagShader.update(-elapsed * 0.1); diff --git a/source/shaderslmfao/ColorSwap.hx b/source/shaderslmfao/ColorSwap.hx index 2ce958385..e24ac1095 100644 --- a/source/shaderslmfao/ColorSwap.hx +++ b/source/shaderslmfao/ColorSwap.hx @@ -9,6 +9,9 @@ class ColorSwap public var colorToReplace(default, set):FlxColor; public var newColor(default, set):FlxColor; public var daTime(default, set):Float; + + public var hasOutline(default, set):Bool = false; + public var hueShit:Float = 0; public function new():Void @@ -16,6 +19,7 @@ class ColorSwap shader = new ColorSwapShader(); shader.uTime.value = [0]; shader.money.value = [0]; + shader.awesomeOutline.value = [hasOutline]; } public function update(elapsed:Float):Void @@ -32,6 +36,12 @@ class ColorSwap return color; } + function set_hasOutline(lol:Bool):Bool + { + shader.awesomeOutline.value = [lol]; + return lol; + } + function set_daTime(daTime:Float):Float { return daTime; @@ -52,9 +62,12 @@ class ColorSwapShader extends FlxShader uniform float uTime; uniform float money; + uniform bool awesomeOutline; + const float offset = 1.0 / 128.0; + vec3 normalizeColor(vec3 color) { @@ -96,6 +109,29 @@ class ColorSwapShader extends FlxShader // money += swagColor[0]; color = vec4(hsv2rgb(vec3(swagColor[0], swagColor[1], swagColor[2])), swagColor[3]); + + + if (awesomeOutline) + { + // Outline bullshit? + vec2 size = vec2(3, 3); + + if (color.a <= 0.5) { + float w = size.x / openfl_TextureSize.x; + float h = size.y / openfl_TextureSize.y; + + if (flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x + w, openfl_TextureCoordv.y)).a != 0. + || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y)).a != 0. + || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y + h)).a != 0. + || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y - h)).a != 0.) + color = vec4(1.0, 1.0, 1.0, 1.0); + } + + + } + + + gl_FragColor = color; @@ -112,9 +148,7 @@ class ColorSwapShader extends FlxShader gl_FragColor = vec4(0.0, 0.0, 0.0, 0.8); else gl_FragColor = color; - } - */ - + } */ } ') diff --git a/source/ui/ColorsMenu.hx b/source/ui/ColorsMenu.hx index bd5071f59..849451a59 100644 --- a/source/ui/ColorsMenu.hx +++ b/source/ui/ColorsMenu.hx @@ -29,10 +29,14 @@ class ColorsMenu extends ui.OptionsState.Page var _effectSpr:FlxEffectSprite = new FlxEffectSprite(note, [new FlxOutlineEffect(FlxOutlineMode.FAST, FlxColor.WHITE, 4, 1)]); add(_effectSpr); _effectSpr.y = 0; - _effectSpr.x = i * 80; + _effectSpr.x = i * 130; _effectSpr.antialiasing = true; - _effectSpr.setGraphicSize(Std.int(_effectSpr.width * 0.7)); - _effectSpr.updateHitbox(); + _effectSpr.scale.x = _effectSpr.scale.y = 0.7; + // _effectSpr.setGraphicSize(); + _effectSpr.height = note.height; + _effectSpr.width = note.width; + + // _effectSpr.updateHitbox(); grpNotes.add(note); } @@ -40,12 +44,6 @@ class ColorsMenu extends ui.OptionsState.Page override function update(elapsed:Float) { - if (controls.BACK) - { - FlxG.state.closeSubState(); - FlxG.state.openSubState(new OptionsSubState()); - } - if (controls.UI_RIGHT_P) curSelected += 1; if (controls.UI_LEFT_P) diff --git a/source/ModdingSubstate.hx b/source/ui/ModMenu.hx similarity index 96% rename from source/ModdingSubstate.hx rename to source/ui/ModMenu.hx index 530fc5cb2..7fed9b4bb 100644 --- a/source/ModdingSubstate.hx +++ b/source/ui/ModMenu.hx @@ -1,16 +1,15 @@ -package; +package ui; -import Controls.Control; import flixel.FlxG; import flixel.group.FlxGroup.FlxTypedGroup; import flixel.text.FlxText; import flixel.util.FlxColor; +#if cpp import polymod.Polymod; -#if desktop import sys.FileSystem; #end -class ModdingSubstate extends MusicBeatSubstate +class ModMenu extends ui.OptionsState.Page { var grpMods:FlxTypedGroup; var enabledMods:Array = []; diff --git a/source/ui/OptionsState.hx b/source/ui/OptionsState.hx index f4daa3c86..283cbc85f 100644 --- a/source/ui/OptionsState.hx +++ b/source/ui/OptionsState.hx @@ -166,6 +166,10 @@ class OptionsMenu extends Page add(items = new TextMenuList()); createItem("controls", function() switchPage(Controls)); createItem('colors', function() switchPage(Colors)); + #if cpp + createItem('mods', function() switchPage(Mods)); + #end + #if CAN_OPEN_LINKS if (showDonate) { @@ -263,4 +267,5 @@ enum PageName Options; Controls; Colors; + Mods; }