Visible Toggle for strumlines

Default Hud Zoom
Ability to disable scripts
Fixed shader camera stuff
This commit is contained in:
NeeEoo
2023-06-09 23:19:58 +02:00
parent 6f0a104fdd
commit ee97bf118b
6 changed files with 65 additions and 13 deletions
+13 -6
View File
@@ -11,27 +11,34 @@
- [x] Fix the strumlines bar when zooming out
- [x] Algorithm to make note placements faster & sorted out
- [x] Play here working
- [ ] Events (including Camera Movement)
- [x] Cap zoom in & out
- [x] Events (including Camera Movement)
- [x] Metadata Editing
- [ ] Custom Notes
- [ ] Metadata Editing
- [ ] Cap zoom in & out
- [ ] Step based zooming
- [ ] Use latest hxCodec
- [ ] Re-export gf-christmas, gf-car and gf-tankmen with padding
- [ ] Multiple state scripts & Multiple global scripts
- [ ] Re-add shader camera stuff
- [x] Re-add shader camera stuff
- [ ] Make update.bat use libs.xml instead of hmm.json
- [ ] New Switch Mod menu
- [ ] Port shader camera stuff over to new flixel fork
- [x] Port shader camera stuff over to new flixel fork
- [ ] Add note offset
- [ ] Dialogue
- [ ] Finish Base Game port
- [ ] Character Editor
- [ ] Add credits
- [ ] Verbose mode (`--verbose`)
- [ ] Fix bugs
## `v1.1.0`
- [ ] Charter Waveforms (maybe in v1.1.0, dont wanna slow shit down)
- [ ] Custom classes
- [ ] Proper super overrides (FlxText_HSX doesn't allow overrides for update because of this)
- [ ] Custom Class extending Custom Classes
- [ ] Statics on Custom Classes
- [ ] Fix Bugs
- [ ] Full 3D support via stages files
- [ ] Multithread sprites loading (for faster load times) ?
- [ ] Stage Editor
- [ ] Stage Editor
- [ ] Optimize flxanimate isOnScreen
+17
View File
@@ -4,7 +4,9 @@ import lime.app.Application;
import flixel.util.FlxDestroyUtil.IFlxDestroyable;
import haxe.io.Path;
import hscript.IHScriptCustomConstructor;
import flixel.util.FlxStringUtil;
@:allow(funkin.backend.scripting.ScriptPack)
/**
* Class used for scripting.
*/
@@ -159,6 +161,10 @@ class Script extends FlxBasic implements IFlxDestroyable {
for(k=>e in getDefaultVariables(this)) {
set(k, e);
}
set("disableScript", () -> {
active = false;
});
set("__script__", this);
}
@@ -250,6 +256,17 @@ class Script extends FlxBasic implements IFlxDestroyable {
], ERROR);
}
override public function toString():String {
return FlxStringUtil.getDebugString(didLoad ? [
LabelValuePair.weak("path", path),
LabelValuePair.weak("active", active),
] : [
LabelValuePair.weak("path", path),
LabelValuePair.weak("active", active),
LabelValuePair.weak("loaded", didLoad),
]);
}
/**
* PRIVATE HANDLERS - DO NOT TOUCH
*/
+13 -3
View File
@@ -1,5 +1,6 @@
package funkin.backend.scripting;
import flixel.util.FlxStringUtil;
import funkin.backend.scripting.events.CancellableEvent;
@:access(CancellableEvent)
@@ -52,7 +53,8 @@ class ScriptPack extends Script {
public override function call(func:String, ?parameters:Array<Dynamic>):Dynamic {
for(e in scripts)
e.call(func, parameters);
if(e.active)
e.call(func, parameters);
return null;
}
@@ -64,8 +66,9 @@ class ScriptPack extends Script {
*/
public inline function event<T:CancellableEvent>(func:String, event:T):T {
for(e in scripts) {
if(!e.active) continue;
e.call(func, [event]);
@:privateAccess
if (event.cancelled && !event.__continueCalls) break;
}
return event;
@@ -95,7 +98,7 @@ class ScriptPack extends Script {
public override function onDestroy() {
for(e in scripts) e.destroy();
}
public override function onCreate(path:String) {}
public function add(script:Script) {
@@ -117,4 +120,11 @@ class ScriptPack extends Script {
script.setPublicMap(publicVariables);
for(k=>e in additionalDefaultVariables) script.set(k, e);
}
override public function toString():String {
return FlxStringUtil.getDebugString([
LabelValuePair.weak("parent", FlxStringUtil.getClassName(parent, true)),
LabelValuePair.weak("total", scripts.length),
]);
}
}
@@ -2,7 +2,7 @@ package funkin.backend.scripting.events;
import flixel.util.FlxDestroyUtil.IFlxDestroyable;
@:allow(ScriptPack)
@:allow(funkin.backend.scripting.ScriptPack)
@:autoBuild(funkin.backend.system.macros.EventMacro.build())
@:noCustomClass
class CancellableEvent implements IFlxDestroyable {
@@ -9,8 +9,8 @@ class CharterStrumline extends UISprite {
public var strumLine:ChartStrumLine;
public var hitsounds:Bool = true;
var healthIcon:HealthIcon;
var button:CharterStrumlineButton;
public var healthIcon:HealthIcon;
public var button:CharterStrumlineButton;
public var curMenu:UIContextMenu = null;
@@ -24,6 +24,9 @@ class CharterStrumline extends UISprite {
healthIcon = new HealthIcon(strumLine.characters != null ? strumLine.characters[0] : null);
healthIcon.scale.set(80 / 150, 80 / 150);
healthIcon.updateHitbox();
if(strumLine.visible == null)
strumLine.visible = true;
healthIcon.alpha = strumLine.visible ? 1 : 0.4;
members.push(healthIcon);
@@ -81,6 +84,15 @@ class CharterStrumlineButton extends UITopMenuButton {
icon: strLine.strumLine.type == ADDITIONAL ? 1 : 0
},
null,
{
label: "Visible",
onSelect: function(_) {
strLine.strumLine.visible = !strLine.strumLine.visible;
strLine.healthIcon.alpha = strLine.strumLine.visible ? 1 : 0.4;
},
icon: strLine.strumLine.visible ? 1 : 0
},
null,
{
label: "Hitsounds",
onSelect: function(_) {
+7 -1
View File
@@ -348,6 +348,11 @@ class PlayState extends MusicBeatState
*/
public var defaultCamZoom:Float = 1.05;
/**
* Camera zoom at which the hud lerps to.
*/
public var defaultHudZoom:Float = 1.0;
/**
* Zoom for the pixel assets.
*/
@@ -658,6 +663,7 @@ class PlayState extends MusicBeatState
FlxG.camera.follow(camFollow, LOCKON, 0.04);
FlxG.camera.zoom = defaultCamZoom;
// camHUD.zoom = defaultHudZoom;
if (smoothTransitionData != null && smoothTransitionData.stage == curStage) {
FlxG.camera.scroll.set(smoothTransitionData.camX, smoothTransitionData.camY);
FlxG.camera.zoom = smoothTransitionData.camZoom;
@@ -1153,7 +1159,7 @@ class PlayState extends MusicBeatState
if (camZooming)
{
FlxG.camera.zoom = lerp(FlxG.camera.zoom, defaultCamZoom, 0.05);
camHUD.zoom = lerp(camHUD.zoom, 1, 0.05);
camHUD.zoom = lerp(camHUD.zoom, defaultHudZoom, 0.05);
}
// RESET = Quick Game Over Screen