Skip to content

Commit

Permalink
no
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackx2 committed Feb 12, 2025
1 parent ebe1608 commit 4ab261e
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 71 deletions.
1 change: 0 additions & 1 deletion source/flixel/AttachedFlxSprite.hx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package flixel;

import funkin.backend.utils.Paths;
import flixel.FlxSprite;

class AttachedFlxSprite extends FlxSprite
{
Expand Down
14 changes: 14 additions & 0 deletions source/flixel/BetterFlxSprite.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package flixel;

/**
* Used to set data inside a flxsprite.
*/
class BetterFlxSprite extends flixel.FlxSprite
{
public var data:Map<String,Dynamic> = new Map<String,Dynamic>();

public function new(?X:Float = 0, ?Y:Float = 0, ?FlxGraphicAsset:flixel.system.FlxAssets.FlxGraphicAsset):Void
{
super(X, Y, FlxGraphicAsset);
}
}
3 changes: 1 addition & 2 deletions source/funkin/backend/system/initialization/Logs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Logs // needs rework ...

public static function print(v:Dynamic, ?color:TColor, ?infos:PosInfos) // sorry but, you don't need PosInfo lmao
{
trace(infos.className);
if (color != null)
Terminal.instance.fg(color);
trace(v, infos);
Expand Down Expand Up @@ -57,7 +56,7 @@ class Logs // needs rework ...
// for (param in infos.customParams)
// extra += ", " + param;

final logThing:String = '[${prefix}]: ${v + (extra == "" ? '' : extra)} : ${infos.fileName + ":" + infos.lineNumber}';
final logThing:String = '[${prefix}]: ${v + (extra == "" ? '' : extra)} : source/${infos.className.replace('.','/') + ":" + infos.lineNumber}';
#if js
if (js.Syntax.typeof(untyped console) != "undefined" && (untyped console).log != null)
(untyped console).log(logThing);
Expand Down
39 changes: 18 additions & 21 deletions source/funkin/game/objects/CampaignUI.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package funkin.game.objects;
// i'll doc later -orbl
private enum abstract DaArrowType(String) to String from String
{
final LEFT = "left";
final RIGHT = "right";
final LOCK = "lock";
final LEFT:String = "left";
final RIGHT:String = "right";
final LOCK:String = "lock";
}

// i hate my life
Expand All @@ -28,8 +28,8 @@ class CampaignUI extends FlxSprite
animation.addByPrefix('press', 'arrow push $TYPE');
}
else
animation.addByPrefix('lock', TYPE);
animation.play(animation.getByName('idle') != null ? 'idle' : 'lock');
animation.addByPrefix('idle', TYPE);
animation.play('idle');

antialiasing = ClientPrefs.data.antialiasing;

Expand All @@ -39,18 +39,19 @@ class CampaignUI extends FlxSprite
}

/**
* Bindable event
* Bind a event to a specific map value.
*/
public function bind(tag:String, func:CampaignUI->Void):Void // enum maybe??
events.set(tag, func);

/**
* Mainly used to GET functions from the map `events`...
*/
private function get(tag:String):Null<CampaignUI->Void>
{
var GET_REQUEST = events.get(tag);
if (GET_REQUEST != null)
return GET_REQUEST;
else
return (void) -> {}; // fail safe, kinda...
final GET_REQUEST:CampaignUI->Void = events.get(tag);
if (GET_REQUEST != null) return GET_REQUEST;
return (void) -> {}; // fail safe, kinda...
}

override function update(elapsed:Float):Void
Expand All @@ -60,17 +61,13 @@ class CampaignUI extends FlxSprite
if (!shouldReact)
return;

if (FlxG.mouse.overlaps(this, camera))
if ((isSelected = FlxG.mouse.overlaps(this, camera)) && FlxG.mouse.justPressed)
{
if (FlxG.mouse.justPressed)
get("clicked")(this);
isSelected = true;
FlxTween.tween(this.scale, {x: _defaultSize.x + .05, y: _defaultSize.y + .05}, .1, {ease: FlxEase.circOut});
}
else
{
isSelected = false;
FlxTween.tween(this.scale, {x: _defaultSize.x, y: _defaultSize.y}, .1, {ease: FlxEase.circOut});
FlxTween.tween(this, {"scale.x": this.scale.x * 0.85, "scale.y": this.scale.y * 0.85}, 0.2, {type: BACKWARD, ease: FlxEase.cubeOut});
//if(animation.getByName('press') != null) animation.play('press');
get("clicked")(this);

new FlxTimer().start(.5, (_) -> {scale.set(_defaultSize.x, _defaultSize.y); animation.play('idle');});
}
}
}
2 changes: 1 addition & 1 deletion source/funkin/game/states/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class FreeplayState extends MusicBeatState
//Paths.clearUnusedMemory();

persistentUpdate = true;
PlayState.isStoryMode = false;
PlayState.isStoryMode = FlxG.mouse.visible = false;
WeekData.reloadWeekFiles(false);

#if DISCORD_ALLOWED
Expand Down
Loading

0 comments on commit 4ab261e

Please sign in to comment.