acuttaly cant belive this
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user