Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Ne_Eo
2024-11-29 22:02:37 +01:00
22 changed files with 214 additions and 38 deletions
+1 -1
View File
@@ -226,4 +226,4 @@ class EditorPickerOption extends FlxTypedSpriteGroup<FlxSprite> {
callback();
});
}
}
}
@@ -23,6 +23,7 @@ class ChartDataScreen extends UISubstateWindow {
public override function create() {
FlxG.sound.music.pause();
Charter.instance.vocals.pause();
for (strumLine in Charter.instance.strumLines.members) strumLine.vocals.pause();
winTitle = 'Chart Properties';
winWidth = 420; winHeight = 230; // guys look, the funny numbers!
+30
View File
@@ -332,6 +332,7 @@ class Charter extends UIState {
null,
{
label: "↑ Speed 25%",
keybind: [PERIOD],
onSelect: _playback_speed_raise
},
{
@@ -340,6 +341,7 @@ class Charter extends UIState {
},
{
label: "↓ Speed 25%",
keybind: [COMMA],
onSelect: _playback_speed_lower
},
null,
@@ -353,6 +355,22 @@ class Charter extends UIState {
keybind: [D],
onSelect: _playback_forward
},
{
label: "Go to start of section",
keybind: [SHIFT, S],
onSelect: _playback_section_start
},
null,
{
label: "Go back a step",
keybind: [W],
onSelect: _playback_back_step
},
{
label: "Go forward a step",
keybind: [S],
onSelect: _playback_forward_step
},
null,
{
label: "Metronome",
@@ -1583,6 +1601,18 @@ class Charter extends UIState {
if (FlxG.sound.music.playing) return;
Conductor.songPosition += (Conductor.beatsPerMeasure * __crochet);
}
function _playback_section_start(_) {
if(FlxG.sound.music.playing) return;
Conductor.songPosition = (Conductor.beatsPerMeasure * (60000 / Conductor.bpm)) * curMeasure;
}
function _playback_back_step(_) {
if (FlxG.sound.music.playing) return;
Conductor.songPosition -= Conductor.stepCrochet;
}
function _playback_forward_step(_) {
if (FlxG.sound.music.playing) return;
Conductor.songPosition += Conductor.stepCrochet;
}
function _song_start(_) {
if (FlxG.sound.music.playing) return;
Conductor.songPosition = 0;
+28 -7
View File
@@ -1,6 +1,7 @@
package funkin.editors.charter;
import flixel.math.FlxPoint;
import flixel.system.FlxAssets.FlxGraphicAsset;
import funkin.backend.chart.ChartData.ChartEvent;
import funkin.editors.charter.Charter.ICharterSelectable;
import funkin.editors.charter.CharterBackdropGroup.EventBackdrop;
@@ -47,14 +48,34 @@ class CharterEvent extends UISliceSprite implements ICharterSelectable {
private static function generateDefaultIcon(name:String) {
var isBase64:Bool = false;
var path:String = Paths.image('editors/charter/event-icons/$name');
if (!Assets.exists(path)) path = Paths.image('editors/charter/event-icons/Unknown');
if (Assets.exists(Paths.pack('events/$name'))) {
var packimg = Assets.getText(Paths.pack('events/$name')).split('________PACKSEP________')[3];
if (isBase64 = (packimg != null))
path = Assets.getText(Paths.pack('events/$name')).split('________PACKSEP________')[3];
var defaultPath = Paths.image('editors/charter/event-icons/Unknown');
if (!Assets.exists(path)) path = defaultPath;
var packPath = Paths.pack('events/$name');
if (Assets.exists(packPath)) {
var packText = Assets.getText(packPath).split('________PACKSEP________');
var packImg = packText[3];
if(packImg != null && packImg.length > 0) {
isBase64 = !packImg.startsWith("assets/");
path = packImg;
}
}
var spr = new FlxSprite().loadGraphic(isBase64 ? openfl.display.BitmapData.fromBase64(path.trim(), 'UTF8') : path);
return spr;
path = path.trim();
var graphic:FlxGraphicAsset = try {
isBase64 ? openfl.display.BitmapData.fromBase64(path, 'UTF8') : path;
} catch(e:Dynamic) {
Logs.trace('Failed to load event icon: ${e.toString()}', ERROR);
isBase64 = false;
defaultPath;
}
if(!isBase64) {
if (!Assets.exists(graphic))
graphic = defaultPath;
}
return new FlxSprite().loadGraphic(graphic);
}
public static function generateEventIcon(event:ChartEvent) {
@@ -43,6 +43,7 @@ class CharterEventScreen extends UISubstateWindow {
FlxG.sound.music.pause(); // prevent the song from continuing
Charter.instance.vocals.pause();
for (strumLine in Charter.instance.strumLines.members) strumLine.vocals.pause();
events = chartEvent.events.copy();
@@ -39,6 +39,7 @@ class CharterMetaDataScreen extends UISubstateWindow {
FlxG.sound.music.pause();
Charter.instance.vocals.pause();
for (strumLine in Charter.instance.strumLines.members) strumLine.vocals.pause();
function addLabelOn(ui:UISprite, text:String)
add(new UIText(ui.x, ui.y - 24, 0, text));
@@ -13,6 +13,7 @@ class CharterNoteTypesList extends UISubstateWindow {
public override function create() {
FlxG.sound.music.pause();
Charter.instance.vocals.pause();
for (strumLine in Charter.instance.strumLines.members) strumLine.vocals.pause();
winTitle = 'Note Types List Editor';
winWidth = 380; winHeight = 390;
@@ -51,6 +51,7 @@ class CharterStrumlineScreen extends UISubstateWindow {
FlxG.sound.music.pause();
Charter.instance.vocals.pause();
for (strumLine in Charter.instance.strumLines.members) strumLine.vocals.pause();
super.create();
+1
View File
@@ -27,6 +27,7 @@ class UISlider extends UISprite {
public var value(default, set):Float = 0;
public function set_value(newVal:Float):Float {
newVal = FlxMath.bound(newVal, segments[0].start, segments[segments.length-1].end);
__barProgress = __calcProgress(newVal); if (onChange != null) onChange(newVal);
if (valueStepper != null) valueStepper.value = newVal;
return value = newVal;