|
@@ -4,7 +4,9 @@ import javax.swing.JPanel;
|
|
|
import java.awt.GridBagLayout;
|
|
import java.awt.GridBagLayout;
|
|
|
import java.awt.GridBagConstraints;
|
|
import java.awt.GridBagConstraints;
|
|
|
import java.awt.Insets;
|
|
import java.awt.Insets;
|
|
|
|
|
+import java.util.Optional;
|
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
|
|
|
+import java.util.function.Function;
|
|
|
|
|
|
|
|
import javax.swing.JTextArea;
|
|
import javax.swing.JTextArea;
|
|
|
|
|
|
|
@@ -228,7 +230,8 @@ class SpellInfoPanel extends JPanel {
|
|
|
gbc_lblEffect.gridy = 4;
|
|
gbc_lblEffect.gridy = 4;
|
|
|
panel.add(lblEffect, gbc_lblEffect);
|
|
panel.add(lblEffect, gbc_lblEffect);
|
|
|
|
|
|
|
|
- JTextField effect = new JTextField(asString(spell.getEffect()));
|
|
|
|
|
|
|
+ JTextField effect = new JTextField(asString(spell.getEffect(), e -> e.getResolved(dclass.getLevel())));
|
|
|
|
|
+ effect.setToolTipText(asString(spell.getEffect()));
|
|
|
effect.setEditable(false);
|
|
effect.setEditable(false);
|
|
|
effect.setColumns(10);
|
|
effect.setColumns(10);
|
|
|
GridBagConstraints gbc_effect = new GridBagConstraints();
|
|
GridBagConstraints gbc_effect = new GridBagConstraints();
|
|
@@ -330,6 +333,14 @@ class SpellInfoPanel extends JPanel {
|
|
|
description.setLineWrap(true);
|
|
description.setLineWrap(true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private <T> String asString(Optional<T> obj, Function<? super T, String> ts) {
|
|
|
|
|
+ return (!obj.isPresent()) ? "" : ts.apply(obj.get());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private <T> String asString(Optional<T> obj) {
|
|
|
|
|
+ return (!obj.isPresent()) ? "" : obj.get().toString();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private String asString(Object obj) {
|
|
private String asString(Object obj) {
|
|
|
return obj == null ? "" : obj.toString();
|
|
return obj == null ? "" : obj.toString();
|
|
|
}
|
|
}
|