Class TipUtil
java.lang.Object
megamek.client.ui.clientGUI.tooltip.TipUtil
Provides static helper functions for creating entity and crew tooltips.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetOptionList(Enumeration<IOptionGroup> optGroups, Function<String, Integer> counter, boolean detailed) Returns an HTML String listing the options given as optGroups, which is e.g.static StringgetOptionList(Enumeration<IOptionGroup> optGroups, Function<String, Integer> counter, boolean detailed, Entity entity) Returns an HTML String listing the options given as optGroups, with optional entity context for enhanced display of entity-specific options like prosthetic enhancements.static StringgetOptionList(Enumeration<IOptionGroup> optGroups, Function<String, Integer> counter, Function<IOptionGroup, String> namer, boolean detailed) Returns an HTML String listing the options given as optGroups, which is e.g.getOptionListArray(Enumeration<IOptionGroup> optGroups, Function<String, Integer> counter, Function<IOptionGroup, String> namer) Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
TipUtil
public TipUtil()
-
-
Method Details
-
getOptionListArray
@Deprecated(since="0.51.0", forRemoval=true) public static List<String> getOptionListArray(Enumeration<IOptionGroup> optGroups, Function<String, Integer> counter, Function<IOptionGroup, String> namer) Deprecated, for removal: This API element is subject to removal in a future version.Returns a List wherein each element consists of an option group of the given optGroups, which is e.g. crew.getOptions().getGroups() or entity.getQuirks().getGroups() as well as the count of active options within that group, e.g. "Manei Domini (2)". A counter function for the options of a group must be supplied, in the form of e.g. e -> crew.countOptions(e) or e -> entity.countQuirks(e). A namer function for the group names must be supplied, e.g. (e) -> weapon.getDesc(). -
getOptionList
public static String getOptionList(Enumeration<IOptionGroup> optGroups, Function<String, Integer> counter, Function<IOptionGroup, String> namer, boolean detailed) Returns an HTML String listing the options given as optGroups, which is e.g. crew.getOptions().getGroups() or entity.getQuirks().getGroups(). A counter function for the options of a group must be supplied, in the form of e.g. e -> crew.countOptions(e) or e -> entity.countQuirks(e). A namer function for the group names must be supplied, e.g. (e) -> weapon.getDesc(). The group names are italicized. The list is 40 characters wide with ⬝ as option separator. -
getOptionList
public static String getOptionList(Enumeration<IOptionGroup> optGroups, Function<String, Integer> counter, boolean detailed) Returns an HTML String listing the options given as optGroups, which is e.g. crew.getOptions().getGroups() or entity.getQuirks().getGroups(). A counter function for the options of a group must be supplied, in the form of e.g. e -> crew.countOptions(e) or e -> entity.countQuirks(e). The list is 40 characters wide with ⬝ as option separator. -
getOptionList
public static String getOptionList(Enumeration<IOptionGroup> optGroups, Function<String, Integer> counter, boolean detailed, @Nullable Entity entity) Returns an HTML String listing the options given as optGroups, with optional entity context for enhanced display of entity-specific options like prosthetic enhancements.- Parameters:
optGroups- the option groups to listcounter- function to count options by namedetailed- if true, returns full option list; if false, returns short summaryentity- optional entity context for enhanced display (may be null)- Returns:
- HTML formatted string listing the options
-