outline bullshit in progress
This commit is contained in:
parent
6c2101fa6f
commit
6fed4b5f16
|
@ -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<Note>;
|
|
||||||
|
|
||||||
public function new()
|
|
||||||
{
|
|
||||||
super();
|
|
||||||
|
|
||||||
grpNotes = new FlxTypedGroup<Note>();
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +1,15 @@
|
||||||
package;
|
package;
|
||||||
|
|
||||||
|
import Controls.Control;
|
||||||
import flixel.FlxG;
|
import flixel.FlxG;
|
||||||
import flixel.FlxSprite;
|
import flixel.FlxSprite;
|
||||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||||
import flixel.text.FlxText;
|
import flixel.text.FlxText;
|
||||||
import flixel.util.FlxColor;
|
import flixel.util.FlxColor;
|
||||||
|
import polymod.Polymod;
|
||||||
|
#if desktop
|
||||||
|
import sys.FileSystem;
|
||||||
|
#end
|
||||||
|
|
||||||
class OptionsSubState extends MusicBeatSubstate
|
class OptionsSubState extends MusicBeatSubstate
|
||||||
{
|
{
|
||||||
|
@ -72,13 +77,13 @@ class OptionsSubState extends MusicBeatSubstate
|
||||||
{
|
{
|
||||||
case "Colors":
|
case "Colors":
|
||||||
FlxG.state.closeSubState();
|
FlxG.state.closeSubState();
|
||||||
FlxG.state.openSubState(new ColorpickSubstate());
|
|
||||||
case "Controls":
|
case "Controls":
|
||||||
FlxG.state.closeSubState();
|
FlxG.state.closeSubState();
|
||||||
FlxG.state.openSubState(new ControlsSubState());
|
FlxG.state.openSubState(new ControlsSubState());
|
||||||
case "Mods":
|
case "Mods":
|
||||||
FlxG.state.closeSubState();
|
FlxG.state.closeSubState();
|
||||||
FlxG.state.openSubState(new ModdingSubstate());
|
// FlxG.state.openSubState(new ModdingSubstate());
|
||||||
case "Back":
|
case "Back":
|
||||||
FlxG.switchState(new MainMenuState());
|
FlxG.switchState(new MainMenuState());
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,11 +62,11 @@ class TitleState extends MusicBeatState
|
||||||
FlxG.save.bind('funkin', 'ninjamuffin99');
|
FlxG.save.bind('funkin', 'ninjamuffin99');
|
||||||
PlayerSettings.init();
|
PlayerSettings.init();
|
||||||
Highscore.load();
|
Highscore.load();
|
||||||
|
|
||||||
#if newgrounds
|
#if newgrounds
|
||||||
NGio.init();
|
NGio.init();
|
||||||
#end
|
#end
|
||||||
|
|
||||||
if (FlxG.save.data.weekUnlocked != null)
|
if (FlxG.save.data.weekUnlocked != null)
|
||||||
{
|
{
|
||||||
// FIX LATER!!!
|
// FIX LATER!!!
|
||||||
|
@ -329,6 +329,9 @@ class TitleState extends MusicBeatState
|
||||||
skipIntro();
|
skipIntro();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FlxG.keys.justPressed.SPACE)
|
||||||
|
swagShader.hasOutline = !swagShader.hasOutline;
|
||||||
|
|
||||||
if (controls.UI_LEFT)
|
if (controls.UI_LEFT)
|
||||||
{
|
{
|
||||||
swagShader.update(-elapsed * 0.1);
|
swagShader.update(-elapsed * 0.1);
|
||||||
|
|
|
@ -9,6 +9,9 @@ class ColorSwap
|
||||||
public var colorToReplace(default, set):FlxColor;
|
public var colorToReplace(default, set):FlxColor;
|
||||||
public var newColor(default, set):FlxColor;
|
public var newColor(default, set):FlxColor;
|
||||||
public var daTime(default, set):Float;
|
public var daTime(default, set):Float;
|
||||||
|
|
||||||
|
public var hasOutline(default, set):Bool = false;
|
||||||
|
|
||||||
public var hueShit:Float = 0;
|
public var hueShit:Float = 0;
|
||||||
|
|
||||||
public function new():Void
|
public function new():Void
|
||||||
|
@ -16,6 +19,7 @@ class ColorSwap
|
||||||
shader = new ColorSwapShader();
|
shader = new ColorSwapShader();
|
||||||
shader.uTime.value = [0];
|
shader.uTime.value = [0];
|
||||||
shader.money.value = [0];
|
shader.money.value = [0];
|
||||||
|
shader.awesomeOutline.value = [hasOutline];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(elapsed:Float):Void
|
public function update(elapsed:Float):Void
|
||||||
|
@ -32,6 +36,12 @@ class ColorSwap
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function set_hasOutline(lol:Bool):Bool
|
||||||
|
{
|
||||||
|
shader.awesomeOutline.value = [lol];
|
||||||
|
return lol;
|
||||||
|
}
|
||||||
|
|
||||||
function set_daTime(daTime:Float):Float
|
function set_daTime(daTime:Float):Float
|
||||||
{
|
{
|
||||||
return daTime;
|
return daTime;
|
||||||
|
@ -52,9 +62,12 @@ class ColorSwapShader extends FlxShader
|
||||||
|
|
||||||
uniform float uTime;
|
uniform float uTime;
|
||||||
uniform float money;
|
uniform float money;
|
||||||
|
uniform bool awesomeOutline;
|
||||||
|
|
||||||
|
|
||||||
const float offset = 1.0 / 128.0;
|
const float offset = 1.0 / 128.0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
vec3 normalizeColor(vec3 color)
|
vec3 normalizeColor(vec3 color)
|
||||||
{
|
{
|
||||||
|
@ -96,6 +109,29 @@ class ColorSwapShader extends FlxShader
|
||||||
// money += swagColor[0];
|
// money += swagColor[0];
|
||||||
|
|
||||||
color = vec4(hsv2rgb(vec3(swagColor[0], swagColor[1], swagColor[2])), swagColor[3]);
|
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;
|
gl_FragColor = color;
|
||||||
|
|
||||||
|
|
||||||
|
@ -112,9 +148,7 @@ class ColorSwapShader extends FlxShader
|
||||||
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.8);
|
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.8);
|
||||||
else
|
else
|
||||||
gl_FragColor = color;
|
gl_FragColor = color;
|
||||||
}
|
} */
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
')
|
')
|
||||||
|
|
|
@ -29,10 +29,14 @@ class ColorsMenu extends ui.OptionsState.Page
|
||||||
var _effectSpr:FlxEffectSprite = new FlxEffectSprite(note, [new FlxOutlineEffect(FlxOutlineMode.FAST, FlxColor.WHITE, 4, 1)]);
|
var _effectSpr:FlxEffectSprite = new FlxEffectSprite(note, [new FlxOutlineEffect(FlxOutlineMode.FAST, FlxColor.WHITE, 4, 1)]);
|
||||||
add(_effectSpr);
|
add(_effectSpr);
|
||||||
_effectSpr.y = 0;
|
_effectSpr.y = 0;
|
||||||
_effectSpr.x = i * 80;
|
_effectSpr.x = i * 130;
|
||||||
_effectSpr.antialiasing = true;
|
_effectSpr.antialiasing = true;
|
||||||
_effectSpr.setGraphicSize(Std.int(_effectSpr.width * 0.7));
|
_effectSpr.scale.x = _effectSpr.scale.y = 0.7;
|
||||||
_effectSpr.updateHitbox();
|
// _effectSpr.setGraphicSize();
|
||||||
|
_effectSpr.height = note.height;
|
||||||
|
_effectSpr.width = note.width;
|
||||||
|
|
||||||
|
// _effectSpr.updateHitbox();
|
||||||
|
|
||||||
grpNotes.add(note);
|
grpNotes.add(note);
|
||||||
}
|
}
|
||||||
|
@ -40,12 +44,6 @@ class ColorsMenu extends ui.OptionsState.Page
|
||||||
|
|
||||||
override function update(elapsed:Float)
|
override function update(elapsed:Float)
|
||||||
{
|
{
|
||||||
if (controls.BACK)
|
|
||||||
{
|
|
||||||
FlxG.state.closeSubState();
|
|
||||||
FlxG.state.openSubState(new OptionsSubState());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (controls.UI_RIGHT_P)
|
if (controls.UI_RIGHT_P)
|
||||||
curSelected += 1;
|
curSelected += 1;
|
||||||
if (controls.UI_LEFT_P)
|
if (controls.UI_LEFT_P)
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
package;
|
package ui;
|
||||||
|
|
||||||
import Controls.Control;
|
|
||||||
import flixel.FlxG;
|
import flixel.FlxG;
|
||||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||||
import flixel.text.FlxText;
|
import flixel.text.FlxText;
|
||||||
import flixel.util.FlxColor;
|
import flixel.util.FlxColor;
|
||||||
|
#if cpp
|
||||||
import polymod.Polymod;
|
import polymod.Polymod;
|
||||||
#if desktop
|
|
||||||
import sys.FileSystem;
|
import sys.FileSystem;
|
||||||
#end
|
#end
|
||||||
|
|
||||||
class ModdingSubstate extends MusicBeatSubstate
|
class ModMenu extends ui.OptionsState.Page
|
||||||
{
|
{
|
||||||
var grpMods:FlxTypedGroup<ModMenuItem>;
|
var grpMods:FlxTypedGroup<ModMenuItem>;
|
||||||
var enabledMods:Array<String> = [];
|
var enabledMods:Array<String> = [];
|
|
@ -166,6 +166,10 @@ class OptionsMenu extends Page
|
||||||
add(items = new TextMenuList());
|
add(items = new TextMenuList());
|
||||||
createItem("controls", function() switchPage(Controls));
|
createItem("controls", function() switchPage(Controls));
|
||||||
createItem('colors', function() switchPage(Colors));
|
createItem('colors', function() switchPage(Colors));
|
||||||
|
#if cpp
|
||||||
|
createItem('mods', function() switchPage(Mods));
|
||||||
|
#end
|
||||||
|
|
||||||
#if CAN_OPEN_LINKS
|
#if CAN_OPEN_LINKS
|
||||||
if (showDonate)
|
if (showDonate)
|
||||||
{
|
{
|
||||||
|
@ -263,4 +267,5 @@ enum PageName
|
||||||
Options;
|
Options;
|
||||||
Controls;
|
Controls;
|
||||||
Colors;
|
Colors;
|
||||||
|
Mods;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue