Merge branch 'rewrite/master' into rewrite/bugfix/chart-editor-event-placement

This commit is contained in:
Cameron Taylor 2023-11-14 17:05:07 -05:00
commit 124a400e8b
123 changed files with 601 additions and 946 deletions

3
.gitmodules vendored
View file

@ -2,6 +2,9 @@
path = assets
url = https://github.com/FunkinCrew/Funkin-history-rewrite-assets
branch = master
update = merge
[submodule "art"]
path = art
url = https://github.com/FunkinCrew/Funkin-history-rewrite-art
branch = master
update = merge

2
assets

@ -1 +1 @@
Subproject commit 6ca2ae9a575b672da6c8243aa46a6cb2434eca7f
Subproject commit fb7120cf30d7accda049409b68d8daa0e1e7650f

View file

@ -56,15 +56,13 @@
"name": "haxeui-flixel",
"type": "git",
"dir": null,
"ref": "bc706d67efc093cd3b1623d0e9d599b326bbd330",
"ref": "9bd0b9e0fea40b8e06a89aac4949512d95064609",
"url": "https://github.com/haxeui/haxeui-flixel"
},
{
"name": "hmm",
"type": "git",
"dir": null,
"ref": "d514d7786cabf18b90e60fcee38399fd44c2ddfb",
"url": "https://github.com/andywhite37/hmm"
"type": "haxelib",
"version": "3.1.0"
},
{
"name": "hscript",

View file

@ -3,7 +3,7 @@ package;
import flixel.FlxGame;
import flixel.FlxState;
import funkin.util.logging.CrashHandler;
import funkin.MemoryCounter;
import funkin.ui.debug.MemoryCounter;
import funkin.save.Save;
import haxe.ui.Toolkit;
import openfl.display.FPS;

View file

@ -23,96 +23,14 @@ import flixel.util.FlxTimer;
import lime.ui.Haptic;
/**
* Since, in many cases multiple actions should use similar keys, we don't want the
* rebinding UI to list every action. ActionBinders are what the user percieves as
* an input so, for instance, they can't set jump-press and jump-release to different keys.
*/
enum Control
{
// List notes in order from left to right on gameplay screen.
NOTE_LEFT;
NOTE_DOWN;
NOTE_UP;
NOTE_RIGHT;
UI_UP;
UI_LEFT;
UI_RIGHT;
UI_DOWN;
RESET;
ACCEPT;
BACK;
PAUSE;
CUTSCENE_ADVANCE;
CUTSCENE_SKIP;
VOLUME_UP;
VOLUME_DOWN;
VOLUME_MUTE;
#if CAN_CHEAT
CHEAT;
#end
}
enum
abstract Action(String) to String from String
{
var UI_UP = "ui_up";
var UI_LEFT = "ui_left";
var UI_RIGHT = "ui_right";
var UI_DOWN = "ui_down";
var UI_UP_P = "ui_up-press";
var UI_LEFT_P = "ui_left-press";
var UI_RIGHT_P = "ui_right-press";
var UI_DOWN_P = "ui_down-press";
var UI_UP_R = "ui_up-release";
var UI_LEFT_R = "ui_left-release";
var UI_RIGHT_R = "ui_right-release";
var UI_DOWN_R = "ui_down-release";
var NOTE_UP = "note_up";
var NOTE_LEFT = "note_left";
var NOTE_RIGHT = "note_right";
var NOTE_DOWN = "note_down";
var NOTE_UP_P = "note_up-press";
var NOTE_LEFT_P = "note_left-press";
var NOTE_RIGHT_P = "note_right-press";
var NOTE_DOWN_P = "note_down-press";
var NOTE_UP_R = "note_up-release";
var NOTE_LEFT_R = "note_left-release";
var NOTE_RIGHT_R = "note_right-release";
var NOTE_DOWN_R = "note_down-release";
var ACCEPT = "accept";
var BACK = "back";
var PAUSE = "pause";
var CUTSCENE_ADVANCE = "cutscene_advance";
var CUTSCENE_SKIP = "cutscene_skip";
var VOLUME_UP = "volume_up";
var VOLUME_DOWN = "volume_down";
var VOLUME_MUTE = "volume_mute";
var RESET = "reset";
#if CAN_CHEAT
var CHEAT = "cheat";
#end
}
enum Device
{
Keys;
Gamepad(id:Int);
}
enum KeyboardScheme
{
Solo;
Duo(first:Bool);
None;
Custom;
}
/**
* A list of actions that a player would invoke via some input device.
* Uses FlxActions to funnel various inputs to a single action.
* A core class which handles receiving player input and interpreting it into game actions.
*/
class Controls extends FlxActionSet
{
/**
* A list of actions that a player would invoke via some input device.
* Uses FlxActions to funnel various inputs to a single action.
*/
var _ui_up = new FlxActionDigital(Action.UI_UP);
var _ui_left = new FlxActionDigital(Action.UI_LEFT);
var _ui_right = new FlxActionDigital(Action.UI_RIGHT);
@ -1241,3 +1159,88 @@ class FlxActionInputDigitalAndroid extends FlxActionInputDigital
}
}
#end
/**
* Since, in many cases multiple actions should use similar keys, we don't want the
* rebinding UI to list every action. ActionBinders are what the user percieves as
* an input so, for instance, they can't set jump-press and jump-release to different keys.
*/
enum Control
{
// List notes in order from left to right on gameplay screen.
NOTE_LEFT;
NOTE_DOWN;
NOTE_UP;
NOTE_RIGHT;
UI_UP;
UI_LEFT;
UI_RIGHT;
UI_DOWN;
RESET;
ACCEPT;
BACK;
PAUSE;
CUTSCENE_ADVANCE;
CUTSCENE_SKIP;
VOLUME_UP;
VOLUME_DOWN;
VOLUME_MUTE;
#if CAN_CHEAT
CHEAT;
#end
}
enum
abstract Action(String) to String from String
{
var UI_UP = "ui_up";
var UI_LEFT = "ui_left";
var UI_RIGHT = "ui_right";
var UI_DOWN = "ui_down";
var UI_UP_P = "ui_up-press";
var UI_LEFT_P = "ui_left-press";
var UI_RIGHT_P = "ui_right-press";
var UI_DOWN_P = "ui_down-press";
var UI_UP_R = "ui_up-release";
var UI_LEFT_R = "ui_left-release";
var UI_RIGHT_R = "ui_right-release";
var UI_DOWN_R = "ui_down-release";
var NOTE_UP = "note_up";
var NOTE_LEFT = "note_left";
var NOTE_RIGHT = "note_right";
var NOTE_DOWN = "note_down";
var NOTE_UP_P = "note_up-press";
var NOTE_LEFT_P = "note_left-press";
var NOTE_RIGHT_P = "note_right-press";
var NOTE_DOWN_P = "note_down-press";
var NOTE_UP_R = "note_up-release";
var NOTE_LEFT_R = "note_left-release";
var NOTE_RIGHT_R = "note_right-release";
var NOTE_DOWN_R = "note_down-release";
var ACCEPT = "accept";
var BACK = "back";
var PAUSE = "pause";
var CUTSCENE_ADVANCE = "cutscene_advance";
var CUTSCENE_SKIP = "cutscene_skip";
var VOLUME_UP = "volume_up";
var VOLUME_DOWN = "volume_down";
var VOLUME_MUTE = "volume_mute";
var RESET = "reset";
#if CAN_CHEAT
var CHEAT = "cheat";
#end
}
enum Device
{
Keys;
Gamepad(id:Int);
}
enum KeyboardScheme
{
Solo;
Duo(first:Bool);
None;
Custom;
}

View file

@ -1,129 +0,0 @@
package funkin;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.graphics.FlxGraphic;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.math.FlxMath;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.system.FlxAssets.FlxGraphicAsset;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import funkin.play.PlayState;
import funkin.shaderslmfao.ScreenWipeShader;
import haxe.format.JsonParser;
import lime.math.Rectangle;
import lime.utils.Assets;
import openfl.filters.ShaderFilter;
class CoolUtil
{
public static function coolBaseLog(base:Float, fin:Float):Float
{
return Math.log(fin) / Math.log(base);
}
public static function coolTextFile(path:String):Array<String>
{
var daList:Array<String> = [];
var swagArray:Array<String> = Assets.getText(path).trim().split('\n');
for (item in swagArray)
{
// comment support in the quick lil text formats??? using //
if (!item.trim().startsWith('//')) daList.push(item);
}
for (i in 0...daList.length)
{
daList[i] = daList[i].trim();
}
return daList;
}
public static function numberArray(max:Int, ?min = 0):Array<Int>
{
var dumbArray:Array<Int> = [];
for (i in min...max)
{
dumbArray.push(i);
}
return dumbArray;
}
static var oldCamPos:FlxPoint = new FlxPoint();
static var oldMousePos:FlxPoint = new FlxPoint();
/**
* Used to be for general camera middle click dragging, now generalized for any click and drag type shit!
* Listen I don't make the rules here
* @param target what you want to be dragged, defaults to CAMERA SCROLL
* @param jusPres the "justPressed", should be a button of some sort
* @param pressed the "pressed", which should be the same button as `jusPres`
*/
public static function mouseCamDrag(?target:FlxPoint, ?jusPres:Bool, ?pressed:Bool):Void
{
if (target == null) target = FlxG.camera.scroll;
if (jusPres == null) jusPres = FlxG.mouse.justPressedMiddle;
if (pressed == null) pressed = FlxG.mouse.pressedMiddle;
if (jusPres)
{
oldCamPos.set(target.x, target.y);
oldMousePos.set(FlxG.mouse.screenX, FlxG.mouse.screenY);
}
if (pressed)
{
target.x = oldCamPos.x - (FlxG.mouse.screenX - oldMousePos.x);
target.y = oldCamPos.y - (FlxG.mouse.screenY - oldMousePos.y);
}
}
public static function mouseWheelZoom():Void
{
if (FlxG.mouse.wheel != 0) FlxG.camera.zoom += FlxG.mouse.wheel * (0.1 * FlxG.camera.zoom);
}
/**
Lerps camera, but accountsfor framerate shit?
Right now it's simply for use to change the followLerp variable of a camera during update
TODO LATER MAYBE:
Actually make and modify the scroll and lerp shit in it's own function
instead of solely relying on changing the lerp on the fly
*/
public static function camLerpShit(lerp:Float):Float
{
return lerp * (FlxG.elapsed / (1 / 60));
}
public static function coolSwitchState(state:FlxState, transitionTex:String = "shaderTransitionStuff/coolDots", time:Float = 2)
{
var screenShit:FlxSprite = new FlxSprite().loadGraphic(Paths.image("shaderTransitionStuff/coolDots"));
var screenWipeShit:ScreenWipeShader = new ScreenWipeShader();
screenWipeShit.funnyShit.input = screenShit.pixels;
FlxTween.tween(screenWipeShit, {daAlphaShit: 1}, time,
{
ease: FlxEase.quadInOut,
onComplete: function(twn) {
screenShit.destroy();
FlxG.switchState(new MainMenuState());
}
});
FlxG.camera.setFilters([new ShaderFilter(screenWipeShit)]);
}
/*
* frame dependant lerp kinda lol
*/
public static function coolLerp(base:Float, target:Float, ratio:Float):Float
{
return base + camLerpShit(ratio) * (target - base);
}
}

View file

@ -1,265 +0,0 @@
package funkin;
import flixel.FlxSprite;
import flixel.addons.text.FlxTypeText;
import flixel.group.FlxSpriteGroup;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
import funkin.play.PlayState;
/**
* Handles dialog boxes and text, like the ones in Week 6.
*/
class DialogueBox extends FlxSpriteGroup
{
var box:FlxSprite;
var curCharacter:String = '';
var dialogue:Alphabet;
var dialogueList:Array<String> = [];
// SECOND DIALOGUE FOR THE PIXEL SHIT INSTEAD???
var swagDialogue:FlxTypeText;
var dropText:FlxText;
public var finishThing:Void->Void;
var portraitLeft:FlxSprite;
var portraitRight:FlxSprite;
var handSelect:FlxSprite;
var bgFade:FlxSprite;
public function new(talkingRight:Bool = true, ?dialogueList:Array<String>)
{
super();
switch (PlayState.instance.currentSong.id.toLowerCase())
{
case 'senpai':
FlxG.sound.playMusic(Paths.music('Lunchbox'), 0);
FlxG.sound.music.fadeIn(1, 0, 0.8);
case 'thorns':
FlxG.sound.playMusic(Paths.music('LunchboxScary'), 0);
FlxG.sound.music.fadeIn(1, 0, 0.8);
}
bgFade = new FlxSprite(-200, -200).makeGraphic(Std.int(FlxG.width * 1.3), Std.int(FlxG.height * 1.3), 0xFFB3DFD8);
bgFade.scrollFactor.set();
bgFade.alpha = 0;
add(bgFade);
new FlxTimer().start(0.83, function(tmr:FlxTimer) {
bgFade.alpha += (1 / 5) * 0.7;
if (bgFade.alpha > 0.7) bgFade.alpha = 0.7;
}, 5);
portraitLeft = new FlxSprite(-20, 40);
portraitLeft.frames = Paths.getSparrowAtlas('weeb/senpaiPortrait');
portraitLeft.animation.addByPrefix('enter', 'Senpai Portrait Enter', 24, false);
portraitLeft.setGraphicSize(Std.int(portraitLeft.width * Constants.PIXEL_ART_SCALE * 0.9));
portraitLeft.updateHitbox();
portraitLeft.scrollFactor.set();
add(portraitLeft);
portraitLeft.visible = false;
portraitRight = new FlxSprite(0, 40);
portraitRight.frames = Paths.getSparrowAtlas('weeb/bfPortrait');
portraitRight.animation.addByPrefix('enter', 'Boyfriend portrait enter', 24, false);
portraitRight.setGraphicSize(Std.int(portraitRight.width * Constants.PIXEL_ART_SCALE * 0.9));
portraitRight.updateHitbox();
portraitRight.scrollFactor.set();
add(portraitRight);
portraitRight.visible = false;
box = new FlxSprite(-20, 45);
var hasDialog:Bool = false;
switch (PlayState.instance.currentSong.id.toLowerCase())
{
case 'senpai':
hasDialog = true;
box.frames = Paths.getSparrowAtlas('weeb/pixelUI/dialogueBox-pixel');
box.animation.addByPrefix('normalOpen', 'Text Box Appear', 24, false);
box.animation.addByIndices('normal', 'Text Box Appear', [4], '', 24);
case 'roses':
hasDialog = true;
FlxG.sound.play(Paths.sound('ANGRY_TEXT_BOX'));
box.frames = Paths.getSparrowAtlas('weeb/pixelUI/dialogueBox-senpaiMad');
box.animation.addByPrefix('normalOpen', 'SENPAI ANGRY IMPACT SPEECH', 24, false);
box.animation.addByIndices('normal', 'SENPAI ANGRY IMPACT SPEECH', [4], '', 24);
case 'thorns':
hasDialog = true;
box.frames = Paths.getSparrowAtlas('weeb/pixelUI/dialogueBox-evil');
box.animation.addByPrefix('normalOpen', 'Spirit Textbox spawn', 24, false);
box.animation.addByIndices('normal', 'Spirit Textbox spawn', [11], '', 24);
var face:FlxSprite = new FlxSprite(320, 170).loadGraphic(Paths.image('weeb/spiritFaceForward'));
face.setGraphicSize(Std.int(face.width * 6));
add(face);
}
this.dialogueList = dialogueList;
if (!hasDialog) return;
box.animation.play('normalOpen');
box.setGraphicSize(Std.int(box.width * Constants.PIXEL_ART_SCALE * 0.9));
box.updateHitbox();
add(box);
box.screenCenter(X);
portraitLeft.screenCenter(X);
handSelect = new FlxSprite(1042, 590).loadGraphic(Paths.image('weeb/pixelUI/hand_textbox'));
handSelect.setGraphicSize(Std.int(handSelect.width * Constants.PIXEL_ART_SCALE * 0.9));
handSelect.updateHitbox();
handSelect.visible = false;
add(handSelect);
if (!talkingRight)
{
// box.flipX = true;
}
dropText = new FlxText(242, 502, Std.int(FlxG.width * 0.6), '', 32);
dropText.font = 'Pixel Arial 11 Bold';
dropText.color = 0xFFD89494;
add(dropText);
swagDialogue = new FlxTypeText(240, 500, Std.int(FlxG.width * 0.6), '', 32);
swagDialogue.font = 'Pixel Arial 11 Bold';
swagDialogue.color = 0xFF3F2021;
swagDialogue.sounds = [FlxG.sound.load(Paths.sound('pixelText'), 0.6)];
add(swagDialogue);
dialogue = new Alphabet(0, 80, '', false, true);
// dialogue.x = 90;
// add(dialogue);
}
var dialogueOpened:Bool = false;
var dialogueStarted:Bool = false;
var dialogueEnded:Bool = false;
override function update(elapsed:Float):Void
{
// HARD CODING CUZ IM STUPDI
if (PlayState.instance.currentSong.id.toLowerCase() == 'roses') portraitLeft.visible = false;
if (PlayState.instance.currentSong.id.toLowerCase() == 'thorns')
{
portraitLeft.color = FlxColor.BLACK;
swagDialogue.color = FlxColor.WHITE;
dropText.color = FlxColor.BLACK;
}
dropText.text = swagDialogue.text;
if (box.animation.curAnim != null)
{
if (box.animation.curAnim.name == 'normalOpen' && box.animation.curAnim.finished)
{
box.animation.play('normal');
dialogueOpened = true;
}
}
if (dialogueOpened && !dialogueStarted)
{
startDialogue();
dialogueStarted = true;
}
if (FlxG.keys.justPressed.ANY && dialogueEnded)
{
remove(dialogue);
FlxG.sound.play(Paths.sound('clickText'), 0.8);
if (dialogueList[1] == null && dialogueList[0] != null)
{
if (!isEnding)
{
isEnding = true;
if (PlayState.instance.currentSong.id.toLowerCase() == 'senpai'
|| PlayState.instance.currentSong.id.toLowerCase() == 'thorns') FlxG.sound.music.fadeOut(2.2, 0);
new FlxTimer().start(0.2, function(tmr:FlxTimer) {
box.alpha -= 1 / 5;
bgFade.alpha -= 1 / 5 * 0.7;
portraitLeft.visible = false;
portraitRight.visible = false;
swagDialogue.alpha -= 1 / 5;
handSelect.alpha -= 1 / 5;
dropText.alpha = swagDialogue.alpha;
}, 5);
new FlxTimer().start(1.2, function(tmr:FlxTimer) {
finishThing();
kill();
});
}
}
else
{
dialogueList.remove(dialogueList[0]);
startDialogue();
}
}
else if (FlxG.keys.justPressed.ANY && dialogueStarted) swagDialogue.skip();
super.update(elapsed);
}
var isEnding:Bool = false;
function startDialogue():Void
{
cleanDialog();
// var theDialog:Alphabet = new Alphabet(0, 70, dialogueList[0], false, true);
// dialogue = theDialog;
// add(theDialog);
// swagDialogue.text = ;
swagDialogue.resetText(dialogueList[0]);
swagDialogue.start(0.04);
swagDialogue.completeCallback = function() {
trace('dialogue finish');
handSelect.visible = true;
dialogueEnded = true;
};
handSelect.visible = false;
dialogueEnded = false;
switch (curCharacter)
{
case 'dad':
portraitRight.visible = false;
if (!portraitLeft.visible)
{
portraitLeft.visible = true;
portraitLeft.animation.play('enter');
}
case 'bf':
portraitLeft.visible = false;
if (!portraitRight.visible)
{
portraitRight.visible = true;
portraitRight.animation.play('enter');
}
}
}
function cleanDialog():Void
{
var splitName:Array<String> = dialogueList[0].split(':');
curCharacter = splitName[1];
dialogueList[0] = dialogueList[0].substr(splitName[1].length + 2).trim();
}
}

View file

@ -1,43 +0,0 @@
package funkin;
import flixel.FlxCamera;
import flixel.FlxSprite;
import flixel.graphics.tile.FlxDrawBaseItem;
import openfl.display.MovieClip;
class FlxSwf extends FlxSprite
{
public var swf:MovieClip;
public function new()
{
super();
}
override function draw()
{
for (camera in cameras)
{
if (!camera.visible || !camera.exists) continue;
getScreenPosition(_point, camera).subtractPoint(offset);
// assume no render blit for now
// use camera.canvas
// camera.canvas.graphics.
}
}
}
class FlxDrawSwfItem extends FlxDrawBaseItem<FlxDrawSwfItem>
{
public function new()
{
super();
type = FlxDrawItemType.TILES;
}
override function render(camera:FlxCamera)
{
super.render(camera);
}
}

View file

@ -1,5 +1,8 @@
package funkin;
/**
* A core class which handles tracking score and combo for the current song.
*/
class Highscore
{
public static var tallies:Tallies = new Tallies();

View file

@ -1,5 +1,6 @@
package funkin;
import funkin.ui.transition.LoadingState;
import flixel.FlxState;
import flixel.addons.transition.FlxTransitionableState;
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
@ -10,7 +11,7 @@ import flixel.math.FlxRect;
import flixel.FlxSprite;
import flixel.system.debug.log.LogStyle;
import flixel.util.FlxColor;
import funkin.ui.PreferencesMenu;
import funkin.ui.options.PreferencesMenu;
import funkin.util.macro.MacroUtil;
import funkin.util.WindowUtil;
import funkin.play.PlayStatePlaylist;
@ -26,11 +27,13 @@ import funkin.play.stage.StageData.StageDataParser;
import funkin.play.character.CharacterData.CharacterDataParser;
import funkin.modding.module.ModuleHandler;
import funkin.ui.title.TitleState;
import funkin.ui.transition.LoadingState;
#if discord_rpc
import Discord.DiscordClient;
#end
/**
* A core class which performs initialization of the game.
* The initialization state has several functions:
* - Calls code to set up the game, including loading saves and parsing game data.
* - Chooses whether to start via debug or via launching normally.
@ -228,13 +231,13 @@ class InitState extends FlxState
#elseif FREEPLAY // -DFREEPLAY
FlxG.switchState(new FreeplayState());
#elseif ANIMATE // -DANIMATE
FlxG.switchState(new funkin.ui.animDebugShit.FlxAnimateTest());
FlxG.switchState(new funkin.ui.debug.anim.FlxAnimateTest());
#elseif CHARTING // -DCHARTING
FlxG.switchState(new funkin.ui.debug.charting.ChartEditorState());
#elseif STAGEBUILD // -DSTAGEBUILD
FlxG.switchState(new funkin.ui.stageBullshit.StageBuilderState());
FlxG.switchState(new funkin.ui.debug.stage.StageBuilderState());
#elseif ANIMDEBUG // -DANIMDEBUG
FlxG.switchState(new funkin.ui.animDebugShit.DebugBoundingState());
FlxG.switchState(new funkin.ui.debug.anim.DebugBoundingState());
#elseif LATENCY // -DLATENCY
FlxG.switchState(new funkin.LatencyState());
#else

View file

@ -1,42 +0,0 @@
package funkin;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
class MenuCharacter extends FlxSprite
{
public var character:String;
public function new(x:Float, character:String = 'bf')
{
super(x);
this.character = character;
var suffix:String = character;
if (character != "darnell" && character != "nene") suffix = "characters";
var tex = Paths.getSparrowAtlas('campaign_menu_UI_' + suffix);
frames = tex;
trace(character);
animation.addByPrefix('bf', "BF idle dance white", 24);
animation.addByPrefix('bfConfirm', 'BF HEY!!', 24, false);
animation.addByPrefix('gf', "GF Dancing Beat WHITE", 24);
animation.addByPrefix('dad', "Dad idle dance BLACK LINE", 24);
animation.addByPrefix('spooky', "spooky dance idle BLACK LINES", 24);
animation.addByPrefix('pico', "Pico Idle Dance", 24);
animation.addByPrefix('mom', "Mom Idle BLACK LINES", 24);
animation.addByPrefix('parents-christmas', "Parent Christmas Idle", 24);
animation.addByPrefix('senpai', "SENPAI idle Black Lines", 24);
animation.addByPrefix('tankman', "Tankman Menu BLACK", 24);
animation.addByPrefix('darnell', "Darnell Black Lines To Scale", 24);
animation.addByPrefix('nene', "Nene Black Lines To Scale", 24);
// Parent Christmas Idle
animation.play(character);
updateHitbox();
}
}

View file

@ -1,65 +0,0 @@
package funkin;
import flixel.FlxSprite;
import haxe.io.Path;
import flixel.graphics.frames.FlxAtlasFrames;
class NoteSplash extends FlxSprite
{
public function new(x:Float, y:Float, noteData:Int = 0):Void
{
super(x, y);
animation.addByPrefix('note0-0', 'note impact 1 purple', 24, false);
animation.addByPrefix('note1-0', 'note impact 1 blue', 24, false);
animation.addByPrefix('note2-0', 'note impact 1 green', 24, false);
animation.addByPrefix('note3-0', 'note impact 1 red', 24, false);
animation.addByPrefix('note0-1', 'note impact 2 purple', 24, false);
animation.addByPrefix('note1-1', 'note impact 2 blue', 24, false);
animation.addByPrefix('note2-1', 'note impact 2 green', 24, false);
animation.addByPrefix('note3-1', 'note impact 2 red', 24, false);
setupNoteSplash(x, y, noteData);
// alpha = 0.75;
}
public override function update(elapsed:Float):Void
{
super.update(elapsed);
if (animation.finished)
{
kill();
}
}
public static function buildSplashFrames(force:Bool = false):FlxAtlasFrames
{
// static variables inside functions are a cool of Haxe 4.3.0.
static var splashFrames:FlxAtlasFrames = null;
if (splashFrames != null && !force) return splashFrames;
splashFrames = Paths.getSparrowAtlas('noteSplashes');
splashFrames.parent.persist = true;
return splashFrames;
}
public function setupNoteSplash(x:Float, y:Float, noteData:Int = 0)
{
setPosition(x, y);
alpha = 0.6;
animation.play('note' + noteData + '-' + FlxG.random.int(0, 1), true);
animation.curAnim.frameRate = 24 + FlxG.random.int(-2, 2);
animation.finishCallback = function(name) {
kill();
};
updateHitbox();
offset.set(width * 0.3, height * 0.3);
}
}

View file

@ -1,6 +0,0 @@
package funkin;
class Options
{
public static var masterVolume:Float = 1;
}

View file

@ -4,6 +4,9 @@ import flixel.graphics.frames.FlxAtlasFrames;
import openfl.utils.AssetType;
import openfl.utils.Assets as OpenFlAssets;
/**
* A core class which handles determining asset paths.
*/
class Paths
{
static var currentLevel:String;

View file

@ -8,8 +8,9 @@ import flixel.input.actions.FlxActionInput;
import flixel.input.gamepad.FlxGamepad;
import flixel.util.FlxSignal;
// import ui.DeviceManager;
// import props.Player;
/**
* A core class which represents the current player(s) and their controls and other configuration.
*/
class PlayerSettings
{
public static var numPlayers(default, null) = 0;

View file

@ -3,7 +3,7 @@ package funkin;
import funkin.save.Save;
/**
* A store of user-configurable, globally relevant values.
* A core class which provides a store of user-configurable, globally relevant values.
*/
class Preferences
{

View file

@ -1,27 +0,0 @@
package funkin;
import flixel.FlxSprite;
import flixel.sound.FlxSound;
class TankCutscene extends FlxSprite
{
public var startSyncAudio:FlxSound;
public function new(x:Float, y:Float)
{
super(x, y);
}
var startedPlayingSound:Bool = false;
override function update(elapsed:Float)
{
if (animation.curAnim.curFrame >= 1 && !startedPlayingSound)
{
startSyncAudio.play();
startedPlayingSound = true;
}
super.update(elapsed);
}
}

View file

@ -1,4 +1,4 @@
package funkin;
package funkin.api.discord;
import Sys.sleep;
#if discord_rpc

View file

@ -241,15 +241,3 @@ class NGUtil
}
#end
}
enum ConnectionResult
{
/** Log in successful */
Success;
/** Could not login */
Fail(msg:String);
/** User cancelled the login */
Cancelled;
}

View file

@ -1,4 +1,4 @@
package funkin;
package funkin.api.newgrounds;
#if newgrounds
import flixel.util.FlxSignal;

View file

@ -6,4 +6,4 @@ This package contains two main classes:
such as retrieving achievement status.
- `NGUnsafe` contains sensitive utility functions for interacting with the Newgrounds API.
- This includes any functions which scripts should not be able to use,
such as writing high scores or posting achievements.
such as writing high scores or posting achievements.

View file

@ -1,4 +1,4 @@
package funkin.audiovis;
package funkin.audio.visualize;
import flixel.FlxSprite;
import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup;

View file

@ -1,12 +1,13 @@
package funkin.audiovis;
package funkin.audio.visualize;
import funkin.audiovis.dsp.FFT;
import funkin.audio.visualize.dsp.FFT;
import flixel.FlxSprite;
import flixel.addons.plugin.taskManager.FlxTask;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup;
import flixel.math.FlxMath;
import flixel.sound.FlxSound;
import funkin.util.MathUtil;
using Lambda;
@ -86,7 +87,7 @@ class ABotVis extends FlxTypedSpriteGroup<FlxSprite>
for (i in 0...group.members.length)
{
var getSliceShit = function(s:Int) {
var powShit = FlxMath.remapToRange(s, 0, group.members.length, 0, CoolUtil.coolBaseLog(10, freqShit[0].length));
var powShit = FlxMath.remapToRange(s, 0, group.members.length, 0, MathUtil.logBase(10, freqShit[0].length));
return Math.round(Math.pow(10, powShit));
};

View file

@ -4,7 +4,7 @@ import flixel.math.FlxMath;
import flixel.math.FlxPoint;
import flixel.sound.FlxSound;
import flixel.util.FlxColor;
import funkin.audiovis.VisShit;
import funkin.audio.visualize.VisShit;
import funkin.graphics.rendering.MeshRender;
import lime.utils.Int16Array;

View file

@ -1,4 +1,4 @@
package funkin.audiovis;
package funkin.audio.visualize;
import flixel.FlxSprite;
import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup;
@ -8,8 +8,8 @@ import flixel.math.FlxVector;
import flixel.sound.FlxSound;
import flixel.util.FlxColor;
import funkin.audio.visualize.PolygonSpectogram.VISTYPE;
import funkin.audiovis.VisShit.CurAudioInfo;
import funkin.audiovis.dsp.FFT;
import funkin.audio.visualize.VisShit.CurAudioInfo;
import funkin.audio.visualize.dsp.FFT;
import haxe.Timer;
import lime.system.ThreadPool;
import lime.utils.Int16Array;

View file

@ -1,11 +1,12 @@
package funkin.audiovis;
package funkin.audio.visualize;
import flixel.math.FlxMath;
import flixel.sound.FlxSound;
import funkin.audiovis.dsp.FFT;
import funkin.audio.visualize.dsp.FFT;
import haxe.Timer;
import lime.system.ThreadPool;
import lime.utils.Int16Array;
import funkin.util.MathUtil;
using Lambda;
@ -42,7 +43,7 @@ class VisShit
// helpers, note that spectrum indexes suppose non-negative frequencies
final binSize = fs / fftN;
final indexToFreq = function(k:Int) {
var powShit:Float = FlxMath.remapToRange(k, 0, halfN, 0, CoolUtil.coolBaseLog(10, halfN)); // 4.3 is almost the log of 20Khz or so. Close enuf lol
var powShit:Float = FlxMath.remapToRange(k, 0, halfN, 0, MathUtil.logBase(10, halfN)); // 4.3 is almost the log of 20Khz or so. Close enuf lol
return 1.0 * (Math.pow(10, powShit)); // we need the `1.0` to avoid overflows
};

View file

@ -1,4 +1,4 @@
package funkin.audiovis.dsp;
package funkin.audio.visualize.dsp;
/**
Complex number representation.

View file

@ -1,9 +1,9 @@
package funkin.audiovis.dsp;
package funkin.audio.visualize.dsp;
import funkin.audiovis.dsp.Complex;
import funkin.audio.visualize.dsp.Complex;
using funkin.audiovis.dsp.OffsetArray;
using funkin.audiovis.dsp.Signal;
using funkin.audio.visualize.dsp.OffsetArray;
using funkin.audio.visualize.dsp.Signal;
// these are only used for testing, down in FFT.main()

View file

@ -1,4 +1,4 @@
package funkin.audiovis.dsp;
package funkin.audio.visualize.dsp;
/**
A view into an Array with an indexing offset.

View file

@ -1,4 +1,4 @@
package funkin.audiovis.dsp;
package funkin.audio.visualize.dsp;
using Lambda;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.system.FlxAssets.FlxShader;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.util.FlxColor;
import openfl.display.ShaderParameter;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.addons.display.FlxRuntimeShader;
import funkin.Paths;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.system.FlxAssets.FlxShader;
import flixel.util.FlxColor;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.addons.display.FlxRuntimeShader;
import funkin.Paths;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.addons.display.FlxRuntimeShader;
import funkin.Paths;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.addons.display.FlxRuntimeShader;
import funkin.Paths;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.math.FlxRect;
import flixel.system.FlxAssets.FlxShader;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.system.FlxAssets.FlxShader;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.math.FlxPoint;
import flixel.system.FlxAssets.FlxShader;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.system.FlxAssets.FlxShader;
import flixel.util.FlxColor;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.system.FlxAssets.FlxShader;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.system.FlxAssets.FlxShader;
import flixel.util.FlxColor;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.math.FlxPoint;
import flixel.system.FlxAssets.FlxShader;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.system.FlxAssets.FlxShader;

View file

@ -1,4 +1,4 @@
package funkin.shaderslmfao;
package funkin.graphics.shaders;
import flixel.addons.display.FlxRuntimeShader;
import openfl.Assets;

View file

@ -108,8 +108,7 @@ class TurboKeyHandler extends FlxBasic
* @param repeatDelay How long to wait between repeats.
* @return A TurboKeyHandler
*/
public static overload inline extern function build(inputKeys:Array<FlxKey>, ?delay:Float = DEFAULT_DELAY,
?interval:Float = DEFAULT_INTERVAL):TurboKeyHandler
public static overload inline extern function build(inputKeys:Array<FlxKey>, ?delay:Float = DEFAULT_DELAY, ?interval:Float = DEFAULT_INTERVAL):TurboKeyHandler
{
return new TurboKeyHandler(inputKeys, delay, interval);
}

View file

@ -5,4 +5,4 @@ package funkin.modding.base;
* Create a scripted class that extends MusicBeatState to use this.
*/
@:hscriptClass
class ScriptedMusicBeatState extends funkin.MusicBeatState implements HScriptedClass {}
class ScriptedMusicBeatState extends funkin.ui.MusicBeatState implements HScriptedClass {}

View file

@ -5,4 +5,4 @@ package funkin.modding.base;
* Create a scripted class that extends MusicBeatSubState to use this.
*/
@:hscriptClass
class ScriptedMusicBeatSubState extends funkin.MusicBeatSubState implements HScriptedClass {}
class ScriptedMusicBeatSubState extends funkin.ui.MusicBeatSubState implements HScriptedClass {}

View file

@ -1,68 +0,0 @@
package funkin.play;
import funkin.play.character.BaseCharacter;
import flixel.FlxSprite;
class Fighter extends BaseCharacter
{
public function new(?x:Float = 0, ?y:Float = 0, ?char:String = "pico-fighter")
{
super(char, Custom);
this.x = x;
this.y = y;
animation.finishCallback = function(anim:String) {
switch anim
{
case "punch low" | "punch high" | "block" | 'dodge':
dance(true);
}
};
}
public var actions:Array<ACTIONS> = [PUNCH, BLOCK, DODGE];
public function doSomething(?forceAction:ACTIONS)
{
var daAction:ACTIONS = FlxG.random.getObject(actions);
if (forceAction != null) daAction = forceAction;
switch (daAction)
{
case PUNCH:
punch();
case BLOCK:
block();
case DODGE:
dodge();
}
}
public var curAction:ACTIONS = DODGE;
function dodge()
{
playAnimation('dodge');
curAction = DODGE;
}
public function block()
{
playAnimation('block');
curAction = BLOCK;
}
public function punch()
{
curAction = PUNCH;
playAnimation('punch ' + (FlxG.random.bool() ? "low" : "high"));
}
}
enum ACTIONS
{
DODGE;
BLOCK;
PUNCH;
}

View file

@ -7,9 +7,11 @@ import flixel.sound.FlxSound;
import funkin.ui.story.StoryMenuState;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
import funkin.ui.MusicBeatSubState;
import funkin.modding.events.ScriptEvent;
import funkin.modding.events.ScriptEventDispatcher;
import funkin.play.PlayState;
import funkin.ui.freeplay.FreeplayState;
import funkin.play.character.BaseCharacter;
/**

View file

@ -1,9 +1,11 @@
package funkin;
package funkin.play;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
import funkin.play.PlayState;
import funkin.ui.MusicBeatState;
import flixel.addons.transition.FlxTransitionableState;
import funkin.ui.mainmenu.MainMenuState;
class GitarooPause extends MusicBeatState
{

View file

@ -1,9 +1,10 @@
package funkin;
package funkin.play;
import funkin.play.PlayStatePlaylist;
import flixel.FlxSprite;
import flixel.addons.transition.FlxTransitionableState;
import flixel.group.FlxGroup.FlxTypedGroup;
import funkin.ui.MusicBeatSubState;
import flixel.sound.FlxSound;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
@ -11,6 +12,7 @@ import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
import funkin.play.PlayState;
import funkin.data.song.SongRegistry;
import funkin.ui.Alphabet;
class PauseSubState extends MusicBeatSubState
{
@ -231,11 +233,11 @@ class PauseSubState extends MusicBeatSubState
if (PlayStatePlaylist.isStoryMode)
{
openSubState(new funkin.ui.StickerSubState(null, STORY));
openSubState(new funkin.ui.transition.StickerSubState(null, STORY));
}
else
{
openSubState(new funkin.ui.StickerSubState(null, FREEPLAY));
openSubState(new funkin.ui.transition.StickerSubState(null, FREEPLAY));
}
case 'Exit to Chart Editor':

View file

@ -1,5 +1,6 @@
package funkin.play;
import funkin.ui.SwagCamera;
import flixel.addons.transition.FlxTransitionableSubState;
import funkin.ui.debug.charting.ChartEditorState;
import haxe.Int64;
@ -16,19 +17,24 @@ import flixel.FlxState;
import flixel.FlxSubState;
import flixel.input.keyboard.FlxKey;
import flixel.math.FlxMath;
import funkin.play.components.ComboMilestone;
import flixel.math.FlxPoint;
import funkin.play.components.HealthIcon;
import funkin.ui.MusicBeatSubState;
import flixel.math.FlxRect;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.ui.FlxBar;
import flixel.util.FlxColor;
import funkin.api.newgrounds.NGio;
import flixel.util.FlxTimer;
import funkin.audio.VoicesGroup;
import funkin.save.Save;
import funkin.Highscore.Tallies;
import funkin.input.PreciseInputManager;
import funkin.modding.events.ScriptEvent;
import funkin.ui.mainmenu.MainMenuState;
import funkin.modding.events.ScriptEventDispatcher;
import funkin.play.character.BaseCharacter;
import funkin.play.character.CharacterData.CharacterDataParser;
@ -42,7 +48,6 @@ import funkin.play.notes.NoteDirection;
import funkin.play.notes.Strumline;
import funkin.play.notes.SustainTrail;
import funkin.play.scoring.Scoring;
import funkin.NoteSplash;
import funkin.play.song.Song;
import funkin.data.song.SongRegistry;
import funkin.data.song.SongData.SongEventData;
@ -50,9 +55,10 @@ import funkin.data.song.SongData.SongNoteData;
import funkin.data.song.SongData.SongCharacterData;
import funkin.play.stage.Stage;
import funkin.play.stage.StageData.StageDataParser;
import funkin.ui.PopUpStuff;
import funkin.ui.PreferencesMenu;
import funkin.ui.stageBuildShit.StageOffsetSubState;
import funkin.ui.transition.LoadingState;
import funkin.play.components.PopUpStuff;
import funkin.ui.options.PreferencesMenu;
import funkin.ui.debug.stage.StageOffsetSubState;
import funkin.ui.story.StoryMenuState;
import funkin.util.SerializerUtil;
import funkin.util.SortUtil;
@ -510,8 +516,6 @@ class PlayState extends MusicBeatSubState
}
instance = this;
NoteSplash.buildSplashFrames();
if (!assertChartExists()) return;
if (false)
@ -700,6 +704,8 @@ class PlayState extends MusicBeatSubState
if (!overrideMusic)
{
// Stop the vocals if they already exist.
if (vocals != null) vocals.stop();
vocals = currentChart.buildVocals();
if (vocals.members.length == 0)
@ -1554,6 +1560,8 @@ class PlayState extends MusicBeatSubState
if (!overrideMusic)
{
// Stop the vocals if they already exist.
if (vocals != null) vocals.stop();
vocals = currentChart.buildVocals();
if (vocals.members.length == 0)

View file

@ -8,16 +8,18 @@ import flixel.graphics.frames.FlxAtlasFrames;
import flixel.graphics.frames.FlxBitmapFont;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.math.FlxPoint;
import funkin.ui.MusicBeatSubState;
import flixel.math.FlxRect;
import flixel.text.FlxBitmapText;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import funkin.ui.freeplay.FreeplayState;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
import flixel.util.FlxGradient;
import flixel.util.FlxTimer;
import funkin.shaderslmfao.LeftMaskShader;
import funkin.ui.TallyCounter;
import funkin.graphics.shaders.LeftMaskShader;
import funkin.play.components.TallyCounter;
import flxanimate.FlxAnimate.Settings;
class ResultState extends MusicBeatSubState

View file

@ -58,7 +58,7 @@ class BaseCharacter extends Bopper
*/
public var dropNoteCounts(default, null):Array<Int>;
@:allow(funkin.ui.animDebugShit.DebugBoundingState)
@:allow(funkin.ui.debug.anim.DebugBoundingState)
final _data:CharacterData;
final singTimeSec:Float;

View file

@ -1,4 +1,4 @@
package funkin;
package funkin.play.components;
import flixel.FlxSprite;
import flixel.group.FlxGroup.FlxTypedGroup;

View file

@ -1,4 +1,4 @@
package funkin.play;
package funkin.play.components;
import funkin.play.character.CharacterData;
import flixel.FlxSprite;
@ -6,6 +6,7 @@ import flixel.math.FlxMath;
import flixel.math.FlxPoint;
import funkin.play.character.CharacterData.CharacterDataParser;
import openfl.utils.Assets;
import funkin.util.MathUtil;
/**
* This is a rework of the health icon with the following changes:
@ -201,19 +202,19 @@ class HealthIcon extends FlxSprite
if (this.width > this.height)
{
// Apply linear interpolation while accounting for frame rate.
var targetSize:Int = Std.int(CoolUtil.coolLerp(this.width, HEALTH_ICON_SIZE * this.size.x, 0.15));
var targetSize:Int = Std.int(MathUtil.coolLerp(this.width, HEALTH_ICON_SIZE * this.size.x, 0.15));
setGraphicSize(targetSize, 0);
}
else
{
var targetSize:Int = Std.int(CoolUtil.coolLerp(this.height, HEALTH_ICON_SIZE * this.size.y, 0.15));
var targetSize:Int = Std.int(MathUtil.coolLerp(this.height, HEALTH_ICON_SIZE * this.size.y, 0.15));
setGraphicSize(0, targetSize);
}
// Lerp the health icon back to its normal angle.
this.angle = CoolUtil.coolLerp(this.angle, 0, 0.15);
this.angle = MathUtil.coolLerp(this.angle, 0, 0.15);
this.updateHitbox();
}

View file

@ -1,4 +1,4 @@
package funkin.ui;
package funkin.play.components;
import flixel.FlxSprite;
import flixel.group.FlxGroup.FlxTypedGroup;

View file

@ -1,4 +1,4 @@
package funkin.ui;
package funkin.play.components;
import flixel.FlxSprite;
import flixel.group.FlxGroup.FlxTypedGroup;
@ -8,7 +8,7 @@ import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
/**
* Similar to ComboCounter, but it's not!
* Numerical counters used next to each judgement in the Results screen.
*/
class TallyCounter extends FlxTypedSpriteGroup<FlxSprite>
{

View file

@ -4,6 +4,7 @@ import flixel.FlxState;
import funkin.modding.events.ScriptEventDispatcher;
import funkin.modding.events.ScriptEvent;
import flixel.util.FlxColor;
import funkin.ui.MusicBeatState;
/**
* A state with displays a conversation with no background.

View file

@ -12,7 +12,7 @@ import funkin.play.notes.NoteSplash;
import funkin.play.notes.NoteSprite;
import funkin.play.notes.SustainTrail;
import funkin.data.song.SongData.SongNoteData;
import funkin.ui.PreferencesMenu;
import funkin.ui.options.PreferencesMenu;
import funkin.util.SortUtil;
/**

View file

@ -8,7 +8,7 @@ import flixel.FlxSprite;
import flixel.graphics.FlxGraphic;
import flixel.graphics.tile.FlxDrawTrianglesItem;
import flixel.math.FlxMath;
import funkin.ui.PreferencesMenu;
import funkin.ui.options.PreferencesMenu;
/**
* This is based heavily on the `FlxStrip` class. It uses `drawTriangles()` to clip a sustain note

View file

@ -85,7 +85,7 @@ class Bopper extends StageProp implements IPlayStateScriptedClass
return globalOffsets = value;
}
@:allow(funkin.ui.animDebugShit.DebugBoundingState)
@:allow(funkin.ui.debug.anim.DebugBoundingState)
var animOffsets(default, set):Array<Float> = [0, 0];
public var originalPosition:FlxPoint = new FlxPoint(0, 0);

View file

@ -1,9 +1,10 @@
package funkin;
package funkin.ui;
import flixel.FlxSprite;
import flixel.group.FlxSpriteGroup;
import flixel.math.FlxMath;
import flixel.util.FlxTimer;
import funkin.util.MathUtil;
/**
* Loosley based on FlxTypeText lolol
@ -151,7 +152,6 @@ class Alphabet extends FlxSpriteGroup
if (AlphaCharacter.alphabet.indexOf(splitWords[loopNum].toLowerCase()) != -1
|| isNumber
|| isSymbol) // if (AlphaCharacter.alphabet.contains(splitWords[loopNum].toLowerCase()) || isNumber || isSymbol)
{
if (lastSprite != null && !xPosResetted)
{
@ -220,8 +220,8 @@ class Alphabet extends FlxSpriteGroup
{
var scaledY = FlxMath.remapToRange(targetY, 0, 1, 0, 1.3);
y = CoolUtil.coolLerp(y, (scaledY * 120) + (FlxG.height * 0.48), 0.16);
x = CoolUtil.coolLerp(x, (targetY * 20) + 90, 0.16);
y = MathUtil.coolLerp(y, (scaledY * 120) + (FlxG.height * 0.48), 0.16);
x = MathUtil.coolLerp(x, (targetY * 20) + 90, 0.16);
}
super.update(elapsed);

View file

@ -38,7 +38,7 @@ class AtlasMenuList extends MenuTypedList<AtlasMenuItem>
/**
* A menu list item which uses single texture atlas.
*/
class AtlasMenuItem extends MenuItem
class AtlasMenuItem extends MenuListItem
{
var atlas:FlxAtlasFrames;

View file

@ -1,9 +1,10 @@
package funkin;
package funkin.ui;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.group.FlxSpriteGroup;
import flixel.math.FlxMath;
import funkin.util.MathUtil;
import flixel.util.FlxColor;
class MenuItem extends FlxSpriteGroup
@ -44,7 +45,7 @@ class MenuItem extends FlxSpriteGroup
override function update(elapsed:Float)
{
super.update(elapsed);
y = CoolUtil.coolLerp(y, (targetY * 120) + 480, 0.17);
y = MathUtil.coolLerp(y, (targetY * 120) + 480, 0.17);
if (isFlashing) flashingInt += 1;

View file

@ -6,7 +6,7 @@ import flixel.group.FlxGroup;
import flixel.math.FlxPoint;
import flixel.util.FlxSignal;
class MenuTypedList<T:MenuItem> extends FlxTypedGroup<T>
class MenuTypedList<T:MenuListItem> extends FlxTypedGroup<T>
{
public var selectedIndex(default, null) = 0;
public var selectedItem(get, never):T;
@ -206,7 +206,7 @@ class MenuTypedList<T:MenuItem> extends FlxTypedGroup<T>
}
}
class MenuItem extends FlxSprite
class MenuListItem extends FlxSprite
{
public var callback:Void->Void;
public var name:String;
@ -261,7 +261,7 @@ class MenuItem extends FlxSprite
}
}
class MenuTypedItem<T:FlxSprite> extends MenuItem
class MenuTypedItem<T:FlxSprite> extends MenuListItem
{
public var label(default, set):T;

View file

@ -1,6 +1,7 @@
package funkin;
package funkin.ui;
import funkin.modding.IScriptedClass.IEventHandler;
import funkin.ui.mainmenu.MainMenuState;
import flixel.FlxState;
import flixel.FlxSubState;
import flixel.addons.transition.FlxTransitionableState;

View file

@ -1,8 +1,9 @@
package funkin;
package funkin.ui;
import flixel.addons.transition.FlxTransitionableSubState;
import flixel.FlxSubState;
import flixel.text.FlxText;
import funkin.ui.mainmenu.MainMenuState;
import flixel.util.FlxColor;
import funkin.modding.events.ScriptEvent;
import funkin.modding.IScriptedClass.IEventHandler;

View file

@ -1,8 +1,9 @@
package funkin;
package funkin.ui;
import flixel.FlxCamera;
import flixel.FlxSprite;
import flixel.math.FlxPoint;
import funkin.util.MathUtil;
class SwagCamera extends FlxCamera
{
@ -92,10 +93,10 @@ class SwagCamera extends FlxCamera
else
{
// THIS THE PART THAT ACTUALLY MATTERS LOL
scroll.x = CoolUtil.coolLerp(scroll.x, _scrollTarget.x, followLerp);
scroll.y = CoolUtil.coolLerp(scroll.y, _scrollTarget.y, followLerp);
// scroll.x += (_scrollTarget.x - scroll.x) * CoolUtil.camLerpShit(followLerp);
// scroll.y += (_scrollTarget.y - scroll.y) * CoolUtil.camLerpShit(followLerp);
scroll.x = MathUtil.coolLerp(scroll.x, _scrollTarget.x, followLerp);
scroll.y = MathUtil.coolLerp(scroll.y, _scrollTarget.y, followLerp);
// scroll.x += (_scrollTarget.x - scroll.x) * MathUtil.cameraLerp(followLerp);
// scroll.y += (_scrollTarget.y - scroll.y) * MathUtil.cameraLerp(followLerp);
}
}
}

View file

@ -3,9 +3,10 @@ package funkin.ui.debug;
import flixel.math.FlxPoint;
import flixel.FlxObject;
import flixel.FlxSprite;
import funkin.MusicBeatSubState;
import funkin.ui.MusicBeatSubState;
import funkin.ui.TextMenuList;
import funkin.ui.debug.charting.ChartEditorState;
import funkin.ui.MusicBeatSubState;
class DebugMenuSubState extends MusicBeatSubState
{
@ -85,13 +86,13 @@ class DebugMenuSubState extends MusicBeatSubState
function openAnimationEditor()
{
FlxG.switchState(new funkin.ui.animDebugShit.DebugBoundingState());
FlxG.switchState(new funkin.ui.debug.anim.DebugBoundingState());
trace('Animation Editor');
}
function testStickers()
{
openSubState(new funkin.ui.StickerSubState());
openSubState(new funkin.ui.transition.StickerSubState());
trace('opened stickers');
}

View file

@ -1,4 +1,4 @@
package funkin;
package funkin.ui.debug;
import openfl.text.TextFormat;
import openfl.system.System;

View file

@ -1,4 +1,4 @@
package funkin.ui.animDebugShit;
package funkin.ui.debug.anim;
import funkin.util.SerializerUtil;
import funkin.play.character.CharacterData;
@ -15,6 +15,7 @@ import flixel.math.FlxPoint;
import flixel.sound.FlxSound;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import funkin.util.MouseUtil;
import flixel.util.FlxSpriteUtil;
import flixel.util.FlxTimer;
import funkin.play.character.BaseCharacter;
@ -25,6 +26,7 @@ import haxe.ui.components.DropDown;
import haxe.ui.core.Component;
import haxe.ui.events.ItemEvent;
import haxe.ui.events.UIEvent;
import funkin.ui.mainmenu.MainMenuState;
import lime.utils.Assets as LimeAssets;
import openfl.Assets;
import openfl.events.Event;
@ -32,6 +34,7 @@ import openfl.events.IOErrorEvent;
import openfl.geom.Rectangle;
import openfl.net.FileReference;
import openfl.net.URLLoader;
import funkin.ui.mainmenu.MainMenuState;
import openfl.net.URLRequest;
import openfl.utils.ByteArray;
import funkin.input.Cursor;
@ -363,8 +366,8 @@ class DebugBoundingState extends FlxState
if (FlxG.keys.justPressed.F4) FlxG.switchState(new MainMenuState());
CoolUtil.mouseCamDrag();
CoolUtil.mouseWheelZoom();
MouseUtil.mouseCamDrag();
MouseUtil.mouseWheelZoom();
// bg.scale.x = FlxG.camera.zoom;
// bg.scale.y = FlxG.camera.zoom;

View file

@ -1,7 +1,8 @@
package funkin.ui.animDebugShit;
package funkin.ui.debug.anim;
import flixel.FlxG;
import funkin.graphics.adobeanimate.FlxAtlasSprite;
import funkin.ui.MusicBeatState;
/**
* A simple test of FlxAnimate.

View file

@ -16,6 +16,7 @@ import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.tweens.misc.VarTween;
import flixel.util.FlxColor;
import funkin.ui.mainmenu.MainMenuState;
import flixel.util.FlxSort;
import flixel.util.FlxTimer;
import funkin.audio.visualize.PolygonSpectogram;
@ -31,10 +32,19 @@ import funkin.input.TurboKeyHandler;
import funkin.modding.events.ScriptEvent;
import funkin.play.character.BaseCharacter.CharacterType;
import funkin.play.character.CharacterData;
import funkin.play.HealthIcon;
import funkin.play.components.HealthIcon;
import funkin.play.notes.NoteSprite;
import funkin.play.PlayState;
import funkin.play.song.Song;
import funkin.data.song.SongData.SongChartData;
import funkin.data.song.SongRegistry;
import funkin.data.song.SongData.SongEventData;
import funkin.data.song.SongData.SongMetadata;
import funkin.data.song.SongData.SongNoteData;
import funkin.data.song.SongData.SongCharacterData;
import funkin.data.song.SongDataUtils;
import funkin.ui.debug.charting.commands.ChartEditorCommand;
import funkin.ui.debug.charting.handlers.ChartEditorShortcutHandler;
import funkin.play.stage.StageData;
import funkin.ui.debug.charting.commands.AddEventsCommand;
import funkin.ui.debug.charting.commands.AddNotesCommand;
@ -1384,6 +1394,7 @@ class ChartEditorState extends HaxeUIState
buildSelectionBox();
buildAdditionalUI();
ChartEditorShortcutHandler.applyPlatformShortcutText(this);
// Setup the onClick listeners for the UI after it's been created.
setupUIListeners();

View file

@ -0,0 +1,61 @@
package funkin.ui.debug.charting.handlers;
import funkin.util.PlatformUtil;
@:access(funkin.ui.debug.charting.ChartEditorState)
class ChartEditorShortcutHandler
{
public static function applyPlatformShortcutText(state:ChartEditorState):Void
{
state.setComponentShortcutText('menubarItemNewChart', ctrlOrCmd('N'));
state.setComponentShortcutText('menubarItemOpenChart', ctrlOrCmd('O'));
state.setComponentShortcutText('menubarItemSaveChartAs', ctrlOrCmd(shift('S')));
state.setComponentShortcutText('menubarItemExit', ctrlOrCmd('Q'));
state.setComponentShortcutText('menubarItemUndo', ctrlOrCmd('Z'));
state.setComponentShortcutText('menubarItemRedo', ctrlOrCmd('Y'));
state.setComponentShortcutText('menubarItemCut', ctrlOrCmd('X'));
state.setComponentShortcutText('menubarItemCopy', ctrlOrCmd('C'));
state.setComponentShortcutText('menubarItemPaste', ctrlOrCmd('V'));
state.setComponentShortcutText('menubarItemSelectAll', ctrlOrCmd('A'));
state.setComponentShortcutText('menubarItemSelectInverse', ctrlOrCmd('I'));
state.setComponentShortcutText('menubarItemSelectNone', ctrlOrCmd('D'));
state.setComponentShortcutText('menubarItemSelectBeforeCursor', shift('Home'));
state.setComponentShortcutText('menubarItemSelectAfterCursor', shift('End'));
state.setComponentShortcutText('menubarItemDifficultyDown', ctrlOrCmd(''));
state.setComponentShortcutText('menubarItemDifficultyUp', ctrlOrCmd(''));
state.setComponentShortcutText('menubarItemPlaytestFull', 'Enter');
state.setComponentShortcutText('menubarItemPlaytestMinimal', shift('Enter'));
}
/**
* Display `Ctrl` on Windows and `` (Command) on macOS.
* @param input
*/
static inline function ctrlOrCmd(input:String)
{
return (PlatformUtil.isMacOS()) ? '+${input}' : 'Ctrl+${input}';
}
/**
* Display `Ctrl` on Windows and `^` (Control) on macOS.
* @param input
*/
static inline function ctrl(input:String)
{
return (PlatformUtil.isMacOS()) ? '^+${input}' : 'Ctrl+${input}';
}
static inline function alt(input:String)
{
return (PlatformUtil.isMacOS()) ? '+${input}' : 'Alt+${input}';
}
static inline function shift(input:String)
{
return (PlatformUtil.isMacOS()) ? '+${input}' : 'Shift+${input}';
}
}

View file

@ -1,4 +1,4 @@
package funkin.ui;
package funkin.ui.debug.latency;
import flash.display.Graphics;
import flash.display.Shape;

View file

@ -1,4 +1,4 @@
package funkin;
package funkin.ui.debug.latency;
import funkin.data.notestyle.NoteStyleRegistry;
import flixel.FlxSprite;
@ -6,13 +6,14 @@ import flixel.FlxSubState;
import flixel.group.FlxGroup;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.math.FlxMath;
import funkin.ui.MusicBeatSubState;
import flixel.sound.FlxSound;
import flixel.system.debug.stats.StatsGraph;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import funkin.audio.visualize.PolygonSpectogram;
import funkin.play.notes.NoteSprite;
import funkin.ui.CoolStatsGraph;
import funkin.ui.debug.latency.CoolStatsGraph;
import haxe.Timer;
import openfl.events.KeyboardEvent;

View file

@ -1,4 +1,4 @@
package funkin.ui.stageBuildShit;
package funkin.ui.debug.stage;
class CharStage extends SprStage
{

View file

@ -1,4 +1,4 @@
package funkin.ui.stageBuildShit;
package funkin.ui.debug.stage;
import flixel.FlxSprite;
import flixel.input.mouse.FlxMouseEvent;

View file

@ -1,4 +1,4 @@
package funkin.ui.stageBuildShit;
package funkin.ui.debug.stage;
import flixel.FlxCamera;
import flixel.FlxSprite;
@ -7,10 +7,12 @@ import flixel.group.FlxGroup;
import flixel.input.mouse.FlxMouseButton.FlxMouseButtonID;
import flixel.input.mouse.FlxMouseEvent;
import flixel.math.FlxPoint;
import funkin.ui.MusicBeatState;
import flixel.text.FlxText;
import flixel.ui.FlxButton;
import flixel.util.FlxColor;
import flixel.util.FlxSort;
import funkin.util.MouseUtil;
import flixel.util.FlxTimer;
class StageBuilderState extends MusicBeatState
@ -185,9 +187,9 @@ class StageBuilderState extends MusicBeatState
if (curSelectedSpr != null) sprGrp.remove(curSelectedSpr, true);
}
CoolUtil.mouseCamDrag();
MouseUtil.mouseCamDrag();
if (FlxG.keys.pressed.CONTROL) CoolUtil.mouseWheelZoom();
if (FlxG.keys.pressed.CONTROL) MouseUtil.mouseWheelZoom();
if (isShaking)
{

View file

@ -1,6 +1,6 @@
package funkin.ui.stageBuildShit;
package funkin.ui.debug.stage;
import funkin.ui.stageBuildShit.StageOffsetSubState;
import funkin.ui.debug.stage.StageOffsetSubState;
import flixel.FlxSprite;
/**

View file

@ -1,4 +1,4 @@
package funkin.ui.stageBuildShit;
package funkin.ui.debug.stage;
import flixel.FlxSprite;
import flixel.input.mouse.FlxMouseEvent;
@ -7,10 +7,11 @@ import funkin.play.character.BaseCharacter;
import funkin.play.PlayState;
import funkin.play.stage.StageData;
import funkin.play.stage.StageProp;
import funkin.shaderslmfao.StrokeShader;
import funkin.graphics.shaders.StrokeShader;
import funkin.ui.haxeui.HaxeUISubState;
import funkin.ui.stageBuildShit.StageEditorCommand;
import funkin.ui.debug.stage.StageEditorCommand;
import funkin.util.SerializerUtil;
import funkin.util.MouseUtil;
import haxe.ui.containers.ListView;
import haxe.ui.core.Component;
import haxe.ui.events.UIEvent;
@ -28,7 +29,7 @@ import openfl.net.FileReference;
* @author ninjamuffin99
*/
// Give other classes access to private instance fields
@:allow(funkin.ui.stageBuildShit.StageEditorCommand)
@:allow(funkin.ui.debug.stage.StageEditorCommand)
class StageOffsetSubState extends HaxeUISubState
{
var uiStuff:Component;
@ -244,9 +245,9 @@ class StageOffsetSubState extends HaxeUISubState
FlxG.mouse.visible = true;
CoolUtil.mouseCamDrag();
MouseUtil.mouseCamDrag();
if (FlxG.keys.pressed.CONTROL) CoolUtil.mouseWheelZoom();
if (FlxG.keys.pressed.CONTROL) MouseUtil.mouseWheelZoom();
if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.Z) undoLastCommand();

View file

@ -1,4 +1,4 @@
package funkin.ui.stageBuildShit;
package funkin.ui.debug.stage;
import flixel.group.FlxGroup;
@ -10,13 +10,5 @@ class StagetoolBar extends FlxGroup
public function new()
{
super();
for (icon in icons)
{
// switch (icon)
// {
// case SELECT:
// }
}
}
}

View file

@ -1,4 +1,4 @@
package funkin.freeplayStuff;
package funkin.ui.freeplay;
import flixel.FlxObject;
import flixel.group.FlxGroup.FlxTypedGroup;

View file

@ -1,9 +1,9 @@
package funkin.freeplayStuff;
package funkin.ui.freeplay;
import openfl.filters.BitmapFilterQuality;
import flixel.text.FlxText;
import flixel.group.FlxSpriteGroup;
import funkin.shaderslmfao.GaussianBlurShader;
import funkin.graphics.shaders.GaussianBlurShader;
class CapsuleText extends FlxSpriteGroup
{

View file

@ -1,4 +1,4 @@
package funkin.freeplayStuff;
package funkin.ui.freeplay;
import flixel.FlxSprite;
import flixel.util.FlxSignal;

View file

@ -1,8 +1,8 @@
package funkin.freeplayStuff;
package funkin.ui.freeplay;
import flixel.group.FlxSpriteGroup;
import funkin.graphics.adobeanimate.FlxAtlasSprite;
import funkin.shaderslmfao.HSVShader;
import funkin.graphics.shaders.HSVShader;
class DifficultyStars extends FlxSpriteGroup
{

View file

@ -1,4 +1,4 @@
package funkin.freeplayStuff;
package funkin.ui.freeplay;
import flixel.group.FlxSpriteGroup;
import flixel.FlxSprite;

View file

@ -1,4 +1,4 @@
package funkin.freeplayStuff;
package funkin.ui.freeplay;
import flixel.FlxSprite;
import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup;

View file

@ -1,6 +1,5 @@
package funkin;
package funkin.ui.freeplay;
import funkin.play.song.Song;
import flash.text.TextField;
import flixel.addons.display.FlxGridOverlay;
import flixel.addons.transition.FlxTransitionableState;
@ -26,24 +25,31 @@ import flixel.util.FlxTimer;
import funkin.Controls.Control;
import funkin.data.level.LevelRegistry;
import funkin.data.song.SongRegistry;
import funkin.freeplayStuff.BGScrollingText;
import funkin.freeplayStuff.DifficultyStars;
import funkin.freeplayStuff.DJBoyfriend;
import funkin.freeplayStuff.FreeplayScore;
import funkin.freeplayStuff.LetterSort;
import funkin.freeplayStuff.SongMenuItem;
import funkin.graphics.adobeanimate.FlxAtlasSprite;
import funkin.play.HealthIcon;
import funkin.graphics.shaders.AngleMask;
import funkin.graphics.shaders.HSVShader;
import funkin.graphics.shaders.PureColor;
import funkin.util.MathUtil;
import funkin.graphics.shaders.StrokeShader;
import funkin.play.components.HealthIcon;
import funkin.play.PlayState;
import funkin.play.PlayStatePlaylist;
import funkin.play.song.Song;
import funkin.play.song.Song;
import funkin.save.Save;
import funkin.save.Save.SaveScoreData;
import funkin.shaderslmfao.AngleMask;
import funkin.shaderslmfao.HSVShader;
import funkin.shaderslmfao.PureColor;
import funkin.shaderslmfao.StrokeShader;
import funkin.ui.StickerSubState;
import funkin.ui.freeplay.BGScrollingText;
import funkin.ui.freeplay.DifficultyStars;
import funkin.ui.freeplay.DJBoyfriend;
import funkin.ui.freeplay.FreeplayScore;
import funkin.ui.freeplay.LetterSort;
import funkin.ui.freeplay.SongMenuItem;
import funkin.ui.MusicBeatState;
import funkin.ui.MusicBeatSubState;
import funkin.ui.mainmenu.MainMenuState;
import funkin.ui.transition.LoadingState;
import funkin.ui.transition.StickerSubState;
import funkin.util.MathUtil;
import lime.app.Future;
import lime.utils.Assets;
@ -84,6 +90,7 @@ class FreeplayState extends MusicBeatSubState
var dj:DJBoyfriend;
var letterSort:LetterSort;
var typing:FlxInputText;
var exitMovers:Map<Array<FlxSprite>, MoveData> = new Map();
@ -413,7 +420,7 @@ class FreeplayState extends MusicBeatSubState
txtCompletion.visible = false;
add(txtCompletion);
var letterSort:LetterSort = new LetterSort(400, 75);
letterSort = new LetterSort(400, 75);
add(letterSort);
letterSort.visible = false;
@ -664,8 +671,8 @@ class FreeplayState extends MusicBeatSubState
}
}
lerpScore = CoolUtil.coolLerp(lerpScore, intendedScore, 0.2);
lerpCompletion = CoolUtil.coolLerp(lerpCompletion, intendedCompletion, 0.9);
lerpScore = MathUtil.coolLerp(lerpScore, intendedScore, 0.2);
lerpCompletion = MathUtil.coolLerp(lerpCompletion, intendedCompletion, 0.9);
fp.updateScore(Std.int(lerpScore));
@ -953,6 +960,7 @@ class FreeplayState extends MusicBeatSubState
trace("RANDOM SELECTED");
busy = true;
letterSort.inputEnabled = false;
var availableSongCapsules:Array<SongMenuItem> = grpCapsules.members.filter(function(cap:SongMenuItem) {
// Dead capsules are ones which were removed from the list when changing filters.
@ -963,6 +971,15 @@ class FreeplayState extends MusicBeatSubState
return cap.songData.songName;
})}');
if (availableSongCapsules.length == 0)
{
trace("No songs available!");
busy = false;
letterSort.inputEnabled = true;
FlxG.sound.play(Paths.sound('cancelMenu'));
return;
}
var targetSong:SongMenuItem = FlxG.random.getObject(availableSongCapsules);
// Seeing if I can do an animation...
@ -976,6 +993,7 @@ class FreeplayState extends MusicBeatSubState
function capsuleOnConfirmDefault(cap:SongMenuItem):Void
{
busy = true;
letterSort.inputEnabled = false;
PlayStatePlaylist.isStoryMode = false;

View file

@ -1,4 +1,4 @@
package funkin.freeplayStuff;
package funkin.ui.freeplay;
import flixel.FlxSprite;
import flixel.group.FlxGroup.FlxTypedGroup;
@ -23,6 +23,8 @@ class LetterSort extends FlxTypedSpriteGroup<FlxSprite>
var rightArrow:FlxSprite;
var grpSeperators:Array<FlxSprite> = [];
public var inputEnabled:Bool = true;
public function new(x, y)
{
super(x, y);
@ -72,8 +74,11 @@ class LetterSort extends FlxTypedSpriteGroup<FlxSprite>
{
super.update(elapsed);
if (FlxG.keys.justPressed.E) changeSelection(1);
if (FlxG.keys.justPressed.Q) changeSelection(-1);
if (inputEnabled)
{
if (FlxG.keys.justPressed.E) changeSelection(1);
if (FlxG.keys.justPressed.Q) changeSelection(-1);
}
}
public function changeSelection(diff:Int = 0)

View file

@ -1,8 +1,8 @@
package funkin.freeplayStuff;
package funkin.ui.freeplay;
import funkin.FreeplayState.FreeplaySongData;
import funkin.shaderslmfao.HSVShader;
import funkin.shaderslmfao.GaussianBlurShader;
import funkin.ui.freeplay.FreeplayState.FreeplaySongData;
import funkin.graphics.shaders.HSVShader;
import funkin.graphics.shaders.GaussianBlurShader;
import flixel.group.FlxGroup;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
@ -12,7 +12,8 @@ import flixel.math.FlxMath;
import flixel.math.FlxPoint;
import flixel.text.FlxText;
import flixel.util.FlxTimer;
import funkin.shaderslmfao.Grayscale;
import funkin.util.MathUtil;
import funkin.graphics.shaders.Grayscale;
class SongMenuItem extends FlxSpriteGroup
{
@ -312,8 +313,8 @@ class SongMenuItem extends FlxSpriteGroup
if (doLerp)
{
x = CoolUtil.coolLerp(x, targetPos.x, 0.3);
y = CoolUtil.coolLerp(y, targetPos.y, 0.4);
x = MathUtil.coolLerp(x, targetPos.x, 0.3);
y = MathUtil.coolLerp(y, targetPos.y, 0.4);
}
super.update(elapsed);

View file

@ -2,8 +2,10 @@ package funkin.ui.haxeui;
import haxe.ui.components.CheckBox;
import haxe.ui.containers.menus.MenuCheckBox;
import haxe.ui.containers.menus.MenuItem;
import haxe.ui.core.Component;
import haxe.ui.core.Screen;
import funkin.ui.MusicBeatState;
import haxe.ui.events.MouseEvent;
import haxe.ui.events.UIEvent;
import haxe.ui.RuntimeComponentBuilder;
@ -122,6 +124,20 @@ class HaxeUIState extends MusicBeatState
}
}
function setComponentShortcutText(key:String, text:String):Void
{
var target:MenuItem = findComponent(key, MenuItem);
if (target == null)
{
// Gracefully handle the case where the item can't be located.
trace('WARN: Could not locate menu item: $key');
}
else
{
target.shortcutText = text;
}
}
/**
* Add an onChange listener to a HaxeUI input component such as a slider or text field.
*/

View file

@ -4,6 +4,9 @@ import haxe.ui.RuntimeComponentBuilder;
import haxe.ui.components.CheckBox;
import haxe.ui.containers.menus.MenuCheckBox;
import haxe.ui.core.Component;
import funkin.ui.MusicBeatState;
import funkin.ui.mainmenu.MainMenuState;
import funkin.ui.MusicBeatSubState;
import haxe.ui.events.MouseEvent;
import haxe.ui.events.UIEvent;

View file

@ -1,3 +1,3 @@
# funkin.ui.haxeui.components
Since there is a line in `source/module.xml` pointing to this folder, all components in this folder will automatically be accessible in any HaxeUI layouts.
Since there is a line in `source/module.xml` pointing to this folder, all components in this folder will automatically be accessible in any HaxeUI layouts.

View file

@ -1,4 +1,4 @@
package funkin;
package funkin.ui.mainmenu;
import flixel.addons.transition.FlxTransitionableSubState;
import funkin.ui.debug.DebugMenuSubState;
@ -13,8 +13,10 @@ import flixel.input.touch.FlxTouch;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import funkin.ui.MusicBeatState;
import flixel.util.FlxTimer;
import funkin.ui.AtlasMenuList;
import funkin.ui.freeplay.FreeplayState;
import funkin.ui.MenuList;
import funkin.ui.title.TitleState;
import funkin.ui.story.StoryMenuState;
@ -108,7 +110,7 @@ class MainMenuState extends MusicBeatState
#end
createMenuItem('options', 'mainmenu/options', function() {
startExitState(new funkin.ui.OptionsState());
startExitState(new funkin.ui.options.OptionsState());
});
// Reset position of menu items.
@ -187,7 +189,7 @@ class MainMenuState extends MusicBeatState
// #end
}
function onMenuItemChange(selected:MenuItem)
function onMenuItemChange(selected:MenuListItem)
{
camFollow.setPosition(selected.getGraphicMidpoint().x, selected.getGraphicMidpoint().y);
}

View file

@ -1,4 +1,4 @@
package funkin;
package funkin.ui.options;
import flixel.FlxSubState;

View file

@ -1,11 +1,11 @@
package funkin.ui;
package funkin.ui.options;
import funkin.data.notestyle.NoteStyleRegistry;
import flixel.addons.effects.chainable.FlxEffectSprite;
import flixel.addons.effects.chainable.FlxOutlineEffect;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.util.FlxColor;
import funkin.ui.OptionsState.Page;
import funkin.ui.options.OptionsState.Page;
import funkin.play.notes.NoteSprite;
class ColorsMenu extends Page

Some files were not shown because too many files have changed in this diff Show more