Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions forge-gui-desktop/src/main/java/forge/control/FControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import forge.model.FModel;
import forge.sound.SoundSystem;
import forge.screens.deckeditor.CDeckEditorUI;
import forge.screens.home.welcome.WelcomeWizardDialog;
import forge.toolbox.FOptionPane;
import forge.toolbox.FSkin;
import forge.util.BuildInfo;
Expand Down Expand Up @@ -299,6 +300,7 @@ public void componentMoved(final ComponentEvent e) {
setGlobalKeyboardHandler();
FView.SINGLETON_INSTANCE.setSplashProgessBarMessage(getLocalizer().getMessage("lblOpeningMainWindow"));
SwingUtilities.invokeLater(() -> Singletons.getView().initialize());
SwingUtilities.invokeLater(WelcomeWizardDialog::maybeShow);
}

public boolean isSnapshot() {
Expand Down
9 changes: 9 additions & 0 deletions forge-gui-desktop/src/main/java/forge/menus/HelpMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import forge.error.ExceptionHandler;
import forge.localinstance.properties.ForgeConstants;
import forge.screens.home.welcome.WelcomeWizardDialog;
import forge.toolbox.FOptionPane;
import forge.util.BuildInfo;
import forge.util.FileUtil;
Expand All @@ -30,6 +31,7 @@ public static JMenu getMenu() {
menu.add(getMenu_GettingStarted());
menu.add(getMenu_Troubleshooting());
menu.add(getMenuItem_KeyboardShortcuts());
menu.add(getMenuItem_ReplayWelcomeWizard());
menu.addSeparator();
menu.add(getMenuItem_ReleaseNotes());
menu.add(getMenuItem_License());
Expand Down Expand Up @@ -77,6 +79,13 @@ private static JMenuItem getMenuItem_KeyboardShortcuts() {
return menuItem;
}

private static JMenuItem getMenuItem_ReplayWelcomeWizard() {
final Localizer localizer = Localizer.getInstance();
JMenuItem menuItem = new JMenuItem(localizer.getMessage("btnReplayWelcomeWizard"));
menuItem.addActionListener(e -> WelcomeWizardDialog.replay());
return menuItem;
}

private static JMenuItem getMenuItem_HowToPlayFile() {
final Localizer localizer = Localizer.getInstance();
JMenuItem menuItem = new JMenuItem(localizer.getMessage("lblHowtoPlay"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import forge.player.GamePlayerUtil;
import forge.screens.deckeditor.CDeckEditorUI;
import forge.screens.deckeditor.controllers.CEditorTokenViewer;
import forge.screens.home.welcome.WelcomeWizardDialog;
import forge.sound.MusicPlaylist;
import forge.sound.SoundSystem;
import forge.toolbox.FComboBox;
Expand Down Expand Up @@ -180,6 +181,8 @@ public void initialize() {

view.getBtnReset().setCommand((UiCommand) CSubmenuPreferences.this::resetForgeSettingsToDefault);

view.getBtnReplayWelcomeWizard().setCommand((UiCommand) WelcomeWizardDialog::replay);

view.getBtnDeleteEditorUI().setCommand((UiCommand) CSubmenuPreferences.this::resetDeckEditorLayout);

view.getBtnDeleteWorkshopUI().setCommand((UiCommand) CSubmenuPreferences.this::resetWorkshopLayout);
Expand Down Expand Up @@ -351,21 +354,7 @@ private void initializeCloseActionComboBox() {
}

private void initializeDefaultLanguageComboBox() {
final File lang_root = new File(ForgeConstants.LANG_DIR);
final File[] files = lang_root.listFiles();
final List<String> allLanguages = new ArrayList<>();
for ( File file : files ) {
if ( !file.isFile() ) {
continue;
}
String languageName = file.getName();
if (!languageName.endsWith(".properties")) {
continue;
}
allLanguages.add(languageName.replace(".properties", ""));
}
final String [] choices = new String[ allLanguages.size() ];
allLanguages.toArray( choices );
final String[] choices = ForgeConstants.getAvailableLanguages().toArray(new String[0]);
final FPref userSetting = FPref.UI_LANGUAGE;
final FComboBoxPanel<String> panel = this.view.getCbpDefaultLanguageComboBoxPanel();
final FComboBox<String> comboBox = createComboBox(choices, userSetting);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

private final FLabel btnReset = new FLabel.Builder().opaque(true).hoverable(true).text(localizer.getMessage("btnReset")).build();
private final FLabel btnReplayWelcomeWizard = new FLabel.Builder().opaque(true).hoverable(true).text(localizer.getMessage("btnReplayWelcomeWizard")).build();
private final FLabel btnDeleteMatchUI = new FLabel.Builder().opaque(true).hoverable(true).text(localizer.getMessage("btnDeleteMatchUI")).build();
private final FLabel btnDeleteEditorUI = new FLabel.Builder().opaque(true).hoverable(true).text(localizer.getMessage("btnDeleteEditorUI")).build();
private final FLabel btnDeleteWorkshopUI = new FLabel.Builder().opaque(true).hoverable(true).text(localizer.getMessage("btnDeleteWorkshopUI")).build();
Expand Down Expand Up @@ -188,6 +189,8 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
pnlPrefs.add(btnContentDirectoryUI, twoButtonConstraints2);
pnlPrefs.add(btnClearImageCache, twoButtonConstraints1);
pnlPrefs.add(btnTokenPreviewer, twoButtonConstraints2);
pnlPrefs.add(btnReplayWelcomeWizard, twoButtonConstraints1);
pnlPrefs.add(new JLabel(""), twoButtonConstraints2);

// Search bar
pnlPrefs.add(getSearchPanel(), "w 80%!, h 28px!, gap 25px 0 30px 40px, span 2 1");
Expand Down Expand Up @@ -1066,6 +1069,10 @@ public FLabel getBtnReset() {
return btnReset;
}

public FLabel getBtnReplayWelcomeWizard() {
return btnReplayWelcomeWizard;
}

public FLabel getBtnPlayerName() {
return btnPlayerName;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package forge.screens.home.welcome;

import java.util.Collections;
import java.util.EnumMap;
import java.util.Map;

import forge.localinstance.properties.ForgePreferences.FPref;

public final class OnboardingPresets {
private OnboardingPresets() {}

public static final Map<FPref, String> AI_CASUAL = build(
FPref.UI_OVERLAY_DRAFT_RANKING, "true",
FPref.UI_ORDER_HAND, "true",
FPref.YIELD_AUTO_PASS_NO_ACTIONS, "true",
FPref.UI_REMIND_ON_PRIORITY, "true",
FPref.UI_SHOW_STORM_COUNT_IN_PROMPT, "true",
FPref.UI_DETAILED_SPELLDESC_IN_PROMPT, "true");
public static final Map<FPref, String> AI_EXPERT = build(
FPref.UI_OVERLAY_DRAFT_RANKING, "false",
FPref.UI_ORDER_HAND, "false",
FPref.YIELD_AUTO_PASS_NO_ACTIONS, "false",
FPref.UI_REMIND_ON_PRIORITY, "false",
FPref.UI_SHOW_STORM_COUNT_IN_PROMPT, "false",
FPref.UI_DETAILED_SPELLDESC_IN_PROMPT, "false");

public static final Map<FPref, String> LAYOUT_DEFAULT = build(
FPref.UI_GROUP_PERMANENTS, "default");
public static final Map<FPref, String> LAYOUT_COMPACT = build(
FPref.UI_GROUP_PERMANENTS, "group_all");

public static final Map<FPref, String> OVERLAYS_NONE = build(
FPref.UI_SHOW_CARD_OVERLAYS, "false",
FPref.UI_TARGETING_OVERLAY, "0");
public static final Map<FPref, String> OVERLAYS_ON = build(
FPref.UI_SHOW_CARD_OVERLAYS, "true",
FPref.UI_TARGETING_OVERLAY, "2");

private static Map<FPref, String> build(Object... kvs) {
EnumMap<FPref, String> m = new EnumMap<>(FPref.class);
for (int i = 0; i < kvs.length; i += 2) {
m.put((FPref) kvs[i], (String) kvs[i + 1]);
}
return Collections.unmodifiableMap(m);
}
}
Loading
Loading