mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Fixed NPE when launcing quest with no pets.
Game options are now stored on new game launch and are synced with main game.
This commit is contained in:
@@ -229,11 +229,11 @@ public class QuestMainPanel extends QuestAbstractPanel {
|
|||||||
optionsPanel = new JPanel();
|
optionsPanel = new JPanel();
|
||||||
optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.Y_AXIS));
|
optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.Y_AXIS));
|
||||||
|
|
||||||
optionsPanel.add(this.devModeCheckBox);
|
|
||||||
optionsPanel.add(Box.createVerticalStrut(5));
|
|
||||||
optionsPanel.add(this.newGUICheckbox);
|
optionsPanel.add(this.newGUICheckbox);
|
||||||
optionsPanel.add(Box.createVerticalStrut(5));
|
optionsPanel.add(Box.createVerticalStrut(5));
|
||||||
optionsPanel.add(this.smoothLandCheckBox);
|
optionsPanel.add(this.smoothLandCheckBox);
|
||||||
|
optionsPanel.add(Box.createVerticalStrut(5));
|
||||||
|
optionsPanel.add(this.devModeCheckBox);
|
||||||
optionsPanel.setBorder(new TitledBorder(new EtchedBorder(), "Options"));
|
optionsPanel.setBorder(new TitledBorder(new EtchedBorder(), "Options"));
|
||||||
return optionsPanel;
|
return optionsPanel;
|
||||||
}
|
}
|
||||||
@@ -351,7 +351,11 @@ public class QuestMainPanel extends QuestAbstractPanel {
|
|||||||
|
|
||||||
void refresh() {
|
void refresh() {
|
||||||
QuestData.saveData(AllZone.QuestData);
|
QuestData.saveData(AllZone.QuestData);
|
||||||
|
|
||||||
|
devModeCheckBox.setSelected(Constant.Runtime.DevMode[0]);
|
||||||
|
smoothLandCheckBox.setSelected(Constant.Runtime.Smooth[0]);
|
||||||
|
newGUICheckbox.setSelected(Gui_NewGame.preferences.newGui);
|
||||||
|
|
||||||
creditsLabel.setText(" " + questData.getCredits());
|
creditsLabel.setText(" " + questData.getCredits());
|
||||||
statsLabel.setText(questData.getWin() + " wins / " + questData.getLost() + " losses");
|
statsLabel.setText(questData.getWin() + " wins / " + questData.getLost() + " losses");
|
||||||
titleLabel.setText(questData.getRank());
|
titleLabel.setText(questData.getRank());
|
||||||
@@ -411,7 +415,7 @@ public class QuestMainPanel extends QuestAbstractPanel {
|
|||||||
petCheckBox.setEnabled(false);
|
petCheckBox.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (questData.getSelectedPet().equals("")) {
|
if (questData.getSelectedPet() == null || questData.getSelectedPet().equals("")) {
|
||||||
petCheckBox.setSelected(false);
|
petCheckBox.setSelected(false);
|
||||||
petComboBox.setEnabled(false);
|
petComboBox.setEnabled(false);
|
||||||
}
|
}
|
||||||
@@ -511,6 +515,9 @@ public class QuestMainPanel extends QuestAbstractPanel {
|
|||||||
else {
|
else {
|
||||||
AllZone.Display = new GuiDisplay3();
|
AllZone.Display = new GuiDisplay3();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gui_NewGame.preferences.newGui = newGUICheckbox.isSelected();
|
||||||
|
|
||||||
Constant.Runtime.Smooth[0] = smoothLandCheckBox.isSelected();
|
Constant.Runtime.Smooth[0] = smoothLandCheckBox.isSelected();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user