mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +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.IVSubmenu;
|
||||||
import forge.screens.home.VHomeUI;
|
import forge.screens.home.VHomeUI;
|
||||||
import forge.toolbox.*;
|
import forge.toolbox.*;
|
||||||
import forge.util.storage.IStorage;
|
|
||||||
import forge.util.Localizer;
|
import forge.util.Localizer;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import org.apache.commons.lang3.text.WordUtils;
|
import org.apache.commons.lang3.text.WordUtils;
|
||||||
@@ -243,17 +242,15 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
|||||||
cboAllowUnlocks.setSelected(true);
|
cboAllowUnlocks.setSelected(true);
|
||||||
|
|
||||||
final Map<String, String> preconDescriptions = new HashMap<>();
|
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) {
|
if (QuestController.getPreconDeals(preconDeck).getMinWins() > 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
final String name = preconDeck.getName();
|
final String name = preconDeck.getName();
|
||||||
cbxPreconDeck.addItem(name);
|
cbxPreconDeck.addItem(name);
|
||||||
String description = preconDeck.getDescription();
|
String description = preconDeck.getDescription();
|
||||||
description = "<html>" + WordUtils.wrap(description, 40, "<br>", false) + "</html>";
|
preconDescriptions.put(name, wordWrapAsHTML(description));
|
||||||
preconDescriptions.put(name, description);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The cbx needs strictly typed renderer
|
// 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");
|
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)
|
/* (non-Javadoc)
|
||||||
* @see forge.view.home.IViewSubmenu#populate()
|
* @see forge.view.home.IViewSubmenu#populate()
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -47,15 +47,10 @@ import forge.util.FileUtil;
|
|||||||
import forge.util.ThreadUtil;
|
import forge.util.ThreadUtil;
|
||||||
import forge.util.Utils;
|
import forge.util.Utils;
|
||||||
import forge.util.gui.SOptionPane;
|
import forge.util.gui.SOptionPane;
|
||||||
import forge.util.storage.IStorage;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.text.WordUtils;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -282,18 +277,12 @@ public class NewQuestScreen extends FScreen {
|
|||||||
|
|
||||||
cbAllowUnlocks.setSelected(true);
|
cbAllowUnlocks.setSelected(true);
|
||||||
|
|
||||||
final Map<String, String> preconDescriptions = new HashMap<>();
|
for (PreconDeck preconDeck : QuestController.getPrecons()) {
|
||||||
IStorage<PreconDeck> preconDecks = QuestController.getPrecons();
|
|
||||||
|
|
||||||
for (PreconDeck preconDeck : preconDecks) {
|
|
||||||
if (QuestController.getPreconDeals(preconDeck).getMinWins() > 0) {
|
if (QuestController.getPreconDeals(preconDeck).getMinWins() > 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String name = preconDeck.getName();
|
String name = preconDeck.getName();
|
||||||
cbxPreconDeck.addItem(name);
|
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
|
// disable the very powerful sets -- they can be unlocked later for a high price
|
||||||
|
|||||||
Reference in New Issue
Block a user