Skip to content

Commit

Permalink
freeplay song grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
Snirozu committed Dec 2, 2024
1 parent 6dd9d44 commit d85a50a
Show file tree
Hide file tree
Showing 5 changed files with 204 additions and 34 deletions.
3 changes: 2 additions & 1 deletion source/backend/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class SaveVariables {
public final badWindow:Int = 135;
public var safeFrames:Float = 10;
public var discordRPC:Bool = true;
//ONLINE
// PSYCH ONLINE
private var nickname:String = "Boyfriend";
public var serverAddress:String = null;
public var modSkin:Array<String> = null;
Expand All @@ -88,6 +88,7 @@ class SaveVariables {
public var showFP:Bool = false;
public var disableFreeplayAlphabet:Bool = false;
public var disableLagDetection:Bool = false;
public var groupSongsBy:String = 'No Grouping';

public function new()
{
Expand Down
2 changes: 2 additions & 0 deletions source/objects/Alphabet.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ interface Scrollable extends IFlxSprite {

var isMenuItem:Bool;
var scaleX(default, set):Float;
var scaleY(default, set):Float;

// IFlxSprite doesn't have?
public var width(get, set):Float;
public var height(get, set):Float;
public var cameras(get, set):Array<FlxCamera>;
}

enum Alignment
Expand Down
8 changes: 8 additions & 0 deletions source/online/objects/AlphaLikeText.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class AlphaLikeText extends FlxText implements Scrollable {
public var startPosition:FlxPoint = new FlxPoint(0, 0); // for the calculations
public var isMenuItem:Bool = true;
public var scaleX(default, set):Float = 1;
public var scaleY(default, set):Float = 1;

public function new(x:Float, y:Float, text:String = "") {
super(x, y);
Expand Down Expand Up @@ -41,4 +42,11 @@ class AlphaLikeText extends FlxText implements Scrollable {

return scale.x = scaleX = value;
}

private function set_scaleY(value:Float) {
if (value == scaleY)
return value;

return scale.y = scaleY = value;
}
}
7 changes: 7 additions & 0 deletions source/options/VisualsUISubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ class VisualsUISubState extends BaseOptionsMenu
'bool');
addOption(option);

var option:Option = new Option('Group Songs:',
"How should songs on Freeplay menu be group by?",
'groupSongsBy',
'string',
['No Grouping', 'Alphabetically', 'Modpack']);
addOption(option);

super();
add(notes);
}
Expand Down
Loading

0 comments on commit d85a50a

Please sign in to comment.