mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Fixed bazaar refresh bug.
Fixed dialog popup in splash mode.
This commit is contained in:
@@ -2,6 +2,7 @@ package forge.control;
|
|||||||
|
|
||||||
import forge.control.home.ControlConstructed;
|
import forge.control.home.ControlConstructed;
|
||||||
import forge.control.home.ControlDraft;
|
import forge.control.home.ControlDraft;
|
||||||
|
import forge.control.home.ControlQuest;
|
||||||
import forge.control.home.ControlSealed;
|
import forge.control.home.ControlSealed;
|
||||||
import forge.control.home.ControlUtilities;
|
import forge.control.home.ControlUtilities;
|
||||||
import forge.view.ViewHomeUI;
|
import forge.view.ViewHomeUI;
|
||||||
@@ -43,6 +44,11 @@ public class ControlHomeUI {
|
|||||||
return view.getViewSealed().getControl();
|
return view.getViewSealed().getControl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return ControlQuest */
|
||||||
|
public ControlQuest getControlQuest() {
|
||||||
|
return view.getViewQuest().getControl();
|
||||||
|
}
|
||||||
|
|
||||||
/** @return ControlUtilities */
|
/** @return ControlUtilities */
|
||||||
public ControlUtilities getControlUtilities() {
|
public ControlUtilities getControlUtilities() {
|
||||||
return view.getViewUtilities().getControl();
|
return view.getViewUtilities().getControl();
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ public enum FControl {
|
|||||||
public void windowClosing(final WindowEvent e) {
|
public void windowClosing(final WindowEvent e) {
|
||||||
Singletons.getView().setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
Singletons.getView().setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||||
changeState(0);
|
changeState(0);
|
||||||
|
Singletons.getControl().getControlHome().getControlQuest().refreshStats();
|
||||||
Singletons.getView().getViewHome().showQuestMenu();
|
Singletons.getView().getViewHome().showQuestMenu();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -98,6 +99,7 @@ public enum FControl {
|
|||||||
public void initialize() {
|
public void initialize() {
|
||||||
this.shortcuts = KeyboardShortcuts.attachKeyboardShortcuts();
|
this.shortcuts = KeyboardShortcuts.attachKeyboardShortcuts();
|
||||||
this.display = Singletons.getView().getLayeredContentPane();
|
this.display = Singletons.getView().getLayeredContentPane();
|
||||||
|
Singletons.getModel().getQuestEventManager().assembleAllEvents();
|
||||||
|
|
||||||
// Handles resizing in null layouts of layers in JLayeredPane.
|
// Handles resizing in null layouts of layers in JLayeredPane.
|
||||||
Singletons.getView().addComponentListener(new ComponentAdapter() {
|
Singletons.getView().addComponentListener(new ComponentAdapter() {
|
||||||
|
|||||||
@@ -330,10 +330,6 @@ public class ControlConstructed {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String[] getEventNames() {
|
private String[] getEventNames() {
|
||||||
// Probably a better place for this, but it's a time consuming method,
|
|
||||||
// and must be completed before UI is built, and a better spot is hard to find.
|
|
||||||
Singletons.getModel().getQuestEventManager().assembleAllEvents();
|
|
||||||
|
|
||||||
final List<String> eventNames = new ArrayList<String>();
|
final List<String> eventNames = new ArrayList<String>();
|
||||||
eventNames.clear();
|
eventNames.clear();
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class QuestEventManager {
|
|||||||
|
|
||||||
for (final File f : allFiles) {
|
for (final File f : allFiles) {
|
||||||
Map<String, List<String>> contents = SectionUtil.parseSections(FileUtil.readFile(f));
|
Map<String, List<String>> contents = SectionUtil.parseSections(FileUtil.readFile(f));
|
||||||
|
|
||||||
if (contents.containsKey("quest")) {
|
if (contents.containsKey("quest")) {
|
||||||
tempEvent = readChallenge(contents.get("quest"));
|
tempEvent = readChallenge(contents.get("quest"));
|
||||||
this.allChallenges.add((QuestChallenge) tempEvent);
|
this.allChallenges.add((QuestChallenge) tempEvent);
|
||||||
@@ -163,7 +163,7 @@ public class QuestEventManager {
|
|||||||
int eqpos;
|
int eqpos;
|
||||||
String key, value;
|
String key, value;
|
||||||
|
|
||||||
final QuestChallenge qc = new QuestChallenge();
|
final QuestChallenge qc = new QuestChallenge();
|
||||||
// Unique properties
|
// Unique properties
|
||||||
for (final String s : contents) {
|
for (final String s : contents) {
|
||||||
if (StringUtils.isBlank(s)) {
|
if (StringUtils.isBlank(s)) {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public abstract class FolderStorageReader<T extends IHasName> implements IItemRe
|
|||||||
if (null == newDeck) {
|
if (null == newDeck) {
|
||||||
|
|
||||||
String msg = "An object stored in " + file.getPath() + " failed to load.\nPlease submit this as a bug with the mentioned file/directory attached.";
|
String msg = "An object stored in " + file.getPath() + " failed to load.\nPlease submit this as a bug with the mentioned file/directory attached.";
|
||||||
// JOptionPane.showMessageDialog(null, msg); -- This becomes bugged if uncommented, but i need these messages to debug other peoples decks // Max Mtg
|
JOptionPane.showMessageDialog(null, msg); //-- This becomes bugged if uncommented, but i need these messages to debug other peoples decks // Max Mtg
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
result.put(newDeck.getName(), newDeck);
|
result.put(newDeck.getName(), newDeck);
|
||||||
|
|||||||
@@ -17,8 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
package forge.view;
|
package forge.view;
|
||||||
|
|
||||||
import javax.swing.SwingUtilities;
|
|
||||||
|
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.control.FControl;
|
import forge.control.FControl;
|
||||||
import forge.error.ErrorViewer;
|
import forge.error.ErrorViewer;
|
||||||
@@ -61,39 +59,34 @@ public final class Main {
|
|||||||
// Open previous menu on first run, or constructed.
|
// Open previous menu on first run, or constructed.
|
||||||
// Focus is reset when the frame becomes visible,
|
// Focus is reset when the frame becomes visible,
|
||||||
// so the call to show the menu must happen here.
|
// so the call to show the menu must happen here.
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
final ForgePreferences.HomeMenus lastMenu =
|
||||||
@Override
|
ForgePreferences.HomeMenus.valueOf(Singletons.getModel().getPreferences().getPref(FPref.UI_HOMEMENU));
|
||||||
public void run() {
|
|
||||||
final ForgePreferences.HomeMenus lastMenu =
|
|
||||||
ForgePreferences.HomeMenus.valueOf(Singletons.getModel().getPreferences().getPref(FPref.UI_HOMEMENU));
|
|
||||||
|
|
||||||
switch(lastMenu) {
|
switch(lastMenu) {
|
||||||
case draft:
|
case draft:
|
||||||
Singletons.getView().getViewHome().getBtnDraft().grabFocus();
|
Singletons.getView().getViewHome().getBtnDraft().grabFocus();
|
||||||
Singletons.getView().getViewHome().showDraftMenu();
|
Singletons.getView().getViewHome().showDraftMenu();
|
||||||
break;
|
break;
|
||||||
case sealed:
|
case sealed:
|
||||||
Singletons.getView().getViewHome().getBtnSealed().grabFocus();
|
Singletons.getView().getViewHome().getBtnSealed().grabFocus();
|
||||||
Singletons.getView().getViewHome().showSealedMenu();
|
Singletons.getView().getViewHome().showSealedMenu();
|
||||||
break;
|
break;
|
||||||
case quest:
|
case quest:
|
||||||
Singletons.getView().getViewHome().getBtnQuest().grabFocus();
|
Singletons.getView().getViewHome().getBtnQuest().grabFocus();
|
||||||
Singletons.getView().getViewHome().showQuestMenu();
|
Singletons.getView().getViewHome().showQuestMenu();
|
||||||
break;
|
break;
|
||||||
case settings:
|
case settings:
|
||||||
Singletons.getView().getViewHome().getBtnSettings().grabFocus();
|
Singletons.getView().getViewHome().getBtnSettings().grabFocus();
|
||||||
Singletons.getView().getViewHome().showSettingsMenu();
|
Singletons.getView().getViewHome().showSettingsMenu();
|
||||||
break;
|
break;
|
||||||
case utilities:
|
case utilities:
|
||||||
Singletons.getView().getViewHome().getBtnUtilities().grabFocus();
|
Singletons.getView().getViewHome().getBtnUtilities().grabFocus();
|
||||||
Singletons.getView().getViewHome().showUtilitiesMenu();
|
Singletons.getView().getViewHome().showUtilitiesMenu();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Singletons.getView().getViewHome().getBtnConstructed().grabFocus();
|
Singletons.getView().getViewHome().getBtnConstructed().grabFocus();
|
||||||
Singletons.getView().getViewHome().showConstructedMenu();
|
Singletons.getView().getViewHome().showConstructedMenu();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (final Throwable exn) {
|
} catch (final Throwable exn) {
|
||||||
ErrorViewer.showError(exn);
|
ErrorViewer.showError(exn);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -307,6 +307,11 @@ public class ViewHomeUI extends FPanel {
|
|||||||
return this.sealed;
|
return this.sealed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return {@link forge.view.home.ViewQuest} */
|
||||||
|
public ViewQuest getViewQuest() {
|
||||||
|
return this.quest;
|
||||||
|
}
|
||||||
|
|
||||||
/** @return {@link forge.view.home.ViewSettings} */
|
/** @return {@link forge.view.home.ViewSettings} */
|
||||||
public ViewSettings getViewSettings() {
|
public ViewSettings getViewSettings() {
|
||||||
return this.settings;
|
return this.settings;
|
||||||
|
|||||||
Reference in New Issue
Block a user