mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Quest mode 95% finished - MVC, checkstyle, debug.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -10749,6 +10749,7 @@ src/main/java/forge/control/ControlHomeUI.java -text
|
||||
src/main/java/forge/control/ControlMatchUI.java -text
|
||||
src/main/java/forge/control/ControlWinLose.java -text
|
||||
src/main/java/forge/control/home/ControlConstructed.java -text
|
||||
src/main/java/forge/control/home/ControlQuest.java -text
|
||||
src/main/java/forge/control/match/ControlDetail.java -text
|
||||
src/main/java/forge/control/match/ControlDock.java -text
|
||||
src/main/java/forge/control/match/ControlField.java -text
|
||||
|
||||
@@ -26,8 +26,7 @@ import forge.view.GuiTopLevel;
|
||||
import forge.view.home.ViewConstructed;
|
||||
|
||||
/**
|
||||
* Controls logic and listeners for "constructed" deck options
|
||||
* in home screen.
|
||||
* Controls logic and listeners for Constructed mode in home screen.
|
||||
*
|
||||
*/
|
||||
public class ControlConstructed {
|
||||
@@ -42,8 +41,7 @@ public class ControlConstructed {
|
||||
|
||||
/**
|
||||
*
|
||||
* Controls logic and listeners for "constructed" deck options
|
||||
* in home screen.
|
||||
* Controls logic and listeners for "constructed" mode in home screen.
|
||||
*
|
||||
* @param v0   ViewConstructed
|
||||
*/
|
||||
@@ -421,20 +419,20 @@ public class ControlConstructed {
|
||||
* Array of color selections present in list boxes. Values
|
||||
* correspond to colorVals hash map.
|
||||
*
|
||||
* @return String[]
|
||||
* @return Object[]
|
||||
*/
|
||||
// Four randoms are included which should cover all possibilities.
|
||||
public String[] getColorNames() {
|
||||
return new String[] {"Random", "Random", "Random",
|
||||
public Object[] getColorNames() {
|
||||
return new Object[] {"Random", "Random", "Random",
|
||||
"Random", "Black", "Blue", "Green", "Red", "White"};
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of theme names, usually used in list boxes.
|
||||
*
|
||||
* @return String[]
|
||||
* @return Object[]
|
||||
*/
|
||||
public String[] getThemeNames() {
|
||||
public Object[] getThemeNames() {
|
||||
themeNames = new ArrayList<String>();
|
||||
themeNames.add("Random");
|
||||
for (String s : GenerateThemeDeck.getThemeNames()) {
|
||||
@@ -443,15 +441,15 @@ public class ControlConstructed {
|
||||
// No theme decks?
|
||||
if (themeNames.size() == 1) { themeNames = new ArrayList<String>(); }
|
||||
|
||||
return oa2sa(themeNames.toArray());
|
||||
return themeNames.toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of pre-constructed deck names, usually used in list boxes.
|
||||
*
|
||||
* @return String[]
|
||||
* @return Object[]
|
||||
*/
|
||||
public String[] getDeckNames() {
|
||||
public Object[] getDeckNames() {
|
||||
deckNames = new ArrayList<String>();
|
||||
deckNames.add("Random");
|
||||
Collection<Deck> allDecks = AllZone.getDeckManager().getDecks();
|
||||
@@ -463,6 +461,6 @@ public class ControlConstructed {
|
||||
// No pre-constructed decks?
|
||||
if (deckNames.size() == 1) { deckNames = new ArrayList<String>(); }
|
||||
|
||||
return oa2sa(deckNames.toArray());
|
||||
return deckNames.toArray();
|
||||
}
|
||||
}
|
||||
|
||||
167
src/main/java/forge/control/home/ControlQuest.java
Normal file
167
src/main/java/forge/control/home/ControlQuest.java
Normal file
@@ -0,0 +1,167 @@
|
||||
package forge.control.home;
|
||||
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import forge.AllZone;
|
||||
import forge.Command;
|
||||
import forge.Constant;
|
||||
import forge.gui.deckeditor.DeckEditorQuest;
|
||||
import forge.gui.deckeditor.DeckEditorShop;
|
||||
import forge.quest.data.QuestData;
|
||||
import forge.quest.data.QuestUtil;
|
||||
import forge.quest.gui.QuestFrame;
|
||||
import forge.quest.gui.bazaar.QuestBazaarPanel;
|
||||
import forge.view.GuiTopLevel;
|
||||
import forge.view.home.ViewQuest;
|
||||
|
||||
/**
|
||||
* Controls logic and listeners for Quest mode in home screen.
|
||||
*
|
||||
*/
|
||||
public class ControlQuest {
|
||||
private ViewQuest view;
|
||||
|
||||
/**
|
||||
* Controls logic and listeners for quest mode in home screen.
|
||||
*
|
||||
* @param v0   ViewQuest
|
||||
*/
|
||||
public ControlQuest(ViewQuest v0) {
|
||||
this.view = v0;
|
||||
|
||||
updateDeckList();
|
||||
}
|
||||
|
||||
/** @return ViewQuest */
|
||||
public ViewQuest getView() {
|
||||
return view;
|
||||
}
|
||||
|
||||
/** */
|
||||
private void updateDeckList() {
|
||||
view.getLstDeckChooser().setListData(AllZone.getQuestData().getDeckNames().toArray());
|
||||
view.getLstDeckChooser().setSelectedIndex(0);
|
||||
}
|
||||
|
||||
/** */
|
||||
public void showDeckEditor() {
|
||||
final Command exit = new Command() {
|
||||
private static final long serialVersionUID = -5110231879431074581L;
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
// saves all deck data
|
||||
AllZone.getQuestData().saveData();
|
||||
updateDeckList();
|
||||
}
|
||||
};
|
||||
|
||||
DeckEditorQuest g = new DeckEditorQuest(AllZone.getQuestData());
|
||||
g.show(exit);
|
||||
g.setVisible(true);
|
||||
}
|
||||
|
||||
/** */
|
||||
public void showCardShop() {
|
||||
final Command exit = new Command() {
|
||||
private static final long serialVersionUID = 8567193482568076362L;
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
// saves all deck data
|
||||
AllZone.getQuestData().saveData();
|
||||
}
|
||||
};
|
||||
|
||||
DeckEditorShop g = new DeckEditorShop(AllZone.getQuestData());
|
||||
g.show(exit);
|
||||
g.setVisible(true);
|
||||
}
|
||||
|
||||
/** */
|
||||
// Since QuestBazaarPanel is not in a JFrame for some reason, one
|
||||
// must be created here. Later, this will be integrated into the
|
||||
// top level UI. Doublestrike 11-12-11.
|
||||
public void showBazaar() {
|
||||
QuestFrame f = new QuestFrame();
|
||||
f.getContentPane().add(new QuestBazaarPanel(f));
|
||||
f.setVisible(true);
|
||||
|
||||
f.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosed(WindowEvent e) {
|
||||
AllZone.getQuestData().saveData();
|
||||
}
|
||||
});
|
||||
} // card shop button
|
||||
|
||||
/**
|
||||
* The actuator for new quests.
|
||||
*/
|
||||
public void newQuest() {
|
||||
int difficulty = 0;
|
||||
QuestData questData = AllZone.getQuestData();
|
||||
|
||||
final String mode = view.getRadFantasy().isSelected() ? forge.quest.data.QuestData.FANTASY
|
||||
: forge.quest.data.QuestData.REALISTIC;
|
||||
|
||||
if (view.getRadEasy().isSelected()) {
|
||||
difficulty = 0;
|
||||
} else if (view.getRadMedium().isSelected()) {
|
||||
difficulty = 1;
|
||||
} else if (view.getRadHard().isSelected()) {
|
||||
difficulty = 2;
|
||||
} else if (view.getRadExpert().isSelected()) {
|
||||
difficulty = 3;
|
||||
} else {
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"Please select a difficulty.",
|
||||
"New Quest: Difficulty?", JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (questData.hasSaveFile()) {
|
||||
// this will overwrite your save file!
|
||||
final Object[] possibleValues = { "Yes", "No" };
|
||||
final Object choice = JOptionPane.showOptionDialog(null,
|
||||
"Starting a new quest will overwrite your current quest. Continue?", "Start New Quest?",
|
||||
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, possibleValues, possibleValues[1]);
|
||||
|
||||
if (!choice.equals(0)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// give the user a few cards to build a deck
|
||||
questData.newGame(difficulty, mode, view.getCbStandardStart().isSelected());
|
||||
|
||||
questData.saveData();
|
||||
|
||||
// set global variable
|
||||
AllZone.setQuestData(questData);
|
||||
view.getParentView().resetQuest();
|
||||
}
|
||||
|
||||
/** */
|
||||
public void start() {
|
||||
QuestData questData = AllZone.getQuestData();
|
||||
|
||||
Constant.Runtime.HUMAN_DECK[0] = questData.getDeck((String) view.getLstDeckChooser().getSelectedValue());
|
||||
Constant.Runtime.COMPUTER_DECK[0] = view.getSelectedOpponent().getEvent().getEventDeck();
|
||||
|
||||
AllZone.setQuestEvent(view.getSelectedOpponent().getEvent());
|
||||
|
||||
GuiTopLevel g = (GuiTopLevel) AllZone.getDisplay();
|
||||
g.getController().changeState(1);
|
||||
g.getController().getMatchController().initMatch();
|
||||
|
||||
AllZone.getGameAction().newGame(
|
||||
Constant.Runtime.HUMAN_DECK[0], Constant.Runtime.COMPUTER_DECK[0],
|
||||
QuestUtil.getHumanStartingCards(questData),
|
||||
QuestUtil.getComputerStartingCards(questData),
|
||||
questData.getLife(), 20, null);
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@ import javax.swing.JPanel;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import forge.AllZone;
|
||||
import forge.quest.data.QuestDataIO;
|
||||
import forge.view.toolbox.FButton;
|
||||
import forge.view.toolbox.FPanel;
|
||||
import forge.view.toolbox.FRoundedPanel;
|
||||
@@ -62,7 +61,6 @@ public class HomeTopLevel extends FPanel {
|
||||
super();
|
||||
skin = AllZone.getSkin();
|
||||
imgDirAddress = "res/images/ui/HomeScreen/default_600/";
|
||||
AllZone.setQuestData(QuestDataIO.loadData());
|
||||
|
||||
constructed = new ViewConstructed(this);
|
||||
sealed = new ViewSealed(this);
|
||||
@@ -229,4 +227,10 @@ public class HomeTopLevel extends FPanel {
|
||||
btnSettings.setToggled(false);
|
||||
btnUtilities.setToggled(false);
|
||||
}
|
||||
|
||||
/** */
|
||||
public void resetQuest() {
|
||||
quest = new ViewQuest(this);
|
||||
quest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import forge.control.home.ControlConstructed;
|
||||
import forge.view.toolbox.FSkin;
|
||||
|
||||
/**
|
||||
* Populates and controls Swing components of "constructed" options in home screen.
|
||||
* Populates Swing components of Constructed mode in home screen.
|
||||
*
|
||||
*/
|
||||
// Control (listeners and logic) could possibly be moved to a new class (ControlConstructed).
|
||||
@@ -39,7 +39,8 @@ public class ViewConstructed extends JPanel {
|
||||
private ControlConstructed control;
|
||||
|
||||
/**
|
||||
* Assembles Swing components for "constructed" view in home screen.
|
||||
* Populates Swing components of "constructed" mode in home screen.
|
||||
*
|
||||
* @param v0   HomeTopLevel parent view
|
||||
*/
|
||||
public ViewConstructed(HomeTopLevel v0) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.ButtonGroup;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JLabel;
|
||||
@@ -22,27 +23,22 @@ import javax.swing.border.MatteBorder;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import forge.AllZone;
|
||||
import forge.Command;
|
||||
import forge.Constant;
|
||||
import forge.control.home.ControlQuest;
|
||||
import forge.gui.GuiUtils;
|
||||
import forge.gui.MultiLineLabel;
|
||||
import forge.gui.MultiLineLabelUI;
|
||||
import forge.gui.deckeditor.DeckEditorQuest;
|
||||
import forge.properties.ForgeProps;
|
||||
import forge.properties.NewConstants;
|
||||
import forge.quest.data.QuestData;
|
||||
import forge.quest.data.QuestUtil;
|
||||
import forge.quest.gui.QuestFrame;
|
||||
import forge.quest.data.QuestDataIO;
|
||||
import forge.quest.gui.main.QuestChallenge;
|
||||
import forge.quest.gui.main.QuestDuel;
|
||||
import forge.quest.gui.main.QuestEvent;
|
||||
import forge.quest.gui.main.QuestEventManager;
|
||||
import forge.view.GuiTopLevel;
|
||||
import forge.view.toolbox.FButton;
|
||||
import forge.view.toolbox.FSkin;
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for this type.
|
||||
* Populates Swing components of Quest mode in home screen.
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@@ -54,19 +50,26 @@ public class ViewQuest extends JScrollPane {
|
||||
private JPanel viewport;
|
||||
private SelectablePanel selectedOpponent;
|
||||
private JList lstDeckChooser;
|
||||
private ControlQuest control;
|
||||
private JRadioButton radEasy, radMedium, radHard, radExpert, radFantasy, radClassic;
|
||||
private JCheckBox cbStandardStart;
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for Constructor.
|
||||
* Populates Swing components of Quest mode in home screen.
|
||||
*
|
||||
* @param v0   HomeTopLevel parent view
|
||||
*/
|
||||
public ViewQuest(HomeTopLevel v0) {
|
||||
// Basic init stuff
|
||||
super(VERTICAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
AllZone.setQuestData(QuestDataIO.loadData());
|
||||
this.setOpaque(false);
|
||||
this.setBorder(null);
|
||||
parentView = v0;
|
||||
skin = AllZone.getSkin();
|
||||
questData = AllZone.getQuestData();
|
||||
|
||||
// Panel is dropped into scroll pane for resize safety.
|
||||
viewport = new JPanel();
|
||||
viewport.setOpaque(false);
|
||||
viewport.setLayout(new MigLayout("insets 0, gap 0, wrap"));
|
||||
@@ -78,8 +81,10 @@ public class ViewQuest extends JScrollPane {
|
||||
lblContinue.setFont(skin.getFont1().deriveFont(Font.BOLD, 20));
|
||||
viewport.add(lblContinue, "w 90%!, gap 5% 0 2% 0");
|
||||
|
||||
// Quest events and options
|
||||
// Quest events
|
||||
populateQuestEvents();
|
||||
|
||||
// Quest options
|
||||
populateQuestOptions();
|
||||
|
||||
// Start button
|
||||
@@ -94,15 +99,20 @@ public class ViewQuest extends JScrollPane {
|
||||
|
||||
btnStart.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) { start(); }
|
||||
public void mousePressed(MouseEvent e) { control.start(); }
|
||||
});
|
||||
|
||||
// New Quest
|
||||
populateNewQuest();
|
||||
|
||||
// Drop into scroll pane, init controller.
|
||||
this.setViewportView(viewport);
|
||||
control = new ControlQuest(this);
|
||||
}
|
||||
|
||||
//========= POPULATION METHODS
|
||||
//...mainly here to avoid one big lump of a constructor.
|
||||
|
||||
private void populateQuestEvents() {
|
||||
// Retrieve quest events, or generate (on first run)
|
||||
this.qem = AllZone.getQuestEventManager();
|
||||
@@ -162,20 +172,51 @@ public class ViewQuest extends JScrollPane {
|
||||
btnEditor.setAction(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
showDeckEditor();
|
||||
control.showDeckEditor();
|
||||
}
|
||||
});
|
||||
btnEditor.setText("Deck Editor");
|
||||
|
||||
String[] decks = objectArrayToStringArray(questData.getDeckNames().toArray());
|
||||
lstDeckChooser = new JList(decks);
|
||||
lstDeckChooser.setSelectedIndex(0);
|
||||
SubButton btnCardShop = new SubButton("");
|
||||
btnCardShop.setAction(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
control.showCardShop();
|
||||
}
|
||||
});
|
||||
btnCardShop.setText("Card Shop");
|
||||
|
||||
optionsContainer.add(btnEditor, "w 30%, h 30px!, gapleft 15%, gapbottom 3px");
|
||||
optionsContainer.add(new OptionsCheckBox("Summon Pet"), "w 30%, h 33px!, gapleft 5%, wrap");
|
||||
optionsContainer.add(lstDeckChooser, "w 30%, h 60px!, gapleft 15%, span 1 2");
|
||||
optionsContainer.add(new OptionsCheckBox("Summon Wall"), "w 30%, h 30px!, gapleft 5%, wrap");
|
||||
optionsContainer.add(new OptionsCheckBox("Launch Zeppelin"), "w 30%, h 30px!, gapleft 5%, wrap");
|
||||
SubButton btnBazaar = new SubButton("");
|
||||
btnBazaar.setAction(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
control.showBazaar();
|
||||
}
|
||||
});
|
||||
btnBazaar.setText("Bazaar");
|
||||
|
||||
OptionsCheckBox cbPet = new OptionsCheckBox("Summon Pet");
|
||||
OptionsCheckBox cbWall = new OptionsCheckBox("Summon Wall");
|
||||
OptionsCheckBox cbZep = new OptionsCheckBox("Launch Zeppelin");
|
||||
|
||||
lstDeckChooser = new JList();
|
||||
|
||||
optionsContainer.add(btnEditor, "w 30%, h 30px!, gapleft 5%, gapright 5%, gapbottom 5px");
|
||||
optionsContainer.add(cbPet, "w 25%, h 30px!, ax center");
|
||||
optionsContainer.add(btnCardShop, "w 25%, h 30px!, gapleft 5%, wrap");
|
||||
|
||||
optionsContainer.add(new JScrollPane(lstDeckChooser), "w 30%, h 60px!, gapleft 5%, gapright 5%, span 1 2");
|
||||
optionsContainer.add(cbWall, "w 25%, h 30px!, ax center, gapbottom 5px, wrap");
|
||||
|
||||
optionsContainer.add(cbZep, "w 25%, h 30px!");
|
||||
optionsContainer.add(btnBazaar, "w 25%, h 30px!, gapleft 5%, wrap");
|
||||
|
||||
if (!questData.isFantasy()) {
|
||||
cbPet.setVisible(false);
|
||||
cbWall.setVisible(false);
|
||||
cbZep.setVisible(false);
|
||||
btnBazaar.setVisible(false);
|
||||
}
|
||||
|
||||
viewport.add(optionsContainer, "w 90%, gap 5% 0 1% 1%");
|
||||
}
|
||||
@@ -195,16 +236,37 @@ public class ViewQuest extends JScrollPane {
|
||||
lblNotes.setForeground(skin.getColor("text"));
|
||||
viewport.add(lblNotes, "w 90%, gapleft 5%");
|
||||
|
||||
JRadioButton radEasy = new OptionsRadio("Easy - 50 games");
|
||||
JRadioButton radMedium = new OptionsRadio("Medium - 100 games");
|
||||
JRadioButton radHard = new OptionsRadio("Hard - 150 games");
|
||||
JRadioButton radExpert = new OptionsRadio("Expert - 200 games");
|
||||
radEasy = new OptionsRadio("Easy - 50 games");
|
||||
radMedium = new OptionsRadio("Medium - 100 games");
|
||||
radHard = new OptionsRadio("Hard - 150 games");
|
||||
radExpert = new OptionsRadio("Expert - 200 games");
|
||||
|
||||
JRadioButton radFantasy = new OptionsRadio("Fantasy");
|
||||
JRadioButton radClassic = new OptionsRadio("Classic");
|
||||
JCheckBox cbStandardStart = new OptionsCheckBox("Standard (Type 2) Starting Pool");
|
||||
ButtonGroup group1 = new ButtonGroup();
|
||||
group1.add(radEasy);
|
||||
group1.add(radMedium);
|
||||
group1.add(radHard);
|
||||
group1.add(radExpert);
|
||||
|
||||
FButton btnEmbark = new FButton("Embark!");
|
||||
radFantasy = new OptionsRadio("Fantasy");
|
||||
radClassic = new OptionsRadio("Classic");
|
||||
|
||||
radEasy.setSelected(true);
|
||||
radClassic.setSelected(true);
|
||||
|
||||
ButtonGroup group2 = new ButtonGroup();
|
||||
group2.add(radFantasy);
|
||||
group2.add(radClassic);
|
||||
|
||||
cbStandardStart = new OptionsCheckBox("Standard (Type 2) Starting Pool");
|
||||
|
||||
SubButton btnEmbark = new SubButton("");
|
||||
btnEmbark.setAction(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
control.newQuest();
|
||||
}
|
||||
});
|
||||
btnEmbark.setText("Embark!");
|
||||
|
||||
JPanel optionsContainer = new JPanel();
|
||||
optionsContainer.setOpaque(false);
|
||||
@@ -224,10 +286,7 @@ public class ViewQuest extends JScrollPane {
|
||||
viewport.add(optionsContainer, "w 100%!, gaptop 2%");
|
||||
}
|
||||
|
||||
/** @return HomeTopLevel */
|
||||
public HomeTopLevel getParentView() {
|
||||
return parentView;
|
||||
}
|
||||
//========= CUSTOM CLASSES
|
||||
|
||||
/** Consolidates radio button styling in one place. */
|
||||
private class OptionsRadio extends JRadioButton {
|
||||
@@ -247,26 +306,11 @@ public class ViewQuest extends JScrollPane {
|
||||
}
|
||||
}
|
||||
|
||||
private void start() {
|
||||
Constant.Runtime.HUMAN_DECK[0] = this.questData.getDeck((String) lstDeckChooser.getSelectedValue());
|
||||
Constant.Runtime.COMPUTER_DECK[0] = this.selectedOpponent.getEvent().getEventDeck();
|
||||
|
||||
AllZone.setQuestEvent(this.selectedOpponent.getEvent());
|
||||
|
||||
GuiTopLevel g = (GuiTopLevel) AllZone.getDisplay();
|
||||
g.getController().changeState(1);
|
||||
g.getController().getMatchController().initMatch();
|
||||
|
||||
AllZone.getGameAction().newGame(
|
||||
Constant.Runtime.HUMAN_DECK[0], Constant.Runtime.COMPUTER_DECK[0],
|
||||
QuestUtil.getHumanStartingCards(this.questData),
|
||||
QuestUtil.getComputerStartingCards(this.questData),
|
||||
this.questData.getLife(), 20, null);
|
||||
}
|
||||
|
||||
private class SelectablePanel extends JPanel {
|
||||
/** Selectable panels for duels and challenges. */
|
||||
public class SelectablePanel extends JPanel {
|
||||
private QuestEvent event;
|
||||
|
||||
/** @param e0   QuestEvent */
|
||||
public SelectablePanel(QuestEvent e0) {
|
||||
super();
|
||||
setBorder(new LineBorder(skin.getColor("borders"), 1));
|
||||
@@ -325,38 +369,66 @@ public class ViewQuest extends JScrollPane {
|
||||
this.add(lblDesc, " h 35px!, w 80%!, gap 1% 0 0 5px");
|
||||
}
|
||||
|
||||
/** @return QuestEvent */
|
||||
public QuestEvent getEvent() {
|
||||
return event;
|
||||
}
|
||||
}
|
||||
|
||||
private String[] objectArrayToStringArray(Object[] o0) {
|
||||
String[] output = new String[o0.length];
|
||||
//========= RETRIEVAL FUNCTIONS
|
||||
|
||||
for (int i = 0; i < o0.length; i++) {
|
||||
output[i] = o0[i].toString();
|
||||
/** @return JList */
|
||||
public JList getLstDeckChooser() {
|
||||
return lstDeckChooser;
|
||||
}
|
||||
|
||||
return output;
|
||||
/** @return JRadioButton */
|
||||
public JRadioButton getRadEasy() {
|
||||
return radEasy;
|
||||
}
|
||||
|
||||
/** */
|
||||
final void showDeckEditor() {
|
||||
final Command exit = new Command() {
|
||||
private static final long serialVersionUID = -5110231879431074581L;
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
// saves all deck data
|
||||
AllZone.getQuestData().saveData();
|
||||
|
||||
new QuestFrame();
|
||||
/** @return JRadioButton */
|
||||
public JRadioButton getRadMedium() {
|
||||
return radMedium;
|
||||
}
|
||||
};
|
||||
|
||||
final DeckEditorQuest g = new DeckEditorQuest(AllZone.getQuestData());
|
||||
/** @return JRadioButton */
|
||||
public JRadioButton getRadHard() {
|
||||
return radHard;
|
||||
}
|
||||
|
||||
g.show(exit);
|
||||
g.setVisible(true);
|
||||
} // deck editor button
|
||||
/** @return JRadioButton */
|
||||
public JRadioButton getRadExpert() {
|
||||
return radExpert;
|
||||
}
|
||||
|
||||
/** @return JRadioButton */
|
||||
public JRadioButton getRadFantasy() {
|
||||
return radFantasy;
|
||||
}
|
||||
|
||||
/** @return JRadioButton */
|
||||
public JRadioButton getRadClassic() {
|
||||
return radClassic;
|
||||
}
|
||||
|
||||
/** @return JCheckBox */
|
||||
public JCheckBox getCbStandardStart() {
|
||||
return cbStandardStart;
|
||||
}
|
||||
|
||||
/** @return SelectablePanel */
|
||||
public SelectablePanel getSelectedOpponent() {
|
||||
return selectedOpponent;
|
||||
}
|
||||
|
||||
/** @return HomeTopLevel */
|
||||
public HomeTopLevel getParentView() {
|
||||
return parentView;
|
||||
}
|
||||
|
||||
/** @return ControlQuest */
|
||||
public ControlQuest getController() {
|
||||
return control;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user