mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 02:08:00 +00:00
pull all still needed WordUtils.wrap calls into one method
This commit is contained in:
@@ -17,7 +17,6 @@ import forge.screens.home.EMenuGroup;
|
||||
import forge.screens.home.IVSubmenu;
|
||||
import forge.screens.home.VHomeUI;
|
||||
import forge.toolbox.*;
|
||||
import forge.util.storage.IStorage;
|
||||
import forge.util.Localizer;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
@@ -243,17 +242,15 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
||||
cboAllowUnlocks.setSelected(true);
|
||||
|
||||
final Map<String, String> preconDescriptions = new HashMap<>();
|
||||
final IStorage<PreconDeck> preconDecks = QuestController.getPrecons();
|
||||
|
||||
for (final PreconDeck preconDeck : preconDecks) {
|
||||
for (final PreconDeck preconDeck : QuestController.getPrecons()) {
|
||||
if (QuestController.getPreconDeals(preconDeck).getMinWins() > 0) {
|
||||
continue;
|
||||
}
|
||||
final String name = preconDeck.getName();
|
||||
cbxPreconDeck.addItem(name);
|
||||
String description = preconDeck.getDescription();
|
||||
description = "<html>" + WordUtils.wrap(description, 40, "<br>", false) + "</html>";
|
||||
preconDescriptions.put(name, description);
|
||||
preconDescriptions.put(name, wordWrapAsHTML(description));
|
||||
}
|
||||
|
||||
// The cbx needs strictly typed renderer
|
||||
@@ -363,6 +360,10 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
||||
pnlOptions.add(btnEmbark, "w 300px!, h 30px!, ax center, span 2, gap 0 0 15px 30px");
|
||||
}
|
||||
|
||||
private static String wordWrapAsHTML(String str) {
|
||||
return "<html>" + WordUtils.wrap(str, 40, "<br>", false, " ") + "</html>";
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see forge.view.home.IViewSubmenu#populate()
|
||||
*/
|
||||
|
||||
@@ -47,15 +47,10 @@ import forge.util.FileUtil;
|
||||
import forge.util.ThreadUtil;
|
||||
import forge.util.Utils;
|
||||
import forge.util.gui.SOptionPane;
|
||||
import forge.util.storage.IStorage;
|
||||
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -282,18 +277,12 @@ public class NewQuestScreen extends FScreen {
|
||||
|
||||
cbAllowUnlocks.setSelected(true);
|
||||
|
||||
final Map<String, String> preconDescriptions = new HashMap<>();
|
||||
IStorage<PreconDeck> preconDecks = QuestController.getPrecons();
|
||||
|
||||
for (PreconDeck preconDeck : preconDecks) {
|
||||
for (PreconDeck preconDeck : QuestController.getPrecons()) {
|
||||
if (QuestController.getPreconDeals(preconDeck).getMinWins() > 0) {
|
||||
continue;
|
||||
}
|
||||
String name = preconDeck.getName();
|
||||
cbxPreconDeck.addItem(name);
|
||||
String description = preconDeck.getDescription();
|
||||
description = "<html>" + WordUtils.wrap(description, 40, "<br>", false) + "</html>";
|
||||
preconDescriptions.put(name, description);
|
||||
}
|
||||
|
||||
// disable the very powerful sets -- they can be unlocked later for a high price
|
||||
|
||||
Reference in New Issue
Block a user