Skip to content

Commit

Permalink
fix track categories by removing custom tracks option
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippvK committed Sep 25, 2020
1 parent ef44cfa commit 3a5eb35
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions client/src/main/java/agolf/lobby/LobbyPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ protected Choicer addChoicerTrackTypes(Panel container, int x, int y, int width,
c.addItem("Only pend (A)");
}

if(Launcher.isUsingCustomServer()) {
c.addItem("Only custom");
}
//if(Launcher.isUsingCustomServer()) {
// c.addItem("Only custom");
//}

c.select(1);
c.setBounds(x, y, width, height);
Expand Down Expand Up @@ -336,7 +336,7 @@ protected Choicer addChoicerScoringEnd(Panel container, int x, int y, int width,
protected Choicer addChoicerTrackCategory(Panel container, int x, int y, int width, int height) {
Choicer c = new Choicer();
c.addItem("Official");
c.addItem("Custom");
//c.addItem("Custom");
c.select(0);
c.setBounds(x, y, width, height);
container.add(c);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
*/
public enum TrackCategory {

UNKNOWN("?", -1), ALL("-", 0), BASIC("basic", 1), TRADITIONAL("traditional", 2), MODERN("modern", 3), HIO("hio", 4), SHORT("short", 5), LONG("long", 6), CUSTOM("custom", 7);
//UNKNOWN("?", -1), ALL("-", 0), BASIC("basic", 1), TRADITIONAL("traditional", 2), MODERN("modern", 3), HIO("hio", 4), SHORT("short", 5), LONG("long", 6), CUSTOM("custom", 7);
UNKNOWN("?", -1), ALL("-", 0), BASIC("basic", 1), TRADITIONAL("traditional", 2), MODERN("modern", 3), HIO("hio", 4), SHORT("short", 5), LONG("long", 6);

private final String dir;
private final int id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ private static final void loadTracks() throws IOException {
FileSystem fs = FileSystems.getDefault();
int counter = 0;
for (TrackCategory type : TrackCategory.values()) {
if (type == TrackCategory.ALL || type == TrackCategory.CUSTOM || type == TrackCategory.UNKNOWN) {
//if (type == TrackCategory.ALL || type == TrackCategory.CUSTOM || type == TrackCategory.UNKNOWN) {
if (type == TrackCategory.ALL || type == TrackCategory.UNKNOWN) {
continue;
}
Path tracksPath = fs.getPath("tracks", type.getDir());
Expand Down Expand Up @@ -173,7 +174,8 @@ public static final ArrayList<Track> getRandomTracks(int number, TrackCategory t
}
ArrayList<Track> usedTracks = new ArrayList<Track>();// horrible
for (Track track : tracks) {
if (TrackCategory.getByTypeId(track.getCategory()) == TrackCategory.ALL || TrackCategory.getByTypeId(track.getCategory()) == type) {
//if (TrackCategory.getByTypeId(track.getCategory()) == TrackCategory.ALL || TrackCategory.getByTypeId(track.getCategory()) == type) {
if (type == TrackCategory.ALL || TrackCategory.getByTypeId(track.getCategory()) == type) {
usedTracks.add(track);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ private static void loadTracks() throws IOException {
tracks = new ArrayList<Track>();
FileSystem fs = FileSystems.getDefault();
for (TrackCategory type : TrackCategory.values()) {
if (type == TrackCategory.ALL || type == TrackCategory.CUSTOM || type == TrackCategory.UNKNOWN) {
//if (type == TrackCategory.ALL || type == TrackCategory.CUSTOM || type == TrackCategory.UNKNOWN) {
if (type == TrackCategory.ALL || type == TrackCategory.UNKNOWN) {
continue;
}
Path tracksPath = fs.getPath("tracks", type.getDir());
Expand Down

0 comments on commit 3a5eb35

Please sign in to comment.