This commit is contained in:
Frakist
2023-08-11 16:19:33 +03:00
7 changed files with 35 additions and 24 deletions
+8 -5
View File
@@ -10,11 +10,14 @@ float uBlur = 0.015;
float uBrightness = 0.6;
vec4 getColor(vec2 pos) {
if (pos.x < 0) pos.x = 0;
else if (pos.x > 1.0 - (1.0 / iResolution.x)) pos.x = 1.0 - (1.0 / iResolution.x);
if (pos.y < 0) pos.y = 0;
else if (pos.y > 1.0 - (1.0 / iResolution.y)) pos.y = 1.0 - (1.0 / iResolution.y);
return getTexture(bitmap, pos);
vec2 ps = camToOg(pos);
if (ps.x < 0) ps.x = 0;
//else if (ps.x > 1.0 - (1.0 / iResolution.x)) ps.x = 1.0 - (1.0 / iResolution.x);
else if (ps.x > 1.0) return vec4(0.0);
if (ps.y < 0) ps.y = 0;
//else if (ps.y > 1.0 - (1.0 / iResolution.y)) return ps.y = 1.0 - (1.0 / iResolution.y);
else if (ps.y > 1.0) return vec4(0.0);
return flixel_texture2D(bitmap, (ps));
}
@@ -8,13 +8,13 @@ class ConductorInfo extends FramerateCategory {
public override function __enterFrame(t:Int) {
if (alpha <= 0.05) return;
_text = 'Current Song Position: ${Conductor.songPosition}';
_text = 'Current Song Position: ${Math.floor(Conductor.songPosition * 1000) / 1000}';
_text += '\n - ${Conductor.curBeat} beats';
_text += '\n - ${Conductor.curStep} steps';
_text += '\n - ${Conductor.curMeasure} measures';
_text += '\nCurrent BPM: ${Conductor.bpm}';
_text += '\nTime Signature: ${Conductor.beatsPerMesure}/${Conductor.stepsPerBeat}';
this.text.text = _text;
super.__enterFrame(t);
}
+14 -12
View File
@@ -39,7 +39,7 @@ class EditorPicker extends MusicBeatSubstate {
public var curSelected:Int = 0;
public var subCam:FlxCamera;
public var oldMousePos:FlxPoint = FlxPoint.get();
public var curMousePos:FlxPoint = FlxPoint.get();
@@ -52,9 +52,9 @@ class EditorPicker extends MusicBeatSubstate {
public override function create() {
super.create();
camera = new FlxCamera();
camera.bgColor = 0;
FlxG.cameras.add(camera, false);
camera = subCam = new FlxCamera();
subCam.bgColor = 0;
FlxG.cameras.add(subCam, false);
bg = new FlxSprite().makeGraphic(1, 1, 0xFF000000);
bg.scrollFactor.set();
@@ -72,7 +72,7 @@ class EditorPicker extends MusicBeatSubstate {
}
sprites[0].selected = true;
FlxG.mouse.getScreenPosition(camera, oldMousePos);
FlxG.mouse.getScreenPosition(subCam, oldMousePos);
}
public override function update(elapsed:Float) {
@@ -82,12 +82,12 @@ class EditorPicker extends MusicBeatSubstate {
if (selected) {
camVelocity += FlxG.width * elapsed * 2;
camera.scroll.x += camVelocity * elapsed;
subCam.scroll.x += camVelocity * elapsed;
return;
}
changeSelection(-FlxG.mouse.wheel + (controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0));
FlxG.mouse.getScreenPosition(camera, curMousePos);
FlxG.mouse.getScreenPosition(subCam, curMousePos);
if (curMousePos.x != oldMousePos.x || curMousePos.y != oldMousePos.y) {
oldMousePos.set(curMousePos.x, curMousePos.y);
curSelected = -1;
@@ -102,13 +102,13 @@ class EditorPicker extends MusicBeatSubstate {
MusicBeatState.skipTransIn = true;
MusicBeatState.skipTransOut = true;
FlxG.sound.music.fadeOut(0.7, 0, function(n) {
FlxG.sound.music.stop();
});
if (FlxG.sound.music != null)
FlxG.sound.music.fadeOut(0.7, 0, function(n) {
FlxG.sound.music.stop();
});
sprites[curSelected].flicker(function() {
if (FlxG.sound.music != null)
camera.fade(0xFF000000, 0.25, false, function() {
subCam.fade(0xFF000000, 0.25, false, function() {
FlxG.switchState(Type.createInstance(options[curSelected].state, []));
});
});
@@ -126,6 +126,8 @@ class EditorPicker extends MusicBeatSubstate {
oldMousePos.put();
curMousePos.put();
FlxG.cameras.remove(subCam);
}
public function changeSelection(change:Int) {
@@ -9,7 +9,7 @@ import flixel.util.FlxColor;
using StringTools;
class CharterEventScreen extends UISubstateWindow {
public var cam:FlxCamera;
//public var cam:FlxCamera;
public var chartEvent:CharterEvent;
public var step:Float = 0;
+9
View File
@@ -126,4 +126,13 @@ class UIButtonList<T:UIButton> extends UIWindow {
buttonCameras.zoom = __lastDrawCameras[0].zoom;
}
}
override function destroy() {
super.destroy();
if(buttonCameras != null) {
FlxG.cameras.remove(buttonCameras);
buttonCameras = null;
}
}
}
@@ -96,9 +96,7 @@ class UIWarningSubstate extends MusicBeatSubstate {
this.buttons = buttons;
}
}
typedef WarningCamShader = {
var cam:FlxCamera;
}
typedef WarningButton = {
var label:String;
var onClick:UIWarningSubstate->Void;
-1
View File
@@ -155,7 +155,6 @@ class PauseSubState extends MusicBeatSubstate
}
override function destroy()
{
if(FlxG.cameras.list.contains(camera))
FlxG.cameras.remove(camera, true);
pauseScript.call("onDestroy");