acuttaly cant belive this

This commit is contained in:
lunarcleint
2023-09-19 20:33:19 -07:00
parent 74e0195b0c
commit 6eb9099577
2 changed files with 12 additions and 11 deletions
+10 -9
View File
@@ -1212,16 +1212,17 @@ class Charter extends UIState {
function changeNoteSustain(change:Float) {
if (selection.length <= 0 || change == 0) return;
undos.addToUndo(CEditSustains([
for(s in selection) {
if (s is CharterNote) {
var n:CharterNote = cast(s, CharterNote);
var old:Float = n.susLength;
n.updatePos(n.step, n.id, Math.max(n.susLength + change, 0));
{before: old, after: n.susLength, note: n};
}
var undoChanges:Array<NoteSustainChange> = [];
for(s in selection) {
if (s is CharterNote) {
var n:CharterNote = cast(s, CharterNote);
var old:Float = n.susLength;
n.updatePos(n.step, n.id, Math.max(n.susLength + change, 0));
undoChanges.push({before: old, after: n.susLength, note: n});
}
]));
}
undos.addToUndo(CEditSustains(undoChanges));
}
public function playtestChart(time:Float = 0, opponentMode = false, here = false) {
+2 -2
View File
@@ -64,12 +64,12 @@ class CharterNote extends UISprite implements ICharterSelectable {
public function get_fullID():Int
return (strumLineID * 4) + id;
public function updatePos(step:Float, id:Int, susLength:Float = 0, ?type:Int = 0, ?strumLine:CharterStrumline) {
public function updatePos(step:Float, id:Int, susLength:Float = 0, ?type:Int = 0, ?strumLine:CharterStrumline = null) {
this.step = step;
this.id = id;
this.susLength = susLength;
this.type = type;
this.strumLine = strumLine;
if (strumLine != null) this.strumLine = strumLine;
y = step * 40;
sustainSpr.scale.set(10, (40 * susLength));