Skip to content

Commit

Permalink
yuh
Browse files Browse the repository at this point in the history
  • Loading branch information
PurSnake committed Aug 20, 2024
1 parent 8c32604 commit 3e0a700
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 13 deletions.
4 changes: 4 additions & 0 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ xsi:schemaLocation="http://lime.openfl.org/project/1.0.4 http://lime.openfl.org/
<define name="FORCE_DEBUG_VERSION" if="GITHUB_BUILD" />
<define name="NO_REDIRECT_ASSETS_FOLDER" if="GITHUB_BUILD" />
<define name="TOUCH_HERE_TO_PLAY" if="web" />
<define name="HXVLC_NO_PLAYLIST" />
<haxedef name="HXVLC_NO_PLAYLIST" />

<!-- _______________________________ Libraries ______________________________ -->
<haxelib name="lime" /> <!-- Game engine backend -->
Expand All @@ -127,6 +129,8 @@ xsi:schemaLocation="http://lime.openfl.org/project/1.0.4 http://lime.openfl.org/
<section if="cpp">
<haxelib name="hxvlc" if="desktop || mobile" unless="hl" /> <!-- Video playback -->
</section>
<define name="HXVLC_NO_PLAYLIST" />
<haxedef name="HXVLC_NO_PLAYLIST" />

<haxelib name="discord_rpc" if="desktop" unless="hl || debug || GITHUB_BUILD" /> <!-- Discord RPC -->
<haxelib name="funkin.vis"/>
Expand Down
4 changes: 2 additions & 2 deletions hmm.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@
"name": "lime",
"type": "git",
"dir": null,
"ref": "872ff6db2f2d27c0243d4ff76802121ded550dd7",
"url": "https://github.com/FunkinCrew/lime"
"ref": null,
"url": "https://github.com/PurSnake/lime-grafexed"
},
{
"name": "mconsole",
Expand Down
5 changes: 2 additions & 3 deletions source/funkin/InitState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,12 @@ class InitState extends FlxState
// Set the game to a lower frame rate while it is in the background.
FlxG.game.focusLostFramerate = 30;

hxvlc.util.Handle.initAsync();
hxvlc.util.Handle.initAsync([], (s) -> trace("HxVlc " + (s ? "LOADED" : "CANNOT BE LOADED")));

@:privateAccess
FlxG.game.getTimer = () -> openfl.Lib.getTimer();

setupFlixelDebug();

//
// FLIXEL TRANSITIONS
//
Expand Down Expand Up @@ -186,7 +185,6 @@ class InitState extends FlxState
// TODO: CharacterDataParser doesn't use json2object, so it's way slower than the other parsers and more prone to syntax errors.
// Move it to use a BaseRegistry.
CharacterDataParser.loadCharacterCache();

NoteKindManager.loadScripts();

ModuleHandler.buildModuleCallbacks();
Expand Down Expand Up @@ -226,6 +224,7 @@ class InitState extends FlxState

FlxG.signals.postStateSwitch.add(function() {
clearCache();
//flxanimate.frames.FlxAnimateFrames.clearCache();
gc(true);
});

Expand Down
2 changes: 2 additions & 0 deletions source/funkin/modding/PolymodHandler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ class PolymodHandler
*/
public static function forceReloadAssets():Void
{
flxanimate.frames.FlxAnimateFrames.clearCache();

// Forcibly clear scripts so that scripts can be edited.
ModuleHandler.clearModuleCache();
Polymod.clearScripts();
Expand Down
9 changes: 8 additions & 1 deletion source/funkin/play/character/CharacterData.hx
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,8 @@ class CharacterDataParser
isPixel: null,
isBopable: null,
offsets: null,
color: null
color: null,
iconDivisor: null
};
}

Expand Down Expand Up @@ -772,6 +773,12 @@ typedef HealthIconData =
* @default Switched via playerId (BF/DAD) from Constants.hx
*/
var color:Null<String>;

/**
* The height/width of one icon frame (if it's legacy).
* @default 150/32
*/
var iconDivisor:Null<Int>;
}

/**
Expand Down
12 changes: 10 additions & 2 deletions source/funkin/play/components/HealthIcon.hx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ class HealthIcon extends FunkinSprite
*/
public var autoUpdate:Bool = true;

/**
* Defaults to 150 or 32, if icon pixel.
* Used to determine Height/Width of one icon frame (if it's legacy/non-animated).
*/
public var iconDivisor:Int = 150;

/**
* @default 0, 0
*/
Expand Down Expand Up @@ -187,6 +193,7 @@ class HealthIcon extends FunkinSprite
{
this.characterId = Constants.DEFAULT_HEALTH_ICON;
this.isPixel = false;
this.iconDivisor = isPixel ? PIXEL_ICON_SIZE : HEALTH_ICON_SIZE;

loadCharacter(characterId);

Expand All @@ -202,14 +209,15 @@ class HealthIcon extends FunkinSprite
{
this.characterId = data.id;
this.isPixel = data.isPixel ?? false;
this.iconDivisor = data.iconDivisor ?? (isPixel ? PIXEL_ICON_SIZE : HEALTH_ICON_SIZE);

loadCharacter(characterId);

this.size.set(data.scale ?? 1.0, data.scale ?? 1.0);

data.offsets != null ? this.customOffset.set(-data.offsets[0], -data.offsets[1]) : this.customOffset.set(0.0, 0.0);
this.flipX = data.flipX ?? false; // Face the OTHER way by default, since that is more common.
this.isBopable = data.isBopable ?? true;
this.isBopable = data.isBopable ?? true;
this.healthColor = data.color != null ? FlxColor.fromString(data.color) : (playerId == 0 ? Constants.COLOR_HEALTH_BAR_GREEN : Constants.COLOR_HEALTH_BAR_RED);
}
}
Expand Down Expand Up @@ -420,7 +428,7 @@ class HealthIcon extends FunkinSprite
}
else
{
loadGraphic(Paths.image('icons/icon-$charId'), true, isPixel ? PIXEL_ICON_SIZE : HEALTH_ICON_SIZE, isPixel ? PIXEL_ICON_SIZE : HEALTH_ICON_SIZE);
loadGraphic(Paths.image('icons/icon-$charId'), true, iconDivisor, iconDivisor);

loadAnimationOld();
}
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/ui/debug/charting/ChartEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
/**
* DEPRECATED.
*/
public static final HITSOUND_OFFSET:Float = -30; // FunkinCrew LIME = -30; || -60 VANILLA
public static final HITSOUND_OFFSET:Float = 0; // FunkinCrew LIME = -30; || -60 VANILLA

/**
* INSTANCE DATA
Expand Down
20 changes: 16 additions & 4 deletions source/funkin/ui/freeplay/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ class FreeplayState extends MusicBeatSubState
boomBox.animation.addByPrefix("boom", "FREEPLAY BOOM", 24, false);
boomBox.zIndex = 550;
boomBox.angle = 10; boomBox.scale.set(.9, .9); boomBox.updateHitbox();
boomBox.zoomFactor = 0.5;
add(boomBox);

boomBox.x = FlxG.width - boomBox.width+15;
Expand All @@ -590,7 +591,7 @@ class FreeplayState extends MusicBeatSubState
FlxTween.tween(boomBox, {x: (boomBox.x += 150) - 150}, 0.6, {ease: FlxEase.quartOut});
exitMovers.set([boomBox],
{
x: boomBox.x + 250,
x: boomBox.x + 450,
speed: 0.4
});

Expand Down Expand Up @@ -1454,10 +1455,10 @@ class FreeplayState extends MusicBeatSubState
}

if (FlxG.keys.justPressed.CONTROL)
{
previewFullSong = !previewFullSong;
trace(previewFullSong);
}

if (FlxG.keys.justPressed.TAB)
bopCamera = !bopCamera;

if (controls.BACK)
{
Expand Down Expand Up @@ -1548,6 +1549,8 @@ class FreeplayState extends MusicBeatSubState
}
}

public static var bopCamera:Bool = true;
public var bopCameraTween:FlxTween = null;
override function beatHit():Bool
{
if (!super.beatHit()) return false;
Expand All @@ -1561,6 +1564,15 @@ class FreeplayState extends MusicBeatSubState
dj.playFlashAnimation('Boyfriend DJ', true);
}

if (bopCamera && !prepForNewRank && !busy && Conductor.instance.currentBeat > 0)
{
if (bopCameraTween != null)
bopCameraTween.cancel();

funnyCam.zoom += (Conductor.instance.currentBeat % 2 == 0 ? 0.004 : 0.002);
bopCameraTween = FlxTween.tween(funnyCam, {zoom: 1}, (Conductor.instance.beatLengthMs / 1000) / 1.25, {ease: FlxEase.cubeOut});

}
return true;
}

Expand Down

0 comments on commit 3e0a700

Please sign in to comment.