mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
add cards won via ante to deck in constructed matches
This commit is contained in:
@@ -9,7 +9,7 @@ Release Notes
|
|||||||
-------------
|
-------------
|
||||||
|
|
||||||
- User data migration -
|
- User data migration -
|
||||||
User data, like decks, saved gauntlets, and card pictures, is now stored in separate directories from the program data. When this version of Forge is first run, it will scan the program directory for all user data and automatically migrate all the files to their new homes. There are three defined user data directores: userDir, cacheDir, and cardPicsDir, and their locations depend on the standard paths for your operating system:
|
User data files, like decks, saved gauntlets, and card pictures, are now stored in new directories separate from the program data. When this version of Forge is first run, it will scan the program directory for all user data and automatically migrate the files to their new homes. There are three defined user data directores: userDir, cacheDir, and cardPicsDir, and their locations depend on the standard paths for your operating system:
|
||||||
|
|
||||||
Windows:
|
Windows:
|
||||||
userDir=%APPDATA%/Forge/
|
userDir=%APPDATA%/Forge/
|
||||||
@@ -24,9 +24,7 @@ User data, like decks, saved gauntlets, and card pictures, is now stored in sepa
|
|||||||
cardPicsDir is defined as <cacheDir>/pics/cards/ by default. If you wish to use a non-default directory, please see the forge.profile.preferences.example file located in the Forge installation directory root. You can use this file to, for example, share the card pics directory with another program, such as Magic Workstation.
|
cardPicsDir is defined as <cacheDir>/pics/cards/ by default. If you wish to use a non-default directory, please see the forge.profile.preferences.example file located in the Forge installation directory root. You can use this file to, for example, share the card pics directory with another program, such as Magic Workstation.
|
||||||
|
|
||||||
If you are using the Mac OS X version of Forge then you will find the forge.profile.preferences.example file by right clicking or control clicking on the Forge.app icon. Select "Show Package Contents" from the contextual menu. A Finder window will open and will display a folder named Contents. Navigate to the folder:
|
If you are using the Mac OS X version of Forge then you will find the forge.profile.preferences.example file by right clicking or control clicking on the Forge.app icon. Select "Show Package Contents" from the contextual menu. A Finder window will open and will display a folder named Contents. Navigate to the folder:
|
||||||
|
/Contents/Resources/Java/
|
||||||
/Contents/Resources/Java/
|
|
||||||
|
|
||||||
and you will find the file named forge.profile.preferences.example.
|
and you will find the file named forge.profile.preferences.example.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -89,41 +89,20 @@ public class GuiChoose {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// returned Object will never be null
|
// returned Object will never be null
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* getChoices.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param <T>
|
|
||||||
* a T object.
|
|
||||||
* @param message
|
|
||||||
* a {@link java.lang.String} object.
|
|
||||||
* @param min
|
|
||||||
* a int.
|
|
||||||
* @param max
|
|
||||||
* a int.
|
|
||||||
* @param choices
|
|
||||||
* a T object.
|
|
||||||
* @return a {@link java.util.List} object.
|
|
||||||
*/
|
|
||||||
public static <T> List<T> getChoices(final String message, final int min, final int max, final T[] choices) {
|
public static <T> List<T> getChoices(final String message, final int min, final int max, final T[] choices) {
|
||||||
final ListChooser<T> c = new ListChooser<T>(message, min, max, choices);
|
return getChoices(message, min, max, Arrays.asList(choices));
|
||||||
return getChoices(c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> List<T> getChoices(final String message, final int min, final int max, final Collection<T> choices) {
|
public static <T> List<T> getChoices(final String message, final int min, final int max, final Collection<T> choices) {
|
||||||
final ListChooser<T> c = new ListChooser<T>(message, min, max, choices);
|
if (null == choices || 0 == choices.size()) {
|
||||||
return getChoices(c);
|
if (0 == min) {
|
||||||
}
|
return new ArrayList<T>();
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("choice required from empty list");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Nothing to choose here. Code uses this to just show a card.
|
ListChooser<T> c = new ListChooser<T>(message, min, max, choices);
|
||||||
public static Card show(final String message, final Card singleChoice) {
|
|
||||||
List<Card> choices = new ArrayList<Card>();
|
|
||||||
choices.add(singleChoice);
|
|
||||||
return one(message, choices);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static <T> List<T> getChoices(final ListChooser<T> c) {
|
|
||||||
final JList list = c.getJList();
|
final JList list = c.getJList();
|
||||||
list.addListSelectionListener(new ListSelectionListener() {
|
list.addListSelectionListener(new ListSelectionListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -142,7 +121,14 @@ public class GuiChoose {
|
|||||||
c.show();
|
c.show();
|
||||||
GuiUtils.clearPanelSelections();
|
GuiUtils.clearPanelSelections();
|
||||||
return c.getSelectedValues();
|
return c.getSelectedValues();
|
||||||
} // getChoice()
|
}
|
||||||
|
|
||||||
|
// Nothing to choose here. Code uses this to just show a card.
|
||||||
|
public static Card show(final String message, final Card singleChoice) {
|
||||||
|
List<Card> choices = new ArrayList<Card>();
|
||||||
|
choices.add(singleChoice);
|
||||||
|
return one(message, choices);
|
||||||
|
}
|
||||||
|
|
||||||
public static <T> List<T> order(final String title, final String top, int remainingObjects,
|
public static <T> List<T> order(final String title, final String top, int remainingObjects,
|
||||||
final List<T> sourceChoices, List<T> destChoices, Card referenceCard) {
|
final List<T> sourceChoices, List<T> destChoices, Card referenceCard) {
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import java.awt.event.MouseEvent;
|
|||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.awt.event.WindowFocusListener;
|
import java.awt.event.WindowFocusListener;
|
||||||
import java.util.AbstractList;
|
import java.util.AbstractList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -84,10 +83,6 @@ public class ListChooser<T> {
|
|||||||
private JOptionPane optionPane;
|
private JOptionPane optionPane;
|
||||||
private Action ok, cancel;
|
private Action ok, cancel;
|
||||||
|
|
||||||
public ListChooser(final String title, final int minChoices, final int maxChoices, final T[] list) {
|
|
||||||
this(title, minChoices, maxChoices, Arrays.asList(list));
|
|
||||||
}
|
|
||||||
|
|
||||||
public ListChooser(final String title, final int minChoices, final int maxChoices, final Collection<T> list) {
|
public ListChooser(final String title, final int minChoices, final int maxChoices, final Collection<T> list) {
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.minChoices = minChoices;
|
this.minChoices = minChoices;
|
||||||
@@ -125,7 +120,7 @@ public class ListChooser<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @return boolean */
|
/** @return boolean */
|
||||||
public synchronized boolean show() {
|
public boolean show() {
|
||||||
return show(list.get(0));
|
return show(list.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +130,7 @@ public class ListChooser<T> {
|
|||||||
* @param index0 index to select when shown
|
* @param index0 index to select when shown
|
||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public synchronized boolean show(T item) {
|
public boolean show(T item) {
|
||||||
if (this.called) {
|
if (this.called) {
|
||||||
throw new IllegalStateException("Already shown");
|
throw new IllegalStateException("Already shown");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ public class ControlWinLose {
|
|||||||
cDeck.getMain().remove(toRemove);
|
cDeck.getMain().remove(toRemove);
|
||||||
if ( cDeck != oDeck )
|
if ( cDeck != oDeck )
|
||||||
oDeck.getMain().remove(toRemove);
|
oDeck.getMain().remove(toRemove);
|
||||||
|
losses.add(toRemove);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user