mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-11-28 07:07:16 +00:00
save/load for inputOffsets
This commit is contained in:
parent
3544f2a804
commit
b11bf09687
|
|
@ -6,6 +6,7 @@ import flixel.math.FlxMath;
|
|||
import funkin.play.song.Song.SongDifficulty;
|
||||
import funkin.data.song.SongData.SongTimeChange;
|
||||
import funkin.data.song.SongDataUtils;
|
||||
import funkin.save.Save;
|
||||
|
||||
/**
|
||||
* A core class which handles musical timing throughout the game,
|
||||
|
|
@ -209,16 +210,18 @@ class Conductor
|
|||
/**
|
||||
* An offset set by the user to compensate for input lag.
|
||||
*/
|
||||
public var inputOffset(get, set):Float;
|
||||
public var inputOffset(get, set):Int;
|
||||
|
||||
function get_inputOffset():Float
|
||||
function get_inputOffset():Int
|
||||
{
|
||||
return Save.get().options.inputOffset;
|
||||
}
|
||||
|
||||
function set_inputOffset(value:Float):Float
|
||||
function set_inputOffset(value:Int):Int
|
||||
{
|
||||
return Save.get().options.inputOffset = value;
|
||||
Save.get().options.inputOffset = value;
|
||||
Save.get().flush();
|
||||
return Save.get().options.inputOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ class LatencyState extends MusicBeatSubState
|
|||
|
||||
offsetText.text += "\naverage input offset needed: " + avgOffsetInput;
|
||||
|
||||
var multiply:Float = 10;
|
||||
var multiply:Int = 10;
|
||||
|
||||
if (FlxG.keys.pressed.SHIFT) multiply = 1;
|
||||
|
||||
|
|
@ -208,24 +208,24 @@ class LatencyState extends MusicBeatSubState
|
|||
{
|
||||
if (FlxG.keys.justPressed.RIGHT)
|
||||
{
|
||||
Conductor.instance.instrumentalOffset += 1.0 * multiply;
|
||||
Conductor.instance.instrumentalOffset += 1 * multiply;
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.LEFT)
|
||||
{
|
||||
Conductor.instance.instrumentalOffset -= 1.0 * multiply;
|
||||
Conductor.instance.instrumentalOffset -= 1 * multiply;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FlxG.keys.justPressed.RIGHT)
|
||||
{
|
||||
Conductor.instance.inputOffset += 1.0 * multiply;
|
||||
Conductor.instance.inputOffset += 1 * multiply;
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.LEFT)
|
||||
{
|
||||
Conductor.instance.inputOffset -= 1.0 * multiply;
|
||||
Conductor.instance.inputOffset -= 1 * multiply;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue