mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-03-22 09:59:25 +00:00
Merge branch 'freeplay-charselect-hint' into rewrite/master
This commit is contained in:
commit
10dfc96cf4
|
@ -395,9 +395,11 @@ class Controls extends FlxActionSet
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDialogueName(action:FlxActionDigital):String
|
public function getDialogueName(action:FlxActionDigital, ?ignoreSurrounding:Bool = false):String
|
||||||
{
|
{
|
||||||
var input = action.inputs[0];
|
var input = action.inputs[0];
|
||||||
|
if (ignoreSurrounding == false)
|
||||||
|
{
|
||||||
return switch (input.device)
|
return switch (input.device)
|
||||||
{
|
{
|
||||||
case KEYBOARD: return '[${(input.inputID : FlxKey)}]';
|
case KEYBOARD: return '[${(input.inputID : FlxKey)}]';
|
||||||
|
@ -405,10 +407,25 @@ class Controls extends FlxActionSet
|
||||||
case device: throw 'unhandled device: $device';
|
case device: throw 'unhandled device: $device';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
public function getDialogueNameFromToken(token:String):String
|
|
||||||
{
|
{
|
||||||
return getDialogueName(getActionFromControl(Control.createByName(token.toUpperCase())));
|
return switch (input.device)
|
||||||
|
{
|
||||||
|
case KEYBOARD: return '${(input.inputID : FlxKey)}';
|
||||||
|
case GAMEPAD: return '${(input.inputID : FlxGamepadInputID)}';
|
||||||
|
case device: throw 'unhandled device: $device';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDialogueNameFromToken(token:String, ?ignoreSurrounding:Bool = false):String
|
||||||
|
{
|
||||||
|
return getDialogueName(getActionFromControl(Control.createByName(token.toUpperCase())), ignoreSurrounding);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDialogueNameFromControl(control:Control, ?ignoreSurrounding:Bool = false):String
|
||||||
|
{
|
||||||
|
return getDialogueName(getActionFromControl(control), ignoreSurrounding);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getActionFromControl(control:Control):FlxActionDigital
|
function getActionFromControl(control:Control):FlxActionDigital
|
||||||
|
|
|
@ -9,6 +9,7 @@ import flixel.group.FlxGroup.FlxTypedGroup;
|
||||||
import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup;
|
import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup;
|
||||||
import flixel.input.touch.FlxTouch;
|
import flixel.input.touch.FlxTouch;
|
||||||
import flixel.math.FlxAngle;
|
import flixel.math.FlxAngle;
|
||||||
|
import flixel.math.FlxMath;
|
||||||
import flixel.math.FlxPoint;
|
import flixel.math.FlxPoint;
|
||||||
import flixel.system.debug.watch.Tracker.TrackerProfile;
|
import flixel.system.debug.watch.Tracker.TrackerProfile;
|
||||||
import flixel.text.FlxText;
|
import flixel.text.FlxText;
|
||||||
|
@ -180,6 +181,8 @@ class FreeplayState extends MusicBeatSubState
|
||||||
var ostName:FlxText;
|
var ostName:FlxText;
|
||||||
var albumRoll:AlbumRoll;
|
var albumRoll:AlbumRoll;
|
||||||
|
|
||||||
|
var charSelectHint:FlxText;
|
||||||
|
|
||||||
var letterSort:LetterSort;
|
var letterSort:LetterSort;
|
||||||
var exitMovers:ExitMoverData = new Map();
|
var exitMovers:ExitMoverData = new Map();
|
||||||
|
|
||||||
|
@ -279,6 +282,7 @@ class FreeplayState extends MusicBeatSubState
|
||||||
txtCompletion = new AtlasText(1185, 87, '69', AtlasFont.FREEPLAY_CLEAR);
|
txtCompletion = new AtlasText(1185, 87, '69', AtlasFont.FREEPLAY_CLEAR);
|
||||||
|
|
||||||
ostName = new FlxText(8, 8, FlxG.width - 8 - 8, 'OFFICIAL OST', 48);
|
ostName = new FlxText(8, 8, FlxG.width - 8 - 8, 'OFFICIAL OST', 48);
|
||||||
|
charSelectHint = new FlxText(-40, 18, FlxG.width - 8 - 8, 'Press [ LOL ] to change characters', 32);
|
||||||
|
|
||||||
bgDad = new FlxSprite(backingCard.pinkBack.width * 0.74, 0).loadGraphic(styleData == null ? 'freeplay/freeplayBGdad' : styleData.getBgAssetGraphic());
|
bgDad = new FlxSprite(backingCard.pinkBack.width * 0.74, 0).loadGraphic(styleData == null ? 'freeplay/freeplayBGdad' : styleData.getBgAssetGraphic());
|
||||||
}
|
}
|
||||||
|
@ -494,7 +498,14 @@ class FreeplayState extends MusicBeatSubState
|
||||||
ostName.alignment = RIGHT;
|
ostName.alignment = RIGHT;
|
||||||
ostName.visible = false;
|
ostName.visible = false;
|
||||||
|
|
||||||
exitMovers.set([overhangStuff, fnfFreeplay, ostName],
|
charSelectHint.alignment = CENTER;
|
||||||
|
charSelectHint.font = "5by7";
|
||||||
|
charSelectHint.color = 0xFF5F5F5F;
|
||||||
|
charSelectHint.text = 'Press [ ${controls.getDialogueNameFromControl(FREEPLAY_CHAR_SELECT, true)} ] to change characters';
|
||||||
|
charSelectHint.y -= 100;
|
||||||
|
FlxTween.tween(charSelectHint, {y: charSelectHint.y + 100}, 0.8, {ease: FlxEase.quartOut});
|
||||||
|
|
||||||
|
exitMovers.set([overhangStuff, fnfFreeplay, ostName, charSelectHint],
|
||||||
{
|
{
|
||||||
y: -overhangStuff.height,
|
y: -overhangStuff.height,
|
||||||
x: 0,
|
x: 0,
|
||||||
|
@ -502,7 +513,7 @@ class FreeplayState extends MusicBeatSubState
|
||||||
wait: 0
|
wait: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
exitMoversCharSel.set([overhangStuff, fnfFreeplay, ostName],
|
exitMoversCharSel.set([overhangStuff, fnfFreeplay, ostName, charSelectHint],
|
||||||
{
|
{
|
||||||
y: -300,
|
y: -300,
|
||||||
speed: 0.8,
|
speed: 0.8,
|
||||||
|
@ -600,6 +611,11 @@ class FreeplayState extends MusicBeatSubState
|
||||||
add(fnfFreeplay);
|
add(fnfFreeplay);
|
||||||
add(ostName);
|
add(ostName);
|
||||||
|
|
||||||
|
if (PlayerRegistry.instance.hasNewCharacter() == true)
|
||||||
|
{
|
||||||
|
add(charSelectHint);
|
||||||
|
}
|
||||||
|
|
||||||
// be careful not to "add()" things in here unless it's to a group that's already added to the state
|
// be careful not to "add()" things in here unless it's to a group that's already added to the state
|
||||||
// otherwise it won't be properly attatched to funnyCamera (relavent code should be at the bottom of create())
|
// otherwise it won't be properly attatched to funnyCamera (relavent code should be at the bottom of create())
|
||||||
var onDJIntroDone = function() {
|
var onDJIntroDone = function() {
|
||||||
|
@ -1344,10 +1360,19 @@ class FreeplayState extends MusicBeatSubState
|
||||||
|
|
||||||
var originalPos:FlxPoint = new FlxPoint();
|
var originalPos:FlxPoint = new FlxPoint();
|
||||||
|
|
||||||
|
var hintTimer:Float = 0;
|
||||||
|
|
||||||
override function update(elapsed:Float):Void
|
override function update(elapsed:Float):Void
|
||||||
{
|
{
|
||||||
super.update(elapsed);
|
super.update(elapsed);
|
||||||
|
|
||||||
|
if (charSelectHint != null)
|
||||||
|
{
|
||||||
|
hintTimer += elapsed * 2;
|
||||||
|
var targetAmt:Float = (Math.sin(hintTimer) + 1) / 2;
|
||||||
|
charSelectHint.alpha = FlxMath.lerp(0.3, 0.9, targetAmt);
|
||||||
|
}
|
||||||
|
|
||||||
#if FEATURE_DEBUG_FUNCTIONS
|
#if FEATURE_DEBUG_FUNCTIONS
|
||||||
if (FlxG.keys.justPressed.P)
|
if (FlxG.keys.justPressed.P)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue