mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Sorted quest files in Quests tab.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -97,6 +97,7 @@ res/pics/booster
|
||||
res/pics/icons
|
||||
res/pics/tokens
|
||||
res/quest/data
|
||||
res/quest/quest.preferences
|
||||
res/quest/questData.dat
|
||||
res/quest/questData.dat.xml
|
||||
res/reprintSetInfo.log
|
||||
|
||||
@@ -5,6 +5,8 @@ import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
@@ -69,6 +71,14 @@ public class QuestFileLister extends JPanel {
|
||||
public void setQuests(QuestData[] qd0) {
|
||||
this.removeAll();
|
||||
List<RowPanel> tempRows = new ArrayList<RowPanel>();
|
||||
List<QuestData> sorted = new ArrayList<QuestData>();
|
||||
for (QuestData qd : qd0) { sorted.add(qd); }
|
||||
Collections.sort(sorted, new Comparator<QuestData>() {
|
||||
@Override
|
||||
public int compare(final QuestData x, final QuestData y) {
|
||||
return ((QuestData) x).getName().compareTo(((QuestData) y).getName());
|
||||
}
|
||||
});
|
||||
|
||||
// Title row
|
||||
// Note: careful with the widths of the rows here;
|
||||
@@ -84,7 +94,7 @@ public class QuestFileLister extends JPanel {
|
||||
this.add(rowTitle, "w 98%!, h 30px!, gapleft 1%");
|
||||
|
||||
RowPanel row;
|
||||
for (QuestData qd : qd0) {
|
||||
for (QuestData qd : sorted) {
|
||||
row = new RowPanel(qd);
|
||||
row.add(new DeleteButton(row), "w 15%!, h 20px!, gap 0 0 5px 0");
|
||||
row.add(new EditButton(row), "w 15%!, h 20px!, gaptop 5px");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package forge.view.home;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Point;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.io.File;
|
||||
@@ -447,6 +448,8 @@ public class ViewQuest extends JScrollPane {
|
||||
selectedOpponent = (SelectablePanel) pnlChallenges.getComponent(0);
|
||||
selectedOpponent.setBackground(skin.getColor(FSkin.Colors.CLR_ACTIVE));
|
||||
}
|
||||
|
||||
this.getViewport().setViewPosition(new Point(0, 0));
|
||||
}
|
||||
|
||||
/** Display handler for decks tab click. */
|
||||
|
||||
Reference in New Issue
Block a user