Adds Duration Arrows for some built-in events
This commit is contained in:
@@ -58,6 +58,11 @@ class Macros {
|
||||
|
||||
final macroPath = 'funkin.backend.system.macros.Macros';
|
||||
Compiler.addMetadata('@:build($macroPath.buildLimeAssetLibrary())', 'lime.utils.AssetLibrary');
|
||||
|
||||
//Adds Compat for #if hscript blocks when you have hscript improved
|
||||
if (Context.defined("hscript_improved") && !Context.defined("hscript")) {
|
||||
Compiler.define('hscript');
|
||||
}
|
||||
}
|
||||
|
||||
public static function buildLimeAssetLibrary():Array<Field> {
|
||||
|
||||
@@ -82,7 +82,7 @@ class CharterEvent extends UISliceSprite implements ICharterSelectable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Pack data is a list of 4 strings separated by `________PACKSEP________`
|
||||
* Pack data is a list of 5 strings separated by `________PACKSEP________`
|
||||
* [0] Event Name
|
||||
* [1] Event Script
|
||||
* [2] Event JSON Info
|
||||
@@ -276,10 +276,47 @@ class CharterEvent extends UISliceSprite implements ICharterSelectable {
|
||||
}
|
||||
|
||||
case "Camera Movement":
|
||||
// camera movement, use health icon
|
||||
if(event.params != null) {
|
||||
var icon = getIconFromStrumline(event.params[0]);
|
||||
if(icon != null) return icon;
|
||||
var shouldDoArrow:Bool = false;
|
||||
var icon:Null<FlxSprite> = null;
|
||||
if (event.params != null) {
|
||||
shouldDoArrow = event.params[1] && event.params[3] != "CLASSIC"; // is Tweened and isnt Lerped
|
||||
icon = getIconFromStrumline(event.params[0]); // camera movement, use health icon
|
||||
}
|
||||
|
||||
if (icon == null) icon = generateDefaultIcon(event.name);
|
||||
|
||||
if(event.params != null && shouldDoArrow && !inMenu) {
|
||||
var group = new EventIconGroup();
|
||||
group.add(icon);
|
||||
group.members[0].x -= 8;
|
||||
group.members[0].y -= 8;
|
||||
generateEventIconDurationArrow(group, event.params[2]);
|
||||
return group;
|
||||
} else
|
||||
return icon;
|
||||
|
||||
case "Camera Position":
|
||||
var shouldDoArrow:Bool = false;
|
||||
if (event.params != null)
|
||||
shouldDoArrow = event.params[2] && event.params[4] != "CLASSIC"; // is Tweened and isnt Lerped
|
||||
|
||||
if(event.params != null && shouldDoArrow && !inMenu) {
|
||||
var group = new EventIconGroup();
|
||||
group.add(generateDefaultIcon(event.name));
|
||||
generateEventIconDurationArrow(group, event.params[3]);
|
||||
return group;
|
||||
}
|
||||
|
||||
case "Camera Zoom":
|
||||
var shouldDoArrow:Bool = false;
|
||||
if (event.params != null)
|
||||
shouldDoArrow = event.params[0];
|
||||
|
||||
if(event.params != null && shouldDoArrow && !inMenu) {
|
||||
var group = new EventIconGroup();
|
||||
group.add(generateDefaultIcon(event.name));
|
||||
generateEventIconDurationArrow(group, event.params[3]);
|
||||
return group;
|
||||
}
|
||||
}
|
||||
return generateDefaultIcon(event.name);
|
||||
|
||||
@@ -17,7 +17,7 @@ class CharterEventGroup extends FlxTypedGroup<CharterEvent> {
|
||||
if (autoSort && members.length != __lastSort)
|
||||
sortEvents();
|
||||
|
||||
eventsRowText.y = FlxMath.lerp(eventsRowText.y, -40 + (members[0] != null ? Math.min(members[0].y, 0) : 0), 1/20);
|
||||
eventsRowText.y = FlxMath.lerp(eventsRowText.y, -40 + (members[0] != null ? Math.min(members[0].y, 0) : 0), 1/10);
|
||||
}
|
||||
|
||||
public override function remove(v:CharterEvent, force:Bool = true):CharterEvent {
|
||||
|
||||
@@ -123,18 +123,18 @@ class TreeMenuScreen extends FlxSpriteGroup {
|
||||
updateItems();
|
||||
}
|
||||
|
||||
dynamic function updateItem(object:FlxSprite, itemHeight:Float, centerY:Float, lerpRatio:Float) {
|
||||
object.y = CoolUtil.fpsLerp(object.y, centerY - itemHeight * 0.5, lerpRatio);
|
||||
object.x = x + 100 - Math.pow(Math.abs((object.y - (FlxG.height - itemHeight) * 0.5) / itemHeight / FlxG.height * FlxG.initialHeight), 1.6) * 15;
|
||||
}
|
||||
|
||||
public function updateItems(force = false) {
|
||||
var r = force ? 1 : 0.25, initY = FlxG.height * 0.5;
|
||||
var i = curSelected, y = initY, object:FlxSprite = null, itemHeight:Float = 0;
|
||||
|
||||
inline function updateItem() {
|
||||
object.y = CoolUtil.fpsLerp(object.y, y - itemHeight * 0.5, r);
|
||||
object.x = x + 100 - Math.pow(Math.abs((object.y - (FlxG.height - itemHeight) * 0.5) / itemHeight / FlxG.height * FlxG.initialHeight), 1.6) * 15;
|
||||
}
|
||||
|
||||
while (i < length) if ((object = members[i++]) != null) {
|
||||
itemHeight = object.height;
|
||||
updateItem();
|
||||
updateItem(object, itemHeight, y, r);
|
||||
y += itemHeight;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ class TreeMenuScreen extends FlxSpriteGroup {
|
||||
i = curSelected;
|
||||
while (i-- > 0) if ((object = members[i]) != null) {
|
||||
y -= (itemHeight = object.height);
|
||||
updateItem();
|
||||
updateItem(object, itemHeight, y, r);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user