Skip to content

Commit 898313e

Browse files
committed
Update SongBox.hx
1 parent b3bad4d commit 898313e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

source/states/freeplay/osu/SongBox.hx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,39 @@ class DiffBox extends SongBox
1717
public var difID:Int = 0;
1818
public var difName:String = '';
1919
}
20+
21+
22+
class SongGroup extends FlxTypedGroup<SongBox>
23+
{
24+
public var songBox:SongBox;
25+
public var diffBoxes:Array<DiffBox>;
26+
27+
public function new(songBox:SongBox, diffNames:Array<String>)
28+
{
29+
super();
30+
this.songBox = songBox;
31+
this.diffBoxes = [];
32+
33+
add(songBox);
34+
35+
for (i in 0...diffNames.length)
36+
{
37+
var diffBox = new DiffBox();
38+
diffBox.difID = i;
39+
diffBox.difName = diffNames[i];
40+
diffBox.posY = i + 1; // Position below the SongBox
41+
diffBox.songID = songBox.songID;
42+
diffBoxes.push(diffBox);
43+
add(diffBox);
44+
}
45+
}
46+
47+
override public function update(elapsed:Float):Void
48+
{
49+
super.update(elapsed);
50+
for (diffBox in diffBoxes)
51+
{
52+
diffBox.posY = diffBoxes.indexOf(diffBox) + 1;
53+
}
54+
}
55+
}

0 commit comments

Comments
 (0)