This commit is contained in:
Verwex
2025-08-06 17:48:38 +02:00
5 changed files with 30 additions and 16 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

+4 -1
View File
@@ -10,7 +10,7 @@ import openfl.Assets;
using StringTools;
class EventsData {
public static var defaultEventsList:Array<String> = ["HScript Call", "Camera Movement", "Camera Position", "Add Camera Zoom", "Camera Zoom", "Camera Modulo Change", "Camera Flash", "BPM Change", "Continuous BPM Change", "Time Signature Change", "Scroll Speed Change", "Alt Animation Toggle", "Play Animation"];
public static var defaultEventsList:Array<String> = ["HScript Call", "Camera Movement", "Camera Position", "Add Camera Zoom", "Camera Bop", "Camera Zoom", "Camera Modulo Change", "Camera Flash", "BPM Change", "Continuous BPM Change", "Time Signature Change", "Scroll Speed Change", "Alt Animation Toggle", "Play Animation"];
public static var defaultEventsParams:Map<String, Array<EventParamInfo>> = [
"HScript Call" => [
{name: "Function Name", type: TString, defValue: "myFunc"},
@@ -56,6 +56,9 @@ class EventsData {
{name: "Amount", type: TFloat(-10, 10, 0.01, 2), defValue: 0.05},
{name: "Camera", type: TDropDown(['camGame', 'camHUD']), defValue: "camGame"}
],
"Camera Bop" => [
{name: "Amount", type: TFloat(-10, 10, 0.1, 2), defValue: 0.1}
],
"Camera Zoom" => [
{name: "Tween Zoom?", type: TBool, defValue: true},
{name: "New Zoom", type: TFloat(-10, 10, 0.01, 2), defValue: 1},
+5 -6
View File
@@ -138,8 +138,12 @@ class Flags {
public static var DEFAULT_HUD_ZOOM:Float = 1.0;
public static var DEFAULT_ZOOM:Float = 1.0;
public static var DEFAULT_ZOOM_LERP:Float = 0.05;
public static var MAX_CAMERA_ZOOM_MULT:Float = 10;
public static var USE_CAM_ZOOM_MULT:Bool = true;
public static var MAX_CAMERA_ZOOM_MULT:Float = 1.35;
public static var DEFAULT_CAM_ZOOM_MULT:Float = 0.015;
public static var DEFAULT_HUD_ZOOM_MULT:Float = 0.03;
public static var DEFAULT_CAM_ZOOM_LERP:Float = 0.05;
public static var DEFAULT_HUD_ZOOM_LERP:Float = 0.05;
// to translate these you need to convert them into ids
// Resume -> pause.resume
@@ -167,11 +171,6 @@ class Flags {
public static var DEFAULT_INTRO_LENGTH:Int = 5;
public static var DEFAULT_INTRO_SPRITES:Array<String> = [null, 'game/ready', 'game/set', 'game/go'];
public static var CAM_BOP_STRENGTH:Float = 0.015;
public static var HUD_BOP_STRENGTH:Float = 0.03;
public static var DEFAULT_CAM_ZOOM_LERP:Float = 0.05;
public static var DEFAULT_HUD_ZOOM_LERP:Float = 0.05;
public static var MAX_SPLASHES:Int = 8;
public static var STUNNED_TIME:Float = 5 / 60;
+2 -2
View File
@@ -150,7 +150,7 @@ class UIUtil {
} else if (member is UITextBox) @:privateAccess {
var textbox:UITextBox = cast member;
if (textbox.__wasFocused) {
textbox.onChange(textbox.label.text);
if (textbox.onChange != null) textbox.onChange(textbox.label.text);
textbox.__wasFocused = false;
}
}
@@ -159,4 +159,4 @@ class UIUtil {
confirmUISelections(cast member);
}
}
}
}
+19 -7
View File
@@ -362,6 +362,10 @@ class PlayState extends MusicBeatState
* Speed at which the game camera zoom lerps to.
*/
public var camGameZoomLerp:Float = Flags.DEFAULT_CAM_ZOOM_LERP;
/**
* The current multiplier for game camera zooming.
*/
public var camGameZoomMult:Float = Flags.DEFAULT_CAM_ZOOM_MULT;
/**
* Camera zoom at which the hud lerps to.
@@ -371,6 +375,10 @@ class PlayState extends MusicBeatState
* Speed at which the hud camera zoom lerps to.
*/
public var camHUDZoomLerp:Float = Flags.DEFAULT_HUD_ZOOM_LERP;
/**
* The current multiplier for game camera zooming.
*/
public var camHUDZoomMult:Float = Flags.DEFAULT_HUD_ZOOM_MULT;
/**
* Camera zoom at which the cameras that zooms lerps to.
@@ -420,7 +428,7 @@ class PlayState extends MusicBeatState
*/
public var useCamZoomMult:Bool = Flags.USE_CAM_ZOOM_MULT;
/**
* The current multiplier for cam zooming.
* The current multiplier for camera zooming.
* (Only used if useCamZoomMult is on).
*/
public var camZoomingMult:Float = Flags.DEFAULT_ZOOM;
@@ -429,7 +437,7 @@ class PlayState extends MusicBeatState
*/
public var maxCamZoom(get, default):Float = Math.NaN;
private inline function get_maxCamZoom() return Math.isNaN(maxCamZoom) ? maxCamZoomMult * defaultCamZoom : maxCamZoom;
private inline function get_maxCamZoom() return Math.isNaN(maxCamZoom) ? defaultCamZoom + (camZoomingMult * camGameZoomMult) : maxCamZoom;
/**
* Zoom for the pixel assets.
@@ -1348,10 +1356,12 @@ class PlayState extends MusicBeatState
var beat = Conductor.getBeats(camZoomingEvery, camZoomingInterval, camZoomingOffset);
if (camZoomingLastBeat != beat) {
camZoomingLastBeat = beat;
if (useCamZoomMult) camZoomingMult = Math.min(camZoomingMult + camZoomingStrength, defaultZoom + camZoomingStrength);
if (useCamZoomMult) {
if (camZoomingMult < maxCamZoomMult) camZoomingMult += camZoomingStrength;
}
else if (FlxG.camera.zoom < maxCamZoom) {
FlxG.camera.zoom += 0.015 * camZoomingStrength;
camHUD.zoom += 0.03 * camZoomingStrength;
FlxG.camera.zoom += camGameZoomMult * camZoomingStrength;
camHUD.zoom += camHUDZoomMult * camZoomingStrength;
}
}
}
@@ -1397,8 +1407,8 @@ class PlayState extends MusicBeatState
if (camZooming) {
if (useCamZoomMult) {
camZoomingMult = lerp(camZoomingMult, defaultZoom, camZoomLerp) - defaultZoom;
FlxG.camera.zoomMultiplier = camZoomingMult * 0.015 + defaultZoom;
camHUD.zoomMultiplier = camZoomingMult * 0.03 + defaultZoom;
FlxG.camera.zoomMultiplier = camZoomingMult * camGameZoomMult + defaultZoom;
camHUD.zoomMultiplier = camZoomingMult * camHUDZoomMult + defaultZoom;
camZoomingMult += defaultZoom;
}
FlxG.camera.zoom = lerp(FlxG.camera.zoom, defaultCamZoom, camGameZoomLerp);
@@ -1559,6 +1569,8 @@ class PlayState extends MusicBeatState
case "Add Camera Zoom":
var camera:FlxCamera = event.params[1] == "camHUD" ? camHUD : camGame;
camera.zoom += event.params[0];
case "Camera Bop":
camZoomingMult += event.params[0];
case "Camera Zoom":
var cam = event.params[2] == "camHUD" ? camHUD : camGame;
var name = (event.params[2] == "camHUD" ? "camHUD" : "camGame") + ".zoom"; // avoiding having different values from these 2 - Nex