Fixed bazaar refresh bug.

Fixed dialog popup in splash mode.
This commit is contained in:
Doublestrike
2012-02-21 12:42:32 +00:00
parent 985b0a1b5b
commit daa9f63a16
7 changed files with 43 additions and 41 deletions

View File

@@ -2,6 +2,7 @@ package forge.control;
import forge.control.home.ControlConstructed;
import forge.control.home.ControlDraft;
import forge.control.home.ControlQuest;
import forge.control.home.ControlSealed;
import forge.control.home.ControlUtilities;
import forge.view.ViewHomeUI;
@@ -43,6 +44,11 @@ public class ControlHomeUI {
return view.getViewSealed().getControl();
}
/** @return ControlQuest */
public ControlQuest getControlQuest() {
return view.getViewQuest().getControl();
}
/** @return ControlUtilities */
public ControlUtilities getControlUtilities() {
return view.getViewUtilities().getControl();

View File

@@ -82,6 +82,7 @@ public enum FControl {
public void windowClosing(final WindowEvent e) {
Singletons.getView().setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
changeState(0);
Singletons.getControl().getControlHome().getControlQuest().refreshStats();
Singletons.getView().getViewHome().showQuestMenu();
}
};
@@ -98,6 +99,7 @@ public enum FControl {
public void initialize() {
this.shortcuts = KeyboardShortcuts.attachKeyboardShortcuts();
this.display = Singletons.getView().getLayeredContentPane();
Singletons.getModel().getQuestEventManager().assembleAllEvents();
// Handles resizing in null layouts of layers in JLayeredPane.
Singletons.getView().addComponentListener(new ComponentAdapter() {

View File

@@ -330,10 +330,6 @@ public class ControlConstructed {
}
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>();
eventNames.clear();

View File

@@ -90,7 +90,7 @@ public abstract class FolderStorageReader<T extends IHasName> implements IItemRe
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.";
// 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;
}
result.put(newDeck.getName(), newDeck);

View File

@@ -17,8 +17,6 @@
*/
package forge.view;
import javax.swing.SwingUtilities;
import forge.Singletons;
import forge.control.FControl;
import forge.error.ErrorViewer;
@@ -61,39 +59,34 @@ public final class Main {
// Open previous menu on first run, or constructed.
// Focus is reset when the frame becomes visible,
// so the call to show the menu must happen here.
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
final ForgePreferences.HomeMenus lastMenu =
ForgePreferences.HomeMenus.valueOf(Singletons.getModel().getPreferences().getPref(FPref.UI_HOMEMENU));
final ForgePreferences.HomeMenus lastMenu =
ForgePreferences.HomeMenus.valueOf(Singletons.getModel().getPreferences().getPref(FPref.UI_HOMEMENU));
switch(lastMenu) {
case draft:
Singletons.getView().getViewHome().getBtnDraft().grabFocus();
Singletons.getView().getViewHome().showDraftMenu();
break;
case sealed:
Singletons.getView().getViewHome().getBtnSealed().grabFocus();
Singletons.getView().getViewHome().showSealedMenu();
break;
case quest:
Singletons.getView().getViewHome().getBtnQuest().grabFocus();
Singletons.getView().getViewHome().showQuestMenu();
break;
case settings:
Singletons.getView().getViewHome().getBtnSettings().grabFocus();
Singletons.getView().getViewHome().showSettingsMenu();
break;
case utilities:
Singletons.getView().getViewHome().getBtnUtilities().grabFocus();
Singletons.getView().getViewHome().showUtilitiesMenu();
break;
default:
Singletons.getView().getViewHome().getBtnConstructed().grabFocus();
Singletons.getView().getViewHome().showConstructedMenu();
}
}
});
switch(lastMenu) {
case draft:
Singletons.getView().getViewHome().getBtnDraft().grabFocus();
Singletons.getView().getViewHome().showDraftMenu();
break;
case sealed:
Singletons.getView().getViewHome().getBtnSealed().grabFocus();
Singletons.getView().getViewHome().showSealedMenu();
break;
case quest:
Singletons.getView().getViewHome().getBtnQuest().grabFocus();
Singletons.getView().getViewHome().showQuestMenu();
break;
case settings:
Singletons.getView().getViewHome().getBtnSettings().grabFocus();
Singletons.getView().getViewHome().showSettingsMenu();
break;
case utilities:
Singletons.getView().getViewHome().getBtnUtilities().grabFocus();
Singletons.getView().getViewHome().showUtilitiesMenu();
break;
default:
Singletons.getView().getViewHome().getBtnConstructed().grabFocus();
Singletons.getView().getViewHome().showConstructedMenu();
}
} catch (final Throwable exn) {
ErrorViewer.showError(exn);
}

View File

@@ -307,6 +307,11 @@ public class ViewHomeUI extends FPanel {
return this.sealed;
}
/** @return {@link forge.view.home.ViewQuest} */
public ViewQuest getViewQuest() {
return this.quest;
}
/** @return {@link forge.view.home.ViewSettings} */
public ViewSettings getViewSettings() {
return this.settings;