* edit chart data, and per strumline scrollspeed * forgot to delete a few things uh * almost forgor this * Change strum speed back to charts when disabled * value instead of label * set max scroll speed to 10
61 lines
1.6 KiB
Haxe
61 lines
1.6 KiB
Haxe
package funkin.editors.charter;
|
|
|
|
import funkin.backend.chart.ChartData;
|
|
import flixel.math.FlxPoint;
|
|
import funkin.backend.chart.ChartData.ChartMetaData;
|
|
|
|
using StringTools;
|
|
|
|
class ChartDataScreen extends UISubstateWindow {
|
|
public var data:ChartData;
|
|
public var saveButton:UIButton;
|
|
public var closeButton:UIButton;
|
|
|
|
public var scrollSpeedStepper:UINumericStepper;
|
|
public var stageBox:UITextBox;
|
|
|
|
public function new(data:ChartData) {
|
|
super();
|
|
this.data = data;
|
|
}
|
|
|
|
public override function create() {
|
|
FlxG.sound.music.pause();
|
|
Charter.instance.vocals.pause();
|
|
|
|
function addLabelOn(ui:UISprite, text:String)
|
|
add(new UIText(ui.x, ui.y - 24, 0, text));
|
|
|
|
winTitle = 'Editing chart data';
|
|
winWidth = 420; winHeight = 69*4; // guys look, the funny numbers!
|
|
|
|
super.create();
|
|
|
|
scrollSpeedStepper = new UINumericStepper(windowSpr.x + 20, windowSpr.y + 60, data.scrollSpeed, 0.1, 2, 0, 10, 82);
|
|
add(scrollSpeedStepper);
|
|
addLabelOn(scrollSpeedStepper, "Scroll Speed");
|
|
|
|
stageBox = new UITextBox(scrollSpeedStepper.x, scrollSpeedStepper.y + 60, PlayState.SONG.stage);
|
|
add(stageBox);
|
|
addLabelOn(stageBox, "Stage");
|
|
|
|
saveButton = new UIButton(windowSpr.x + windowSpr.bWidth - 20 - 125, windowSpr.y + windowSpr.bHeight - 16 - 32, "Save & Close", function() {
|
|
onSave();
|
|
close();
|
|
}, 125);
|
|
add(saveButton);
|
|
|
|
closeButton = new UIButton(saveButton.x - 20, saveButton.y, "Cancel", function() {
|
|
close();
|
|
}, 125);
|
|
add(closeButton);
|
|
closeButton.x -= closeButton.bWidth;
|
|
}
|
|
|
|
public function onSave()
|
|
{
|
|
PlayState.SONG.stage = stageBox.label.text;
|
|
PlayState.SONG.scrollSpeed = scrollSpeedStepper.value;
|
|
}
|
|
|
|
} |